Massive javascript cleanup, all .js files now live in $g['www_path']/javascript

Purged unused JS
This commit is contained in:
Bill Marquette 2009-03-14 14:41:04 -05:00
parent d3bc15eae5
commit 625dcc400c
22 changed files with 25 additions and 1720 deletions

View File

@ -1,366 +0,0 @@
/* ---- Variables ---- */
var actb_timeOut = -1; // Autocomplete Timeout in ms (-1: autocomplete never time out)
var actb_lim = 5; // Number of elements autocomplete can show (-1: no limit)
var actb_firstText = false; // should the auto complete be limited to the beginning of keyword?
/* ---- Variables ---- */
/* --- Styles --- */
var actb_bgColor = '#FFFFFF';
var actb_textColor = '#000000';
var actb_hBgColor = '#990000';
var actb_htextColor = '#FFFFFF';
var actb_fFamily = 'Courier';
var actb_fSize = '14px';
var actb_hStyle = 'text-decoration:underline;font-weight="bold"';
/* --- Styles --- */
/* ---- Constants ---- */
var actb_keywords = new Array();
var actb_display = true;
var actb_pos = 0;
var actb_total = 0;
var actb_curr = null;
var actb_rangeu = 0;
var actb_ranged = 0;
var actb_bool = new Array();
var actb_pre = 0;
var actb_toid;
var actb_tomake = true;
/* ---- Constants ---- */
function actb_parse(n){
var t = escape(actb_curr.value);
var tobuild = '';
var i;
var re = "";
if (actb_firstText){
re = new RegExp("^" + t, "i");
}else{
re = new RegExp(t, "i");
}
var p = n.search(re);
for (i=0;i<p;i++){
tobuild += n.substr(i,1);
}
tobuild += "";
for (i=p;i<t.length+p;i++){
tobuild += n.substr(i,1);
}
tobuild += "";
for (i=t.length+p;i<n.length;i++){
tobuild += n.substr(i,1);
}
return tobuild;
}
function actb_generate(){
if(navigator.appName == "Microsoft Internet Explorer") {
if(window.location.protocol == 'https:') return;
if(actb_keywords.length < 1) return; // if no items setup, do not invoke code. prevent ie crashing.
if (document.getElementById('tat_frame')) document.body.removeChild(document.getElementById('tat_frame'));
}
if (document.getElementById('tat_table')) document.body.removeChild(document.getElementById('tat_table'));
if(navigator.appName == "Microsoft Internet Explorer") {
frame = document.createElement('iframe');
frame.cellSpacing='1px';
frame.cellPadding='2px';
frame.style.zIndex = 3;
frame.style.position='absolute';
frame.style.top = eval(curTop() + actb_curr.offsetHeight) + "px";
frame.style.left = curLeft() + "px";
frame.style.backgroundColor=actb_bgColor;
frame.id = 'tat_frame';
}
a = document.createElement('table');
a.cellSpacing='1px';
a.cellPadding='2px';
a.style.border = '1px solid #990000';
a.style.zIndex = 5;
a.style.position='absolute';
a.style.top = eval(curTop() + actb_curr.offsetHeight) + "px";
a.style.left = curLeft() + "px";
a.style.backgroundColor=actb_bgColor;
a.id = 'tat_table';
if(navigator.appName == "Microsoft Internet Explorer")
document.body.appendChild(frame);
document.body.appendChild(a);
var i;
var first = true;
var j = 1;
var height = 0;
var counter = 0;
for (i=0;i<actb_keywords.length;i++){
if (actb_bool[i]){
counter++;
r = a.insertRow(-1);
if (first && !actb_tomake){
r.style.backgroundColor = actb_hBgColor;
first = false;
actb_pos = counter;
}else if(actb_pre == i){
r.style.backgroundColor = actb_hBgColor;
first = false;
actb_pos = counter;
}else{
r.style.backgroundColor = actb_bgColor;
r.style.color = actb_bgColor;
}
r.id = 'tat_tr'+(j);
c = r.insertCell(-1);
c.style.color = actb_textColor;
counter = 0;
first = true;
if (first && !actb_tomake){
c.style.color = actb_htextColor;
first = false;
actb_pos = counter;
}else if(actb_pre == i){
c.style.color = actb_htextColor;
first = false;
actb_pos = counter;
}else{
c.style.color = actb_textColor;
}
c.style.fontFamily = actb_fFamily;
a.style.zIndex = 5;
c.style.fontSize = actb_fSize;
c.innerHTML = actb_parse(actb_keywords[i]);
c.id = 'tat_td'+(j);
height = height + c.offsetHeight;
width = c.offsetWidth;
j++;
}
if (j - 1 == actb_lim && j < actb_total){
r = a.insertRow(-1);
r.style.backgroundColor = actb_bgColor;
c = r.insertCell(-1);
c.style.color = actb_textColor;
a.style.zIndex = 5;
c.style.fontFamily = 'arial narrow';
c.style.fontSize = actb_fSize;
c.align='center';
c.innerHTML = '\\/';
break;
}
}
actb_rangeu = 1;
actb_ranged = j-1;
actb_display = true;
if (actb_pos <= 0) actb_pos = 1;
if(navigator.appName == "Microsoft Internet Explorer") {
frame.width=width;
frame.height=height + 5;
}
}
function curTop(){
actb_toreturn = 0;
obj = actb_curr;
while(obj){
actb_toreturn += obj.offsetTop;
obj = obj.offsetParent;
}
return actb_toreturn;
}
function curLeft(){
actb_toreturn = 0;
obj = actb_curr;
while(obj){
actb_toreturn += obj.offsetLeft;
obj = obj.offsetParent;
}
return actb_toreturn;
}
function actb_remake() {
document.body.removeChild(document.getElementById('tat_table'));
if(navigator.appName == "Microsoft Internet Explorer") {
document.body.removeChild(document.getElementById('tat_frame'));
frame = document.createElement('iframe');
frame.cellSpacing='2px';
frame.cellPadding='3px';
frame.style.position='absolute';
frame.style.zIndex = 5;
frame.style.top = eval(curTop() + actb_curr.offsetHeight) + "px";
frame.style.left = curLeft() + "px";
frame.style.backgroundColor=actb_bgColor;
frame.id = 'tat_frame';
}
a = document.createElement('table');
a.cellSpacing='2px';
a.cellPadding='3px';
a.style.position='absolute';
a.style.zIndex = 5;
a.style.top = eval(curTop() + actb_curr.offsetHeight) + "px";
a.style.left = curLeft() + "px";
a.style.backgroundColor=actb_bgColor;
a.id = 'tat_table';
if(navigator.appName == "Microsoft Internet Explorer")
document.body.appendChild(frame);
document.body.appendChild(a);
var width = 0;
var height = 0;
var i;
var first = true;
var j = 1;
if (actb_rangeu > 1){
r = a.insertRow(-1);
r.style.backgroundColor = actb_bgColor;
c = r.insertCell(-1);
c.style.color = actb_textColor;
c.style.fontFamily = 'arial narrow';
a.style.zIndex = 5;
c.style.fontSize = actb_fSize;
c.align='center';
c.innerHTML = '/\\';
}
for (i=0;i<actb_keywords.length;i++){
if (actb_bool[i]){
if (j >= actb_rangeu && j <= actb_ranged){
r = a.insertRow(-1);
r.style.backgroundColor = actb_bgColor;
r.id = 'tat_tr'+(j);
c = r.insertCell(-1);
c.style.color = actb_textColor;
c.style.fontFamily = actb_fFamily;
a.style.zIndex = 5;
c.style.fontSize = actb_fSize;
c.innerHTML = actb_parse(actb_keywords[i]);
c.id = 'tat_td'+(j);
j++;
}else{
j++;
}
}
if (j > actb_ranged) break;
}
if (j-1 < actb_total){
r = a.insertRow(-1);
r.style.backgroundColor = actb_bgColor;
c = r.insertCell(-1);
c.style.color = actb_textColor;
c.style.fontFamily = 'arial narrow';
c.style.fontSize = actb_fSize;
c.align='center';
c.innerHTML = '\\/';
height = height + c.height;
width = c.width;
}
if(navigator.appName == "Microsoft Internet Explorer") {
frame.width=width;
frame.height=height;
}
}
function actb_goup(){
if (!actb_display) return;
if (actb_pos == 1) return;
document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_bgColor;
document.getElementById('tat_td'+actb_pos).style.color = actb_textColor;
actb_pos--;
if (actb_pos < actb_rangeu) actb_moveup();
document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hBgColor;
document.getElementById('tat_td'+actb_pos).style.color = actb_htextColor;
if (actb_toid) clearTimeout(actb_toid);
if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
}
function actb_godown(){
if (!actb_display) return;
if (actb_pos == actb_total) return;
document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_bgColor;
document.getElementById('tat_td'+actb_pos).style.color = actb_textColor;
actb_pos++;
if (actb_pos > actb_ranged) actb_movedown();
document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hBgColor;
document.getElementById('tat_td'+actb_pos).style.color= actb_htextColor;
if (actb_toid) clearTimeout(actb_toid);
if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
}
function actb_movedown(){
actb_rangeu++;
actb_ranged++;
actb_remake();
}
function actb_moveup(){
actb_rangeu--;
actb_ranged--;
actb_remake();
}
function actb_penter(){
if (!actb_display) return;
actb_display = 0;
var word = '';
var c = 0;
for (var i=0;i<=actb_keywords.length;i++){
if (actb_bool[i]) c++;
if (c == actb_pos){
word = actb_keywords[i];
break;
}
}
a = word;//actb_keywords[actb_pos-1];//document.getElementById('tat_td'+actb_pos).;
actb_curr.value = a;
actb_removedisp();
}
function actb_removedisp(){
actb_display = 0;
if(navigator.appName == "Microsoft Internet Explorer")
if (document.getElementById('tat_frame')) document.body.removeChild(document.getElementById('tat_frame'));
if (document.getElementById('tat_table')) document.body.removeChild(document.getElementById('tat_table'));
if (actb_toid) clearTimeout(actb_toid);
}
function actb_checkkey(evt, sndr){
a = evt.keyCode;
if (a == 38){ // up key
actb_goup();
}else if(a == 40){ // down key
actb_godown();
}else if(a == 13){
actb_penter();
}
}
function actb_tocomplete(sndr,evt,arr){
if (arr) actb_keywords = arr;
if (evt.keyCode == 38 || evt.keyCode == 40 || evt.keyCode == 13) return;
var i;
if (actb_display){
var word = 0;
var c = 0;
for (i=0;i<=actb_keywords.length;i++){
if (actb_bool[i]) c++;
if (c == actb_pos){
word = i;
break;
}
}
actb_pre = word;//actb_pos;
}else{ actb_pre = -1; }
if (!sndr) sndr = evt.srcElement;
actb_curr = sndr;
if (sndr.value == ''){
actb_removedisp();
return;
}
var t = sndr.value;
var re = "";
if (actb_firstText){
re = new RegExp("^" + t, "i");
}else{
re = new RegExp(t, "i");
}
actb_total = 0;
actb_tomake = false;
for (i=0;i<actb_keywords.length;i++){
actb_bool[i] = false;
if (re.test(actb_keywords[i])){
actb_total++;
actb_bool[i] = true;
if (actb_pre == i) actb_tomake = true;
}
}
if (actb_toid) clearTimeout(actb_toid);
if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
actb_generate(actb_bool);
}

