javascript normalization

This commit is contained in:
ayvis 2014-03-26 00:25:32 +01:00
parent 07130afe2b
commit 354ecfbc9e
50 changed files with 178 additions and 182 deletions

View File

@ -191,7 +191,7 @@ AutoSuggestControl.prototype.highlightSuggestion = function (oSuggestionNode) {
for (var i=0; i < this.layer.childNodes.length; i++) {
var oNode = this.layer.childNodes[i];
if (oNode == oSuggestionNode) {
oNode.className = "current"
oNode.className = "current";
} else if (oNode.className == "current") {
oNode.className = "";
}

View File

@ -139,4 +139,4 @@ var Base64 = {
return string;
}
}
};

View File

@ -2,5 +2,4 @@
window.onLoad = function () {
NiftyCheck();
Rounded("div#mainlevel","all","#FFF","#eeeeee","smooth");
}
};

View File

@ -383,7 +383,7 @@ function datePicker(options) {
return o.killEvent(e);
};
o.trueBody = function() {
return
return;
};
o.resize = function() {
if(!o.created || !o.getElem()) return;

View File

@ -75,10 +75,10 @@ var Behaviour = {
window.onload = function() {
oldonload();
func();
}
};
}
}
}
};
Behaviour.start();

View File

@ -157,7 +157,7 @@ domTT_Hash.prototype.get = function(in_key)
}
return null;
}
};
domTT_Hash.prototype.set = function(in_key, in_value)
{
@ -176,7 +176,7 @@ domTT_Hash.prototype.set = function(in_key, in_value)
}
return false;
}
};
domTT_Hash.prototype.remove = function(in_key)
{
@ -194,17 +194,17 @@ domTT_Hash.prototype.remove = function(in_key)
}
return tmp_value;
}
};
domTT_Hash.prototype.size = function()
{
return this.length;
}
};
domTT_Hash.prototype.has = function(in_key)
{
return typeof(this.elementData[in_key]) != 'undefined';
}
};
domTT_Hash.prototype.find = function(in_obj)
{
@ -217,7 +217,7 @@ domTT_Hash.prototype.find = function(in_obj)
}
return null;
}
};
domTT_Hash.prototype.merge = function(in_hash)
{
@ -234,7 +234,7 @@ domTT_Hash.prototype.merge = function(in_hash)
this.elementData[tmp_key] = in_hash.elementData[tmp_key];
}
}
};
domTT_Hash.prototype.compare = function(in_hash)
{
@ -252,7 +252,7 @@ domTT_Hash.prototype.compare = function(in_hash)
}
return true;
}
};
// }}}
// {{{ domLib_isDescendantOf()
@ -529,7 +529,7 @@ function domLib_clearTimeout(in_id)
{
if (domLib_timeoutStates.has(in_id))
{
clearTimeout(domLib_timeoutStates.get(in_id).get('timeoutId'))
clearTimeout(domLib_timeoutStates.get(in_id).get('timeoutId'));
domLib_timeoutStates.remove(in_id);
}
}

View File

@ -117,7 +117,7 @@ if (domLib_useLibrary && domTT_useGlobalMousePosition)
{
domTT_dragUpdate(in_event);
}
}
};
}
// }}}

View File

@ -94,39 +94,39 @@ function Fadomatic (element, rate, initialOpacity, minOpacity, maxOpacity) {
Fadomatic.prototype.fadeOut = function () {
this._isFadeOut = true;
this._beginFade();
}
};
// Initiates a fade in
Fadomatic.prototype.fadeIn = function () {
this._isFadeOut = false;
this._beginFade();
}
};
// Makes the element completely opaque, stops any fade in progress
Fadomatic.prototype.show = function () {
this.haltFade();
this._opacity = this._maxOpacity;
this._updateOpacity();
}
};
// Makes the element completely transparent, stops any fade in progress
Fadomatic.prototype.hide = function () {
this.haltFade();
this._opacity = 0;
this._updateOpacity();
}
};
// Halts any fade in progress
Fadomatic.prototype.haltFade = function () {
clearInterval(this._intervalId);
}
};
// Resumes a fade where it was halted
Fadomatic.prototype.resumeFade = function () {
this._beginFade();
}
};
// Pseudo-private members
@ -135,7 +135,7 @@ Fadomatic.prototype._beginFade = function () {
this.haltFade();
var objref = this;
this._intervalId = setInterval(function() { objref._tickFade(); },Fadomatic.INTERVAL_MILLIS);
}
};
Fadomatic.prototype._tickFade = function () {
@ -154,7 +154,7 @@ Fadomatic.prototype._tickFade = function () {
}
this._updateOpacity();
}
};
Fadomatic.prototype._updateVisibility = function () {
@ -163,18 +163,18 @@ Fadomatic.prototype._updateVisibility = function () {
} else {
this._element.style.visibility = 'hidden';
}
}
};
Fadomatic.prototype._updateOpacityW3c = function () {
this._element.style.opacity = this._opacity/100;
this._updateVisibility();
}
};
Fadomatic.prototype._updateOpacityMSIE = function () {
this._element.filters.alpha.opacity = this._opacity;
this._updateVisibility();
}
};
Fadomatic.prototype._updateOpacity = null;

