From 584d51a2c22192dc79439fd7312776b36298c5f7 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 14 Apr 2006 05:23:20 +0000 Subject: Fixed #57 (I think it should not haved caused problems elsewhere, e.g. dom.js) --- framework/Web/Javascripts/js/prado.js | 1469 +++++++++++++------------- framework/Web/Javascripts/prototype/array.js | 7 +- 2 files changed, 737 insertions(+), 739 deletions(-) (limited to 'framework') diff --git a/framework/Web/Javascripts/js/prado.js b/framework/Web/Javascripts/js/prado.js index a60372e8..36c1f658 100644 --- a/framework/Web/Javascripts/js/prado.js +++ b/framework/Web/Javascripts/js/prado.js @@ -471,7 +471,6 @@ return _126; } }; Object.extend(Array.prototype,Enumerable); -Array.prototype._reverse=Array.prototype.reverse; Object.extend(Array.prototype,{_each:function(_127){ for(var i=0;i"; }}; -function $H(_141){ -var hash=Object.extend({},_141||{}); +function $H(_140){ +var hash=Object.extend({},_140||{}); Object.extend(hash,Enumerable); Object.extend(hash,Hash); return hash; } ObjectRange=Class.create(); Object.extend(ObjectRange.prototype,Enumerable); -Object.extend(ObjectRange.prototype,{initialize:function(_142,end,_144){ -this.start=_142; +Object.extend(ObjectRange.prototype,{initialize:function(_141,end,_143){ +this.start=_141; this.end=end; -this.exclusive=_144; -},_each:function(_145){ -var _146=this.start; +this.exclusive=_143; +},_each:function(_144){ +var _145=this.start; do{ -_145(_146); -_146=_146.succ(); -}while(this.include(_146)); -},include:function(_147){ -if(_1470; -})._each(_203); -},set:function(_205){ -this.element.className=_205; -},add:function(_206){ -if(this.include(_206)){ +})._each(_202); +},set:function(_204){ +this.element.className=_204; +},add:function(_205){ +if(this.include(_205)){ return; } -this.set(this.toArray().concat(_206).join(" ")); -},remove:function(_207){ -if(!this.include(_207)){ +this.set(this.toArray().concat(_205).join(" ")); +},remove:function(_206){ +if(!this.include(_206)){ return; } -this.set(this.select(function(_208){ -return _208!=_207; +this.set(this.select(function(_207){ +return _207!=_206; }).join(" ")); },toString:function(){ return this.toArray().join(" "); }}; Object.extend(Element.ClassNames.prototype,Enumerable); -Object.extend(Element,{condClassName:function(_209,_210,cond){ -(cond?Element.addClassName:Element.removeClassName)(_209,_210); +Object.extend(Element,{condClassName:function(_208,_209,cond){ +(cond?Element.addClassName:Element.removeClassName)(_208,_209); }}); var Field={clear:function(){ for(var i=0;i=0){ -opt=_243.options[index]; -_244=opt.value; -if(!_244&&!("value" in opt)){ -_244=opt.text; +opt=_242.options[index]; +_243=opt.value; +if(!_243&&!("value" in opt)){ +_243=opt.text; } } -return [_243.name,_244]; -},selectMany:function(_245){ -var _246=new Array(); -for(var i=0;i<_245.length;i++){ -var opt=_245.options[i]; +return [_242.name,_243]; +},selectMany:function(_244){ +var _245=new Array(); +for(var i=0;i<_244.length;i++){ +var opt=_244.options[i]; if(opt.selected){ -var _248=opt.value; -if(!_248&&!("value" in opt)){ -_248=opt.text; +var _247=opt.value; +if(!_247&&!("value" in opt)){ +_247=opt.text; } -_246.push(_248); +_245.push(_247); } } -return [_245.name,_246]; +return [_244.name,_245]; }}; var $F=Form.Element.getValue; Abstract.TimedObserver=function(){ }; -Abstract.TimedObserver.prototype={initialize:function(_249,_250,_251){ -this.frequency=_250; -this.element=$(_249); -this.callback=_251; +Abstract.TimedObserver.prototype={initialize:function(_248,_249,_250){ +this.frequency=_249; +this.element=$(_248); +this.callback=_250; this.lastValue=this.getValue(); this.registerCallback(); },registerCallback:function(){ setInterval(this.onTimerEvent.bind(this),this.frequency*1000); },onTimerEvent:function(){ -var _252=this.getValue(); -if(this.lastValue!=_252){ -this.callback(this.element,_252); -this.lastValue=_252; +var _251=this.getValue(); +if(this.lastValue!=_251){ +this.callback(this.element,_251); +this.lastValue=_251; } }}; Form.Element.Observer=Class.create(); @@ -992,9 +989,9 @@ return Form.serialize(this.element); }}); Abstract.EventObserver=function(){ }; -Abstract.EventObserver.prototype={initialize:function(_253,_254){ -this.element=$(_253); -this.callback=_254; +Abstract.EventObserver.prototype={initialize:function(_252,_253){ +this.element=$(_252); +this.callback=_253; this.lastValue=this.getValue(); if(this.element.tagName.toLowerCase()=="form"){ this.registerFormCallbacks(); @@ -1002,29 +999,29 @@ this.registerFormCallbacks(); this.registerCallback(this.element); } },onElementEvent:function(){ -var _255=this.getValue(); -if(this.lastValue!=_255){ -this.callback(this.element,_255); -this.lastValue=_255; +var _254=this.getValue(); +if(this.lastValue!=_254){ +this.callback(this.element,_254); +this.lastValue=_254; } },registerFormCallbacks:function(){ -var _256=Form.getElements(this.element); -for(var i=0;i<_256.length;i++){ -this.registerCallback(_256[i]); +var _255=Form.getElements(this.element); +for(var i=0;i<_255.length;i++){ +this.registerCallback(_255[i]); } -},registerCallback:function(_257){ -if(_257.type){ -switch(_257.type.toLowerCase()){ +},registerCallback:function(_256){ +if(_256.type){ +switch(_256.type.toLowerCase()){ case "checkbox": case "radio": -Event.observe(_257,"click",this.onElementEvent.bind(this)); +Event.observe(_256,"click",this.onElementEvent.bind(this)); break; case "password": case "text": case "textarea": case "select-one": case "select-multiple": -Event.observe(_257,"change",this.onElementEvent.bind(this)); +Event.observe(_256,"change",this.onElementEvent.bind(this)); break; } } @@ -1040,39 +1037,39 @@ return Form.serialize(this.element); if(!window.Event){ var Event=new Object(); } -Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_258){ -return _258.target||_258.srcElement; -},isLeftClick:function(_259){ -return (((_259.which)&&(_259.which==1))||((_259.button)&&(_259.button==1))); -},pointerX:function(_260){ -return _260.pageX||(_260.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)); -},pointerY:function(_261){ -return _261.pageY||(_261.clientY+(document.documentElement.scrollTop||document.body.scrollTop)); -},stop:function(_262){ -if(_262.preventDefault){ -_262.preventDefault(); -_262.stopPropagation(); +Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_257){ +return _257.target||_257.srcElement; +},isLeftClick:function(_258){ +return (((_258.which)&&(_258.which==1))||((_258.button)&&(_258.button==1))); +},pointerX:function(_259){ +return _259.pageX||(_259.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)); +},pointerY:function(_260){ +return _260.pageY||(_260.clientY+(document.documentElement.scrollTop||document.body.scrollTop)); +},stop:function(_261){ +if(_261.preventDefault){ +_261.preventDefault(); +_261.stopPropagation(); }else{ -_262.returnValue=false; -_262.cancelBubble=true; +_261.returnValue=false; +_261.cancelBubble=true; } -},findElement:function(_263,_264){ -var _265=Event.element(_263); -while(_265.parentNode&&(!_265.tagName||(_265.tagName.toUpperCase()!=_264.toUpperCase()))){ -_265=_265.parentNode; +},findElement:function(_262,_263){ +var _264=Event.element(_262); +while(_264.parentNode&&(!_264.tagName||(_264.tagName.toUpperCase()!=_263.toUpperCase()))){ +_264=_264.parentNode; } -return _265; -},observers:false,_observeAndCache:function(_266,name,_267,_268){ +return _264; +},observers:false,_observeAndCache:function(_265,name,_266,_267){ if(!this.observers){ this.observers=[]; } -if(_266.addEventListener){ -this.observers.push([_266,name,_267,_268]); -_266.addEventListener(name,_267,_268); +if(_265.addEventListener){ +this.observers.push([_265,name,_266,_267]); +_265.addEventListener(name,_266,_267); }else{ -if(_266.attachEvent){ -this.observers.push([_266,name,_267,_268]); -_266.attachEvent("on"+name,_267); +if(_265.attachEvent){ +this.observers.push([_265,name,_266,_267]); +_265.attachEvent("on"+name,_266); } } },unloadCache:function(){ @@ -1084,24 +1081,24 @@ Event.stopObserving.apply(this,Event.observers[i]); Event.observers[i][0]=null; } Event.observers=false; -},observe:function(_269,name,_270,_271){ -var _269=$(_269); -_271=_271||false; -if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_269.attachEvent)){ +},observe:function(_268,name,_269,_270){ +var _268=$(_268); +_270=_270||false; +if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_268.attachEvent)){ name="keydown"; } -this._observeAndCache(_269,name,_270,_271); -},stopObserving:function(_272,name,_273,_274){ -var _272=$(_272); -_274=_274||false; -if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_272.detachEvent)){ +this._observeAndCache(_268,name,_269,_270); +},stopObserving:function(_271,name,_272,_273){ +var _271=$(_271); +_273=_273||false; +if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_271.detachEvent)){ name="keydown"; } -if(_272.removeEventListener){ -_272.removeEventListener(name,_273,_274); +if(_271.removeEventListener){ +_271.removeEventListener(name,_272,_273); }else{ -if(_272.detachEvent){ -_272.detachEvent("on"+name,_273); +if(_271.detachEvent){ +_271.detachEvent("on"+name,_272); } } }}); @@ -1109,38 +1106,38 @@ Event.observe(window,"unload",Event.unloadCache,false); Object.extend(Event,{OnLoad:function(fn){ var w=document.addEventListener&&!window.addEventListener?document:window; Event.__observe(w,"load",fn); -},observe:function(_277,name,_278,_279){ -if(!isList(_277)){ -return this.__observe(_277,name,_278,_279); +},observe:function(_276,name,_277,_278){ +if(!isList(_276)){ +return this.__observe(_276,name,_277,_278); } -for(var i=0;i<_277.length;i++){ -this.__observe(_277[i],name,_278,_279); +for(var i=0;i<_276.length;i++){ +this.__observe(_276[i],name,_277,_278); } -},__observe:function(_280,name,_281,_282){ -var _280=$(_280); -_282=_282||false; -if(name=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_280.attachEvent)){ +},__observe:function(_279,name,_280,_281){ +var _279=$(_279); +_281=_281||false; +if(name=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_279.attachEvent)){ name="keydown"; } -this._observeAndCache(_280,name,_281,_282); +this._observeAndCache(_279,name,_280,_281); },keyCode:function(e){ return e.keyCode!=null?e.keyCode:e.charCode; },isHTMLEvent:function(type){ -var _285=["abort","blur","change","error","focus","load","reset","resize","scroll","select","submit","unload"]; -return _285.include(type); +var _284=["abort","blur","change","error","focus","load","reset","resize","scroll","select","submit","unload"]; +return _284.include(type); },isMouseEvent:function(type){ -var _286=["click","mousedown","mousemove","mouseout","mouseover","mouseup"]; -return _286.include(type); -},fireEvent:function(_287,type){ -_287=$(_287); +var _285=["click","mousedown","mousemove","mouseout","mouseover","mouseup"]; +return _285.include(type); +},fireEvent:function(_286,type){ +_286=$(_286); if(document.createEvent){ if(Event.isHTMLEvent(type)){ -var _288=document.createEvent("HTMLEvents"); -_288.initEvent(type,true,true); +var _287=document.createEvent("HTMLEvents"); +_287.initEvent(type,true,true); }else{ if(Event.isMouseEvent(type)){ -var _288=document.createEvent("MouseEvents"); -_288.initMouseEvent(type,true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null); +var _287=document.createEvent("MouseEvents"); +_287.initMouseEvent(type,true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null); }else{ if(Logger){ Logger.error("undefined event",type); @@ -1148,263 +1145,263 @@ Logger.error("undefined event",type); return; } } -_287.dispatchEvent(_288); +_286.dispatchEvent(_287); }else{ -if(_287.fireEvent){ -_287.fireEvent("on"+type); -_287[type](); +if(_286.fireEvent){ +_286.fireEvent("on"+type); +_286[type](); }else{ -_287[type](); +_286[type](); } } }}); var Position={includeScrollOffsets:false,prepare:function(){ this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0; this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0; -},realOffset:function(_289){ -var _290=0,valueL=0; +},realOffset:function(_288){ +var _289=0,valueL=0; do{ -_290+=_289.scrollTop||0; -valueL+=_289.scrollLeft||0; -_289=_289.parentNode; -}while(_289); -return [valueL,_290]; -},cumulativeOffset:function(_291){ -var _292=0,valueL=0; +_289+=_288.scrollTop||0; +valueL+=_288.scrollLeft||0; +_288=_288.parentNode; +}while(_288); +return [valueL,_289]; +},cumulativeOffset:function(_290){ +var _291=0,valueL=0; do{ -_292+=_291.offsetTop||0; -valueL+=_291.offsetLeft||0; -_291=_291.offsetParent; -}while(_291); -return [valueL,_292]; -},positionedOffset:function(_293){ -var _294=0,valueL=0; +_291+=_290.offsetTop||0; +valueL+=_290.offsetLeft||0; +_290=_290.offsetParent; +}while(_290); +return [valueL,_291]; +},positionedOffset:function(_292){ +var _293=0,valueL=0; do{ -_294+=_293.offsetTop||0; -valueL+=_293.offsetLeft||0; -_293=_293.offsetParent; -if(_293){ -p=Element.getStyle(_293,"position"); +_293+=_292.offsetTop||0; +valueL+=_292.offsetLeft||0; +_292=_292.offsetParent; +if(_292){ +p=Element.getStyle(_292,"position"); if(p=="relative"||p=="absolute"){ break; } } -}while(_293); -return [valueL,_294]; -},offsetParent:function(_295){ -if(_295.offsetParent){ -return _295.offsetParent; +}while(_292); +return [valueL,_293]; +},offsetParent:function(_294){ +if(_294.offsetParent){ +return _294.offsetParent; } -if(_295==document.body){ -return _295; +if(_294==document.body){ +return _294; } -while((_295=_295.parentNode)&&_295!=document.body){ -if(Element.getStyle(_295,"position")!="static"){ -return _295; +while((_294=_294.parentNode)&&_294!=document.body){ +if(Element.getStyle(_294,"position")!="static"){ +return _294; } } return document.body; -},within:function(_296,x,y){ +},within:function(_295,x,y){ if(this.includeScrollOffsets){ -return this.withinIncludingScrolloffsets(_296,x,y); +return this.withinIncludingScrolloffsets(_295,x,y); } this.xcomp=x; this.ycomp=y; -this.offset=this.cumulativeOffset(_296); -return (y>=this.offset[1]&&y=this.offset[0]&&x=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp=this.offset[1]&&y=this.offset[0]&&x=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp"; +_322.innerHTML="<"+_320+">"; } catch(e){ } -var _324=_323.firstChild||null; -if(_324&&(_324.tagName!=_321)){ -_324=_324.getElementsByTagName(_321)[0]; +var _323=_322.firstChild||null; +if(_323&&(_323.tagName!=_320)){ +_323=_323.getElementsByTagName(_320)[0]; } -if(!_324){ -_324=document.createElement(_321); +if(!_323){ +_323=document.createElement(_320); } -if(!_324){ +if(!_323){ return; } if(arguments[1]){ if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)){ -this._children(_324,arguments[1]); +this._children(_323,arguments[1]); }else{ -var _325=this._attributes(arguments[1]); -if(_325.length){ +var _324=this._attributes(arguments[1]); +if(_324.length){ try{ -_323.innerHTML="<"+_321+" "+_325+">"; +_322.innerHTML="<"+_320+" "+_324+">"; } catch(e){ } -_324=_323.firstChild||null; -if(!_324){ -_324=document.createElement(_321); +_323=_322.firstChild||null; +if(!_323){ +_323=document.createElement(_320); for(attr in arguments[1]){ -_324[attr=="class"?"className":attr]=arguments[1][attr]; +_323[attr=="class"?"className":attr]=arguments[1][attr]; } } -if(_324.tagName!=_321){ -_324=_323.getElementsByTagName(_321)[0]; +if(_323.tagName!=_320){ +_323=_322.getElementsByTagName(_320)[0]; } } } } if(arguments[2]){ -this._children(_324,arguments[2]); +this._children(_323,arguments[2]); } -return _324; +return _323; },_text:function(text){ return document.createTextNode(text); -},_attributes:function(_327){ -var _328=[]; -for(attribute in _327){ -_328.push((attribute=="className"?"class":attribute)+"=\""+_327[attribute].toString().escapeHTML()+"\""); -} -return _328.join(" "); -},_children:function(_329,_330){ -if(typeof _330=="object"){ -_330.flatten().each(function(e){ +},_attributes:function(_326){ +var _327=[]; +for(attribute in _326){ +_327.push((attribute=="className"?"class":attribute)+"=\""+_326[attribute].toString().escapeHTML()+"\""); +} +return _327.join(" "); +},_children:function(_328,_329){ +if(typeof _329=="object"){ +_329.flatten().each(function(e){ if(typeof e=="object"){ -_329.appendChild(e); +_328.appendChild(e); }else{ if(Builder._isStringOrNumber(e)){ -_329.appendChild(Builder._text(e)); +_328.appendChild(Builder._text(e)); } } }); }else{ -if(Builder._isStringOrNumber(_330)){ -_329.appendChild(Builder._text(_330)); +if(Builder._isStringOrNumber(_329)){ +_328.appendChild(Builder._text(_329)); } } -},_isStringOrNumber:function(_331){ -return (typeof _331=="string"||typeof _331=="number"); +},_isStringOrNumber:function(_330){ +return (typeof _330=="string"||typeof _330=="number"); }}; Object.extend(Builder,{exportTags:function(){ var tags=["BUTTON","TT","PRE","H1","H2","H3","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","CAPTION"]; @@ -1424,7 +1421,7 @@ return Builder.node(tag,args.shift(),args); }); }}); Builder.exportTags(); -Object.extend(Date.prototype,{SimpleFormat:function(_335,data){ +Object.extend(Date.prototype,{SimpleFormat:function(_334,data){ data=data||{}; var bits=new Array(); bits["d"]=this.getDate(); @@ -1437,11 +1434,11 @@ bits["MMM"]=data.AbbreviatedMonthNames[this.getMonth()]; if(data.MonthNames){ bits["MMMM"]=data.MonthNames[this.getMonth()]; } -var _338=""+this.getFullYear(); -_338=(_338.length==2)?"19"+_338:_338; -bits["yyyy"]=_338; +var _337=""+this.getFullYear(); +_337=(_337.length==2)?"19"+_337:_337; +bits["yyyy"]=_337; bits["yy"]=bits["yyyy"].toString().substr(2,2); -var frm=new String(_335); +var frm=new String(_334); for(var sect in bits){ var reg=new RegExp("\\b"+sect+"\\b","g"); frm=frm.replace(reg,bits[sect]); @@ -1453,70 +1450,70 @@ var m=String(this.getMonth()+1).zerofill(2); var d=String(this.getDate()).zerofill(2); return String(y)+String(m)+String(d); }}); -Object.extend(Date,{SimpleParse:function(_342,_343){ -val=String(_342); -_343=String(_343); +Object.extend(Date,{SimpleParse:function(_341,_342){ +val=String(_341); +_342=String(_342); if(val.length<=0){ return null; } -if(_343.length<=0){ -return new Date(_342); +if(_342.length<=0){ +return new Date(_341); } -var _344=function(val){ -var _346="1234567890"; +var _343=function(val){ +var _345="1234567890"; for(var i=0;i=_349;x--){ -var _351=str.substring(i,i+x); -if(_351.length<_349){ +var _346=function(str,i,_348,_349){ +for(var x=_349;x>=_348;x--){ +var _350=str.substring(i,i+x); +if(_350.length<_348){ return null; } -if(_344(_351)){ -return _351; +if(_343(_350)){ +return _350; } } return null; }; +var _351=0; var _352=0; -var _353=0; var c=""; +var _354=""; var _355=""; -var _356=""; var x,y; var now=new Date(); var year=now.getFullYear(); -var _359=now.getMonth()+1; +var _358=now.getMonth()+1; var date=1; -while(_353<_343.length){ -c=_343.charAt(_353); -_355=""; -while((_343.charAt(_353)==c)&&(_353<_343.length)){ -_355+=_343.charAt(_353++); -} -if(_355=="yyyy"||_355=="yy"||_355=="y"){ -if(_355=="yyyy"){ +while(_352<_342.length){ +c=_342.charAt(_352); +_354=""; +while((_342.charAt(_352)==c)&&(_352<_342.length)){ +_354+=_342.charAt(_352++); +} +if(_354=="yyyy"||_354=="yy"||_354=="y"){ +if(_354=="yyyy"){ x=4; y=4; } -if(_355=="yy"){ +if(_354=="yy"){ x=2; y=2; } -if(_355=="y"){ +if(_354=="y"){ x=2; y=4; } -year=_347(val,_352,x,y); +year=_346(val,_351,x,y); if(year==null){ return null; } -_352+=year.length; +_351+=year.length; if(year.length==2){ if(year>70){ year=1900+(year-0); @@ -1525,33 +1522,33 @@ year=2000+(year-0); } } }else{ -if(_355=="MM"||_355=="M"){ -_359=_347(val,_352,_355.length,2); -if(_359==null||(_359<1)||(_359>12)){ +if(_354=="MM"||_354=="M"){ +_358=_346(val,_351,_354.length,2); +if(_358==null||(_358<1)||(_358>12)){ return null; } -_352+=_359.length; +_351+=_358.length; }else{ -if(_355=="dd"||_355=="d"){ -date=_347(val,_352,_355.length,2); +if(_354=="dd"||_354=="d"){ +date=_346(val,_351,_354.length,2); if(date==null||(date<1)||(date>31)){ return null; } -_352+=date.length; +_351+=date.length; }else{ -if(val.substring(_352,_352+_355.length)!=_355){ +if(val.substring(_351,_351+_354.length)!=_354){ return null; }else{ -_352+=_355.length; +_351+=_354.length; } } } } } -if(_352!=val.length){ +if(_351!=val.length){ return null; } -if(_359==2){ +if(_358==2){ if(((year%4==0)&&(year%100!=0))||(year%400==0)){ if(date>29){ return null; @@ -1562,18 +1559,18 @@ return null; } } } -if((_359==4)||(_359==6)||(_359==9)||(_359==11)){ +if((_358==4)||(_358==6)||(_358==9)||(_358==11)){ if(date>30){ return null; } } -var _361=new Date(year,_359-1,date,0,0,0); -return _361; +var _360=new Date(year,_358-1,date,0,0,0); +return _360; }}); var Prado={Version:"3.0a",Browser:function(){ var info={Version:"1.0"}; -var _363=parseInt(navigator.appVersion); -info.nver=_363; +var _362=parseInt(navigator.appVersion); +info.nver=_362; info.ver=navigator.appVersion; info.agent=navigator.userAgent; info.dom=document.getElementById?1:0; @@ -1584,7 +1581,7 @@ info.ie4=(document.all&&!info.dom&&!info.opera)?1:0; info.ie=info.ie4||info.ie5||info.ie6; info.mac=info.agent.indexOf("Mac")>-1; info.ns6=(info.dom&&parseInt(info.ver)>=5)?1:0; -info.ie3=(info.ver.indexOf("MSIE")&&(_363<4)); +info.ie3=(info.ver.indexOf("MSIE")&&(_362<4)); info.hotjava=(info.agent.toLowerCase().indexOf("hotjava")!=-1)?1:0; info.ns4=(document.layers&&!info.dom&&!info.hotjava)?1:0; info.bw=(info.ie6||info.ie5||info.ie4||info.ns4||info.ns6||info.opera); @@ -1592,13 +1589,13 @@ info.ver3=(info.hotjava||info.ie3); info.opera7=((info.agent.toLowerCase().indexOf("opera 7")>-1)||(info.agent.toLowerCase().indexOf("opera/7")>-1)); info.operaOld=info.opera&&!info.opera7; return info; -},ImportCss:function(doc,_365){ +},ImportCss:function(doc,_364){ if(Prado.Browser().ie){ -var _366=doc.createStyleSheet(_365); +var _365=doc.createStyleSheet(_364); }else{ var elm=doc.createElement("link"); elm.rel="stylesheet"; -elm.href=_365; +elm.href=_364; if(headArr=doc.getElementsByTagName("head")){ headArr[0].appendChild(elm); } @@ -1606,50 +1603,50 @@ headArr[0].appendChild(elm); }}; Prado.Focus=Class.create(); Prado.Focus.setFocus=function(id){ -var _369=document.getElementById?document.getElementById(id):document.all[id]; -if(_369&&!Prado.Focus.canFocusOn(_369)){ -_369=Prado.Focus.findTarget(_369); +var _368=document.getElementById?document.getElementById(id):document.all[id]; +if(_368&&!Prado.Focus.canFocusOn(_368)){ +_368=Prado.Focus.findTarget(_368); } -if(_369){ +if(_368){ try{ -_369.focus(); -_369.scrollIntoView(false); +_368.focus(); +_368.scrollIntoView(false); if(window.__smartNav){ -window.__smartNav.ae=_369.id; +window.__smartNav.ae=_368.id; } } catch(e){ } } }; -Prado.Focus.canFocusOn=function(_370){ -if(!_370||!(_370.tagName)){ +Prado.Focus.canFocusOn=function(_369){ +if(!_369||!(_369.tagName)){ return false; } -var _371=_370.tagName.toLowerCase(); -return !_370.disabled&&(!_370.type||_370.type.toLowerCase()!="hidden")&&Prado.Focus.isFocusableTag(_371)&&Prado.Focus.isVisible(_370); +var _370=_369.tagName.toLowerCase(); +return !_369.disabled&&(!_369.type||_369.type.toLowerCase()!="hidden")&&Prado.Focus.isFocusableTag(_370)&&Prado.Focus.isVisible(_369); }; -Prado.Focus.isFocusableTag=function(_372){ -return (_372=="input"||_372=="textarea"||_372=="select"||_372=="button"||_372=="a"); +Prado.Focus.isFocusableTag=function(_371){ +return (_371=="input"||_371=="textarea"||_371=="select"||_371=="button"||_371=="a"); }; -Prado.Focus.findTarget=function(_373){ -if(!_373||!(_373.tagName)){ +Prado.Focus.findTarget=function(_372){ +if(!_372||!(_372.tagName)){ return null; } -var _374=_373.tagName.toLowerCase(); -if(_374=="undefined"){ +var _373=_372.tagName.toLowerCase(); +if(_373=="undefined"){ return null; } -var _375=_373.childNodes; -if(_375){ -for(var i=0;i<_375.length;i++){ +var _374=_372.childNodes; +if(_374){ +for(var i=0;i<_374.length;i++){ try{ -if(Prado.Focus.canFocusOn(_375[i])){ -return _375[i]; +if(Prado.Focus.canFocusOn(_374[i])){ +return _374[i]; }else{ -var _376=Prado.Focus.findTarget(_375[i]); -if(_376){ -return _376; +var _375=Prado.Focus.findTarget(_374[i]); +if(_375){ +return _375; } } } @@ -1659,76 +1656,76 @@ catch(e){ } return null; }; -Prado.Focus.isVisible=function(_377){ -var _378=_377; -while((typeof (_378)!="undefined")&&(_378!=null)){ -if(_378.disabled||(typeof (_378.style)!="undefined"&&((typeof (_378.style.display)!="undefined"&&_378.style.display=="none")||(typeof (_378.style.visibility)!="undefined"&&_378.style.visibility=="hidden")))){ +Prado.Focus.isVisible=function(_376){ +var _377=_376; +while((typeof (_377)!="undefined")&&(_377!=null)){ +if(_377.disabled||(typeof (_377.style)!="undefined"&&((typeof (_377.style.display)!="undefined"&&_377.style.display=="none")||(typeof (_377.style.visibility)!="undefined"&&_377.style.visibility=="hidden")))){ return false; } -if(typeof (_378.parentNode)!="undefined"&&_378.parentNode!=null&&_378.parentNode!=_378&&_378.parentNode.tagName.toLowerCase()!="body"){ -_378=_378.parentNode; +if(typeof (_377.parentNode)!="undefined"&&_377.parentNode!=null&&_377.parentNode!=_377&&_377.parentNode.tagName.toLowerCase()!="body"){ +_377=_377.parentNode; }else{ return true; } } return true; }; -Prado.PostBack=function(_379,_380){ -var form=$(_380["FormID"]); +Prado.PostBack=function(_378,_379){ +var form=$(_379["FormID"]); +var _380=true; +if(_379["CausesValidation"]&&Prado.Validation){ var _381=true; -if(_380["CausesValidation"]&&Prado.Validation){ -var _382=true; -if(_380["ValidationGroup"]){ -_382=Prado.Validation.ValidateValidationGroup(_380["ValidationGroup"]); +if(_379["ValidationGroup"]){ +_381=Prado.Validation.ValidateValidationGroup(_379["ValidationGroup"]); }else{ -_382=Prado.Validation.ValidateNonGroup(form); +_381=Prado.Validation.ValidateNonGroup(form); } -if(!_382){ -if(_380["StopEvent"]){ -Event.stop(_379); +if(!_381){ +if(_379["StopEvent"]){ +Event.stop(_378); } return; } } -if(_380["PostBackUrl"]&&_380["PostBackUrl"].length>0){ -form.action=_380["PostBackUrl"]; +if(_379["PostBackUrl"]&&_379["PostBackUrl"].length>0){ +form.action=_379["PostBackUrl"]; } -if(_380["TrackFocus"]){ -var _383=$("PRADO_LASTFOCUS"); +if(_379["TrackFocus"]){ +var _382=$("PRADO_LASTFOCUS"); +if(_382){ +var _383=document.activeElement; if(_383){ -var _384=document.activeElement; -if(_384){ -_383.value=_384.id; +_382.value=_383.id; }else{ -_383.value=_380["EventTarget"]; +_382.value=_379["EventTarget"]; } } } -$("PRADO_POSTBACK_TARGET").value=_380["EventTarget"]; -$("PRADO_POSTBACK_PARAMETER").value=_380["EventParameter"]; +$("PRADO_POSTBACK_TARGET").value=_379["EventTarget"]; +$("PRADO_POSTBACK_PARAMETER").value=_379["EventParameter"]; Event.fireEvent(form,"submit"); -if(_380["StopEvent"]){ -Event.stop(_379); +if(_379["StopEvent"]){ +Event.stop(_378); } }; -Prado.Element={setValue:function(_385,_386){ -var el=$(_385); +Prado.Element={setValue:function(_384,_385){ +var el=$(_384); if(el&&typeof (el.value)!="undefined"){ -el.value=_386; +el.value=_385; } -},select:function(_388,_389,_390){ -var el=$(_388); -var _391=_388.indexOf("[]")>-1; -if(!el&&!_391){ +},select:function(_387,_388,_389){ +var el=$(_387); +var _390=_387.indexOf("[]")>-1; +if(!el&&!_390){ return; } -_389=_391?"check"+_389:el.tagName.toLowerCase()+_389; -var _392=Prado.Element.Selection; -if(isFunction(_392[_389])){ -_392[_389](_391?_388:el,_390); +_388=_390?"check"+_388:el.tagName.toLowerCase()+_388; +var _391=Prado.Element.Selection; +if(isFunction(_391[_388])){ +_391[_388](_390?_387:el,_389); } -},click:function(_393){ -var el=$(_393); +},click:function(_392){ +var el=$(_392); if(!el){ return; } @@ -1744,25 +1741,25 @@ el.onclick(); } } } -},setAttribute:function(_395,_396,_397){ -var el=$(_395); -if(_396=="disabled"&&_397==false){ -el.removeAttribute(_396); +},setAttribute:function(_394,_395,_396){ +var el=$(_394); +if(_395=="disabled"&&_396==false){ +el.removeAttribute(_395); }else{ -el.setAttribute(_396,_397); +el.setAttribute(_395,_396); } -},setOptions:function(_398,_399){ -var el=$(_398); +},setOptions:function(_397,_398){ +var el=$(_397); if(el&&el.tagName.toLowerCase()=="select"){ while(el.length>0){ el.remove(0); } -for(var i=0;i<_399.length;i++){ -el.options[el.options.length]=new Option(_399[i][0],_399[i][1]); +for(var i=0;i<_398.length;i++){ +el.options[el.options.length]=new Option(_398[i][0],_398[i][1]); } } -},focus:function(_400){ -var obj=$(_400); +},focus:function(_399){ +var obj=$(_399); if(isObject(obj)&&isdef(obj.focus)){ setTimeout(function(){ obj.focus(); @@ -1770,22 +1767,22 @@ obj.focus(); } return false; }}; -Prado.Element.Selection={inputValue:function(el,_402){ +Prado.Element.Selection={inputValue:function(el,_401){ switch(el.type.toLowerCase()){ case "checkbox": case "radio": -return el.checked=_402; +return el.checked=_401; } -},selectValue:function(el,_403){ -$A(el.options).each(function(_404){ -_404.selected=_404.value==_403; +},selectValue:function(el,_402){ +$A(el.options).each(function(_403){ +_403.selected=_403.value==_402; }); -},selectIndex:function(el,_405){ +},selectIndex:function(el,_404){ if(el.type=="select-one"){ -el.selectedIndex=_405; +el.selectedIndex=_404; }else{ for(var i=0;i-1?this.radios[_457].value:this.options.caption; +this.setCaption(_455); +},setCaption:function(_456){ +this.caption.innerHTML=_456>-1?this.radios[_456].value:this.options.caption; }}; diff --git a/framework/Web/Javascripts/prototype/array.js b/framework/Web/Javascripts/prototype/array.js index d23596cb..51ad864b 100644 --- a/framework/Web/Javascripts/prototype/array.js +++ b/framework/Web/Javascripts/prototype/array.js @@ -12,7 +12,7 @@ var $A = Array.from = function(iterable) { Object.extend(Array.prototype, Enumerable); -Array.prototype._reverse = Array.prototype.reverse; +//Array.prototype._reverse = Array.prototype.reverse; Object.extend(Array.prototype, { _each: function(iterator) { @@ -58,11 +58,12 @@ Object.extend(Array.prototype, { if (this[i] == object) return i; return -1; }, - + +/* reverse: function(inline) { return (inline !== false ? this : this.toArray())._reverse(); }, - +*/ shift: function() { var result = this[0]; for (var i = 0; i < this.length - 1; i++) -- cgit v1.2.3