View File

@ -1,187 +0,0 @@
/**************************************************
* dom-drag.js
* 09.25.2001
* www.youngpup.net
**************************************************
* 10.28.2001 - fixed minor bug where events
* sometimes fired off the handle, not the root.
**************************************************
* 05.30.2005 - added a workaround for firefox
* activating links when finished dragging.
* mmosier@astrolabe.com
**************************************************/
/*
The DragList drag and drop ordered lists implementation is available under the terms of the new BSD license.
Copyright (c) 2005, DTLink, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* 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.
* Neither the name of DTLink, LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "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 COPYRIGHT OWNER OR
CONTRIBUTORS 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.
*/
var Drag = {
obj : null,
init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
{
o.onmousedown = Drag.start;
o.hmode = bSwapHorzRef ? false : true ;
o.vmode = bSwapVertRef ? false : true ;
o.root = oRoot && oRoot != null ? oRoot : o ;
if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px";
if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px";
if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px";
if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
o.minX = typeof minX != 'undefined' ? minX : null;
o.minY = typeof minY != 'undefined' ? minY : null;
o.maxX = typeof maxX != 'undefined' ? maxX : null;
o.maxY = typeof maxY != 'undefined' ? maxY : null;
o.xMapper = fXMapper ? fXMapper : null;
o.yMapper = fYMapper ? fYMapper : null;
o.root.onDragStart = new Function();
o.root.onDragEnd = new Function();
o.root.onDrag = new Function();
},
start : function(e)
{
var o = Drag.obj = this;
e = Drag.fixE(e);
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
o.root.onDragStart(x, y);
o.startX = x;
o.startY = y;
o.lastMouseX = e.clientX;
o.lastMouseY = e.clientY;
if (o.hmode) {
if (o.minX != null) o.minMouseX = e.clientX - x + o.minX;
if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX;
} else {
if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
}
if (o.vmode) {
if (o.minY != null) o.minMouseY = e.clientY - y + o.minY;
if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY;
} else {
if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
}
document.onmousemove = Drag.drag;
document.onmouseup = Drag.end;
if (o.linkDisabled) {
var hrefs = o.root.getElementsByTagName("a");
for (var i = 0; i < hrefs.length; i++) {
hrefs[i].onclick = hrefs[i].prevOnclick;
hrefs[i].prevOnclick = null;
}
o.linkDisabled = false;
}
return false;
},
drag : function(e)
{
e = Drag.fixE(e);
var o = Drag.obj;
var ey = e.clientY;
var ex = e.clientX;
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
var nx, ny;
if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
if (o.xMapper) nx = o.xMapper(y);
else if (o.yMapper) ny = o.yMapper(x);
Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
Drag.obj.lastMouseX = ex;
Drag.obj.lastMouseY = ey;
var threshold = 4;
if (!o.linkDisabled) {
if (Math.abs(nx - o.startX) > threshold || Math.abs(ny - o.startY) > threshold) {
var hrefs = o.root.getElementsByTagName("a");
for (var i = 0; i < hrefs.length; i++) {
hrefs[i].prevOnclick = hrefs[i].onclick;
hrefs[i].onclick = function() { return false; };
}
o.linkDisabled = true;
}
}
Drag.obj.root.onDrag(nx, ny, Drag.obj.root);
return false;
},
end : function()
{
document.onmousemove = null;
document.onmouseup = null;
Drag.obj.root.onDragEnd(
parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),
parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]),
Drag.obj.root);
Drag.obj = null;
},
fixE : function(e)
{
if (typeof e == 'undefined') e = window.event;
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
return e;
}
};