View File

@ -29,10 +29,10 @@ if (typeof getURL == 'undefined') {
content : http_request.responseText,
contentType : http_request.getResponseHeader("Content-Type") } );
}
}
};
http_request.open('GET', url, true);
http_request.send(null);
}
};
}
function outputrule(req) {

View File

@ -386,7 +386,7 @@ var firebug = {
d.css.index=d.css.index<0?i:d.css.index;
el.button.css.selectbox.child.add(
new pi.element("OPTION").attribute.set("value",i).update(uri)
)
);
};
d.css.open(d.css.index);
}
@ -563,7 +563,7 @@ var firebug = {
d.html.current = [_element,link];
return;t
return t;
}
parentLayer = d.html.openHtmlTree(map[t],parentLayer,map[t+1]);
t++;

View File

@ -191,7 +191,7 @@ AutoSuggestControl.prototype.highlightSuggestion = function (oSuggestionNode) {
for (var i=0; i < this.layer.childNodes.length; i++) {
var oNode = this.layer.childNodes[i];
if (oNode == oSuggestionNode) {
oNode.className = "current"
oNode.className = "current";
} else if (oNode.className == "current") {
oNode.className = "";
}

View File

@ -1,4 +1,4 @@
<!--
//<![CDATA[
var portsenabled = 1;
var dstenabled = 1;
var showsource = 0;
@ -200,4 +200,4 @@ function dst_change( iface, old_iface, old_dst ) {
document.iform.dsttype.value = iface.concat("ip");
}
}
//-->
//]]>

View File

@ -191,7 +191,7 @@ AutoSuggestControl.prototype.highlightSuggestion = function (oSuggestionNode) {
for (var i=0; i < this.layer.childNodes.length; i++) {
var oNode = this.layer.childNodes[i];
if (oNode == oSuggestionNode) {
oNode.className = "current"
oNode.className = "current";
} else if (oNode.className == "current") {
oNode.className = "";
}

View File

@ -1,4 +1,4 @@
<!--
//<![CDATA[
var portsenabled = 1;
var editenabled = 1;
@ -218,4 +218,4 @@ function tcpflags_anyclick(obj) {
document.getElementById('tcpheader').style.display= "";
}
}
//-->
//]]>

View File

@ -191,7 +191,7 @@ AutoSuggestControl.prototype.highlightSuggestion = function (oSuggestionNode) {
for (var i=0; i < this.layer.childNodes.length; i++) {
var oNode = this.layer.childNodes[i];
if (oNode == oSuggestionNode) {
oNode.className = "current"
oNode.className = "current";
} else if (oNode.className == "current") {
oNode.className = "";
}

View File

@ -1,4 +1,4 @@
<!--
//<![CDATA[
function ext_change() {
if (document.iform.beginport.selectedIndex == 0) {
document.iform.beginport_cust.disabled = 0;
@ -18,7 +18,7 @@ function ext_change() {
document.iform.localbeginport_cust.value = "";
document.iform.localbeginport_cust.disabled = 1;
}
}
};
function ext_rep_change() {
document.iform.endport.selectedIndex = document.iform.beginport.selectedIndex;
document.iform.localbeginport.selectedIndex = document.iform.beginport.selectedIndex;
@ -32,6 +32,6 @@ window.onload = function () {
var oTextbox1 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
var oTextbox2 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray));
var oTextbox3 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray));
}
};
//-->
//]]>

