summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-03-05 04:07:42 +0000
committerBill Marquette <billm@pfsense.org>2005-03-05 04:07:42 +0000
commit6a8d35cab6d1d48f7754984079eafb1a6917846b (patch)
tree4c05bd9af879323a92496a7447b18ee1892725fb
parent3830eba66291d6b6090527347008be286b665cfb (diff)
downloadpfsense-6a8d35cab6d1d48f7754984079eafb1a6917846b.zip
pfsense-6a8d35cab6d1d48f7754984079eafb1a6917846b.tar.gz
Move row selecting javascript into it's own file so we can use it in other screens
-rwxr-xr-xusr/local/www/firewall_rules.php52
-rwxr-xr-xusr/local/www/row_toggle.js48
2 files changed, 49 insertions, 51 deletions
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php
index a8fe5a6..e0deebd 100755
--- a/usr/local/www/firewall_rules.php
+++ b/usr/local/www/firewall_rules.php
@@ -152,57 +152,7 @@ if (isset($_POST['del_x'])) {
<?php include("fbegin.inc"); ?>
<p class="pgtitle">Firewall: Rules</p>
<form action="firewall_rules.php" method="post">
-<script language="JavaScript">
-<!--
-function fr_toggle(id) {
- var checkbox = document.getElementById('frc' + id);
- checkbox.checked = !checkbox.checked;
- fr_bgcolor(id);
-}
-function fr_bgcolor(id) {
- var row = document.getElementById('fr' + id);
- var checkbox = document.getElementById('frc' + id);
- var cells = row.getElementsByTagName("td");
-
- for (i = 2; i <= 6; i++) {
- cells[i].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#FFFFFF";
- }
- //cells[7].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#990000";
-}
-function fr_insline(id, on) {
- var row = document.getElementById('fr' + id);
- if (id != 0) {
- var prevrow = document.getElementById('fr' + (id-1));
- } else {
- var prevrow = document.getElementById('frheader');
- }
-
- var cells = row.getElementsByTagName("td");
- var prevcells = prevrow.getElementsByTagName("td");
-
- for (i = 2; i <= 7; i++) {
- if (on) {
- prevcells[i].style.borderBottom = "3px solid #990000";
- prevcells[i].style.paddingBottom = (id != 0) ? 2 : 3;
- } else {
- prevcells[i].style.borderBottom = "1px solid #999999";
- prevcells[i].style.borderBottomWidth = "1px";
- prevcells[i].style.paddingBottom = (id != 0) ? 4 : 5;
- }
- }
-
- for (i = 2; i <= 7; i++) {
- if (on) {
- cells[i].style.borderTop = "2px solid #990000";
- cells[i].style.paddingTop = 2;
- } else {
- prevcells[i].style.borderBottom = "1px solid #999999";
- cells[i].style.borderTopWidth = 0;
- cells[i].style.paddingTop = 4;
- }
- }
-}
-// -->
+<script type="text/javascript" language="javascript" src="row_toggle.js">
</script>
<form action="firewall_rules.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
diff --git a/usr/local/www/row_toggle.js b/usr/local/www/row_toggle.js
new file mode 100755
index 0000000..4e8ad9a
--- /dev/null
+++ b/usr/local/www/row_toggle.js
@@ -0,0 +1,48 @@
+function fr_toggle(id) {
+ var checkbox = document.getElementById('frc' + id);
+ checkbox.checked = !checkbox.checked;
+ fr_bgcolor(id);
+}
+function fr_bgcolor(id) {
+ var row = document.getElementById('fr' + id);
+ var checkbox = document.getElementById('frc' + id);
+ var cells = row.getElementsByTagName("td");
+
+ for (i = 2; i <= 6; i++) {
+ cells[i].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#FFFFFF";
+ }
+ //cells[7].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#990000";
+}
+function fr_insline(id, on) {
+ var row = document.getElementById('fr' + id);
+ if (id != 0) {
+ var prevrow = document.getElementById('fr' + (id-1));
+ } else {
+ var prevrow = document.getElementById('frheader');
+ }
+
+ var cells = row.getElementsByTagName("td");
+ var prevcells = prevrow.getElementsByTagName("td");
+
+ for (i = 2; i <= 7; i++) {
+ if (on) {
+ prevcells[i].style.borderBottom = "3px solid #990000";
+ prevcells[i].style.paddingBottom = (id != 0) ? 2 : 3;
+ } else {
+ prevcells[i].style.borderBottom = "1px solid #999999";
+ prevcells[i].style.borderBottomWidth = "1px";
+ prevcells[i].style.paddingBottom = (id != 0) ? 4 : 5;
+ }
+ }
+
+ for (i = 2; i <= 7; i++) {
+ if (on) {
+ cells[i].style.borderTop = "2px solid #990000";
+ cells[i].style.paddingTop = 2;
+ } else {
+ prevcells[i].style.borderBottom = "1px solid #999999";
+ cells[i].style.borderTopWidth = 0;
+ cells[i].style.paddingTop = 4;
+ }
+ }
+}
OpenPOWER on IntegriCloud