From 78b4b127045edb52342386832e1b398ef497c24c Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Tue, 19 Jan 2016 21:18:02 -0500 Subject: Changed color scheme to use existing bg-* classes Simplfied color change mechanism Implemented "Cancel" button --- src/usr/local/www/bootstrap/css/pfSense-BETA.css | 16 -------- src/usr/local/www/bootstrap/css/pfSense.css | 20 ---------- src/usr/local/www/firewall_rules.php | 51 ++++++++++++++---------- 3 files changed, 30 insertions(+), 57 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/bootstrap/css/pfSense-BETA.css b/src/usr/local/www/bootstrap/css/pfSense-BETA.css index 1d21bb5..41d115d 100644 --- a/src/usr/local/www/bootstrap/css/pfSense-BETA.css +++ b/src/usr/local/www/bootstrap/css/pfSense-BETA.css @@ -4,19 +4,3 @@ .panel-title { font-size: 16px; } - -.separator-red { - bgcolor: red; -} - -.separator-green { - bgcolor: green; -} - -.separator-blue { - bgcolor: blue; -} - -.separator-orange { - bgcolor: orange; -} \ No newline at end of file diff --git a/src/usr/local/www/bootstrap/css/pfSense.css b/src/usr/local/www/bootstrap/css/pfSense.css index c44abe1..fde1e66 100644 --- a/src/usr/local/www/bootstrap/css/pfSense.css +++ b/src/usr/local/www/bootstrap/css/pfSense.css @@ -781,23 +781,3 @@ ul.tree li .over{ max-height: none !important; } } -/* These colors style the separator bars that may be added to firewall rules and NAT rules*/ -tr .separator-red { - background-color: #ff9999; - color: #4d0000; -} - -.separator-green { - background-color: #79d379; - color: #0d260d; -} - -.separator-blue { - background-color: #cce5ff; - color: #002699; -} - -.separator-orange { - background-color: #ffcc00; - color: #1a1400; -} \ No newline at end of file diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php index 62dea06..1d32e65 100644 --- a/src/usr/local/www/firewall_rules.php +++ b/src/usr/local/www/firewall_rules.php @@ -786,24 +786,33 @@ events.push(function() { }); // Separator bar stuff ------------------------------------------------------------------------ + + // Globals + gColor = 'bg-info'; + newSeperator = false; + $("#addsep").prop('type' ,'button'); $("#addsep").click(function() { -// alert("This feature is not yet complete. (Nothing is saved)\nIncluded for review only."); + if (newSeperator) { + return(false); + } + gColor = 'bg-info'; // Inset a temporary bar in which the user can enter some optional text - $('#ruletable > tbody:last').append('' + - '" class="col-md-12" type="text">' + - '' + + $('#ruletable > tbody:last').append('' + + '" class="col-md-12" type="text">' + + '' + '' + '    ' + - '  ' + - '  ' + - '  ' + - '  ' + + '  ' + + '  ' + + '  ' + + '  ' + ''); $('#newsep').focus(); + newSeperator = true; $("#btnnewsep").prop('type' ,'button'); @@ -820,6 +829,14 @@ events.push(function() { ''); $('#order-store').removeAttr('disabled'); + newSeperator = false; + }); + + // Cancel button + $('#btncncsep').click(function(e) { + e.preventDefault(); + $(this).parents('tr').remove(); + newSeperator = false; }); }); @@ -832,8 +849,6 @@ events.push(function() { }); }); - gColor = 'separator-blue'; - // Compose an inout array containing the row # and text for each separator function save_separators() { var seprow = 0; @@ -870,19 +885,13 @@ events.push(function() { $('[id^=sepclr]').click(function () { var color = $(this).attr('value'); // Clear all the color classes - $(this).parent('td').removeClass('separator-red'); - $(this).parent('td').removeClass('separator-green'); - $(this).parent('td').removeClass('separator-blue'); - $(this).parent('td').removeClass('separator-orange'); - $(this).parent('td').prev('td').removeClass('separator-red'); - $(this).parent('td').prev('td').removeClass('separator-green'); - $(this).parent('td').prev('td').removeClass('separator-blue'); - $(this).parent('td').prev('td').removeClass('separator-orange'); + $(this).parent('td').prop('class', ''); + $(this).parent('td').prev('td').prop('class', ''); // Install our new color class - $(this).parent('td').addClass('separator-' + color); - $(this).parent('td').prev('td').addClass('separator-' + color); + $(this).parent('td').addClass(color); + $(this).parent('td').prev('td').addClass(color); // Set the global color - gColor = 'separator-' + color; + gColor = color; }); } -- cgit v1.1