View File

@ -163,8 +163,8 @@ $.extend(Timepicker.prototype, {
},
timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
});
tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) { return val.toUpperCase() });
tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) { return val.toUpperCase() });
tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) { return val.toUpperCase() ;});
tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) { return val.toUpperCase() ;});
if (tp_inst._defaults.timezoneList === null) {
var timezoneList = [];
@ -975,7 +975,7 @@ $.datepicker.formatTime = function(format, time, options) {
tmptime = $.trim(tmptime);
return tmptime;
}
};
//########################################################################
// the bad hack :/ override datepicker so it doesnt close on select

4
usr/local/www/javascript/niftyjsCode.js Executable file → Normal file
View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -21,7 +21,7 @@ function removeEvent(obj, evType, fn, useCapture){
return false;
}
if(!String.prototype.trim) String.prototype.trim = function() { return this.replace(/^\s*/,'').replace(/\s*$/, ''); }
if(!String.prototype.trim) String.prototype.trim = function() { return this.replace(/^\s*/,'').replace(/\s*$/, ''); };
var incrementalInputController;
@ -183,7 +183,7 @@ function incrementalInput(inp, range, increment, classInc, classDec) {
self._timer.setPauseTime(self._timerInc);
if(!stop) self._timer.start();
}
};
this.construct = function() {
var h = self._inp.offsetHeight;
@ -226,7 +226,7 @@ function incrementalInput(inp, range, increment, classInc, classDec) {
var self = this;
self._timer.ontimer = function() { self.updateValue(); }
self._timer.ontimer = function() { self.updateValue(); };
self.construct();
}
@ -279,7 +279,7 @@ incremetalInputController = {
}
}
}
}
};
// Close and call anonymous function
})();

View File