View File

@ -1,331 +0,0 @@
// ----------------------------------------------------------------------------
// (c) Copyright, DTLink, LLC 1997-2005
// http://www.dtlink.com
//
// DragList - Drag and Drop Ordered Lists
//
// Javascript Support file for formVista <draglist> fvml tag.
//
// For more information please see:
//
// http://www.formvista.com/otherprojects/draglist.html
//
// For questions or comments please contact us at:
//
// http://www.formvista.com/contact.html
//
// LICENSE: This file is governed by the new BSD license. For more information
/*
The DragList drag and drop ordered lists implementation is available under the terms of the new BSD license.
Copyright (c) 2005, DTLink, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
* 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.
* Neither the name of DTLink, LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "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 COPYRIGHT OWNER OR
CONTRIBUTORS 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.
*/
//
// REVISION HISTORY:
//
// 2004-11-12 YmL:
// . initial revision.
//
// 2005-05-28 YmL:
// . pulled out of formVista, relicensed and packaged as a standalone implementation.
//
// 2005-06-02 mtmosier:
// . added horizontal dragging support.
//
// ------------------------
/**
* constructor for dragList class
*/
function fv_dragList( name )
{
// name of this dragList. Must match the id of the root DIV tag.
this.dragListRootId = name;
// array of item offsets
this.offsetsX = new Array();
this.offsetsY = new Array();
}
// ----------------------------------------------
/**
* setup the draglist prior to use
*
* @param string orientation defaults to vert. if set to "horz" renders horizontally.
* @param string itemTagName. if null defaults to "div". Can be "span".
*/
fv_dragList.prototype.setup = function( orientation, itemTagName )
{
var horizontal;
if ( orientation == "horz" )
horizontal = true;
else
horizontal = false;
this.listRoot = document.getElementById( this.dragListRootId );
this.listItems = this.getListItems( itemTagName );
for (var i = 0; i < this.listItems.length; i++)
{
if ( this.listItems[i] == undefined )
continue;
if ( horizontal )
{
Drag.init(this.listItems[i], null, null, null, 0, 0);
}
else
{
Drag.init(this.listItems[i], null, 0, 0, null, null);
}
// ---------------------------------------------------
// on drag method
this.listItems[i].onDrag = function( x, y, thisElem )
{
x = thisElem.offsetLeft;
y = thisElem.offsetTop;
// this is a callback from the dom-drag code. From within this
// function "this" does not refer to the fv_draglist function.
draglist = getDragList( thisElem );
draglist.recalcOffsets( itemTagName );
var pos = draglist.getCurrentOffset( thisElem, itemTagName );
//var listItems = this.getListItems( itemTagName );
// if bottom edge is below top of lower item.
var testMoveUp;
var testMoveDown;
if ( horizontal )
{
testMoveUp = (x + draglist.getDivWidth(thisElem) > draglist.offsetsX[pos + 1] + draglist.getDivWidth( draglist.listItems[pos + 1] ));
testMoveDown = x < draglist.offsetsX[pos - 1];
}
else
{
testMoveUp = (y + draglist.getDivHeight(thisElem) > draglist.offsetsY[pos + 1] + draglist.getDivHeight( draglist.listItems[pos + 1] ));
testMoveDown = y < draglist.offsetsY[pos - 1];
}
if (( pos != draglist.listItems.length - 1) && testMoveUp )
{
draglist.listRoot.removeChild(thisElem);
if ( pos + 1 == draglist.listItems.length )
{
draglist.listRoot.appendChild( thisElem );
}
else
{
draglist.listRoot.insertBefore(thisElem, draglist.listItems[pos+1]);
}
thisElem.style["top"] = "0px";
thisElem.style["left"] = "0px";
}
else if ( pos != 0 && testMoveDown )
{
draglist.listRoot.removeChild(thisElem);
draglist.listRoot.insertBefore(thisElem, draglist.listItems[pos-1]);
thisElem.style["top"] = "0px";
thisElem.style["left"] = "0px";
}
};
this.listItems[i].onDragEnd = function(x,y,thisElem)
{
thisElem.style["top"] = "0px";
thisElem.style["left"] = "0px";
};
} // end of for loop.
this.recalcOffsets( itemTagName );
}; // end of setup.
// ----------------------------------------------
/**
* update the order value fields and submit the form.
*/
fv_dragList.prototype.do_submit = function( formName, dragListRootId )
{
var listOrderItems = this.listRoot.getElementsByTagName("input");
for (var i = 0; i < listOrderItems.length; i++)
{
listOrderItems[i].value = i;
}
expr = "document." + formName + ".submit()";
eval( expr );
};
// ----------------------------------------------
// "Private" methods.
// ----------------------------------------------
fv_dragList.prototype.recalcOffsets = function( itemTagName )
{
var listItems = this.getListItems( itemTagName );
for (var i = 0; i < listItems.length; i++)
{
this.offsetsX[i] = listItems[i].offsetLeft;
this.offsetsY[i] = listItems[i].offsetTop;
}
};
fv_dragList.prototype.getCurrentOffset = function(elem, itemTagName)
{
var listItems = this.getListItems( itemTagName );
for (var i = 0; i < listItems.length; i++)
{
if (listItems[i] == elem)
{
return i;
}
}
};
fv_dragList.prototype.getDivWidth = function(elem)
{
if (( elem == undefined) || ( elem.offsetWidth == undefined ))
return( 0 );
value = elem.offsetWidth;
if (isNaN(value))
{
value = 0;
}
return( value );
};
fv_dragList.prototype.getDivHeight = function(elem)
{
if (( elem == undefined) || ( elem.offsetHeight == undefined ))
return( 0 );
value = elem.offsetHeight;
if (isNaN(value))
{
value = 25;
}
return( value );
};
/**
* return list of draggable items
*/
fv_dragList.prototype.getListItems = function( itemTagName )
{
if ( itemTagName == undefined )
{
itemTagName = "div";
}
var listItems = this.listRoot.getElementsByTagName( itemTagName );
return( listItems );
};
// end of draglist class definition.
// -------------------------------------
/**
* add a new dragList to the list of draglists on this page
*
* This implementatoin supports multiple managed draglists on
* a single page. The index is contained in a global dragListIndex
* array that must be declared in the page.
*/
function addDragList( draglist )
{
dragListIndex[ draglist.dragListRootId ] = draglist;
}
// -------------------------------------------------------
/**
* given a draggable div element, return the draglist it belongs to
*
* @see fv_draglist.prototype.setup
* @todo this should probably be a method inside the draglist class.
*/
function getDragList( elem )
{
// given a list item return the drag list it belongs to.
var draglistContainer = elem.parentNode;
var draglist = dragListIndex[ draglistContainer.id ];
return( draglist );
}
// END

