diff options
21 files changed, 81 insertions, 671 deletions
diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php index 5b1d4e4..9adc6a9 100644 --- a/src/usr/local/www/diag_backup.php +++ b/src/usr/local/www/diag_backup.php @@ -776,44 +776,6 @@ print($form); <script type="text/javascript"> //<![CDATA[ events.push(function(){ - //---------- "Standard" show/hide functions --------------------------------------------------- - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - - // Hides all elements of the specified class belonging to a multiselect. - function hideMultiClass(s_class, hide) { - if(hide) - $('.' + s_class).parent().parent().hide(); - else - $('.' + s_class).parent().parent().show(); - } - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } // ------- Show/hide sections based on checkbox settings -------------------------------------- diff --git a/src/usr/local/www/diag_logs_settings.php b/src/usr/local/www/diag_logs_settings.php index 271d6a0..c27d2d9 100644 --- a/src/usr/local/www/diag_logs_settings.php +++ b/src/usr/local/www/diag_logs_settings.php @@ -189,9 +189,9 @@ if ($_POST['resetlogs'] == gettext("Reset Log Files")) { $retval = 0; $retval = system_syslogd_start(); if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) || - ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass'])) || - ($oldnologbogons !== isset($config['syslog']['nologbogons'])) || - ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) { + ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass'])) || + ($oldnologbogons !== isset($config['syslog']['nologbogons'])) || + ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) { $retval |= filter_configure(); } @@ -462,7 +462,7 @@ $group->add(new Form_MultiCheckbox( $pconfig['hostapd'] )); -// Ugly hack to prevent the "Toggle all" button from being automatically +// Ugly hack to prevent the "Toggle all" button from being automatically created $group->add(new Form_MultiCheckbox( 'notoggleall', null, @@ -477,40 +477,27 @@ $group->setHelp('Syslog sends UDP datagrams to port 514 on the specified remote $section->add($group); $form->add($section); + print $form; ?> <script> //<![CDATA[ events.push(function(){ - function hideSelect(id, hide) { - if(hide) - $('#' + id).parent('div').parent('div').addClass('hidden'); - else - $('#' + id).parent('div').parent('div').removeClass('hidden'); - } - - //---------- "Standard" show/hide functions --------------------------------------------------- - - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } + hideMultiCheckbox('notoggleall', true); - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().addClass('hidden'); - else - $('#' + id).parent().removeClass('hidden'); - } + // ---------- Click checkbox handlers --------------------------------------------------------- - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } + $('#logall').click(function () { + disableEverything(); + }); - hideInput('notoggleall', true); + $('#enable').click(function () { + hideClass('remotelogging', !this.checked); + hideSelect('sourceip', !this.checked); + hideSelect('ipproto', !this.checked); + hideMultiCheckbox('notoggleall', true); + }); function disableEverything() { var hide = $('#logall').prop('checked'); @@ -525,21 +512,8 @@ events.push(function(){ disableInput('hostapd', hide); } - // ---------- Click checkbox handlers --------------------------------------------------------- - - $('#logall').click(function () { - disableEverything(); - }); - - $('#enable').click(function () { - hideClass('remotelogging', !this.checked); - hideSelect('sourceip', !this.checked); - hideSelect('ipproto', !this.checked); - }); - // ---------- On initial page load ------------------------------------------------------------ - disableEverything(); hideClass('remotelogging', !$('#enable').prop('checked')); hideSelect('sourceip', !$('#enable').prop('checked')); hideSelect('ipproto', !$('#enable').prop('checked')); @@ -548,4 +522,5 @@ events.push(function(){ </script> <?php + include("foot.inc"); diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php index 2dcb408..afb0648 100644 --- a/src/usr/local/www/firewall_nat_out_edit.php +++ b/src/usr/local/www/firewall_nat_out_edit.php @@ -689,52 +689,6 @@ print($form); events.push(function(){ var portsenabled = 1; - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if (hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified group input element lives so that the input, - // its label and help text are hidden - function hideGroupInput(id, hide) { - if (hide) - $('#' + id).parent('div').addClass('hidden'); - else - $('#' + id).parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if (hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section - function hideClass(s_class, hide) { - if (hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - - // Hides all elements of the specified class assigned to a group. This will usually be a group - function hideGroupClass(s_class, hide) { - if (hide) - $('.' + s_class).parent().parent().parent().hide(); - else - $('.' + s_class).parent().parent().parent().show(); - } - function staticportchange() { if ($('#staticnatport').prop('checked')) { $('#natport').val(""); diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index b2e32be..b3363b2 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1661,53 +1661,6 @@ echo $form; <script> //<![CDATA[ events.push(function(){ - //---------- "Standard" show/hide functions --------------------------------------------------- - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if (hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified group input element lives so that the input, - // its label and help text are hidden - function hideGroupInput(id, hide) { - if (hide) - $('#' + id).parent('div').addClass('hidden'); - else - $('#' + id).parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if (hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section - function hideClass(s_class, hide) { - if (hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - - // Hides all elements of the specified class assigned to a group. This will usually be a group - function hideGroupClass(s_class, hide) { - if (hide) - $('.' + s_class).parent().parent().parent().hide(); - else - $('.' + s_class).parent().parent().parent().show(); - } var portsenabled = 1; var editenabled = 1; diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 6e8b264..899daae 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -3624,38 +3624,6 @@ events.push(function(){ }); } - // Hides all elements of the specified class. This will usually be a section - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified IP address element lives so that the input, its label and help text are hidden - function hideIpAddress(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - function show_dhcp6adv() { var ovr = $('#adv_dhcp6_config_file_override').prop('checked'); var adv = $('#dhcp6adv').prop('checked'); diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php index 729e9c4..a7856d5 100644 --- a/src/usr/local/www/interfaces_ppps_edit.php +++ b/src/usr/local/www/interfaces_ppps_edit.php @@ -985,36 +985,6 @@ print($form); events.push(function(){ var showadvanced = false; - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - - // Simple test in which clicking the ‘clear’ button toggles certain display elements function setAdvVisible() { // Update the button text and toggle showadvanced if(showadvanced) { diff --git a/src/usr/local/www/jquery/pfSenseHelpers.js b/src/usr/local/www/jquery/pfSenseHelpers.js index 6fde31e..c814b61 100644 --- a/src/usr/local/www/jquery/pfSenseHelpers.js +++ b/src/usr/local/www/jquery/pfSenseHelpers.js @@ -2,49 +2,87 @@ // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); + if(hide) + $('#' + id).parent().parent('div').addClass('hidden'); + else + $('#' + id).parent().parent('div').removeClass('hidden'); } // Hides the <div> in which the specified group input element lives so that the input, // its label and help text are hidden function hideGroupInput(id, hide) { - if(hide) - $('#' + id).parent('div').addClass('hidden'); - else - $('#' + id).parent('div').removeClass('hidden'); + if(hide) + $('#' + id).parent('div').addClass('hidden'); + else + $('#' + id).parent('div').removeClass('hidden'); } // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); + if(hide) + $('#' + id).parent().parent().parent('div').addClass('hidden'); + else + $('#' + id).parent().parent().parent('div').removeClass('hidden'); } // Disables the specified input element function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); + $('#' + id).prop("disabled", disable); } // Hides all elements of the specified class. This will usually be a section function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); + if(hide) + $('.' + s_class).hide(); + else + $('.' + s_class).show(); } // Hides all elements of the specified class assigned to a group. This will usually be a group function hideGroupClass(s_class, hide) { - if(hide) - $('.' + s_class).parent().parent().parent().hide(); - else - $('.' + s_class).parent().parent().parent().show(); + if(hide) + $('.' + s_class).parent().parent().parent().hide(); + else + $('.' + s_class).parent().parent().parent().show(); } +function hideSelect(id, hide) { + if(hide) + $('#' + id).parent('div').parent('div').addClass('hidden'); + else + $('#' + id).parent('div').parent('div').removeClass('hidden'); +} + +function hideMultiCheckbox(id, hide) { + if(hide) + $('#' + id).parent().addClass('hidden'); + else + $('#' + id).parent().removeClass('hidden'); +} + +// Hides the <div> in which the specified IP address element lives so that the input, its label and help text are hidden +function hideIpAddress(id, hide) { + if(hide) + $('#' + id).parent().parent().parent('div').addClass('hidden'); + else + $('#' + id).parent().parent().parent('div').removeClass('hidden'); +} + +// Hides all elements of the specified class belonging to a multiselect. +function hideMultiClass(s_class, hide) { + if(hide) + $('.' + s_class).parent().parent().hide(); + else + $('.' + s_class).parent().parent().show(); +} + +// Hides div whose label contains the specified text. (Good for StaticText) +function hideLabel(text, hide) { + + var element = $('label:contains(' + text + ')'); - + if(hide) + element.parent('div').addClass('hidden'); + else + element.parent('div').removeClass('hidden'); +}
\ No newline at end of file diff --git a/src/usr/local/www/services_captiveportal.php b/src/usr/local/www/services_captiveportal.php index 4be9b19..50fbdc6 100644 --- a/src/usr/local/www/services_captiveportal.php +++ b/src/usr/local/www/services_captiveportal.php @@ -1146,44 +1146,6 @@ print_info_box(gettext('Warning:' . '<br />' . 'Don\'t forget to enable the DHCP <script type="text/javascript"> //<![CDATA[ events.push(function(){ - //---------- "Standard" show/hide functions --------------------------------------------------- - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - - // Hides all elements of the specified class belonging to a multiselect. - function hideMultiClass(s_class, hide) { - if(hide) - $('.' + s_class).parent().parent().hide(); - else - $('.' + s_class).parent().parent().show(); - } - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } // ------- Show/hide sections based on checkbox settings -------------------------------------- function hideSections(hide) { diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index 4925d0a..52969cb 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -1337,53 +1337,6 @@ if (!is_numeric($pool) && !($act == "newpool")) { <script> //<![CDATA[ events.push(function(){ - var visible = false; - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified group input element lives so that the input, - // its label and help text are hidden - function hideGroupInput(id, hide) { - if(hide) - $('#' + id).parent('div').addClass('hidden'); - else - $('#' + id).parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - - // Hides all elements of the specified class assigned to a group. This will usually be a group - function hideGroupClass(s_class, hide) { - if(hide) - $('.' + s_class).parent().parent().parent().hide(); - else - $('.' + s_class).parent().parent().parent().show(); - } // Row add/delete function for class="repeatable" ================================================================= diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php index 1967bef..3d54a0c 100644 --- a/src/usr/local/www/services_dhcp_edit.php +++ b/src/usr/local/www/services_dhcp_edit.php @@ -663,33 +663,9 @@ print($form); <script> //<![CDATA[ events.push(function(){ - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified icheckbox lives so that the input, its label and help text are hidden - // Checkboxes live inside <label></label> tags so we need another parent level - function hideCheckBox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } function hideDDNS(hide) { - hideCheckBox('ddnsupdate', hide); + hideCheckbox('ddnsupdate', hide); hideInput('ddnsdomain', hide); hideInput('ddnsdomainprimary', hide); hideInput('ddnsdomainkeyname', hide); diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php index b837c27..ed0048e 100644 --- a/src/usr/local/www/services_dhcpv6.php +++ b/src/usr/local/www/services_dhcpv6.php @@ -925,30 +925,6 @@ endif; <script> //<![CDATA[ events.push(function(){ - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified icheckbox lives so that the input, its label and help text are hidden - // Checkboxes live inside <label></label> tags so we need another parent level - function hideCheckBox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } function hideDDNS(hide) { hideCheckBox('ddnsupdate', hide); diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php index 727939d..6d23b88 100644 --- a/src/usr/local/www/services_dyndns_edit.php +++ b/src/usr/local/www/services_dyndns_edit.php @@ -393,23 +393,6 @@ print($form); <script> //<![CDATA[ events.push(function(){ - var visible = false; - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } function setVisible(service) { switch(service) { diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php index 737f19e..7422155 100644 --- a/src/usr/local/www/services_ntpd.php +++ b/src/usr/local/www/services_ntpd.php @@ -505,22 +505,6 @@ print($form); //<![CDATA[ events.push(function(){ - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - function setMasks() { // Find all ipaddress masks and make dynamic based on address family of input $('span.pfIpMask + select').each(function (idx, select){ diff --git a/src/usr/local/www/services_ntpd_gps.php b/src/usr/local/www/services_ntpd_gps.php index f22a7cf..9d39181 100644 --- a/src/usr/local/www/services_ntpd_gps.php +++ b/src/usr/local/www/services_ntpd_gps.php @@ -424,22 +424,6 @@ events.push(function(){ return(hexsum); } - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - function set_gps_default(type) { $('#gpsnmea').val(0); $('#gpsspeed').val(0); diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php index 590a736..3545379 100644 --- a/src/usr/local/www/services_unbound.php +++ b/src/usr/local/www/services_unbound.php @@ -353,20 +353,8 @@ print_info_box(sprintf(gettext("If the DNS Resolver is enabled, the DHCP". <script> //<![CDATA[ events.push(function(){ - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - // If hte enable checkbox is not checked, disable the next three checkboxes + // If the enable checkbox is not checked, disable the next three checkboxes function disableDHCP() { var hide = ! $('#enable').prop('checked'); diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php index e98ad4f..91c7f98 100644 --- a/src/usr/local/www/system_advanced_admin.php +++ b/src/usr/local/www/system_advanced_admin.php @@ -527,24 +527,14 @@ print $form; //<![CDATA[ events.push(function(){ - //---------- "Standard" show/hide functions --------------------------------------------------- - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - // ---------- On initial page load ------------------------------------------------------------ - hideInput('ssl-certificate', $('input[name=webguiproto]:checked').val() == 'http'); + hideInput('ssl-certref', $('input[name=webguiproto]:checked').val() == 'http'); // ---------- Click checkbox handlers --------------------------------------------------------- $('[id=webguiproto]').click(function () { - hideInput('ssl-certificate', $('input[name=webguiproto]:checked').val() == 'http'); + hideInput('ssl-certref', $('input[name=webguiproto]:checked').val() == 'http'); }); }); //]]> diff --git a/src/usr/local/www/vpn_ipsec_phase1.php b/src/usr/local/www/vpn_ipsec_phase1.php index fda98b3..1dbbd2f 100644 --- a/src/usr/local/www/vpn_ipsec_phase1.php +++ b/src/usr/local/www/vpn_ipsec_phase1.php @@ -1023,48 +1023,6 @@ events.push(function(){ $('#dpd_maxfail').val('5') } - // ---------- Library of show/hide functions -------------------------------------------------- - - // Hides the <div> in which the specified input element lives so that the input, - // its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified group input element lives so that the input, - // its label and help text are hidden - function hideGroupInput(id, hide) { - if(hide) - $('#' + id).parent('div').addClass('hidden'); - else - $('#' + id).parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, - // its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - // ---------- Monitor elements for change and call the appropriate display functions ---------- // Enable DPD diff --git a/src/usr/local/www/vpn_ipsec_phase2.php b/src/usr/local/www/vpn_ipsec_phase2.php index 6c85685..c747c50 100644 --- a/src/usr/local/www/vpn_ipsec_phase2.php +++ b/src/usr/local/www/vpn_ipsec_phase2.php @@ -909,48 +909,6 @@ events.push(function(){ hideClass('encalg', ($('#proto').val() != 'esp')); } - // ---------- Library of show/hide functions -------------------------------------------------- - - // Hides the <div> in which the specified input element lives so that the input, - // its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified group input element lives so that the input, - // its label and help text are hidden - function hideGroupInput(id, hide) { - if(hide) - $('#' + id).parent('div').addClass('hidden'); - else - $('#' + id).parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, - // its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - // ---------- Monitor elements for change and call the appropriate display functions ---------- // Protocol diff --git a/src/usr/local/www/vpn_openvpn_client.php b/src/usr/local/www/vpn_openvpn_client.php index f30f0cc..d848ff4 100644 --- a/src/usr/local/www/vpn_openvpn_client.php +++ b/src/usr/local/www/vpn_openvpn_client.php @@ -926,49 +926,6 @@ events.push(function(){ hideInput('tls', $('#autotls_enable').prop('checked') || !$('#tlsauth_enable').prop('checked')); } - // ---------- Library of show/hide functions ---------------------------------------------------------------------- - - // Hides div whose label contains the specified text. (Good for StaticText) - function hideLabel(text, hide) { - var element = $('label:contains(' + text + ')'); - - if(hide) - element.parent('div').addClass('hidden'); - else - element.parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified input element lives so that the input, - // its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, - // its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - // ---------- Monitor elements for change and call the appropriate display functions ------------------------------ // TLS Authorization diff --git a/src/usr/local/www/vpn_openvpn_csc.php b/src/usr/local/www/vpn_openvpn_csc.php index 8bf5157..09b03cc 100644 --- a/src/usr/local/www/vpn_openvpn_csc.php +++ b/src/usr/local/www/vpn_openvpn_csc.php @@ -565,33 +565,6 @@ if($act=="new" || $act=="edit"): <script> //<![CDATA[ events.push(function(){ - var visible = false; - - //---------- "Standard" show/hide functions --------------------------------------------------- - - // Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } // Hide/show that section, but have to also respect the wins_server_enable checkbox function setNetbios() { diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php index 910ec02..b43bb8a 100644 --- a/src/usr/local/www/vpn_openvpn_server.php +++ b/src/usr/local/www/vpn_openvpn_server.php @@ -1586,58 +1586,6 @@ events.push(function(){ } } - // ---------- Library of show/hide functions ---------------------------------------------------------------------- - - // Hides all elements of the specified class belonging to a multiselect. - function hideMultiClass(s_class, hide) { - if(hide) - $('.' + s_class).parent().parent().hide(); - else - $('.' + s_class).parent().parent().show(); - } - - // Hides div whose label contains the specified text. (Good for StaticText) - function hideLabel(text, hide) { - - var element = $('label:contains(' + text + ')'); - - if(hide) - element.parent('div').addClass('hidden'); - else - element.parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified input element lives so that the input, - // its label and help text are hidden - function hideInput(id, hide) { - if(hide) - $('#' + id).parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent('div').removeClass('hidden'); - } - - // Hides the <div> in which the specified checkbox lives so that the checkbox, - // its label and help text are hidden - function hideCheckbox(id, hide) { - if(hide) - $('#' + id).parent().parent().parent('div').addClass('hidden'); - else - $('#' + id).parent().parent().parent('div').removeClass('hidden'); - } - - // Disables the specified input element - function disableInput(id, disable) { - $('#' + id).prop("disabled", disable); - } - - // Hides all elements of the specified class. This will usually be a section or group - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - // ---------- Monitor elements for change and call the appropriate display functions ------------------------------ // NTP |