@ -23,10 +23,10 @@
pi.util = {
IsArray:function(_object){
return _object && _object != window && ( _object instanceof Array || ( typeof _object.length == "number" && typeof _object.item =="function" ) )
return _object && _object != window && ( _object instanceof Array || ( typeof _object.length == "number" && typeof _object.item =="function" ) );
},
IsHash:function(_object){
return _object && typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object)
return _object && typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object);
},
DOMContentLoaded:[],
AddEvent: function(_element,_eventName,_fn,_useCapture){
@ -40,7 +40,7 @@
return {
height:pi.env.ie?Math.max(document.documentElement.clientHeight,document.body.clientHeight):window.innerHeight,
width:pi.env.ie?Math.max(document.documentElement.clientWidth,document.body.clientWidth):window.innerWidth
}
};
},
Include:function(_url,_callback){
var script = new pi.element("script").attribute.set("src",_url), callback = _callback||new Function, done = false, head = pi.get.byTag("head")[0];
@ -122,7 +122,7 @@
"offsetHeight":_element.offsetHeight,
"offsetWidth":_element.offsetWidth,
"width":view["width"]
}
};
},
addStyle:function(_element,_style){
for(var key in _style){
@ -168,7 +168,7 @@
var value = _source[key];
if (pi.util.IsArray(_source[key])) {
if(pi.util.IsArray( _object[key] )){
Array.prototype.push.apply( _source[key], _object[key] )
Array.prototype.push.apply( _source[key], _object[key] );
}
else
value = _source[key].clone();
@ -647,7 +647,7 @@
var values = arguments;
return this.replace(/\{(\d)\}/g,function(){
return values[arguments[1]];
})
});
};
String.prototype.leftpad = function(_len,_ch){

View File

@ -73,7 +73,7 @@ Autocompleter.Base = Class.create({
Effect.Appear(update,{duration:0.15});
};
this.options.onHide = this.options.onHide ||
function(element, update){ new Effect.Fade(update,{duration:0.15}) };
function(element, update){ new Effect.Fade(update,{duration:0.15}); };
if(typeof(this.options.tokens) == 'string')
this.options.tokens = new Array(this.options.tokens);

View File

@ -12,7 +12,7 @@ var Droppables = {
drops: [],
remove: function(element) {
this.drops = this.drops.reject(function(d) { return d.element==$(element) });
this.drops = this.drops.reject(function(d) { return d.element==$(element); });
},
add: function(element) {
@ -28,7 +28,7 @@ var Droppables = {
options._containers = [];
var containment = options.containment;
if(Object.isArray(containment)) {
containment.each( function(c) { options._containers.push($(c)) });
containment.each( function(c) { options._containers.push($(c)); });
} else {
options._containers.push($(containment));
}
@ -59,7 +59,7 @@ var Droppables = {
} else {
containmentNode = element.parentNode;
}
return drop._containers.detect(function(c) { return containmentNode == c });
return drop._containers.detect(function(c) { return containmentNode == c; });
},
isAffected: function(point, element, drop) {
@ -69,7 +69,7 @@ var Droppables = {
this.isContained(element, drop)) &&
((!drop.accept) ||
(Element.classNames(element).detect(
function(v) { return drop.accept.include(v) } ) )) &&
function(v) { return drop.accept.include(v); } ) )) &&
Position.within(drop.element, point[0], point[1]) );
},
@ -142,7 +142,7 @@ var Draggables = {
},
unregister: function(draggable) {
this.drags = this.drags.reject(function(d) { return d==draggable });
this.drags = this.drags.reject(function(d) { return d==draggable; });
if(this.drags.length == 0) {
Event.stopObserving(document, "mouseup", this.eventMouseUp);
Event.stopObserving(document, "mousemove", this.eventMouseMove);
@ -200,7 +200,7 @@ var Draggables = {
},
removeObserver: function(element) { // element instead of observer fixes mem leaks
this.observers = this.observers.reject( function(o) { return o.element==element });
this.observers = this.observers.reject( function(o) { return o.element==element; });
this._cacheObserverCallbacks();
},
@ -238,7 +238,7 @@ var Draggable = Class.create({
new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
queue: {scope:'_draggable', position:'end'},
afterFinish: function(){
Draggable._dragging[element] = false
Draggable._dragging[element] = false;
}
});
},
@ -470,7 +470,7 @@ var Draggable = Class.create({
}
var p = [0,1].map(function(i){
return (point[i]-pos[i]-this.offset[i])
return (point[i]-pos[i]-this.offset[i]);
}.bind(this));
if(this.options.snap) {
@ -479,10 +479,10 @@ var Draggable = Class.create({
} else {
if(Object.isArray(this.options.snap)) {
p = p.map( function(v, i) {
return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this));
return (v/this.options.snap[i]).round()*this.options.snap[i]; }.bind(this));
} else {
p = p.map( function(v) {
return (v/this.options.snap).round()*this.options.snap }.bind(this));
return (v/this.options.snap).round()*this.options.snap; }.bind(this));
}
}}
@ -586,7 +586,7 @@ var SortableObserver = Class.create({
onEnd: function() {
Sortable.unmark();
if(this.lastValue != Sortable.serialize(this.element))
this.observer(this.element)
this.observer(this.element);
}
});
@ -614,7 +614,7 @@ var Sortable = {
if(s) {
Draggables.removeObserver(s.element);
s.droppables.each(function(d){ Droppables.remove(d) });
s.droppables.each(function(d){ Droppables.remove(d); });
s.draggables.invoke('destroy');
delete Sortable.sortables[s.element.id];
@ -958,7 +958,7 @@ Element.findChildren = function(element, only, recursive, tagName) {
var elements = [];
$A(element.childNodes).each( function(e) {
if(e.tagName && e.tagName.toUpperCase()==tagName &&
(!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
(!only || (Element.classNames(e).detect(function(v) { return only.include(v); }))))
elements.push(e);
if(recursive) {
var grandchildren = Element.findChildren(e, only, recursive, tagName);

View File

@ -15,7 +15,7 @@ String.prototype.parseColor = function() {
var color = '#';
if (this.slice(0,4) == 'rgb(') {
var cols = this.slice(4,this.length-1).split(',');
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
var i=0; do { color += parseInt(cols[i]).toColorPart(); } while (++i<3);
} else {
if (this.slice(0,1) == '#') {
if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
@ -178,7 +178,7 @@ Effect.ScopedQueue = Class.create(Enumerable, {
switch(position) {
case 'front':
// move unstarted effects after this effect
this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
this.effects.findAll(function(e){ return e.state=='idle'; }).each( function(e) {
e.startOn += effect.finishOn;
e.finishOn += effect.finishOn;
});
@ -202,7 +202,7 @@ Effect.ScopedQueue = Class.create(Enumerable, {
this.interval = setInterval(this.loop.bind(this), 15);
},
remove: function(effect) {
this.effects = this.effects.reject(function(e) { return e==effect });
this.effects = this.effects.reject(function(e) { return e==effect; });
if (this.effects.length == 0) {
clearInterval(this.interval);
this.interval = null;
@ -331,7 +331,7 @@ Effect.Tween = Class.create(Effect.Base, {
options = args.length == 5 ? args[3] : null;
this.method = Object.isFunction(method) ? method.bind(object) :
Object.isFunction(object[method]) ? object[method].bind(object) :
function(value) { object[method] = value };
function(value) { object[method] = value; };
this.start(Object.extend({ from: from, to: to }, options || { }));
},
update: function(position) {
@ -493,8 +493,8 @@ Effect.Highlight = Class.create(Effect.Base, {
if (!this.options.restorecolor)
this.options.restorecolor = this.element.getStyle('background-color');
// init color calculations
this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16); }.bind(this));
this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]; }.bind(this));
},
update: function(position) {
this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
@ -1025,7 +1025,7 @@ Effect.Transform = Class.create({
this.tracks.map(function(track){
var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options');
var elements = [$(ids) || $$(ids)].flatten();
return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) });
return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)); });
}).flatten(),
this.options
);

View File

@ -19,7 +19,7 @@ var Prototype = {
WebKit: ua.indexOf('AppleWebKit/') > -1,
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
MobileSafari: /Apple.*Mobile/.test(ua)
}
};
})(),
BrowserFeatures: {
@ -54,7 +54,7 @@ var Prototype = {
emptyFunction: function() { },
K: function(x) { return x }
K: function(x) { return x; }
};
if (Prototype.Browser.MobileSafari)
@ -389,7 +389,7 @@ Object.extend(Function.prototype, (function() {
return function() {
var a = merge(args, arguments);
return __method.apply(context, a);
}
};
}
function bindAsEventListener(context) {
@ -397,7 +397,7 @@ Object.extend(Function.prototype, (function() {
return function(event) {
var a = update([event || window.event], args);
return __method.apply(context, a);
}
};
}
function curry() {
@ -406,7 +406,7 @@ Object.extend(Function.prototype, (function() {
return function() {
var a = merge(args, arguments);
return __method.apply(this, a);
}
};
}
function delay(timeout) {
@ -427,7 +427,7 @@ Object.extend(Function.prototype, (function() {
return function() {
var a = update([__method.bind(this)], arguments);
return wrapper.apply(this, a);
}
};
}
function methodize() {
@ -448,14 +448,13 @@ Object.extend(Function.prototype, (function() {
defer: defer,
wrap: wrap,
methodize: methodize
}
};
})());
(function(proto) {
function toISOString() {
return this.getUTCFullYear() + '-' +
(this.getUTCMonth() + 1).toPaddedString(2) + '-' +
@ -539,7 +538,7 @@ Object.extend(String.prototype, (function() {
function prepareReplacement(replacement) {
if (Object.isFunction(replacement)) return replacement;
var template = new Template(replacement);
return function(match) { return template.evaluate(match) };
return function(match) { return template.evaluate(match); };
}
function gsub(pattern, replacement) {
@ -609,7 +608,7 @@ Object.extend(String.prototype, (function() {
}
function evalScripts() {
return this.extractScripts().map(function(script) { return eval(script) });
return this.extractScripts().map(function(script) { return eval(script); });
}
function escapeHTML() {
@ -1142,7 +1141,7 @@ Array.from = $A;
function intersect(array) {
return this.uniq().findAll(function(item) {
return array.detect(function(value) { return item === value });
return array.detect(function(value) { return item === value; });
});
}
@ -1212,7 +1211,7 @@ Array.from = $A;
var CONCAT_ARGUMENTS_BUGGY = (function() {
return [].concat(arguments)[0][0] !== 1;
})(1,2)
})(1,2);
if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
@ -1425,9 +1424,9 @@ var ObjectRange = Class.create(Enumerable, (function() {
var Ajax = {
getTransport: function() {
return Try.these(
function() {return new XMLHttpRequest()},
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
function() {return new ActiveXObject('Microsoft.XMLHTTP')}
function() {return new XMLHttpRequest();},
function() {return new ActiveXObject('Msxml2.XMLHTTP');},
function() {return new ActiveXObject('Microsoft.XMLHTTP');}
) || false;
},
@ -1464,8 +1463,8 @@ Ajax.Responders = {
Object.extend(Ajax.Responders, Enumerable);
Ajax.Responders.register({
onCreate: function() { Ajax.activeRequestCount++ },
onComplete: function() { Ajax.activeRequestCount-- }
onCreate: function() { Ajax.activeRequestCount++; },
onComplete: function() { Ajax.activeRequestCount--; }
});
Ajax.Base = Class.create({
initialize: function(options) {
@ -1572,7 +1571,7 @@ Ajax.Request = Class.create(Ajax.Base, {
for (var i = 0, length = extras.length; i < length; i += 2)
headers[extras[i]] = extras[i+1];
else
$H(extras).each(function(pair) { headers[pair.key] = pair.value });
$H(extras).each(function(pair) { headers[pair.key] = pair.value; });
}
for (var name in headers)
@ -1588,7 +1587,7 @@ Ajax.Request = Class.create(Ajax.Base, {
try {
if (this.transport.status === 1223) return 204;
return this.transport.status || 0;
} catch (e) { return 0 }
} catch (e) { return 0; }
},
respondToReadyState: function(readyState) {
@ -1691,7 +1690,7 @@ Ajax.Response = Class.create({
getStatusText: function() {
try {
return this.transport.statusText || '';
} catch (e) { return '' }
} catch (e) { return ''; }
},
getHeader: Ajax.Request.prototype.getHeader,
@ -1699,7 +1698,7 @@ Ajax.Response = Class.create({
getAllHeaders: function() {
try {
return this.getAllResponseHeaders();
} catch (e) { return null }
} catch (e) { return null; }
},
getResponseHeader: function(name) {
@ -1913,7 +1912,7 @@ Element._purgeElement = function(element) {
element._prototypeUID = void 0;
delete Element.Storage[uid];
}
}
};
Element.Methods = {
visible: function(element) {
@ -2031,14 +2030,14 @@ Element.Methods = {
}
Element._getContentFromAnonymousElement(tagName, content.stripScripts())
.each(function(node) {
element.appendChild(node)
element.appendChild(node);
});
} else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
while (element.firstChild) {
element.removeChild(element.firstChild);
}
var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true);
nodes.each(function(node) { element.appendChild(node) });
nodes.each(function(node) { element.appendChild(node); });
}
else {
element.innerHTML = content.stripScripts();
@ -2247,7 +2246,7 @@ Element.Methods = {
element = $(element);
var id = Element.readAttribute(element, 'id');
if (id) return id;
do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
do { id = 'anonymous_element_' + Element.idCounter++; } while ($(id));
Element.writeAttribute(element, 'id', id);
return id;
},
@ -2659,7 +2658,7 @@ else if (Prototype.Browser.IE) {
}
}
}
}
};
})();
Element._attributeTranslations.write = {
@ -2732,7 +2731,7 @@ else if (Prototype.Browser.IE) {
if (arguments.length == 1) return element.firstDescendant();
return Object.isNumber(expression) ? _descendants(element)[expression] :
Element.select(element, expression)[index || 0];
}
};
})();
}
@ -2784,9 +2783,9 @@ if ('outerHTML' in document.documentElement) {
fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
parent.removeChild(element);
if (nextSibling)
fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
fragments.each(function(node) { parent.insertBefore(node, nextSibling); });
else
fragments.each(function(node) { parent.appendChild(node) });
fragments.each(function(node) { parent.appendChild(node); });
}
else element.outerHTML = content.stripScripts();
@ -2921,7 +2920,7 @@ Element.extend = (function() {
}
}
return element;
}
};
}
return Prototype.K;
}
@ -3089,7 +3088,7 @@ document.viewport = {
property[D] = 'client' + D;
viewport['get' + D] = function() { return element[property[D]] };
viewport['get' + D] = function() { return element[property[D]]; };
return viewport['get' + D]();
}
@ -4985,7 +4984,7 @@ var Form = {
initial = '';
accumulator = function(result, key, value) {
return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
}
};
}
return elements.inject(initial, function(result, element) {
@ -5018,7 +5017,7 @@ Form.Methods = {
if (serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));
return elements;
})
});
},
getInputs: function(form, typeName, name) {
@ -5055,7 +5054,7 @@ Form.Methods = {
});
var firstByIndex = elements.findAll(function(element) {
return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
}).sortBy(function(element) { return element.tabIndex }).first();
}).sortBy(function(element) { return element.tabIndex; }).first();
return firstByIndex ? firstByIndex : elements.find(function(element) {
return /^(?:input|select|textarea)$/i.test(element.tagName);
@ -5394,7 +5393,7 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
_isButton = function(event, code) {
return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
_isButtonForDOMEvents(event, code);
}
};
}
} else if (Prototype.Browser.WebKit) {
_isButton = _isButtonForWebKit;
@ -5402,11 +5401,11 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
_isButton = _isButtonForDOMEvents;
}
function isLeftClick(event) { return _isButton(event, 0) }
function isLeftClick(event) { return _isButton(event, 0); }
function isMiddleClick(event) { return _isButton(event, 1) }
function isMiddleClick(event) { return _isButton(event, 1); }
function isRightClick(event) { return _isButton(event, 2) }
function isRightClick(event) { return _isButton(event, 2); }
function element(event) {
event = Event.extend(event);
@ -5461,7 +5460,6 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
(docElement.clientTop || 0));
}
function stop(event) {
Event.extend(event);
event.preventDefault();
@ -5470,7 +5468,6 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
event.stopped = true;
}
Event.Methods = {
isLeftClick: isLeftClick,
isMiddleClick: isMiddleClick,
@ -5510,9 +5507,9 @@ Form.EventObserver = Class.create(Abstract.EventObserver, {
}
var additionalMethods = {
stopPropagation: function() { this.cancelBubble = true },
preventDefault: function() { this.returnValue = false },
inspect: function() { return '[object Event]' }
stopPropagation: function() { this.cancelBubble = true; },
preventDefault: function() { this.returnValue = false; },
inspect: function() { return '[object Event]'; }
};
Event.extend = function(event, element) {

View File

@ -18,7 +18,7 @@ Control.Slider = Class.create({
var slider = this;
if (Object.isArray(handle)) {
this.handles = handle.collect( function(e) { return $(e) });
this.handles = handle.collect( function(e) { return $(e); });
} else {
this.handles = [$(handle)];
}
@ -32,8 +32,8 @@ Control.Slider = Class.create({
this.range = this.options.range || $R(0,1);
this.value = 0; // assure backwards compat
this.values = this.handles.map( function() { return 0 });
this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false;
this.values = this.handles.map( function() { return 0; });
this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s); }) : false;
this.options.startSpan = $(this.options.startSpan || null);
this.options.endSpan = $(this.options.endSpan || null);
@ -179,7 +179,7 @@ Control.Slider = Class.create({
drawSpans: function() {
var slider = this;
if (this.spans)
$R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
$R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)); });
if (this.options.startSpan)
this.setSpan(this.options.startSpan,
$R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
@ -197,7 +197,7 @@ Control.Slider = Class.create({
}
},
updateStyles: function() {
this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
this.handles.each( function(h){ Element.removeClassName(h, 'selected'); });
Element.addClassName(this.activeHandle, 'selected');
},
startDrag: function(event) {

View File

@ -48,11 +48,11 @@ Sound = {
};
if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1; }))
Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>');
else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('Windows Media') != -1 }))
else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('Windows Media') != -1; }))
Sound.template = new Template('<object id="sound_#{track}_#{id}" type="application/x-mplayer2" data="#{url}"></object>');
else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('RealPlayer') != -1 }))
else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('RealPlayer') != -1; }))
Sound.template = new Template('<embed type="audio/x-pn-realaudio-plugin" style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>');
else
Sound.play = function(){};