View File

@ -1,767 +0,0 @@
function navigate(url) {
location.href=url;
}
// getElementByID with browser check!!
function getElById(idVal) {
if (document.getElementById != null)
return document.getElementById(idVal);
if (document.all != null)
return document.all[idVal];
alert("Problem getting element by id");
return null;
}
// Node object
function Node(id, pid, name, url, title, target, icon, iconOpen, open , checkable ,checked, add, del) {
this.id = id;
this.pid = pid;
this.name = name;
this.url = url;
this.title = title;
this.target = target;
this.icon = icon;
this.iconOpen = iconOpen;
this._io = open || false;
this.checkable = checkable || false;
this.checked = checked || false;
this.add = add || false;
this.del = del || false;
this._is = false;
this._ls = false;
this._hc = false;
this._ai = 0;
this._p;
}
// Tree object
function dTree(objName) {
this.config = {
target : null,
folderLinks : true,
useSelection : true,
useCookies : true,
useLines : true,
useIcons : true,
useStatusText : false,
closeSameLevel : false,
inOrder : false
};
this.icon = {
root : 'tree-images/zone.gif',
folder : 'tree-images/folder.gif',
folderOpen : 'tree-images/folderopen.gif',
node : 'tree-images/page.gif',
empty : 'tree-images/empty.gif',
line : 'tree-images/line.gif',
join : 'tree-images/join.gif',
joinBottom : 'tree-images/joinbottom.gif',
plus : 'tree-images/plus_updown.gif',
plusBottom : 'tree-images/plus_up.gif',
minus : 'tree-images/minus_.gif',
minusBottom : 'tree-images/minus_up.gif',
nlPlus : 'tree-images/plus_.gif',
nlMinus : 'tree-images/minus_.gif'
};
this.obj = objName;
this.aNodes = [];
this.aIndent = [];
this.root = new Node(-1);
this.selectedNode = null;
this.selectedFound = false;
this.completed = false;
}
// Adds a new node to the node array
dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open, checkable, checked, add, del) {
this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open, checkable, checked, add, del);
};
// Open/close all nodes
dTree.prototype.openAll = function() {
this.oAll(true);
};
dTree.prototype.closeAll = function() {
this.oAll(false);
};
// Outputs the tree to the page
dTree.prototype.toString = function() {
var str = '<div class="treeview">\n';
if (document.getElementById) {
if (this.config.useCookies) this.selectedNode = this.getSelected();
str += this.addNode(this.root);
} else str += 'Browser not supported.';
str += '</div>';
if (!this.selectedFound) this.selectedNode = null;
this.completed = true;
return str;
};
// Creates the tree structure
dTree.prototype.addNode = function(pNode) {
var str = '';
var n=0;
if (this.config.inOrder) n = pNode._ai;
for (n; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == pNode.id) {
var cn = this.aNodes[n];
cn._p = pNode;
cn._ai = n;
this.setCS(cn);
if (!cn.target && this.config.target) cn.target = this.config.target;
if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
if (!this.config.folderLinks && cn._hc) cn.url = null;
if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
cn._is = true;
this.selectedNode = n;
this.selectedFound = true;
}
str += this.node(cn, n);
if (cn._ls) break;
}
}
return str;
};
// Creates the node icon, url and text
dTree.prototype.node = function(node, nodeId) {
var str = '<div class="node" >' + this.indent(node, nodeId);
if (this.config.useIcons) {
if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
if (this.root.id == node.pid) {
node.icon = this.icon.root;
node.iconOpen = this.icon.root;
}
//class="img" border="10" vspace="18" align="bottom" style="border:0px; margin:0; padding:0; FILTER: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50); -moz-opacity:0.5"
str += '<img style="border:0; margin:0; padding:0; height:16px; vertical-align:top; overflow:hidden;" id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
if (node.checkable) {
str += '<input style="border:0; margin:0; padding:0; height:16px; vertical-align:top; overflow:hidden; FILTER: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50); " type="checkbox" id="c' + this.obj + node.id + '" onclick="javascript : ' + this.obj + '.c(' + node.id + ');"';
if (node.checked) str += ' checked >'; else str += ' >';
}//else str+='';
}
if (node.url) {
str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="javascript:navigate(\'' + node.url + '\')"';
if (node.title) str += ' title="' + node.title + '"';
//if (node.target) str += ' target="' + node.target + ';"';
if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
str += '>';
}
else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
str += '<a style="border:0; margin:0; padding:0; text-size: smaller; vertical-align: top; overflow:hidden;" href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
str += ' '+node.name;
if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
if (node.add && node.url) {
str += ' -- <a href="' + node.url + '&qaction=addsub"/> <img style="border:0; margin:0; padding:0; width: 16px; height:16px; vertical-align: top; overflow:hidden;" id="i' + this.obj + nodeId + '" src="images/plus.gif" alt="" /></a>';
}
if (node.del && node.url) {
str += ' <a href="' + node.url + '&qaction=delete"/> <img style="border:0; margin:0; padding:0; width: 11px; height:11px; vertical-align: top; overflow:hidden;" id="i' + this.obj + nodeId + '" src="images/block.gif" alt="" /></a>';
}
if (node._hc) {
str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
str += this.addNode(node);
str += '</div>';
}
str += '</div>';
this.aIndent.pop();
return str;
};
// Adds the empty and line icons
dTree.prototype.indent = function(node, nodeId) {
var str = '';
if (this.root.id != node.pid) {
for (var n=0; n<this.aIndent.length; n++)
str += '<img style="verical-align: top;" src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
if (node._hc) {
str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
str += '" alt="" /></a>';
} else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
}
return str;
};
// Checks if a node has any children and if it is the last sibling
dTree.prototype.setCS = function(node) {
var lastId;
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.id) node._hc = true;
if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
}
if (lastId==node.id) node._ls = true;
};
// Returns the selected node
dTree.prototype.getSelected = function() {
var sn = this.getCookie('cs' + this.obj);
return (sn) ? sn : null;
};
// Highlights the selected node
dTree.prototype.s = function(id) {
if (!this.config.useSelection) return;
var cn = this.aNodes[id];
if (cn._hc && !this.config.folderLinks) return;
if (this.selectedNode != id) {
if (this.selectedNode || this.selectedNode==0) {
eOld = document.getElementById("s" + this.obj + this.selectedNode);
eOld.className = "node";
}
eNew = document.getElementById("s" + this.obj + id);
eNew.className = "nodeSel";
this.selectedNode = id;
if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
}
};
// Checks all parents
dTree.prototype.c = function(id) {
//alert('callid='+id);
var n=0;
var parent;
parent = document.getElementById("c" + this.obj + id);
//if (parent.checked==true) parent.checked=false; else parent.checked=true;
var what = parent.checked;
for (n; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == id) {
var cn = this.aNodes[n];
element = document.getElementById("c" + this.obj + cn.id);
element.checked = what;
cn.checked = what;
//alert(cn.pid+'(child)==(parent)'+id+'->'+cn.id+'='+what+','+this.aNodes.length );
this.c(cn.id);
}
}
};
dTree.prototype.generate_checkedlist = function(id) {
var retStr='';
var n=0;
var parent = document.getElementById("c" + this.obj + id);
for (n; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == id) {
var cn = this.aNodes[n];
var element = document.getElementById("c" + this.obj + cn.id);
//alert(cn.name + ' = ' +element.checked);
if (element.checked) {
if (retStr == '')
{retStr = cn.name; }// this.generate_checkedlist(cn.id);
else
retStr += ',' + cn.name;//this.generate_checkedlist(cn.id);
}
//alert(cn.pid+'(child)==(parent)'+id+'->'+cn.id+'='+what+','+this.aNodes.length );
}
}
return retStr;
};
// Toggle Open or close
dTree.prototype.o = function(id) {
var cn = this.aNodes[id];
this.nodeStatus(!cn._io, id, cn._ls);
cn._io = !cn._io;
if (this.config.closeSameLevel) this.closeLevel(cn);
if (this.config.useCookies) this.updateCookie();
};
// Open or close all nodes
dTree.prototype.oAll = function(status) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
this.nodeStatus(status, n, this.aNodes[n]._ls);
this.aNodes[n]._io = status;
}
}
if (this.config.useCookies) this.updateCookie();
};
// Opens the tree to a specific node
dTree.prototype.openTo = function(nId, bSelect, bFirst) {
if (!bFirst) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].id == nId) {
nId=n;
break;
}
}
}
var cn=this.aNodes[nId];
if (cn.pid==this.root.id || !cn._p) return;
cn._io = true;
cn._is = bSelect;
if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
if (this.completed && bSelect) this.s(cn._ai);
else if (bSelect) this._sn=cn._ai;
this.openTo(cn._p._ai, false, true);
};
// Closes all nodes on the same level as certain node
dTree.prototype.closeLevel = function(node) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
}
}
};
// Closes all children of a node
dTree.prototype.closeAllChildren = function(node) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
}
}
};
// Change the status of a node(open or closed)
dTree.prototype.nodeStatus = function(status, id, bottom) {
eDiv = document.getElementById('d' + this.obj + id);
eJoin = document.getElementById('j' + this.obj + id);
if (this.config.useIcons) {
eIcon = document.getElementById('i' + this.obj + id);
eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
}
eJoin.src = (this.config.useLines)?
((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
((status)?this.icon.nlMinus:this.icon.nlPlus);
eDiv.style.display = (status) ? 'block': 'none';
};
// [Cookie] Clears a cookie
dTree.prototype.clearCookie = function() {
var now = new Date();
var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
this.setCookie('co'+this.obj, 'cookieValue', yesterday);
this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
};
// [Cookie] Sets value in a cookie
dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
document.cookie =
escape(cookieName) + '=' + escape(cookieValue) +
(expires ? '; expires=' + expires.toGMTString() : '') +
(path ? '; path=' + path : '') +
(domain ? '; domain=' + domain : '') +
(secure ? '; secure' : '');
};
// [Cookie] Gets a value from a cookie
dTree.prototype.getCookie = function(cookieName) {
var cookieValue = '';
var posName = document.cookie.indexOf(escape(cookieName) + '=');
if (posName != -1) {
var posValue = posName + (escape(cookieName) + '=').length;
var endPos = document.cookie.indexOf(';', posValue);
if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
else cookieValue = unescape(document.cookie.substring(posValue));
}
return (cookieValue);
};
// [Cookie] Returns ids of open nodes as a string
dTree.prototype.updateCookie = function() {
var str = '';
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
if (str) str += '.';
str += this.aNodes[n].id;
}
}
this.setCookie('co' + this.obj, str);
};
// [Cookie] Checks if a node id is in a cookie
dTree.prototype.isOpen = function(id) {
var aOpen = this.getCookie('co' + this.obj).split('.');
for (var n=0; n<aOpen.length; n++) {
if (aOpen[n] == id) return true;
}
return false;
};
// If Push and pop is not implemented by the browser
if (!Array.prototype.push) {
Array.prototype.push = function array_push() {
for(var i=0;i<arguments.length;i++)
this[this.length]=arguments[i];
return this.length;
};
}
if (!Array.prototype.pop) {
Array.prototype.pop = function array_pop() {
lastElement = this[this.length-1];
this.length = Math.max(this.length-1,0);
return lastElement;
};
}

