summaryrefslogtreecommitdiffstats
path: root/usr/local/www/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/javascript')
-rwxr-xr-xusr/local/www/javascript/load_balancer_pool_edit/pool.js153
-rw-r--r--usr/local/www/javascript/load_balancer_relay_protocol_edit/load_balancer_relay_protocol_edit.js56
-rwxr-xr-xusr/local/www/javascript/niftyjsCode.js174
-rwxr-xr-xusr/local/www/javascript/row_helper.js69
-rwxr-xr-xusr/local/www/javascript/row_helper_dynamic.js72
-rwxr-xr-xusr/local/www/javascript/row_toggle.js55
-rwxr-xr-xusr/local/www/javascript/ticker.js50
7 files changed, 629 insertions, 0 deletions
diff --git a/usr/local/www/javascript/load_balancer_pool_edit/pool.js b/usr/local/www/javascript/load_balancer_pool_edit/pool.js
new file mode 100755
index 0000000..ab6303d
--- /dev/null
+++ b/usr/local/www/javascript/load_balancer_pool_edit/pool.js
@@ -0,0 +1,153 @@
+/*
+ pool.js
+ part of pfSense (http://www.pfsense.com/)
+
+ Copyright (C) 2005-2008 Bill Marquette <bill.marquette@gmail.com>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/* Add server to virtual server pool
+ * operates on whatever form is passed to it
+ */
+function AddServerToPool(form) {
+ var ServerPort = form.ipaddr.value;
+ form['servers[]'].options[form['servers[]'].options.length] = new Option(ServerPort,ServerPort);
+}
+
+
+function AllServers(id, selectAll) {
+ var opts = document.getElementById(id).getElementsByTagName('option');
+ for (i = 0; i < opts.length; i++)
+ {
+ opts[i].selected = selectAll;
+ }
+}
+
+
+function RemoveServerFromPool(form, field)
+{
+ var theSel = form[field];
+ var selIndex = theSel.selectedIndex;
+ if (selIndex != -1) {
+ for(i=theSel.length-1; i>=0; i--)
+ {
+ if(theSel.options[i].selected)
+ {
+ theSel.options[i] = null;
+ }
+ }
+ if (theSel.length > 0) {
+ theSel.selectedIndex = selIndex == 0 ? 0 : selIndex - 1;
+ }
+ }
+}
+
+function addOption(theSel, theText, theValue)
+{
+ var newOpt = new Option(theText, theValue);
+ var selLength = theSel.length;
+ theSel.options[selLength] = newOpt;
+}
+
+function deleteOption(theSel, theIndex)
+{
+ var selLength = theSel.length;
+ if(selLength>0)
+ {
+ theSel.options[theIndex] = null;
+ }
+}
+
+function moveOptions(theSelFrom, theSelTo)
+{
+ var selLength = theSelFrom.length;
+ var selectedText = new Array();
+ var selectedValues = new Array();
+ var selectedCount = 0;
+
+ var i;
+
+ // Find the selected Options in reverse order
+ // and delete them from the 'from' Select.
+ for(i=selLength-1; i>=0; i--)
+ {
+ if(theSelFrom.options[i].selected)
+ {
+ selectedText[selectedCount] = theSelFrom.options[i].text;
+ selectedValues[selectedCount] = theSelFrom.options[i].value;
+ deleteOption(theSelFrom, i);
+ selectedCount++;
+ }
+ }
+
+ // Add the selected text/values in reverse order.
+ // This will add the Options to the 'to' Select
+ // in the same order as they were in the 'from' Select.
+ for(i=selectedCount-1; i>=0; i--)
+ {
+ addOption(theSelTo, selectedText[i], selectedValues[i]);
+ }
+}
+
+// functions up() and down() modified from http://www.babailiica.com/js/sorter/
+
+function up(obj) {
+ var sel = new Array();
+ for (var i=0; i<obj.length; i++) {
+ if (obj[i].selected == true) {
+ sel[sel.length] = i;
+ }
+ }
+ for (i in sel) {
+ if (sel[i] != 0 && !obj[sel[i]-1].selected) {
+ var tmp = new Array(obj[sel[i]-1].text, obj[sel[i]-1].value);
+ obj[sel[i]-1].text = obj[sel[i]].text;
+ obj[sel[i]-1].value = obj[sel[i]].value;
+ obj[sel[i]].text = tmp[0];
+ obj[sel[i]].value = tmp[1];
+ obj[sel[i]-1].selected = true;
+ obj[sel[i]].selected = false;
+ }
+ }
+}
+
+function down(obj) {
+ var sel = new Array();
+ for (var i=obj.length-1; i>-1; i--) {
+ if (obj[i].selected == true) {
+ sel[sel.length] = i;
+ }
+ }
+ for (i in sel) {
+ if (sel[i] != obj.length-1 && !obj[sel[i]+1].selected) {
+ var tmp = new Array(obj[sel[i]+1].text, obj[sel[i]+1].value);
+ obj[sel[i]+1].text = obj[sel[i]].text;
+ obj[sel[i]+1].value = obj[sel[i]].value;
+ obj[sel[i]].text = tmp[0];
+ obj[sel[i]].value = tmp[1];
+ obj[sel[i]+1].selected = true;
+ obj[sel[i]].selected = false;
+ }
+ }
+}
diff --git a/usr/local/www/javascript/load_balancer_relay_protocol_edit/load_balancer_relay_protocol_edit.js b/usr/local/www/javascript/load_balancer_relay_protocol_edit/load_balancer_relay_protocol_edit.js
new file mode 100644
index 0000000..fcf67ce
--- /dev/null
+++ b/usr/local/www/javascript/load_balancer_relay_protocol_edit/load_balancer_relay_protocol_edit.js
@@ -0,0 +1,56 @@
+/*
+ pool.js
+ part of pfSense (http://www.pfsense.com/)
+
+ Copyright (C) 2005-2008 Bill Marquette <bill.marquette@gmail.com>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+ * This code makes use of prototype shortcuts and will not work
+ * without prototype being loaded prior to it.
+ */
+
+function copyOption(theSrc, theDst)
+{
+ var selOption = theSrc[theSrc.selectedIndex];
+ theDst.options[theDst.length] = new Option(selOption.text, selOption.value);
+}
+
+function deleteOption(theSel)
+{
+ var theIndex = theSel.selectedIndex;
+ var selLength = theSel.length;
+ if(selLength>0)
+ {
+ theSel.options[theIndex] = null;
+ }
+}
+
+function AllOptions(el, selectAll) {
+ el.select('option').each(function(opt) {
+ opt.selected = selectAll;
+ });
+}
+
diff --git a/usr/local/www/javascript/niftyjsCode.js b/usr/local/www/javascript/niftyjsCode.js
new file mode 100755
index 0000000..8093a48
--- /dev/null
+++ b/usr/local/www/javascript/niftyjsCode.js
@@ -0,0 +1,174 @@
+function NiftyCheck(){
+if(!document.getElementById || !document.createElement)
+ return(false);
+isXHTML=/html\:/.test(document.getElementsByTagName('body')[0].nodeName);
+if(Array.prototype.push==null){Array.prototype.push=function(){
+ this[this.length]=arguments[0]; return(this.length);}}
+return(true);
+}
+
+function Rounded(selector,wich,bk,color,opt){
+var i,prefixt,prefixb,cn="r",ecolor="",edges=false,eclass="",b=false,t=false;
+
+if(color=="transparent"){
+ cn=cn+"x";
+ ecolor=bk;
+ bk="transparent";
+ }
+else if(opt && opt.indexOf("border")>=0){
+ var optar=opt.split(" ");
+ for(i=0;i<optar.length;i++)
+ if(optar[i].indexOf("#")>=0) ecolor=optar[i];
+ if(ecolor=="") ecolor="#666";
+ cn+="e";
+ edges=true;
+ }
+else if(opt && opt.indexOf("smooth")>=0){
+ cn+="a";
+ ecolor=Mix(bk,color);
+ }
+if(opt && opt.indexOf("small")>=0) cn+="s";
+prefixt=cn;
+prefixb=cn;
+if(wich.indexOf("all")>=0){t=true;b=true}
+else if(wich.indexOf("top")>=0) t="true";
+else if(wich.indexOf("tl")>=0){
+ t="true";
+ if(wich.indexOf("tr")<0) prefixt+="l";
+ }
+else if(wich.indexOf("tr")>=0){
+ t="true";
+ prefixt+="r";
+ }
+if(wich.indexOf("bottom")>=0) b=true;
+else if(wich.indexOf("bl")>=0){
+ b="true";
+ if(wich.indexOf("br")<0) prefixb+="l";
+ }
+else if(wich.indexOf("br")>=0){
+ b="true";
+ prefixb+="r";
+ }
+var v=getElementsBySelector(selector);
+var l=v.length;
+for(i=0;i<l;i++){
+ if(edges) AddBorder(v[i],ecolor);
+ if(t) AddTop(v[i],bk,color,ecolor,prefixt);
+ if(b) AddBottom(v[i],bk,color,ecolor,prefixb);
+ }
+}
+
+function AddBorder(el,bc){
+var i;
+if(!el.passed){
+ if(el.childNodes.length==1 && el.childNodes[0].nodeType==3){
+ var t=el.firstChild.nodeValue;
+ el.removeChild(el.lastChild);
+ var d=CreateEl("span");
+ d.style.display="block";
+ d.appendChild(document.createTextNode(t));
+ el.appendChild(d);
+ }
+ for(i=0;i<el.childNodes.length;i++){
+ if(el.childNodes[i].nodeType==1){
+ el.childNodes[i].style.borderLeft="1px solid "+bc;
+ el.childNodes[i].style.borderRight="1px solid "+bc;
+ }
+ }
+ }
+el.passed=true;
+}
+
+function AddTop(el,bk,color,bc,cn){
+var i,lim=4,d=CreateEl("b");
+
+if(cn.indexOf("s")>=0) lim=2;
+if(bc) d.className="artop";
+else d.className="rtop";
+d.style.backgroundColor=bk;
+for(i=1;i<=lim;i++){
+ var x=CreateEl("b");
+ x.className=cn + i;
+ x.style.backgroundColor=color;
+ if(bc) x.style.borderColor=bc;
+ d.appendChild(x);
+ }
+el.style.paddingTop=0;
+el.insertBefore(d,el.firstChild);
+}
+
+function AddBottom(el,bk,color,bc,cn){
+var i,lim=4,d=CreateEl("b");
+
+if(cn.indexOf("s")>=0) lim=2;
+if(bc) d.className="artop";
+else d.className="rtop";
+d.style.backgroundColor=bk;
+for(i=lim;i>0;i--){
+ var x=CreateEl("b");
+ x.className=cn + i;
+ x.style.backgroundColor=color;
+ if(bc) x.style.borderColor=bc;
+ d.appendChild(x);
+ }
+el.style.paddingBottom=0;
+el.appendChild(d);
+}
+
+function CreateEl(x){
+if(isXHTML) return(document.createElementNS('http://www.w3.org/1999/xhtml',x));
+else return(document.createElement(x));
+}
+
+function getElementsBySelector(selector){
+var i,selid="",selclass="",tag=selector,f,s=[],objlist=[];
+
+if(selector.indexOf(" ")>0){ //descendant selector like "tag#id tag"
+ s=selector.split(" ");
+ var fs=s[0].split("#");
+ if(fs.length==1) return(objlist);
+ f=document.getElementById(fs[1]);
+ if(f) return(f.getElementsByTagName(s[1]));
+ return(objlist);
+ }
+if(selector.indexOf("#")>0){ //id selector like "tag#id"
+ s=selector.split("#");
+ tag=s[0];
+ selid=s[1];
+ }
+if(selid!=""){
+ f=document.getElementById(selid);
+ if(f) objlist.push(f);
+ return(objlist);
+ }
+if(selector.indexOf(".")>0){ //class selector like "tag.class"
+ s=selector.split(".");
+ tag=s[0];
+ selclass=s[1];
+ }
+var v=document.getElementsByTagName(tag); // tag selector like "tag"
+if(selclass=="")
+ return(v);
+for(i=0;i<v.length;i++){
+ if(v[i].className.indexOf(selclass)>=0){
+ objlist.push(v[i]);
+ }
+ }
+return(objlist);
+}
+
+function Mix(c1,c2){
+var i,step1,step2,x,y,r=new Array(3);
+if(c1.length==4)step1=1;
+else step1=2;
+if(c2.length==4) step2=1;
+else step2=2;
+for(i=0;i<3;i++){
+ x=parseInt(c1.substr(1+step1*i,step1),16);
+ if(step1==1) x=16*x+x;
+ y=parseInt(c2.substr(1+step2*i,step2),16);
+ if(step2==1) y=16*y+y;
+ r[i]=Math.floor((x*50+y*50)/100);
+ }
+return("#"+r[0].toString(16)+r[1].toString(16)+r[2].toString(16));
+} \ No newline at end of file
diff --git a/usr/local/www/javascript/row_helper.js b/usr/local/www/javascript/row_helper.js
new file mode 100755
index 0000000..15d23f1
--- /dev/null
+++ b/usr/local/www/javascript/row_helper.js
@@ -0,0 +1,69 @@
+// Global Variables
+var rowname = new Array(4999);
+var rowtype = new Array(4999);
+var newrow = new Array(4999);
+var rowsize = new Array(4999);
+
+for (i = 0; i < 4999; i++) {
+ rowname[i] = '';
+ rowtype[i] = '';
+ newrow[i] = '';
+ rowsize[i] = '30';
+}
+
+var field_counter_js = 0;
+var loaded = 0;
+var is_streaming_progress_bar = 0;
+var temp_streaming_text = "";
+
+var addRowTo = (function() {
+ return (function (tableId) {
+ var d, tbody, tr, td, bgc, i, ii, j;
+ d = document;
+ tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0);
+ tr = d.createElement("tr");
+ for (i = 0; i < field_counter_js; i++) {
+ td = d.createElement("td");
+ if(rowtype[i] == 'textbox') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + rowsize[i] + "' class='formfld unknown' name='" + rowname[i] + totalrows + "'></input> ";
+ } else if(rowtype[i] == 'select') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select size='1' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> ";
+ } else {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input type='checkbox' name='" + rowname[i] + totalrows + "'></input> ";
+ }
+ tr.appendChild(td);
+ }
+ td = d.createElement("td");
+ td.rowSpan = "1";
+
+ td.innerHTML = '<input type="image" src="/themes/' + theme + '/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="Delete">';
+ tr.appendChild(td);
+ tbody.appendChild(tr);
+ totalrows++;
+ });
+})();
+
+function removeRow(el) {
+ var cel;
+ while (el && el.nodeName.toLowerCase() != "tr")
+ el = el.parentNode;
+
+ if (el && el.parentNode) {
+ cel = el.getElementsByTagName("td").item(0);
+ el.parentNode.removeChild(el);
+ }
+}
+
+function find_unique_field_name(field_name) {
+ // loop through field_name and strip off -NUMBER
+ var last_found_dash = 0;
+ for (var i = 0; i < field_name.length; i++) {
+ // is this a dash, if so, update
+ // last_found_dash
+ if (field_name.substr(i,1) == "-" )
+ last_found_dash = i;
+ }
+ if (last_found_dash < 1)
+ return field_name;
+ return(field_name.substr(0,last_found_dash));
+}
diff --git a/usr/local/www/javascript/row_helper_dynamic.js b/usr/local/www/javascript/row_helper_dynamic.js
new file mode 100755
index 0000000..47c5140
--- /dev/null
+++ b/usr/local/www/javascript/row_helper_dynamic.js
@@ -0,0 +1,72 @@
+// Global Variables
+var rowname = new Array(99);
+var rowtype = new Array(99);
+var newrow = new Array(99);
+var rowsize = new Array(99);
+
+for (i = 0; i < 99; i++) {
+ rowname[i] = '';
+ rowtype[i] = '';
+ newrow[i] = '';
+ rowsize[i] = '25';
+}
+
+var field_counter_js = 0;
+var loaded = 0;
+var is_streaming_progress_bar = 0;
+var temp_streaming_text = "";
+
+var addRowTo = (function() {
+ return (function (tableId) {
+ var d, tbody, tr, td, bgc, i, ii, j;
+ d = document;
+ tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0);
+ tr = d.createElement("tr");
+ totalrows++;
+ for (i = 0; i < field_counter_js; i++) {
+ td = d.createElement("td");
+ if(rowtype[i] == 'textbox') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + rowsize[i] + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
+ } else if(rowtype[i] == 'select') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> ";
+ } else if(rowtype[i] == 'checkbox') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input type='checkbox'name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
+ } else if(rowtype[i] == 'input') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input class='formfld unknown' size='" + rowsize[i] + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
+ } else if(rowtype[i] == 'password') {
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input class='formfld pwd' type='password' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
+ }
+ tr.appendChild(td);
+ }
+ td = d.createElement("td");
+ td.rowSpan = "1";
+ td.innerHTML = '<input type="image" src="/themes/' + theme + '/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="Delete">';
+ tr.appendChild(td);
+ tbody.appendChild(tr);
+ });
+})();
+
+function removeRow(el) {
+ var cel;
+ while (el && el.nodeName.toLowerCase() != "tr")
+ el = el.parentNode;
+
+ if (el && el.parentNode) {
+ cel = el.getElementsByTagName("td").item(0);
+ el.parentNode.removeChild(el);
+ }
+}
+
+function find_unique_field_name(field_name) {
+ // loop through field_name and strip off -NUMBER
+ var last_found_dash = 0;
+ for (var i = 0; i < field_name.length; i++) {
+ // is this a dash, if so, update
+ // last_found_dash
+ if (field_name.substr(i,1) == "-" )
+ last_found_dash = i;
+ }
+ if (last_found_dash < 1)
+ return field_name;
+ return(field_name.substr(0,last_found_dash));
+}
diff --git a/usr/local/www/javascript/row_toggle.js b/usr/local/www/javascript/row_toggle.js
new file mode 100755
index 0000000..6a1f5f8
--- /dev/null
+++ b/usr/local/www/javascript/row_toggle.js
@@ -0,0 +1,55 @@
+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');
+ var cellcnt = cells.length;
+
+ for (i = 0; i < cellcnt; i++) {
+ // Check for cells with frd id only
+ if (cells[i].id == "frd" + id)
+ 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);
+ var prevrow;
+ if (id != 0) {
+ prevrow = document.getElementById('fr' + (id-1));
+ } else {
+ prevrow = document.getElementById('frheader');
+ }
+
+ var cells = row.getElementsByTagName("td");
+ var prevcells = prevrow.getElementsByTagName("td");
+
+ for (i = 0; i <= prevcells.length - 1; i++) {
+ if (prevcells[i].id == 'frd' + (id-1)) {
+ if (on) {
+ prevcells[i].style.borderBottom = "3px solid #990000";
+ prevcells[i].style.paddingBottom = ((id != 0) ? 2 : 3) + "px";
+ } else {
+ prevcells[i].style.borderBottom = "1px solid #999999";
+ prevcells[i].style.borderBottomWidth = "1px";
+ prevcells[i].style.paddingBottom = ((id != 0) ? 4 : 5) + "px";
+ }
+ }
+ }
+
+ for (i = 0; i <= cells.length - 1; i++) {
+ if (cells[i].id == 'frd' + (id)) {
+ if (on) {
+ cells[i].style.borderTop = "2px solid #990000";
+ cells[i].style.paddingTop = "2px";
+ } else {
+ cells[i].style.borderTopWidth = 0;
+ cells[i].style.paddingTop = "4px";
+ }
+ }
+ }
+}
diff --git a/usr/local/www/javascript/ticker.js b/usr/local/www/javascript/ticker.js
new file mode 100755
index 0000000..77d3c63
--- /dev/null
+++ b/usr/local/www/javascript/ticker.js
@@ -0,0 +1,50 @@
+<!--
+
+var width="310px";
+
+var speed=2;
+var pauseit=1;
+
+var divonclick=speed=(document.all)? speed : Math.max(1, speed-1);
+var copyspeed=speed;
+var pausespeed=(pauseit==0)? copyspeed: 0;
+var iedom=document.all||document.getElementById;
+
+if (iedom)
+ document.write('<span id="marquee-container">'+content+'</span>');
+
+var actualwidth='';
+var scroller;
+
+if (window.addEventListener)
+ window.addEventListener("load", populatescroller, false);
+else if (window.attachEvent)
+ window.attachEvent("onload", populatescroller);
+else if (document.all || document.getElementById)
+ window.onload=populatescroller;
+
+function populatescroller(){
+ scroller=document.getElementById? document.getElementById("scroller") : document.all.scroller;
+ scroller.style.left=parseInt(width)+8+"px";
+ scroller.innerHTML=content;
+ document.getElementById("marquee-text");
+ actualwidth=document.all? document.getElementById("marquee-text").offsetWidth : document.getElementById("marquee-text").offsetWidth;
+ lefttime=setInterval("scrollmarquee()",20);
+}
+
+function scrollmarquee(){
+ if (parseInt(scroller.style.left)>(actualwidth*(-1)+8))
+ scroller.style.left=parseInt(scroller.style.left)-copyspeed+"px";
+ else
+ scroller.style.left=parseInt(width)+8+"px";
+}
+
+if (iedom){
+ document.write('<table id="marquee"><td>');
+ document.write('<div id="container" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=speed">');
+ document.write('<div id="scroller"></div>');
+ document.write('</div>');
+ document.write('</td></table>');
+}
+
+//--> \ No newline at end of file
OpenPOWER on IntegriCloud