mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-01 05:44:41 +03:00
Move page style related JS code to separate files
This commit is contained in:
parent
086c163db1
commit
5714193eeb
48
src/mibew/styles/pages/default/js/features.js
Normal file
48
src/mibew/styles/pages/default/js/features.js
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* @preserve Copyright 2005-2013 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function($) {
|
||||||
|
function updateSurvey() {
|
||||||
|
if ($("#enablepresurvey").is(":checked")) {
|
||||||
|
$(".undersurvey").show();
|
||||||
|
} else {
|
||||||
|
$(".undersurvey").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateSSL() {
|
||||||
|
if ($("#enablessl").is(":checked")) {
|
||||||
|
$(".underssl").show();
|
||||||
|
} else {
|
||||||
|
$(".underssl").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateGroups() {
|
||||||
|
if ($("#enablegroups").is(":checked")) {
|
||||||
|
$(".undergroups").show();
|
||||||
|
} else {
|
||||||
|
$(".undergroups").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("#enablepresurvey").change(function() {
|
||||||
|
updateSurvey();
|
||||||
|
});
|
||||||
|
$("#enablessl").change(function() {
|
||||||
|
updateSSL();
|
||||||
|
});
|
||||||
|
$("#enablegroups").change(function() {
|
||||||
|
updateGroups();
|
||||||
|
});
|
||||||
|
updateSurvey();
|
||||||
|
updateSSL();
|
||||||
|
updateGroups();
|
||||||
|
});
|
||||||
|
})(jQuery);
|
24
src/mibew/styles/pages/default/js/group.js
Normal file
24
src/mibew/styles/pages/default/js/group.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* @preserve Copyright 2005-2013 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function($) {
|
||||||
|
function updateParentGroup() {
|
||||||
|
if ($("#parentgroup").val() == '') {
|
||||||
|
$("#extrafields").show();
|
||||||
|
} else {
|
||||||
|
$("#extrafields").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("#parentgroup").change(function() {
|
||||||
|
updateParentGroup();
|
||||||
|
});
|
||||||
|
updateParentGroup();
|
||||||
|
});
|
||||||
|
})(jQuery);
|
@ -21,46 +21,7 @@ require_once(dirname(__FILE__).'/inc_tabbar.php');
|
|||||||
function tpl_header() { global $page, $mibewroot;
|
function tpl_header() { global $page, $mibewroot;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" language="javascript" src="<?php echo $mibewroot ?>/js/libs/jquery.min.js"></script>
|
<script type="text/javascript" language="javascript" src="<?php echo $mibewroot ?>/js/libs/jquery.min.js"></script>
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript" src="<?php echo $mibewroot ?>/styles/pages/default/js/features.js"></script>
|
||||||
function updateSurvey() {
|
|
||||||
if($("#enablepresurvey").is(":checked")) {
|
|
||||||
$(".undersurvey").show();
|
|
||||||
} else {
|
|
||||||
$(".undersurvey").hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSSL() {
|
|
||||||
if($("#enablessl").is(":checked")) {
|
|
||||||
$(".underssl").show();
|
|
||||||
} else {
|
|
||||||
$(".underssl").hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateGroups(){
|
|
||||||
if($("#enablegroups").is(":checked")) {
|
|
||||||
$(".undergroups").show();
|
|
||||||
} else {
|
|
||||||
$(".undergroups").hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function(){
|
|
||||||
$("#enablepresurvey").change(function() {
|
|
||||||
updateSurvey();
|
|
||||||
});
|
|
||||||
$("#enablessl").change(function() {
|
|
||||||
updateSSL();
|
|
||||||
});
|
|
||||||
$("#enablegroups").change(function() {
|
|
||||||
updateGroups();
|
|
||||||
});
|
|
||||||
updateSurvey();
|
|
||||||
updateSSL();
|
|
||||||
updateGroups();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,23 +21,7 @@ require_once(dirname(__FILE__).'/inc_tabbar.php');
|
|||||||
function tpl_header() { global $page, $mibewroot;
|
function tpl_header() { global $page, $mibewroot;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" language="javascript" src="<?php echo $mibewroot ?>/js/libs/jquery.min.js"></script>
|
<script type="text/javascript" language="javascript" src="<?php echo $mibewroot ?>/js/libs/jquery.min.js"></script>
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript" src="<?php echo $mibewroot ?>/styles/pages/default/js/group.js"></script>
|
||||||
|
|
||||||
function updateParentGroup() {
|
|
||||||
if($("#parentgroup").val() == '') {
|
|
||||||
$("#extrafields").show();
|
|
||||||
}else{
|
|
||||||
$("#extrafields").hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function(){
|
|
||||||
$("#parentgroup").change(function() {
|
|
||||||
updateParentGroup();
|
|
||||||
});
|
|
||||||
updateParentGroup();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user