View File

@ -97,7 +97,7 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') {
<script type="text/javascript">
var content='<div id="marquee-text"><?= $notice_msgs; ?></div>'
</script>
<script type="text/javascript" src="/ticker.js"></script>
<script type="text/javascript" src="/javascript/ticker.js"></script>
</div>
<?
} else {

View File

@ -372,7 +372,7 @@ EOD;
echo $jscriptstr;
?>
<script type="text/javascript" src="row_helper.js">
<script type="text/javascript" src="/javascript/row_helper.js">
</script>
<input type='hidden' name='address_type' value='textbox' />

View File

@ -152,8 +152,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<body link="#000000" vlink="#000000" alink="#000000">
<?php include("fbegin.inc"); ?>
<form action="firewall_nat.php" method="post" name="iform">
<script type="text/javascript" language="javascript" src="row_toggle.js">
</script>
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js"></script>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<?php
if($savemsg)

View File

@ -185,7 +185,7 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<form action="firewall_nat_out.php" method="post" name="iform">
<script type="text/javascript" language="javascript" src="row_toggle.js">
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
</script>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_natconfdirty_path)): ?><p>

View File

@ -194,7 +194,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<form action="firewall_rules.php" method="post">
<script type="text/javascript" language="javascript" src="row_toggle.js">
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
</script>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_filterconfdirty_path)): ?><p>

