summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_schedule_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-03-25 16:06:52 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-03-25 16:06:59 -0300
commit0a6dc4627f31eb6a6f756adaaeb6d743e75010e6 (patch)
tree280b4de907864c0ee221915d98c1880d653108eb /usr/local/www/firewall_schedule_edit.php
parent000a8d1dcdd1714913cd7f46f9cc4433e13e68d5 (diff)
downloadpfsense-0a6dc4627f31eb6a6f756adaaeb6d743e75010e6.zip
pfsense-0a6dc4627f31eb6a6f756adaaeb6d743e75010e6.tar.gz
Fix days and weeks selection on schedules, reported at https://forum.pfsense.org/index.php?topic=74101.0
Diffstat (limited to 'usr/local/www/firewall_schedule_edit.php')
-rw-r--r--usr/local/www/firewall_schedule_edit.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/usr/local/www/firewall_schedule_edit.php b/usr/local/www/firewall_schedule_edit.php
index 41235ea..1ff324b 100644
--- a/usr/local/www/firewall_schedule_edit.php
+++ b/usr/local/www/firewall_schedule_edit.php
@@ -215,7 +215,15 @@ var month_array = ['January','February','March','April','May','June','July','Aug
var day_array = ['Mon','Tues','Wed','Thur','Fri','Sat','Sun'];
var schCounter = 0;
-
+function rgb2hex(rgb) {
+ var parts = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
+ if (parts == null)
+ return;
+ function hex(x) {
+ return ("0" + parseInt(x).toString(16)).slice(-2);
+ }
+ return ("#" + hex(parts[1]) + hex(parts[2]) + hex(parts[3])).toUpperCase();
+}
function repeatExistingDays(){
var tempstr, tempstrdaypos, week, daypos, dayposdone = "";
@@ -234,7 +242,7 @@ function repeatExistingDays(){
tempstr = 'w' + week + 'p' + daypos;
daycell = eval('document.getElementById(tempstr)');
if (daydone == "-1"){
- if (daycell.style.backgroundColor == "#F08080") // lightcoral
+ if (rgb2hex(daycell.style.backgroundColor) == "#F08080") // lightcoral
daytogglerepeating(week,daypos,true);
else
daytogglerepeating(week,daypos,false);
@@ -274,7 +282,7 @@ function daytogglerepeating(week,daypos,bExists){
}
}
}
-
+
function daytoggle(id) {
var runrepeat, tempstr = "";
var bFoundValid = false;
@@ -302,12 +310,12 @@ function daytoggle(id) {
var daycell = document.getElementById(idmod);
if (daycell != null){
- if (daycell.style.backgroundColor == "#FF0000"){ // red
+ if (rgb2hex(daycell.style.backgroundColor) == "#FF0000"){ // red
daycell.style.backgroundColor = "#FFFFFF"; // white
str = id + ",";
daysSelected = daysSelected.replace(str, "");
}
- else if (daycell.style.backgroundColor == "#F08080") // lightcoral
+ else if (rgb2hex(daycell.style.backgroundColor) == "#F08080") // lightcoral
{
daytogglerepeating(week,daypos,true);
}
OpenPOWER on IntegriCloud