diff options
author | Phil Davis <phil.davis@inf.org> | 2016-03-20 16:06:02 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-03-20 16:06:02 +0545 |
commit | 347c0214388bae18616a9003adf84d7be509fa86 (patch) | |
tree | 7f9bd3f0093719a7a34eb2c63024345ba713abf9 /src/usr | |
parent | 7cb01159934f0fa24c0c0050917cef1ad9bb9f2b (diff) | |
download | pfsense-347c0214388bae18616a9003adf84d7be509fa86.zip pfsense-347c0214388bae18616a9003adf84d7be509fa86.tar.gz |
Reengineer Form_Button setAttribute
As per what was done for https://github.com/pfsense/pfsense/pull/2765 -
do it to the rest of them.
Seems to work OK.
Diffstat (limited to 'src/usr')
20 files changed, 54 insertions, 149 deletions
diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php index 5b92df7..383d026 100644 --- a/src/usr/local/www/firewall_nat_edit.php +++ b/src/usr/local/www/firewall_nat_edit.php @@ -726,7 +726,7 @@ $btnsrcadv = new Form_Button( 'fa-cog' ); -$btnsrcadv->addClass('btn-info btn-sm'); +$btnsrcadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Source', @@ -1267,7 +1267,6 @@ events.push(function() { }); // ---------- On initial page load -------------------------------------------------------------------------------- - $("#btnsrcadv").prop('type', 'button'); hideSource(!srcenabled); ext_change(); dst_change($('#interface').val(),'<?=htmlspecialchars($pconfig['interface'])?>','<?=htmlspecialchars($pconfig['dst'])?>'); diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 21e719a..01312cc 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1366,7 +1366,7 @@ foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) { 'Display Advanced', null, 'fa-cog' - ))->addClass('btn-info btn-sm'); + ))->setAttribute('type','button')->addClass('btn-info btn-sm'); } $portValues = ['' => gettext('(other)'), 'any' => gettext('any')]; @@ -1448,7 +1448,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Advanced Options', @@ -1767,8 +1767,6 @@ events.push(function() { $('#btnadvopts').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvopts').prop('type', 'button'); - $('#btnadvopts').click(function(event) { show_advopts(); }); @@ -1963,9 +1961,6 @@ events.push(function() { show_source_port_range(); <?php endif; ?> - // Make it a regular button, not a submit - $("#btnsrcadv").prop('type','button'); - // on click . . $('#srcbeginport').on('change', function() { src_rep_change(); diff --git a/src/usr/local/www/firewall_schedule_edit.php b/src/usr/local/www/firewall_schedule_edit.php index 14f9d0c..1a9b4b1 100644 --- a/src/usr/local/www/firewall_schedule_edit.php +++ b/src/usr/local/www/firewall_schedule_edit.php @@ -471,14 +471,14 @@ $group->add(new Form_Button( 'Add Time', null, 'fa-plus' -))->addClass('btn-success btn-sm'); +))->setAttribute('type','button')->addClass('btn-success btn-sm'); $group->add(new Form_Button( 'btnclrsel', 'Clear selection', null, 'fa-undo' -))->addClass('btn-info btn-sm'); +))->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->add($group); @@ -657,7 +657,7 @@ if ($getSchedule) { 'Delete', null, 'fa-trash' - ))->addClass('btn-xs btn-warning'); + ))->setAttribute('type','button')->addClass('btn-xs btn-warning'); $group->add(new Form_Input( 'schedule' . $counter, @@ -695,24 +695,16 @@ events.push(function() { update_month(); }); - // Make the ‘clear’ button a plain button, not a submit button - $('#btnclrsel').prop('type', 'button'); - $('#btnclrsel').click(function() { clearCalendar(); clearTime(); clearDescr(); }); - // Make the ‘Add time’ button a plain button, not a submit button - $('#btnaddtime').prop('type', 'button'); - $('#btnaddtime').click(function() { processEntries(); }); - $('[id^=Delete]').prop('type', 'button'); - $('[id^=Delete]').click(function(event) { fse_delete_row(event.target.id.slice(6)); }); diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 45835c4..6adb66a 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -1759,7 +1759,7 @@ $btnmymac = new Form_Button( 'fa-clone' ); -$btnmymac->addClass('btn-success btn-sm'); +$btnmymac->setAttribute('type','button')->addClass('btn-success btn-sm'); $group = new Form_Group('MAC controls'); $group->add($macaddress); @@ -1819,7 +1819,7 @@ $group->add(new Form_Button( 'Add a new gateway', null, 'fa-plus' -))->addClass('btn-success')->setAttribute('data-target', '#newgateway')->setAttribute('data-toggle', 'modal'); +))->setAttribute('type','button')->addClass('btn-success')->setAttribute('data-target', '#newgateway')->setAttribute('data-toggle', 'modal'); $group->setHelp('If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the "Add" button.' . '<br />' . 'On local LANs the upstream gateway should be "none".' . @@ -1852,7 +1852,7 @@ $group->add(new Form_Button( 'Add a new gateway', null, 'fa-plus' -))->addClass('btn-success')->setAttribute('data-target', '#newgateway6')->setAttribute('data-toggle', 'modal'); +))->setAttribute('type','button')->addClass('btn-success')->setAttribute('data-target', '#newgateway6')->setAttribute('data-toggle', 'modal'); $group->setHelp('If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the "Add" button.' . '<br />' . 'On local LANs the upstream gateway should be "none". '); @@ -1896,7 +1896,7 @@ $btnaddgw6 = new Form_Button( 'fa-plus' ); -$btnaddgw6->addClass('btn-success'); +$btnaddgw6->setAttribute('type','button')->addClass('btn-success'); $btncnxgw6 = new Form_Button( 'cnx6', @@ -1905,7 +1905,7 @@ $btncnxgw6 = new Form_Button( 'fa-undo' ); -$btncnxgw6->addClass('btn-warning'); +$btncnxgw6->setAttribute('type','button')->addClass('btn-warning'); $modal->addInput(new Form_StaticText( null, @@ -2561,7 +2561,7 @@ $section->addInput(new Form_Button( 'Advanced PPP', isset($pconfig['pppid']) ? 'interfaces_ppps_edit.php?id=' . htmlspecialchars($pconfig['pppid']) : 'interfaces_ppps_edit.php', 'fa-cog' -))->addClass('btn-info')->setAttribute('id')->setHelp('Create a new PPP configuration'); +))->setAttribute('type','button')->addClass('btn-info')->setAttribute('id')->setHelp('Create a new PPP configuration'); $form->add($section); @@ -2687,7 +2687,7 @@ $section->addInput(new Form_Button( 'Advanced and MLPPP', isset($pconfig['pppid']) ? 'interfaces_ppps_edit.php?id=' . htmlspecialchars($pconfig['pppid']) : 'interfaces_ppps_edit.php', 'fa-cog' -))->addClass('btn-info')->setAttribute('id')->setHelp('Click for additional PPPoE configuration options. Save first if changes have been made.'); +))->setAttribute('type','button')->addClass('btn-info')->setAttribute('id')->setHelp('Click for additional PPPoE configuration options. Save first if changes have been made.'); $form->add($section); @@ -2750,7 +2750,7 @@ $section->addInput(new Form_Button( 'Advanced and MLPPP', isset($pconfig['pppid']) ? 'interfaces_ppps_edit.php?id=' . htmlspecialchars($pconfig['pppid']) : 'interfaces_ppps_edit.php', 'fa-cog' -))->addClass('btn-info')->setAttribute('id')->setHelp($mlppp_text . 'Click for additional PPTP and L2TP configuration options. Save first if changes have been made.'); +))->setAttribute('type','button')->addClass('btn-info')->setAttribute('id')->setHelp($mlppp_text . 'Click for additional PPTP and L2TP configuration options. Save first if changes have been made.'); $form->add($section); @@ -3203,7 +3203,7 @@ $btnaddgw = new Form_Button( 'fa-plus' ); -$btnaddgw->addClass('btn-success'); +$btnaddgw->setAttribute('type','button')->addClass('btn-success'); $btncnxgw = new Form_Button( 'cnx', @@ -3212,7 +3212,7 @@ $btncnxgw = new Form_Button( 'fa-undo' ); -$btncnxgw->addClass('btn-warning'); +$btncnxgw->setAttribute('type','button')->addClass('btn-warning'); $modal->addInput(new Form_StaticText( null, @@ -3592,12 +3592,6 @@ events.push(function() { updateType($('#type').val()); updateTypeSix($('#type6').val()); show_reset_settings($('#pppoe-reset-type').val()); - $("#add").prop('type', 'button'); - $("#cnx").prop('type', 'button'); - $("#addgw").prop('type', 'button'); - $("#add6").prop('type', 'button'); - $("#cnx6").prop('type', 'button'); - $("#addgw6").prop('type', 'button'); hideClass('dhcp6advanced', true); hideClass('dhcpadvanced', true); show_dhcp6adv(); diff --git a/src/usr/local/www/interfaces_bridge_edit.php b/src/usr/local/www/interfaces_bridge_edit.php index 523e513..cf2f622 100644 --- a/src/usr/local/www/interfaces_bridge_edit.php +++ b/src/usr/local/www/interfaces_bridge_edit.php @@ -452,7 +452,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Advanced Options', @@ -697,8 +697,6 @@ events.push(function() { $('#btnadvopts').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvopts').prop('type', 'button'); - $('#btnadvopts').click(function(event) { show_advopts(); }); diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php index 02ff08e..b3c4fa8 100644 --- a/src/usr/local/www/interfaces_ppps_edit.php +++ b/src/usr/local/www/interfaces_ppps_edit.php @@ -836,7 +836,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Advanced options', @@ -1051,8 +1051,6 @@ events.push(function() { $('#btnadvopts').html('<i class="fa fa-cog"></i> ' + text); } // e-o-show_advopts - $('#btnadvopts').prop('type', 'button'); - $('#btnadvopts').click(function(event) { show_advopts(); }); diff --git a/src/usr/local/www/load_balancer_pool_edit.php b/src/usr/local/www/load_balancer_pool_edit.php index 5f6d220..4ac291d 100644 --- a/src/usr/local/www/load_balancer_pool_edit.php +++ b/src/usr/local/www/load_balancer_pool_edit.php @@ -282,13 +282,6 @@ events.push(function() { } } - // Make buttons plain buttons, not a submit - $("#btnaddtopool").prop('type','button'); - $("#removeenabled").prop('type','button'); - $("#removedisabled").prop('type','button'); - $("#movetodisabled").prop('type','button'); - $("#movetoenabled").prop('type','button'); - // On click . . $("#btnaddtopool").click(function() { $('[name="servers[]"]').append(new Option($('#ipaddr').val(), $('#ipaddr').val())); @@ -415,7 +408,7 @@ $group->add(new Form_Button( 'Add to pool', null, 'fa-plus' -))->addClass('btn-success'); +))->setAttribute('type','button')->addClass('btn-success'); $section->add($group); @@ -460,14 +453,14 @@ $group->add(new Form_Button( 'Remove', null, 'fa-trash' -))->addClass('btn-danger btn-sm'); +))->setAttribute('type','button')->addClass('btn-danger btn-sm'); $group->add(new Form_Button( 'removeenabled', 'Remove', null, 'fa-trash' -))->addClass('btn-danger btn-sm'); +))->setAttribute('type','button')->addClass('btn-danger btn-sm'); $section->add($group); @@ -478,14 +471,14 @@ $group->add(new Form_Button( 'Move to enabled list', null, 'fa-angle-double-right' -))->addClass('btn-info btn-sm'); +))->setAttribute('type','button')->addClass('btn-info btn-sm'); $group->add(new Form_Button( 'movetodisabled', 'Move to disabled list', null, 'fa-angle-double-left' -))->addClass('btn-info btn-sm'); +))->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->add($group); diff --git a/src/usr/local/www/pkg_edit.php b/src/usr/local/www/pkg_edit.php index 785f1ea..651f115 100644 --- a/src/usr/local/www/pkg_edit.php +++ b/src/usr/local/www/pkg_edit.php @@ -1518,7 +1518,7 @@ if (!empty($advanced)) { 'Show Advanced Options', null, 'fa-cog' - ))->addClass('btn-info'); + ))->setAttribute('type','button')->addClass('btn-info'); $form->add($advanced); } @@ -1548,8 +1548,6 @@ if ($pkg['fields']['field'] != "") { ?> checkLastRow(); // Show advanced section if you click the showadv button - $('#showadv').prop('type', 'button'); - $("#showadv").click(function() { advanced_visible = !advanced_visible; diff --git a/src/usr/local/www/services_captiveportal_mac_edit.php b/src/usr/local/www/services_captiveportal_mac_edit.php index 89ce6ce..5459e00 100644 --- a/src/usr/local/www/services_captiveportal_mac_edit.php +++ b/src/usr/local/www/services_captiveportal_mac_edit.php @@ -251,7 +251,7 @@ $btnmymac = new Form_Button( 'fa-clone' ); -$btnmymac->removeClass('btn-primary')->addClass('btn-success btn-sm'); +$btnmymac->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-success btn-sm'); $group = new Form_Group('MAC Address'); $group->add($macaddress); @@ -312,9 +312,6 @@ print($form); <script type="text/javascript"> //<![CDATA[ events.push(function() { - // Make the ‘Copy My MAC’ button a plain button, not a submit button - $("#btnmymac").prop('type','button'); - // On click, copy the hidden 'mymac' text to the 'mac' input $("#btnmymac").click(function() { $('#mac').val('<?=$mymac?>'); diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index 59cf4d0..3139cb3 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -1004,7 +1004,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Dynamic DNS', @@ -1054,7 +1054,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'MAC address control', @@ -1083,7 +1083,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'NTP', @@ -1110,7 +1110,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'TFTP', @@ -1131,7 +1131,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'LDAP', @@ -1153,7 +1153,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Additional BOOTP/DHCP Options', @@ -1426,8 +1426,6 @@ events.push(function() { $('#btnadvdns').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvdns').prop('type', 'button'); - $('#btnadvdns').click(function(event) { show_advdns(); }); @@ -1463,8 +1461,6 @@ events.push(function() { $('#btnadvmac').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvmac').prop('type', 'button'); - $('#btnadvmac').click(function(event) { show_advmac(); }); @@ -1500,8 +1496,6 @@ events.push(function() { $('#btnadvntp').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvntp').prop('type', 'button'); - $('#btnadvntp').click(function(event) { show_advntp(); }); @@ -1536,8 +1530,6 @@ events.push(function() { $('#btnadvtftp').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvtftp').prop('type', 'button'); - $('#btnadvtftp').click(function(event) { show_advtftp(); }); @@ -1572,8 +1564,6 @@ events.push(function() { $('#btnadvldap').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvldap').prop('type', 'button'); - $('#btnadvldap').click(function(event) { show_advldap(); }); @@ -1609,8 +1599,6 @@ events.push(function() { $('#btnadvopts').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvopts').prop('type', 'button'); - $('#btnadvopts').click(function(event) { show_advopts(); }); diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php index 7cc8b98..6ab36ce 100644 --- a/src/usr/local/www/services_dhcp_edit.php +++ b/src/usr/local/www/services_dhcp_edit.php @@ -439,7 +439,7 @@ $btnmymac = new Form_Button( 'fa-clone' ); -$btnmymac->removeClass('btn-primary')->addClass('btn-success btn-sm'); +$btnmymac->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-success btn-sm'); $group = new Form_Group('MAC controls'); $group->add($macaddress); @@ -597,7 +597,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Dynamic DNS', @@ -645,7 +645,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'NTP servers', @@ -681,7 +681,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'TFTP servers', @@ -738,8 +738,6 @@ events.push(function() { $('#btnadvdns').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvdns').prop('type', 'button'); - $('#btnadvdns').click(function(event) { show_advdns(); }); @@ -775,8 +773,6 @@ events.push(function() { $('#btnadvntp').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvntp').prop('type', 'button'); - $('#btnadvntp').click(function(event) { show_advntp(); }); @@ -811,15 +807,10 @@ events.push(function() { $('#btnadvtftp').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvtftp').prop('type', 'button'); - $('#btnadvtftp').click(function(event) { show_advtftp(); }); - // Make the ‘Copy My MAC’ button a plain button, not a submit button - $("#btnmymac").prop('type','button'); - // On click, copy the hidden 'mymac' text to the 'mac' input $("#btnmymac").click(function() { $('#mac').val('<?=$mymac?>'); diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php index bb81e2b..9da4609 100644 --- a/src/usr/local/www/services_dhcpv6.php +++ b/src/usr/local/www/services_dhcpv6.php @@ -759,7 +759,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Dynamic DNS', @@ -827,7 +827,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'NTP servers', @@ -863,7 +863,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'LDAP', @@ -884,7 +884,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Network booting', @@ -912,7 +912,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Additional BOOTP/DHCP Options', @@ -1106,8 +1106,6 @@ events.push(function() { $('#btnadvdns').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvdns').prop('type', 'button'); - $('#btnadvdns').click(function(event) { show_advdns(); }); @@ -1143,8 +1141,6 @@ events.push(function() { $('#btnadvntp').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvntp').prop('type', 'button'); - $('#btnadvntp').click(function(event) { show_advntp(); }); @@ -1179,8 +1175,6 @@ events.push(function() { $('#btnadvldap').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvldap').prop('type', 'button'); - $('#btnadvldap').click(function(event) { show_advldap(); }); @@ -1216,8 +1210,6 @@ events.push(function() { $('#btnadvnetboot').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvnetboot').prop('type', 'button'); - $('#btnadvnetboot').click(function(event) { show_advnetboot(); }); @@ -1254,8 +1246,6 @@ events.push(function() { $('#btnadvopts').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvopts').prop('type', 'button'); - $('#btnadvopts').click(function(event) { show_advopts(); checkLastRow(); diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php index 22af484..ca7abc8 100644 --- a/src/usr/local/www/services_ntpd.php +++ b/src/usr/local/www/services_ntpd.php @@ -340,7 +340,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Statistics Logging', @@ -376,7 +376,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Leap seconds', @@ -445,8 +445,6 @@ events.push(function() { $('#btnadvstats').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvstats').prop('type', 'button'); - $('#btnadvstats').click(function(event) { show_advstats(); }); @@ -484,8 +482,6 @@ events.push(function() { $('#btnadvleap').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvleap').prop('type', 'button'); - $('#btnadvleap').click(function(event) { show_advleap(); }); diff --git a/src/usr/local/www/services_ntpd_gps.php b/src/usr/local/www/services_ntpd_gps.php index d20e502..5b8ad4b 100644 --- a/src/usr/local/www/services_ntpd_gps.php +++ b/src/usr/local/www/services_ntpd_gps.php @@ -379,7 +379,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'GPS Initialization', @@ -406,7 +406,7 @@ $btncalc = new Form_Button( 'fa-calculator' ); -$btncalc->removeClass('btn-primary')->addClass('btn-success btn-sm'); +$btncalc->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-success btn-sm'); $group->add($btncalc); @@ -570,14 +570,10 @@ events.push(function() { $('#btnadvgps').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvgps').prop('type', 'button'); - $('#btnadvgps').click(function(event) { show_advgps(); }); - // Make the ‘Calculate’ button a plain button, not a submit button - $('#btncalc').prop('type','button'); $('#result').prop("disabled", true); // Onclick read the string from the nmeastring box, calculate the checksum diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php index e76bb2d..9b94f4e 100644 --- a/src/usr/local/www/system_authservers.php +++ b/src/usr/local/www/system_authservers.php @@ -640,7 +640,7 @@ $group->add(new Form_Button( 'Select a container', null, 'fa-search' -))->addClass('btn-info'); +))->setAttribute('type','button')->addClass('btn-info'); $section->add($group); @@ -959,7 +959,6 @@ events.push(function() { <?php endif; ?> hideClass('ldapanon', $('#ldap_anon').prop('checked')); - $("#Select").prop('type','button'); hideClass('extended', !$('#ldap_extended_enabled').prop('checked')); if($('#ldap_port').val() == "") diff --git a/src/usr/local/www/system_gateways_edit.php b/src/usr/local/www/system_gateways_edit.php index 336776a..92bce53 100644 --- a/src/usr/local/www/system_gateways_edit.php +++ b/src/usr/local/www/system_gateways_edit.php @@ -708,7 +708,7 @@ $btnadv = new Form_Button( 'fa-cog' ); -$btnadv->addClass('btn-info btn-sm'); +$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( null, @@ -911,8 +911,6 @@ events.push(function() { $('#btnadvopts').html('<i class="fa fa-cog"></i> ' + text); } - $('#btnadvopts').prop('type', 'button'); - $('#btnadvopts').click(function(event) { show_advopts(); }); diff --git a/src/usr/local/www/system_groupmanager.php b/src/usr/local/www/system_groupmanager.php index aaf814c..5c2eb3a 100644 --- a/src/usr/local/www/system_groupmanager.php +++ b/src/usr/local/www/system_groupmanager.php @@ -452,14 +452,14 @@ if ($pconfig['gid'] != 1998) { // all users group 'Move to "Members"', null, 'fa-angle-double-right' - ))->removeClass('btn-primary')->addClass('btn-info btn-sm'); + ))->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-info btn-sm'); $group->add(new Form_Button( 'movetodisabled', 'Move to "Not members', null, 'fa-angle-double-left' - ))->removeClass('btn-primary')->addClass('btn-info btn-sm'); + ))->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-info btn-sm'); $group->setHelp('Hold down CTRL (pc)/COMMAND (mac) key to select multiple items'); $section->add($group); @@ -484,11 +484,6 @@ print $form; //<![CDATA[ events.push(function() { - // Make buttons plain buttons, not submit - $("#movetodisabled").prop('type','button'); - $("#movetoenabled").prop('type','button'); - - // On click . . $("#movetodisabled").click(function() { moveOptions($('[name="members[]"] option'), $('[name="notmembers[]"]')); diff --git a/src/usr/local/www/system_groupmanager_addprivs.php b/src/usr/local/www/system_groupmanager_addprivs.php index d999cdf..5c58092 100644 --- a/src/usr/local/www/system_groupmanager_addprivs.php +++ b/src/usr/local/www/system_groupmanager_addprivs.php @@ -217,7 +217,7 @@ $btnfilter = new Form_Button( 'fa-filter' ); -$btnfilter->addClass('btn btn-info'); +$btnfilter->setAttribute('type','button')->addClass('btn btn-info'); $form->addGlobal($btnfilter); @@ -228,7 +228,7 @@ $btnclear = new Form_Button( 'fa-times' ); -$btnclear->addClass('btn btn-warning'); +$btnclear->setAttribute('type','button')->addClass('btn btn-warning'); $form->addGlobal($btnclear); $form->add($section); @@ -287,8 +287,6 @@ events.push(function() { }); }); - $('#btnfilter').prop('type', 'button'); - $('#btnfilter').click(function() { searchterm = $('#filtertxt').val().toLowerCase(); copyselect(true); @@ -301,8 +299,6 @@ events.push(function() { }); }); - $('#btnclear').prop('type', 'button'); - $('#btnclear').click(function() { // Copy all options from shadow to sysprivs copyselect(true) diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index 3d9c67c..3b6298c 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -719,14 +719,14 @@ if ($act == "new" || $act == "edit" || $input_errors): 'Move to "Member of" list', null, 'fa-angle-double-right' - ))->removeClass('btn-primary')->addClass('btn-info btn-sm'); + ))->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-info btn-sm'); $group->add(new Form_Button( 'movetodisabled', 'Move to "Not member of" list', null, 'fa-angle-double-left' - ))->removeClass('btn-primary')->addClass('btn-info btn-sm'); + ))->setAttribute('type','button')->removeClass('btn-primary')->addClass('btn-info btn-sm'); $group->setHelp('Hold down CTRL (pc)/COMMAND (mac) key to select multiple items'); $section->add($group); @@ -852,10 +852,6 @@ print $form; //<![CDATA[ events.push(function() { - // Make buttons plain buttons, not submit - $("#movetodisabled").prop('type','button'); - $("#movetoenabled").prop('type','button'); - // On click . . $("#movetodisabled").click(function() { moveOptions($('[name="groups[]"] option'), $('[name="sysgroups[]"]')); diff --git a/src/usr/local/www/system_usermanager_addprivs.php b/src/usr/local/www/system_usermanager_addprivs.php index aad6fcc..da7b942 100644 --- a/src/usr/local/www/system_usermanager_addprivs.php +++ b/src/usr/local/www/system_usermanager_addprivs.php @@ -211,7 +211,7 @@ $btnfilter = new Form_Button( 'fa-filter' ); -$btnfilter->addClass('btn btn-info'); +$btnfilter->setAttribute('type','button')->addClass('btn btn-info'); $form->addGlobal($btnfilter); @@ -222,7 +222,7 @@ $btnclear = new Form_Button( 'fa-times' ); -$btnclear->addClass('btn btn-warning'); +$btnclear->setAttribute('type','button')->addClass('btn btn-warning'); $form->addGlobal($btnclear); @@ -292,8 +292,6 @@ events.push(function() { }); }); - $('#btnfilter').prop('type', 'button'); - $('#btnfilter').click(function() { searchterm = $('#filtertxt').val().toLowerCase(); copyselect(true); @@ -306,8 +304,6 @@ events.push(function() { }); }); - $('#btnclear').prop('type', 'button'); - $('#btnclear').click(function() { // Copy all options from shadow to sysprivs copyselect(true) |