View File

@ -28,33 +28,33 @@ $pagetitle = gentitle( $pgtitle );
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false &&
file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?>
<?php outputCSSFileInline("themes/{$g['theme']}/wizard.css"); ?>
<?php outputCSSFileInline("{$g['www_path']}/themes/{$g['theme']}/wizard.css"); ?>
<?php else: ?>
<link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" media="all" />
<?php endif; ?>
<?php
if(file_exists("niftycssCode.css"))
outputCSSFileInline("niftycssCode.css");
if(file_exists("niftycssprintCode.css"))
outputCSSPrintFileInline("niftycssprintCode.css");
if(file_exists("niftyjsCode.js"))
outputJavaScriptFileInline("niftyjsCode.js");
if(file_exists("{$g['www_path']}/niftycssCode.css"))
outputCSSFileInline("{$g['www_path']}/niftycssCode.css");
if(file_exists("{$g['www_path']}/niftycssprintCode.css"))
outputCSSPrintFileInline("{$g['www_path']}/niftycssprintCode.css");
if(file_exists("{$g['www_path']}/javascript/niftyjsCode.js"))
outputJavaScriptFileInline("{$g['www_path']}/javascript/niftyjsCode.js");
?>
<script type="text/javascript">
var theme = "<?php echo $g['theme']; ?>";
</script>
<?php outputJavaScriptFileInline("themes/{$g['theme']}/loader.js"); ?>
<?php outputJavaScriptFileInline("{$g['www_path']}/themes/{$g['theme']}/loader.js"); ?>
<?php
if($_GET['enablefirebuglite']) {
outputJavaScriptFileInline("javascript/pi.js");
outputJavaScriptFileInline("javascript/firebug-lite.js");
outputJavaScriptFileInline("{$g['www_path']}/javascript/pi.js");
outputJavaScriptFileInline("{$g['www_path']}/javascript/firebug-lite.js");
}
outputJavaScriptFileInline("javascript/scriptaculous/prototype.js");
outputJavaScriptFileInline("javascript/scriptaculous/scriptaculous.js");
outputJavaScriptFileInline("javascript/scriptaculous/effects.js");
outputJavaScriptFileInline("javascript/scriptaculous/dragdrop.js");
if(file_exists("javascript/global.js"))
outputJavaScriptFileInline("javascript/global.js");
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/prototype.js");
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/scriptaculous.js");
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/effects.js");
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/dragdrop.js");
if(file_exists("{$g['www_path']}/javascript/global.js"))
outputJavaScriptFileInline("{$g['www_path']}/javascript/global.js");
/*
* Find all javascript files that need to be included
@ -63,13 +63,13 @@ $pagetitle = gentitle( $pgtitle );
*/
$dir = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
$path = "/usr/local/www/javascript/" . $dir . "/";
$path = "{$g['www_path']}/javascript/" . $dir . "/";
if (is_dir($path)) {
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {
if (is_dir($file)) continue;
//echo "\t".'<script type="text/javascript" src="/javascript/'.$dir.'/'.$file.'"></script>'."\n";
outputJavaScriptFileInline("javascript/{$dir}/{$file}");
outputJavaScriptFileInline("{$g['www_path']}/javascript/{$dir}/{$file}");
}
closedir($dh);
}