View File

@ -305,7 +305,7 @@ Test.Unit.Assertions.prototype = {
assertEnumEqual: function(expected, actual) {
var message = arguments[2] || "assertEnumEqual";
try { $A(expected).length == $A(actual).length &&
expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ?
expected.zip(actual).all(function(pair) { return pair[0] == pair[1]; }) ?
this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) +
', actual ' + Test.Unit.inspect(actual)); }
catch(e) { this.error(e); }
@ -474,7 +474,7 @@ Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.p
test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)');
this.test = function() {
eval('with(this){'+test+'}');
}
};
} else {
this.test = test || function() {};
}
@ -537,7 +537,7 @@ Test.setupBDDExtensionMethods = function(){
});
[Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each(
function(p){ Object.extend(p, Test.BDDMethods) }
function(p){ Object.extend(p, Test.BDDMethods); }
);
};
@ -558,7 +558,7 @@ Test.context = function(name, spec, log){
if(/^\{/.test(body[0])) body = body.slice(1);
body.pop();
body = body.map(function(statement){
return statement.strip()
return statement.strip();
});
compiledSpec[testName] = body.join('\n');
titles[testName] = specName;

View File

@ -216,7 +216,7 @@ sorttable = {
// check for a date: dd/mm/yyyy or dd/mm/yy
// can have / or . or - as separator
// can be mm/dd as well
possdate = text.match(sorttable.DATE_RE)
possdate = text.match(sorttable.DATE_RE);
if (possdate) {
// looks like a date
first = parseInt(possdate[1]);
@ -406,7 +406,7 @@ sorttable = {
} // while(swap)
}
}
};
/* ******************************************************************
Supporting functions: bundled here to avoid depending on a library
@ -526,7 +526,7 @@ fixEvent.preventDefault = function() {
};
fixEvent.stopPropagation = function() {
this.cancelBubble = true;
}
};
// Dean's forEach: http://dean.edwards.name/base/forEach.js
/*

View File

@ -191,7 +191,7 @@ AutoSuggestControl.prototype.highlightSuggestion = function (oSuggestionNode) {
for (var i=0; i < this.layer.childNodes.length; i++) {
var oNode = this.layer.childNodes[i];
if (oNode == oSuggestionNode) {
oNode.className = "current"
oNode.className = "current";
} else if (oNode.className == "current") {
oNode.className = "";
}

View File

@ -694,7 +694,7 @@ if (!window.CanvasRenderingContext2D) {
return {
x: Z * (aX * this.m_[0][0] + aY * this.m_[1][0] + this.m_[2][0]) - Z2,
y: Z * (aX * this.m_[0][1] + aY * this.m_[1][1] + this.m_[2][1]) - Z2
}
};
};
contextPrototype.save = function() {

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -7,9 +7,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

4
usr/local/www/themes/code-red/loader.js Executable file → Normal file
View File

@ -7,9 +7,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -7,9 +7,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -7,9 +7,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -7,9 +7,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -7,9 +7,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -7,9 +7,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -8,9 +8,9 @@ var cond = '';
if (browser == '')
{
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -3,7 +3,7 @@ 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);}}
this[this.length]=arguments[0]; return(this.length);};}
return(true);
}
@ -30,7 +30,7 @@ else if(opt && opt.indexOf("smooth")>=0){
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
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";

View File

@ -8,9 +8,9 @@ var cond = '';
// BROWSER?
if (browser == '') {
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
browser = 'IE';
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
browser = 'Netscape';
else
browser = 'IE';
}

View File

@ -38,7 +38,7 @@ function initTree(el) {
spanA.appendChild(spanB);
spanB.appendChild(spanC);
spanA.className = 'a ' + li.className.replace('closed','spanClosed');
spanA.onMouseOver = function() {}
spanA.onMouseOver = function() {};
spanB.className = 'b';
spanB.onclick = treeToggle;
spanC.className = 'c';
@ -109,10 +109,10 @@ function treeToggle(el, force) {
if( force != null ){
if( force == "open"){
treeOpen( topSpan, el )
treeOpen( topSpan, el );
}
else if( force == "close" ){
treeClose( topSpan, el )
treeClose( topSpan, el );
}
}
@ -120,10 +120,10 @@ function treeToggle(el, force) {
else if( childSet != null) {
// Is open, close it
if(!el.className.match(/(^| )closed($| )/)) {
treeClose( topSpan, el )
treeClose( topSpan, el );
// Is closed, open it
} else {
treeOpen( topSpan, el )
treeOpen( topSpan, el );
}
}
}

View File

@ -227,14 +227,14 @@ function GraphDraw(graph) {
if(graph['scale_type'] == GL_STATIC)
var getMargin = function(i) {
return graph['vals'][i] + 'px';
}
};
else
var getMargin = function(i) {
var h = graph['height'];
var s = graph['scale'];
var v = graph['vals'][i];
return (h - Math.round((h - v) * s)) + 'px';
}
};
graph['spans'][count - 1].css("display", "none");