diff options
author | Jared Dillard <jdillard@netgate.com> | 2015-09-24 11:47:56 -0500 |
---|---|---|
committer | Jared Dillard <jdillard@netgate.com> | 2015-09-24 11:48:03 -0500 |
commit | eef931443d426e1a5a75352a75cd881d8223d979 (patch) | |
tree | 176dba700001cd0ccfca56e76bf6ac20fdb30945 /src/usr/local | |
parent | d94da29844316954348a3f7c97fff93de15051f9 (diff) | |
download | pfsense-eef931443d426e1a5a75352a75cd881d8223d979.zip pfsense-eef931443d426e1a5a75352a75cd881d8223d979.tar.gz |
Ticket #5204 a clean up pass of the jquery sections
Diffstat (limited to 'src/usr/local')
20 files changed, 80 insertions, 42 deletions
diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php index 073f8aa..5b1d4e4 100644 --- a/src/usr/local/www/diag_backup.php +++ b/src/usr/local/www/diag_backup.php @@ -816,6 +816,7 @@ events.push(function(){ } // ------- Show/hide sections based on checkbox settings -------------------------------------- + function hideSections(hide) { hidePasswords(); } @@ -841,7 +842,8 @@ events.push(function(){ hidePasswords(); }); - // ---------- On itial page load -------------------------------------------------------------- + // ---------- On initial page load ------------------------------------------------------------ + hideSections(); }); //]]> diff --git a/src/usr/local/www/diag_logs_settings.php b/src/usr/local/www/diag_logs_settings.php index 686df32..255c98f 100644 --- a/src/usr/local/www/diag_logs_settings.php +++ b/src/usr/local/www/diag_logs_settings.php @@ -490,7 +490,8 @@ events.push(function(){ $('#' + id).parent('div').parent('div').removeClass('hidden'); } - // Hides all elements of the specified class. This will usually be a section + //---------- "Standard" show/hide functions --------------------------------------------------- + function hideClass(s_class, hide) { if(hide) $('.' + s_class).hide(); @@ -524,7 +525,8 @@ events.push(function(){ disableInput('hostapd', hide); } - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('#logall').click(function () { disableEverything(); }); @@ -535,9 +537,8 @@ events.push(function(){ hideSelect('ipproto', !this.checked); }); + // ---------- On initial page load ------------------------------------------------------------ - - // On page load . . disableEverything(); hideClass('remotelogging', !$('#enable').prop('checked')); hideSelect('sourceip', !$('#enable').prop('checked')); diff --git a/src/usr/local/www/firewall_nat_1to1_edit.php b/src/usr/local/www/firewall_nat_1to1_edit.php index 22d48ce..9f26c60 100644 --- a/src/usr/local/www/firewall_nat_1to1_edit.php +++ b/src/usr/local/www/firewall_nat_1to1_edit.php @@ -552,7 +552,7 @@ events.push(function(){ } } - // On-click . . + // ---------- Click checkbox handlers --------------------------------------------------------- $('#srctype').click(function () { typesel_change(); @@ -562,10 +562,12 @@ events.push(function(){ typesel_change(); }); - // Initial page load + // ---------- On initial page load ------------------------------------------------------------ + typesel_change(); - // --------- Autocomplete ----------------------------------------------------------------------------------------- + // ---------- Autocomplete -------------------------------------------------------------------- + var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>; $('#dst').autocomplete({ diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 6927af3..b2e32be 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1661,6 +1661,7 @@ 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) { @@ -1965,15 +1966,18 @@ events.push(function(){ setHelpText(target, dispstr); } - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('#statetype').on('change', function() { setOptText('statetype', this.value); }); - // At page load . . + // ---------- On initial page load ------------------------------------------------------------ + setOptText('statetype', $('#statetype').val()) - // --------- Autocomplete ----------------------------------------------------------------------------------------- + // ---------- Autocomplete -------------------------------------------------------------------- + var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>; var customarray = <?= json_encode(get_alias_list(array("port", "url_ports", "urltable_ports"))) ?>; diff --git a/src/usr/local/www/firewall_shaper_vinterface.php b/src/usr/local/www/firewall_shaper_vinterface.php index 8d942eb..f0b9f7b 100644 --- a/src/usr/local/www/firewall_shaper_vinterface.php +++ b/src/usr/local/www/firewall_shaper_vinterface.php @@ -473,10 +473,12 @@ events.push(function(){ disableInput('maskbitsv6', ($('#scheduler').val() == 'none')); } - // On page load . . + // ---------- On initial page load ------------------------------------------------------------ + change_masks(); - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('#scheduler').on('change', function() { change_masks(); }); diff --git a/src/usr/local/www/firewall_virtual_ip_edit.php b/src/usr/local/www/firewall_virtual_ip_edit.php index f4dea61..7ccf55e 100644 --- a/src/usr/local/www/firewall_virtual_ip_edit.php +++ b/src/usr/local/www/firewall_virtual_ip_edit.php @@ -540,6 +540,8 @@ events.push(function(){ } } + // ---------- Click checkbox handlers --------------------------------------------------------- + // When radio buttons are clicked . . $('input:radio[name=mode]').click(function() { check_mode(); @@ -551,7 +553,8 @@ events.push(function(){ hideCheckbox('noexpand', (this.value == 'single')); }); - // On initial page load + // ---------- On initial page load ------------------------------------------------------------ + check_mode(); }); //]]> diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 8377dc1..6e8b264 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -3688,7 +3688,8 @@ events.push(function(){ } } - // On page load . . + // ---------- On initial page load ------------------------------------------------------------ + updateType($('#type').val()); updateTypeSix($('#type6').val()); show_reset_settings($('#pppoe-reset-type').val()); @@ -3703,7 +3704,8 @@ events.push(function(){ show_dhcp6adv(); setDHCPoptions() - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('#type').on('change', function() { updateType( this.value ); }); diff --git a/src/usr/local/www/load_balancer_monitor_edit.php b/src/usr/local/www/load_balancer_monitor_edit.php index 6134b37..5348c19 100644 --- a/src/usr/local/www/load_balancer_monitor_edit.php +++ b/src/usr/local/www/load_balancer_monitor_edit.php @@ -249,13 +249,14 @@ events.push(function(){ hideClass(t, false); } + // ---------- Click checkbox handlers --------------------------------------------------------- - // On click . . $('#type').on('change', function() { updateType($('#type').val()); }); - // On page load + // ---------- On initial page load ------------------------------------------------------------ + updateType($('#type').val()); }); diff --git a/src/usr/local/www/services_captiveportal.php b/src/usr/local/www/services_captiveportal.php index 75e56e7..4be9b19 100644 --- a/src/usr/local/www/services_captiveportal.php +++ b/src/usr/local/www/services_captiveportal.php @@ -1250,7 +1250,7 @@ events.push(function(){ hideHTTPS(!this.checked); }); - // ---------- On itial page load -------------------------------------------------------------- + // ---------- On initial page load ------------------------------------------------------------ hideSections(!$('#enable').prop('checked')); disableInput('localauth_priv', !($('input[name="auth_method"]:checked').val() == 'local')); }); diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index dfe4010..4925d0a 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -1706,7 +1706,7 @@ events.push(function(){ show_advboot(); }); - // Show advanced additional opts options =========================================================================== + // Show advanced additional opts options =========================================================================== var showadvopts = false; function show_advopts() { @@ -1731,7 +1731,8 @@ events.push(function(){ show_advopts(); }); - // On page load . . + // ---------- On initial page load ------------------------------------------------------------ + show_advdns(); show_advmac(); show_advntp(); diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php index dfbfe31..727939d 100644 --- a/src/usr/local/www/services_dyndns_edit.php +++ b/src/usr/local/www/services_dyndns_edit.php @@ -460,7 +460,8 @@ events.push(function(){ setVisible( this.value ); }); - // On initial page load + // ---------- On initial page load ------------------------------------------------------------ + setVisible($('#type').val()); }); diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php index d6cad3e..edc6334 100644 --- a/src/usr/local/www/system_advanced_admin.php +++ b/src/usr/local/www/system_advanced_admin.php @@ -527,6 +527,8 @@ 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) @@ -535,10 +537,12 @@ events.push(function(){ $('#' + id).parent().parent('div').removeClass('hidden'); } - // On page load . . + // ---------- On initial page load ------------------------------------------------------------ + hideInput('ssl-certificate', $('input[name=webguiproto]:checked').val() == 'http'); - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('[id=webguiproto]').click(function () { hideInput('ssl-certificate', $('input[name=webguiproto]:checked').val() == 'http'); }); diff --git a/src/usr/local/www/system_advanced_firewall.php b/src/usr/local/www/system_advanced_firewall.php index 8be0ce7..e1ba2e5 100644 --- a/src/usr/local/www/system_advanced_firewall.php +++ b/src/usr/local/www/system_advanced_firewall.php @@ -767,12 +767,14 @@ events.push(function(){ setHelpText('optimization', htext); } - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('#optimization').on('change', function() { setOptText(this.value); }); - // At page load . . + // ---------- On initial page load ------------------------------------------------------------ + setOptText($('#optimization').val()) }); //]]> diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php index 72780b1..7b9c6fa 100644 --- a/src/usr/local/www/system_authservers.php +++ b/src/usr/local/www/system_authservers.php @@ -823,7 +823,7 @@ events.push(function(){ } } - // On page load . . + // ---------- On initial page load ------------------------------------------------------------ <?php if ($act != 'edit') : ?> ldap_tmplchange(); @@ -851,7 +851,8 @@ events.push(function(){ } } ?> - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('#ldap_tmpltype').on('change', function() { ldap_tmplchange(); }); diff --git a/src/usr/local/www/system_certmanager.php b/src/usr/local/www/system_certmanager.php index 2e10c69..3e8cb26 100644 --- a/src/usr/local/www/system_certmanager.php +++ b/src/usr/local/www/system_certmanager.php @@ -1248,12 +1248,14 @@ events.push(function(){ } } - // On click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('#caref').on('change', function() { internalca_change(); }); - // On page load . . + // ---------- On initial page load ------------------------------------------------------------ + internalca_change(); <?php endif; ?> diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index d00d420..107b9d8 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -834,6 +834,8 @@ print $form; <script> //<![CDATA[ events.push(function(){ + //---------- "Standard" show/hide functions --------------------------------------------------- + // Hides all elements of the specified class. function hideClass(s_class, hide) { if(hide) @@ -912,9 +914,10 @@ events.push(function(){ } }); - // On page load . . - hideClass('cert-options', true); -// hideInput('authorizedkeys', true); + // ---------- On initial page load ------------------------------------------------------------ + + hideClass('cert-options', true); + //hideInput('authorizedkeys', true); hideCheckbox('showkey', true); // On submit mark all the user's groups as "selected" diff --git a/src/usr/local/www/vpn_ipsec_phase1.php b/src/usr/local/www/vpn_ipsec_phase1.php index e3abe5f..59eab8a 100644 --- a/src/usr/local/www/vpn_ipsec_phase1.php +++ b/src/usr/local/www/vpn_ipsec_phase1.php @@ -1022,7 +1022,7 @@ events.push(function(){ $('#dpd_maxfail').val('5') } - // ---------- Library of show/hide functions ---------------------------------------------------------------------- + // ---------- 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 @@ -1064,7 +1064,7 @@ events.push(function(){ $('.' + s_class).show(); } - // ---------- Monitor elements for change and call the appropriate display functions ------------------------------ + // ---------- Monitor elements for change and call the appropriate display functions ---------- // Enable DPD $('#dpd_enable').click(function () { @@ -1104,7 +1104,7 @@ events.push(function(){ ealgosel_change(<?=$keyset?>); dpdchkbox_change(); - // ---------- Iniatial page load ---------------------------------------------------------------------------------- + // ---------- On initial page load ------------------------------------------------------------ hideInput('ikeid', true); }); diff --git a/src/usr/local/www/vpn_ipsec_phase2.php b/src/usr/local/www/vpn_ipsec_phase2.php index 573f9cf..9a97346 100644 --- a/src/usr/local/www/vpn_ipsec_phase2.php +++ b/src/usr/local/www/vpn_ipsec_phase2.php @@ -909,7 +909,7 @@ events.push(function(){ hideClass('encalg', ($('#proto').val() != 'esp')); } - // ---------- Library of show/hide functions ---------------------------------------------------------------------- + // ---------- 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 @@ -951,7 +951,7 @@ events.push(function(){ $('.' + s_class).show(); } - // ---------- Monitor elements for change and call the appropriate display functions ------------------------------ + // ---------- Monitor elements for change and call the appropriate display functions ---------- // Protocol $('#proto').click(function () { @@ -978,7 +978,7 @@ events.push(function(){ change_mode(); }); - // ---------- Iniatial page load ---------------------------------------------------------------------------------- + // ---------- On initial page load ------------------------------------------------------------ hideInput('ikeid', true); hideInput('uniqid', true); diff --git a/src/usr/local/www/vpn_openvpn_csc.php b/src/usr/local/www/vpn_openvpn_csc.php index 9dffd9d..8bf5157 100644 --- a/src/usr/local/www/vpn_openvpn_csc.php +++ b/src/usr/local/www/vpn_openvpn_csc.php @@ -567,6 +567,8 @@ if($act=="new" || $act=="edit"): 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) @@ -610,6 +612,8 @@ events.push(function(){ hideClass('winsservers', ! $('#wins_server_enable').prop('checked')); } + // ---------- Click checkbox handlers --------------------------------------------------------- + // On clicking the netbios_enable checkbox $('#netbios_enable').click(function () { setNetbios(); @@ -620,7 +624,8 @@ events.push(function(){ setWins(); }); - // On initial page load + // ---------- On initial page load ------------------------------------------------------------ + setNetbios(); }); //]]> diff --git a/src/usr/local/www/vpn_pppoe_edit.php b/src/usr/local/www/vpn_pppoe_edit.php index 7eb1cee..6bc2674 100644 --- a/src/usr/local/www/vpn_pppoe_edit.php +++ b/src/usr/local/www/vpn_pppoe_edit.php @@ -763,14 +763,16 @@ events.push(function(){ hide_radius2(!$('#radiussecenable').prop('checked')); }); - //On initial page load + // ---------- On initial page load ------------------------------------------------------------ + hide_radius2(!$('#radiussecenable').prop('checked')); hide_radius(!$('#radiusenable').prop('checked')); // These are action buttons, not submit buttons $('[id^=addrow]').prop('type','button'); $('[id^=delete]').prop('type','button'); - // on click . . + // ---------- Click checkbox handlers --------------------------------------------------------- + $('[id^=addrow]').click(function() { add_row(); }); |