View File

@ -1,37 +0,0 @@
function gen_bits_lan(ipaddr) {
if (ipaddr.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1) {
var adr = ipaddr.split(/\./);
if (adr[0] > 255 || adr[1] > 255 || adr[2] > 255 || adr[3] > 255)
return "";
if (adr[0] == 0 && adr[1] == 0 && adr[2] == 0 && adr[3] == 0)
return "";
if (adr[0] <= 127)
return "8";
else if (adr[0] <= 191)
return "16";
else
return "24";
}
else
return "";
}
function gen_bits_opt(ipaddr) {
if (ipaddr.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) != -1) {
var adr = ipaddr.split(/\./);
if (adr[0] > 255 || adr[1] > 255 || adr[2] > 255 || adr[3] > 255)
return 0;
if (adr[0] == 0 && adr[1] == 0 && adr[2] == 0 && adr[3] == 0)
return 0;
if (adr[0] <= 127)
return 23;
else if (adr[0] <= 191)
return 15;
else
return 7;
}
else
return 0;
}

View File

@ -141,8 +141,6 @@ include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<script type="text/javascript" language="javascript" src="pool.js"></script>
<script language="javascript">
function clearcombo(){
for (var i=document.iform.serversSelect.options.length-1; i>=0; i--){

View File

@ -134,10 +134,6 @@ include("head.inc");
$types = array("http" => "HTTP", "tcp" => "TCP", "dns" => "DNS");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<script type="text/javascript" language="javascript" src="load_balancer_relay_protocol_edit.js"></script>
<script language="javascript">
function updateType(t){
switch(t) {

View File

@ -284,7 +284,7 @@ foreach ($pkg['fields']['field'] as $field) {
//-->
</script>
<?php } ?>
<script type="text/javascript" language="javascript" src="row_helper_dynamic.js">
<script type="text/javascript" language="javascript" src="/javascript/row_helper_dynamic.js">
</script>
<?php include("fbegin.inc"); ?>

View File

@ -122,7 +122,7 @@ include("head.inc");
include("fbegin.inc");
?>
<script type="text/javascript" src="row_helper.js">
<script type="text/javascript" src="/javascript/row_helper.js">
</script>
<input type='hidden' name='address_type' value='textbox' class="formfld unknown" />