diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php index 2545072a56..87af5c2a74 100644 --- a/src/usr/local/www/firewall_nat.php +++ b/src/usr/local/www/firewall_nat.php @@ -352,9 +352,9 @@ foreach ($a_nat as $natent): - " href="firewall_nat_edit.php?id="> - " href="firewall_nat.php?act=del&id="> - " href="firewall_nat_edit.php?dup="> + " href="firewall_nat_edit.php?id="> + " href="firewall_nat_edit.php?dup="> + " href="firewall_nat.php?act=del&id=" onclick="return confirm('')"> - - - - - diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index cef2bc6ba4..0aa2985bd2 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -609,8 +609,7 @@ function clear_all_log_files() { return; } -// This version of dump_clog() does not output or any other table elements. It can be renamed -// and the dump_clog() removed once all of the diag_log*.php files have been converted to Bootstrap +// This version of dump_clog() does not output or any other table elements. function dump_clog_no_table($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") { global $g, $config; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; diff --git a/src/usr/local/www/jquery/pfSenseHelpers.js b/src/usr/local/www/jquery/pfSenseHelpers.js index 2a1d1237ad..26fabfb84f 100644 --- a/src/usr/local/www/jquery/pfSenseHelpers.js +++ b/src/usr/local/www/jquery/pfSenseHelpers.js @@ -138,6 +138,46 @@ function hideLabel(text, hide) { element.parent('div').removeClass('hidden'); } +// Toggle table row chackboxes and background colors on the pages that use sortable tables: +// /usr/local/www/firewall_nat.php +// /usr/local/www/firewall_nat_1to1.php +// /usr/local/www/firewall_nat_out.php +// /usr/local/www/firewall_rules.php +// /usr/local/www/vpn_ipsec.php +// Striping of the tables is handled here, NOT with hte Bootstrap table-striped class because it would +// get confused when rows are sorted or deleted. + +function stripe_table() { + $("tr:odd").addClass('active'); + $("tr:even").removeClass('active'); +} + +function fr_toggle(id, prefix) { + if (!prefix) + prefix = 'fr'; + + var checkbox = document.getElementById(prefix + 'c' + id); + checkbox.checked = !checkbox.checked; + fr_bgcolor(id, prefix); +} + +// Change background color based on state of checkbox +// On resetting background, reapply table striping +function fr_bgcolor(id, prefix) { + if (!prefix) + prefix = 'fr'; + + var row = $('#' + prefix + id); + + if ($('#' + prefix + 'c' + id).prop('checked') ) { + row.css("background-color", "#DDF4FF"); + row.removeClass('active'); + } else { + row.css("background-color", "#FFFFFF"); + stripe_table(); + } +} + // The following functions are used by Form_Groups assigned a class of "repeatable" and provide the ability // to add/delete rows of sequentially numbered elements, their labels and their help text // See firewall_aliases_edit.php for an example