From a2a030c3cfbb0249762fffa4159107bc13f8952d Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 2 Feb 2006 05:04:50 +0000 Subject: Fixed #19 --- .gitattributes | 4 + buildscripts/jsbuilder/build.php | 15 +- framework/Web/Javascripts/js/ajax.js | 1172 ++++++----- framework/Web/Javascripts/js/prado.js | 2092 ++++++++++---------- framework/Web/Javascripts/js/rico.js | 97 +- framework/Web/Javascripts/js/validator.js | 169 +- framework/Web/Javascripts/prado/controls.js | 28 +- tests/FunctionalTests/index.php | 5 +- .../protected/pages/I18N/BasicI18N.page | 2 +- tests/FunctionalTests/protected/pages/Layout.tpl | 5 +- .../protected/pages/UI/DatePicker.page | 2 - .../pages/UI/TestTPanelDefaultButton.page | 13 +- .../protected/pages/UI/TestTPanelDefaultButton.php | 15 +- .../protected/pages/UI/testLabeledTextBox.page | 2 - .../protected/pages/UI/testOnClickAttribute.page | 7 + .../protected/pages/UI/testOnClickAttribute.php | 36 + .../protected/pages/Validation/CheckBox.page | 4 - .../pages/Validation/RequiredFieldValidator.page | 3 - .../pages/Validation/testInitialValueRequired.page | 11 + .../pages/Validation/testInitialValueRequired.php | 25 + 20 files changed, 1903 insertions(+), 1804 deletions(-) create mode 100644 tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page create mode 100644 tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php create mode 100644 tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page create mode 100644 tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php diff --git a/.gitattributes b/.gitattributes index 52d94fe4..3acbd78a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -720,10 +720,14 @@ tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page -text tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php -text tests/FunctionalTests/protected/pages/UI/testHtmlArea.page -text tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page -text +tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page -text +tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php -text tests/FunctionalTests/protected/pages/Validation/CheckBox.page -text tests/FunctionalTests/protected/pages/Validation/CheckBox.php -text tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page -text tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.php -text +tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page -text +tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php -text tests/FunctionalTests/protected/pages/ViewSource.page -text tests/FunctionalTests/protected/pages/ViewSource.php -text tests/FunctionalTests/protected/pages/config.xml -text diff --git a/buildscripts/jsbuilder/build.php b/buildscripts/jsbuilder/build.php index ba721eba..0b61b1bb 100644 --- a/buildscripts/jsbuilder/build.php +++ b/buildscripts/jsbuilder/build.php @@ -143,14 +143,15 @@ foreach($libraries as $libFile => $sourceFiles) $sourceFile=SOURCE_DIR.'/'.$sourceFile; if(!is_file($sourceFile)) echo "Source file not found: $sourceFile\n"; - $tempFile=$sourceFile.'.tmp'; - $command=sprintf(COMPRESS_COMMAND,$sourceFile,$tempFile); - echo "...adding $sourceFile\n". - system($command); - $contents.=file_get_contents($tempFile); - @unlink($tempFile); + + echo "...adding $sourceFile\n"; + $contents.=file_get_contents($sourceFile)."\n\n"; } - file_put_contents($libFile,$contents); + $tempFile=$libFile.'.tmp'; + file_put_contents($tempFile,$contents); + $command=sprintf(COMPRESS_COMMAND,$tempFile,$libFile); + system($command); + @unlink($tempFile); } ?> \ No newline at end of file diff --git a/framework/Web/Javascripts/js/ajax.js b/framework/Web/Javascripts/js/ajax.js index de445885..8e655fae 100644 --- a/framework/Web/Javascripts/js/ajax.js +++ b/framework/Web/Javascripts/js/ajax.js @@ -195,16 +195,15 @@ this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*100 },onTimerEvent:function(){ this.updater=new Ajax.Updater(this.container,this.url,this.options); }}); - Prado.AJAX={Service:"Prototype"}; -Prado.AJAX.EvalScript=function(_1){ -var _2=new RegExp(Ajax.Updater.ScriptFragment,"img"); -var _3=_1.match(_2); -if(_3){ -_2=new RegExp(Ajax.Updater.ScriptFragment,"im"); +Prado.AJAX.EvalScript=function(_32){ +var _33=new RegExp(Ajax.Updater.ScriptFragment,"img"); +var _34=_32.match(_33); +if(_34){ +_33=new RegExp(Ajax.Updater.ScriptFragment,"im"); setTimeout((function(){ -for(var i=0;i<_3.length;i++){ -eval(_3[i].match(_2)[1]); +for(var i=0;i<_34.length;i++){ +eval(_34[i].match(_33)[1]); } }).bind(this),50); } @@ -212,50 +211,50 @@ eval(_3[i].match(_2)[1]); Prado.AJAX.Request=Class.create(); Prado.AJAX.Request.prototype=Object.extend(Ajax.Request.prototype,{evalJSON:function(){ try{ -var _5=this.transport.getResponseHeader("X-JSON"),object; -object=eval(_5); +var _35=this.transport.getResponseHeader("X-JSON"),object; +object=eval(_35); return object; } catch(e){ -if(isString(_5)){ -return Prado.AJAX.JSON.parse(_5); +if(isString(_35)){ +return Prado.AJAX.JSON.parse(_35); } } -},respondToReadyState:function(_6){ -var _7=Ajax.Request.Events[_6]; -var _8=this.transport,json=this.evalJSON(); -if(_7=="Complete"&&_8.status){ -Ajax.Responders.dispatch("on"+_8.status,this,_8,json); +},respondToReadyState:function(_36){ +var _37=Ajax.Request.Events[_36]; +var _38=this.transport,json=this.evalJSON(); +if(_37=="Complete"&&_38.status){ +Ajax.Responders.dispatch("on"+_38.status,this,_38,json); } -(this.options["on"+_7]||Prototype.emptyFunction)(_8,json); -Ajax.Responders.dispatch("on"+_7,this,_8,json); -if(_7=="Complete"){ -(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_8,json); +(this.options["on"+_37]||Prototype.emptyFunction)(_38,json); +Ajax.Responders.dispatch("on"+_37,this,_38,json); +if(_37=="Complete"){ +(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_38,json); } -if(_7=="Complete"){ +if(_37=="Complete"){ this.transport.onreadystatechange=Prototype.emptyFunction; } }}); -Prado.AJAX.Error=function(e,_10){ +Prado.AJAX.Error=function(e,_40){ e.name="Prado.AJAX.Error"; -e.code=_10; +e.code=_40; return e; }; Prado.AJAX.RequestBuilder=Class.create(); Prado.AJAX.RequestBuilder.prototype={initialize:function(){ this.body=""; this.data=[]; -},encode:function(_11){ -return Prado.AJAX.JSON.stringify(_11); -},build:function(_12){ +},encode:function(_41){ +return Prado.AJAX.JSON.stringify(_41); +},build:function(_42){ var sep=""; -for(var _14 in _12){ -if(isFunction(_12[_14])){ +for(var _44 in _42){ +if(isFunction(_42[_44])){ continue; } try{ -this.body+=sep+_14+"="; -this.body+=encodeURIComponent(this.encode(_12[_14])); +this.body+=sep+_44+"="; +this.body+=encodeURIComponent(this.encode(_42[_44])); } catch(e){ throw Prado.AJAX.Error(e,1006); @@ -269,40 +268,40 @@ return this.body; Prado.AJAX.RemoteObject=function(){ }; Prado.AJAX.RemoteObject.Request=Class.create(); -Prado.AJAX.RemoteObject.Request.prototype=Object.extend(Prado.AJAX.Request.prototype,{initialize:function(_15){ +Prado.AJAX.RemoteObject.Request.prototype=Object.extend(Prado.AJAX.Request.prototype,{initialize:function(_45){ this.transport=Ajax.getTransport(); -this.setOptions(_15); +this.setOptions(_45); this.post=new Prado.AJAX.RequestBuilder(); -},invokeRemoteObject:function(url,_17){ -this.initParameters(_17); +},invokeRemoteObject:function(url,_46){ +this.initParameters(_46); this.options.postBody=this.post.getAll(); this.request(url); -},initParameters:function(_18){ +},initParameters:function(_47){ this.post.data["__parameters"]=[]; -for(var i=0;i<_18.length;i++){ -this.post.data["__parameters"][i]=_18[i]; +for(var i=0;i<_47.length;i++){ +this.post.data["__parameters"][i]=_47[i]; } }}); -Prado.AJAX.RemoteObject.prototype={baseInitialize:function(_19,_20){ -this.__handlers=_19||{}; -this.__service=new Prado.AJAX.RemoteObject.Request(_20); -},__call:function(url,_21,_22){ +Prado.AJAX.RemoteObject.prototype={baseInitialize:function(_48,_49){ +this.__handlers=_48||{}; +this.__service=new Prado.AJAX.RemoteObject.Request(_49); +},__call:function(url,_50,_51){ this.__service.options.onSuccess=this.__onSuccess.bind(this); -this.__callback=_21; -return this.__service.invokeRemoteObject(url+"/"+_21,_22); -},__onSuccess:function(_23,_24){ +this.__callback=_50; +return this.__service.invokeRemoteObject(url+"/"+_50,_51); +},__onSuccess:function(_52,_53){ if(this.__handlers[this.__callback]){ -this.__handlers[this.__callback](_24,_23.responseText); +this.__handlers[this.__callback](_53,_52.responseText); } }}; -Prado.AJAX.Exception={"on505":function(_25,_26,e){ -var msg="HTTP "+_26.status+" with response"; -Logger.error(msg,_26.responseText); +Prado.AJAX.Exception={"on505":function(_54,_55,e){ +var msg="HTTP "+_55.status+" with response"; +Logger.error(msg,_55.responseText); Logger.exception(e); -},onComplete:function(_28,_29,e){ -if(_29.status!=505){ -var msg="HTTP "+_29.status+" with response : \n"; -msg+=_29.responseText+"\n"; +},onComplete:function(_57,_58,e){ +if(_58.status!=505){ +var msg="HTTP "+_58.status+" with response : \n"; +msg+=_58.responseText+"\n"; msg+="Data : \n"+inspect(e); Logger.warn(msg); } @@ -310,11 +309,11 @@ Logger.warn(msg); var msg=e.type+" with message \""+e.message+"\""; msg+=" in "+e.file+"("+e.line+")\n"; msg+="Stack trace:\n"; -var _30=e.trace; -for(var i=0;i<_30.length;i++){ -msg+=" #"+i+" "+_30[i].file; -msg+="("+_30[i].line+"): "; -msg+=_30[i]["class"]+"->"+_30[i]["function"]+"()"+"\n"; +var _59=e.trace; +for(var i=0;i<_59.length;i++){ +msg+=" #"+i+" "+_59[i].file; +msg+="("+_59[i].line+"): "; +msg+=_59[i]["class"]+"->"+_59[i]["function"]+"()"+"\n"; } return msg; },logException:function(e){ @@ -328,15 +327,15 @@ Ajax.Responders.register(Prado.AJAX.Exception); } }); Prado.AJAX.Callback=Class.create(); -Prado.AJAX.Callback.prototype=Object.extend(new Prado.AJAX.RemoteObject(),{initialize:function(ID,_32){ +Prado.AJAX.Callback.prototype=Object.extend(new Prado.AJAX.RemoteObject(),{initialize:function(ID,_61){ if(!isString(ID)&&typeof (ID.id)!="undefined"){ ID=ID.id; } if(!isString(ID)){ throw new Error("A Control ID must be specified"); } -this.baseInitialize(this,_32); -this.options=_32||[]; +this.baseInitialize(this,_61); +this.options=_61||[]; this.__service.post.data["__ID"]=ID; this.requestCallback(); },collectPostData:function(){ @@ -352,44 +351,44 @@ this.__service.post.data["__data"][id]=$F(id); } } } -},collectArrayPostData:function(_35){ -var _36=document.getElementsByName(_35); -var _37=[]; -$A(_36).each(function(el){ +},collectArrayPostData:function(_64){ +var _65=document.getElementsByName(_64); +var _66=[]; +$A(_65).each(function(el){ if($F(el)){ -_37.push($F(el)); +_66.push($F(el)); } }); -return _37; +return _66; },requestCallback:function(){ this.collectPostData(); if(Prado.AJAX.Validate(this.options)){ return this.__call(Prado.AJAX.Callback.Server,"handleCallback",this.options.params); } -},handleCallback:function(_39,_40){ -if(typeof (_39)!="undefined"&&!isNull(_39)){ -this.options.onSuccess(_39["data"],_40); -if(_39["actions"]){ -_39.actions.each(Prado.AJAX.Callback.Action.__run); +},handleCallback:function(_68,_69){ +if(typeof (_68)!="undefined"&&!isNull(_68)){ +this.options.onSuccess(_68["data"],_69); +if(_68["actions"]){ +_68.actions.each(Prado.AJAX.Callback.Action.__run); } } }}); -Prado.AJAX.Callback.Action={__run:function(_41){ -for(var _42 in _41){ -if(_41[_42][0]&&($(_41[_42][0])||_41[_42][0].indexOf("[]")>-1)){ -_42.toFunction().apply(this,_41[_42]); +Prado.AJAX.Callback.Action={__run:function(_70){ +for(var _71 in _70){ +if(_70[_71][0]&&($(_70[_71][0])||_70[_71][0].indexOf("[]")>-1)){ +_71.toFunction().apply(this,_70[_71]); } } }}; -Prado.AJAX.Validate=function(_43){ -if(_43.CausesValidation){ -if(_43.ValidatorGroup){ -return Prado.Validation.ValidateValidatorGroup(_43.ValidatorGroup); +Prado.AJAX.Validate=function(_72){ +if(_72.CausesValidation){ +if(_72.ValidatorGroup){ +return Prado.Validation.ValidateValidatorGroup(_72.ValidatorGroup); }else{ -if(_43.ValidationGroup){ -return Prado.Validation.ValidateValidationGroup(_43.ValidationGroup); +if(_72.ValidationGroup){ +return Prado.Validation.ValidateValidationGroup(_72.ValidationGroup); }else{ -return Prado.Validation.ValidateNonGroup(_43.ValidationForm); +return Prado.Validation.ValidateNonGroup(_72.ValidationForm); } } }else{ @@ -398,22 +397,21 @@ return true; }; Prado.AJAX.Callback.Server=""; Prado.AJAX.Callback.IDs=[]; -Prado.Callback=function(ID,_44,_45,_46){ -var _47={"params":[_44]||[],"onSuccess":_45||Prototype.emptyFunction,"CausesValidation":true}; -Object.extend(_47,_46||{}); -new Prado.AJAX.Callback(ID,_47); +Prado.Callback=function(ID,_73,_74,_75){ +var _76={"params":[_73]||[],"onSuccess":_74||Prototype.emptyFunction,"CausesValidation":true}; +Object.extend(_76,_75||{}); +new Prado.AJAX.Callback(ID,_76); return false; }; - Array.prototype.______array="______array"; -Prado.AJAX.JSON={org:"http://www.JSON.org",copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(_1){ +Prado.AJAX.JSON={org:"http://www.JSON.org",copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(arg){ var c,i,l,s="",v; -switch(typeof _1){ +switch(typeof arg){ case "object": -if(_1){ -if(_1.______array=="______array"){ -for(i=0;i<_1.length;++i){ -v=this.stringify(_1[i]); +if(arg){ +if(arg.______array=="______array"){ +for(i=0;i=" "){ if(c=="\\"||c=="\""){ s+="\\"; @@ -474,18 +472,18 @@ s+="\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16); } return s+"\""; case "boolean": -return String(_1); +return String(arg); default: return "null"; } -},parse:function(_3){ +},parse:function(_79){ var at=0; var ch=" "; function error(m){ -throw {name:"JSONError",message:m,at:at-1,text:_3}; +throw {name:"JSONError",message:m,at:at-1,text:_79}; } function next(){ -ch=_3.charAt(at); +ch=_79.charAt(at); at+=1; return ch; } @@ -706,36 +704,35 @@ return ch>="0"&&ch<="9"?number():word(); } return value(); }}; - var Autocompleter={}; Autocompleter.Base=function(){ }; -Autocompleter.Base.prototype={baseInitialize:function(_1,_2,_3){ -this.element=$(_1); -this.update=$(_2); +Autocompleter.Base.prototype={baseInitialize:function(_86,_87,_88){ +this.element=$(_86); +this.update=$(_87); this.hasFocus=false; this.changed=false; this.active=false; this.index=0; this.entryCount=0; if(this.setOptions){ -this.setOptions(_3); +this.setOptions(_88); }else{ -this.options=_3||{}; +this.options=_88||{}; } this.options.paramName=this.options.paramName||this.element.name; this.options.tokens=this.options.tokens||[]; this.options.frequency=this.options.frequency||0.4; this.options.minChars=this.options.minChars||1; -this.options.onShow=this.options.onShow||function(_1,_2){ -if(!_2.style.position||_2.style.position=="absolute"){ -_2.style.position="absolute"; -Position.clone(_1,_2,{setHeight:false,offsetTop:_1.offsetHeight}); +this.options.onShow=this.options.onShow||function(_86,_87){ +if(!_87.style.position||_87.style.position=="absolute"){ +_87.style.position="absolute"; +Position.clone(_86,_87,{setHeight:false,offsetTop:_86.offsetHeight}); } -Effect.Appear(_2,{duration:0.15}); +Effect.Appear(_87,{duration:0.15}); }; -this.options.onHide=this.options.onHide||function(_4,_5){ -new Effect.Fade(_5,{duration:0.15}); +this.options.onHide=this.options.onHide||function(_89,_90){ +new Effect.Fade(_90,{duration:0.15}); }; if(typeof (this.options.tokens)=="string"){ this.options.tokens=new Array(this.options.tokens); @@ -777,17 +774,17 @@ Element.show(this.options.indicator); if(this.options.indicator){ Element.hide(this.options.indicator); } -},onKeyPress:function(_6){ +},onKeyPress:function(_91){ if(this.active){ -switch(_6.keyCode){ +switch(_91.keyCode){ case Event.KEY_TAB: case Event.KEY_RETURN: this.selectEntry(); -Event.stop(_6); +Event.stop(_91); case Event.KEY_ESC: this.hide(); this.active=false; -Event.stop(_6); +Event.stop(_91); return; case Event.KEY_LEFT: case Event.KEY_RIGHT: @@ -796,19 +793,19 @@ case Event.KEY_UP: this.markPrevious(); this.render(); if(navigator.appVersion.indexOf("AppleWebKit")>0){ -Event.stop(_6); +Event.stop(_91); } return; case Event.KEY_DOWN: this.markNext(); this.render(); if(navigator.appVersion.indexOf("AppleWebKit")>0){ -Event.stop(_6); +Event.stop(_91); } return; } }else{ -if(_6.keyCode==Event.KEY_TAB||_6.keyCode==Event.KEY_RETURN){ +if(_91.keyCode==Event.KEY_TAB||_91.keyCode==Event.KEY_RETURN){ return; } } @@ -818,19 +815,19 @@ if(this.observer){ clearTimeout(this.observer); } this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000); -},onHover:function(_7){ -var _8=Event.findElement(_7,"LI"); -if(this.index!=_8.autocompleteIndex){ -this.index=_8.autocompleteIndex; +},onHover:function(_92){ +var _93=Event.findElement(_92,"LI"); +if(this.index!=_93.autocompleteIndex){ +this.index=_93.autocompleteIndex; this.render(); } -Event.stop(_7); -},onClick:function(_9){ -var _10=Event.findElement(_9,"LI"); -this.index=_10.autocompleteIndex; +Event.stop(_92); +},onClick:function(_94){ +var _95=Event.findElement(_94,"LI"); +this.index=_95.autocompleteIndex; this.selectEntry(); this.hide(); -},onBlur:function(_11){ +},onBlur:function(_96){ setTimeout(this.hide.bind(this),250); this.hasFocus=false; this.active=false; @@ -859,53 +856,53 @@ this.index++; }else{ this.index=0; } -},getEntry:function(_13){ -return this.update.firstChild.childNodes[_13]; +},getEntry:function(_97){ +return this.update.firstChild.childNodes[_97]; },getCurrentEntry:function(){ return this.getEntry(this.index); },selectEntry:function(){ this.active=false; this.updateElement(this.getCurrentEntry()); -},updateElement:function(_14){ +},updateElement:function(_98){ if(this.options.updateElement){ -this.options.updateElement(_14); +this.options.updateElement(_98); return; } -var _15=""; +var _99=""; if(this.options.select){ -var _16=document.getElementsByClassName(this.options.select,_14)||[]; -if(_16.length>0){ -_15=Element.collectTextNodes(_16[0],this.options.select); +var _100=document.getElementsByClassName(this.options.select,_98)||[]; +if(_100.length>0){ +_99=Element.collectTextNodes(_100[0],this.options.select); } }else{ -_15=Element.collectTextNodesIgnoreClass(_14,"informal"); +_99=Element.collectTextNodesIgnoreClass(_98,"informal"); } -var _17=this.findLastToken(); -if(_17!=-1){ -var _18=this.element.value.substr(0,_17+1); -var _19=this.element.value.substr(_17+1).match(/^\s+/); -if(_19){ -_18+=_19[0]; +var _101=this.findLastToken(); +if(_101!=-1){ +var _102=this.element.value.substr(0,_101+1); +var _103=this.element.value.substr(_101+1).match(/^\s+/); +if(_103){ +_102+=_103[0]; } -this.element.value=_18+_15; +this.element.value=_102+_99; }else{ -this.element.value=_15; +this.element.value=_99; } this.element.focus(); if(this.options.afterUpdateElement){ -this.options.afterUpdateElement(this.element,_14); +this.options.afterUpdateElement(this.element,_98); } -},updateChoices:function(_20){ +},updateChoices:function(_104){ if(!this.changed&&this.hasFocus){ -this.update.innerHTML=_20; +this.update.innerHTML=_104; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.firstChild); if(this.update.firstChild&&this.update.firstChild.childNodes){ this.entryCount=this.update.firstChild.childNodes.length; for(var i=0;i=this.options.minChars){ @@ -927,26 +924,26 @@ this.active=false; this.hide(); } },getToken:function(){ -var _23=this.findLastToken(); -if(_23!=-1){ -var ret=this.element.value.substr(_23+1).replace(/^\s+/,"").replace(/\s+$/,""); +var _107=this.findLastToken(); +if(_107!=-1){ +var ret=this.element.value.substr(_107+1).replace(/^\s+/,"").replace(/\s+$/,""); }else{ var ret=this.element.value; } return /\n/.test(ret)?"":ret; },findLastToken:function(){ -var _25=-1; +var _109=-1; for(var i=0;i_25){ -_25=_26; +var _110=this.element.value.lastIndexOf(this.options.tokens[i]); +if(_110>_109){ +_109=_110; } } -return _25; +return _109; }}; Ajax.Autocompleter=Class.create(); -Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(_27,_28,url,_30){ -this.baseInitialize(_27,_28,_30); +Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(_111,_112,url,_113){ +this.baseInitialize(_111,_112,_113); this.options.asynchronous=true; this.options.onComplete=this.onComplete.bind(this); this.options.defaultParams=this.options.parameters||null; @@ -958,62 +955,62 @@ if(this.options.defaultParams){ this.options.parameters+="&"+this.options.defaultParams; } new Ajax.Request(this.url,this.options); -},onComplete:function(_31){ -this.updateChoices(_31.responseText); +},onComplete:function(_114){ +this.updateChoices(_114.responseText); }}); Autocompleter.Local=Class.create(); -Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_32,_33,_34,_35){ -this.baseInitialize(_32,_33,_35); -this.options.array=_34; +Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_115,_116,_117,_118){ +this.baseInitialize(_115,_116,_118); +this.options.array=_117; },getUpdatedChoices:function(){ this.updateChoices(this.options.selector(this)); -},setOptions:function(_36){ -this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(_37){ +},setOptions:function(_119){ +this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(_120){ var ret=[]; -var _38=[]; -var _39=_37.getToken(); -var _40=0; -for(var i=0;i<_37.options.array.length&&ret.length<_37.options.choices;i++){ -var _41=_37.options.array[i]; -var _42=_37.options.ignoreCase?_41.toLowerCase().indexOf(_39.toLowerCase()):_41.indexOf(_39); -while(_42!=-1){ -if(_42==0&&_41.length!=_39.length){ -ret.push("
  • "+_41.substr(0,_39.length)+""+_41.substr(_39.length)+"
  • "); +var _121=[]; +var _122=_120.getToken(); +var _123=0; +for(var i=0;i<_120.options.array.length&&ret.length<_120.options.choices;i++){ +var elem=_120.options.array[i]; +var _125=_120.options.ignoreCase?elem.toLowerCase().indexOf(_122.toLowerCase()):elem.indexOf(_122); +while(_125!=-1){ +if(_125==0&&elem.length!=_122.length){ +ret.push("
  • "+elem.substr(0,_122.length)+""+elem.substr(_122.length)+"
  • "); break; }else{ -if(_39.length>=_37.options.partialChars&&_37.options.partialSearch&&_42!=-1){ -if(_37.options.fullSearch||/\s/.test(_41.substr(_42-1,1))){ -_38.push("
  • "+_41.substr(0,_42)+""+_41.substr(_42,_39.length)+""+_41.substr(_42+_39.length)+"
  • "); +if(_122.length>=_120.options.partialChars&&_120.options.partialSearch&&_125!=-1){ +if(_120.options.fullSearch||/\s/.test(elem.substr(_125-1,1))){ +_121.push("
  • "+elem.substr(0,_125)+""+elem.substr(_125,_122.length)+""+elem.substr(_125+_122.length)+"
  • "); break; } } } -_42=_37.options.ignoreCase?_41.toLowerCase().indexOf(_39.toLowerCase(),_42+1):_41.indexOf(_39,_42+1); +_125=_120.options.ignoreCase?elem.toLowerCase().indexOf(_122.toLowerCase(),_125+1):elem.indexOf(_122,_125+1); } } -if(_38.length){ -ret=ret.concat(_38.slice(0,_37.options.choices-ret.length)); +if(_121.length){ +ret=ret.concat(_121.slice(0,_120.options.choices-ret.length)); } return "
      "+ret.join("")+"
    "; -}},_36||{}); +}},_119||{}); }}); -Field.scrollFreeActivate=function(_43){ +Field.scrollFreeActivate=function(_126){ setTimeout(function(){ -Field.activate(_43); +Field.activate(_126); },1); }; Ajax.InPlaceEditor=Class.create(); Ajax.InPlaceEditor.defaultHighlightColor="#FFFF99"; -Ajax.InPlaceEditor.prototype={initialize:function(_44,url,_45){ +Ajax.InPlaceEditor.prototype={initialize:function(_127,url,_128){ this.url=url; -this.element=$(_44); -this.options=Object.extend({okButton:true,okText:"ok",cancelLink:true,cancelText:"cancel",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(_46,_44){ -new Effect.Highlight(_44,{startcolor:this.options.highlightcolor}); -},onFailure:function(_47){ -alert("Error communicating with the server: "+_47.responseText.stripTags()); -},callback:function(_48){ -return Form.serialize(_48); -},handleLineBreaks:true,loadingText:"Loading...",savingClassName:"inplaceeditor-saving",loadingClassName:"inplaceeditor-loading",formClassName:"inplaceeditor-form",highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{}},_45||{}); +this.element=$(_127); +this.options=Object.extend({okButton:true,okText:"ok",cancelLink:true,cancelText:"cancel",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(_129,_127){ +new Effect.Highlight(_127,{startcolor:this.options.highlightcolor}); +},onFailure:function(_130){ +alert("Error communicating with the server: "+_130.responseText.stripTags()); +},callback:function(form){ +return Form.serialize(form); +},handleLineBreaks:true,loadingText:"Loading...",savingClassName:"inplaceeditor-saving",loadingClassName:"inplaceeditor-loading",formClassName:"inplaceeditor-form",highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{}},_128||{}); if(!this.options.formId&&this.element.id){ this.options.formId=this.element.id+"-inplaceeditor"; if($(this.options.formId)){ @@ -1082,49 +1079,49 @@ cancelLink.appendChild(document.createTextNode(this.options.cancelText)); cancelLink.onclick=this.onclickCancel.bind(this); this.form.appendChild(cancelLink); } -},hasHTMLLineBreaks:function(_51){ +},hasHTMLLineBreaks:function(_134){ if(!this.options.handleLineBreaks){ return false; } -return _51.match(/
    /i); -},convertHTMLLineBreaks:function(_52){ -return _52.replace(/
    /gi,"\n").replace(//gi,"\n").replace(/<\/p>/gi,"\n").replace(/

    /gi,""); +return _134.match(/
    /i); +},convertHTMLLineBreaks:function(_135){ +return _135.replace(/
    /gi,"\n").replace(//gi,"\n").replace(/<\/p>/gi,"\n").replace(/

    /gi,""); },createEditField:function(){ -var _53; +var text; if(this.options.loadTextURL){ -_53=this.options.loadingText; +text=this.options.loadingText; }else{ -_53=this.getText(); +text=this.getText(); } var obj=this; -if(this.options.rows==1&&!this.hasHTMLLineBreaks(_53)){ +if(this.options.rows==1&&!this.hasHTMLLineBreaks(text)){ this.options.textarea=false; -var _55=document.createElement("input"); -_55.obj=this; -_55.type="text"; -_55.name="value"; -_55.value=_53; -_55.style.backgroundColor=this.options.highlightcolor; -var _56=this.options.size||this.options.cols||0; -if(_56!=0){ -_55.size=_56; +var _138=document.createElement("input"); +_138.obj=this; +_138.type="text"; +_138.name="value"; +_138.value=text; +_138.style.backgroundColor=this.options.highlightcolor; +var size=this.options.size||this.options.cols||0; +if(size!=0){ +_138.size=size; } if(this.options.submitOnBlur){ -_55.onblur=this.onSubmit.bind(this); +_138.onblur=this.onSubmit.bind(this); } -this.editField=_55; +this.editField=_138; }else{ this.options.textarea=true; -var _57=document.createElement("textarea"); -_57.obj=this; -_57.name="value"; -_57.value=this.convertHTMLLineBreaks(_53); -_57.rows=this.options.rows; -_57.cols=this.options.cols||40; +var _140=document.createElement("textarea"); +_140.obj=this; +_140.name="value"; +_140.value=this.convertHTMLLineBreaks(text); +_140.rows=this.options.rows; +_140.cols=this.options.cols||40; if(this.options.submitOnBlur){ -_57.onblur=this.onSubmit.bind(this); +_140.onblur=this.onSubmit.bind(this); } -this.editField=_57; +this.editField=_140; } if(this.options.loadTextURL){ this.loadExternalText(); @@ -1136,26 +1133,26 @@ return this.element.innerHTML; Element.addClassName(this.form,this.options.loadingClassName); this.editField.disabled=true; new Ajax.Request(this.options.loadTextURL,Object.extend({asynchronous:true,onComplete:this.onLoadedExternalText.bind(this)},this.options.ajaxOptions)); -},onLoadedExternalText:function(_58){ +},onLoadedExternalText:function(_141){ Element.removeClassName(this.form,this.options.loadingClassName); this.editField.disabled=false; -this.editField.value=_58.responseText.stripTags(); +this.editField.value=_141.responseText.stripTags(); },onclickCancel:function(){ this.onComplete(); this.leaveEditMode(); return false; -},onFailure:function(_59){ -this.options.onFailure(_59); +},onFailure:function(_142){ +this.options.onFailure(_142); if(this.oldInnerHTML){ this.element.innerHTML=this.oldInnerHTML; this.oldInnerHTML=null; } return false; },onSubmit:function(){ -var _60=this.form; -var _61=this.editField.value; +var form=this.form; +var _143=this.editField.value; this.onLoading(); -new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(_60,_61),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions)); +new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(form,_143),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions)); if(arguments.length>1){ Event.stop(arguments[0]); } @@ -1209,9 +1206,9 @@ this.editing=false; this.saving=false; this.oldInnerHTML=null; this.onLeaveEditMode(); -},onComplete:function(_62){ +},onComplete:function(_144){ this.leaveEditMode(); -this.options.onComplete.bind(this)(_62,this.element); +this.options.onComplete.bind(this)(_144,this.element); },onEnterEditMode:function(){ },onLeaveEditMode:function(){ },dispose:function(){ @@ -1229,14 +1226,14 @@ Event.stopObserving(this.options.externalControl,"mouseout",this.mouseoutListene } }}; Form.Element.DelayedObserver=Class.create(); -Form.Element.DelayedObserver.prototype={initialize:function(_63,_64,_65){ -this.delay=_64||0.5; -this.element=$(_63); -this.callback=_65; +Form.Element.DelayedObserver.prototype={initialize:function(_145,_146,_147){ +this.delay=_146||0.5; +this.element=$(_145); +this.callback=_147; this.timer=null; this.lastValue=$F(this.element); Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this)); -},delayedListener:function(_66){ +},delayedListener:function(_148){ if(this.lastValue==$F(this.element)){ return; } @@ -1249,76 +1246,75 @@ this.lastValue=$F(this.element); this.timer=null; this.callback(this.element,$F(this.element)); }}; - -var Droppables={drops:[],remove:function(_1){ +var Droppables={drops:[],remove:function(_149){ this.drops=this.drops.reject(function(d){ -return d.element==$(_1); +return d.element==$(_149); }); -},add:function(_3){ -_3=$(_3); -var _4=Object.extend({greedy:true,hoverclass:null},arguments[1]||{}); -if(_4.containment){ -_4._containers=[]; -var _5=_4.containment; -if((typeof _5=="object")&&(_5.constructor==Array)){ -_5.each(function(c){ -_4._containers.push($(c)); +},add:function(_151){ +_151=$(_151); +var _152=Object.extend({greedy:true,hoverclass:null},arguments[1]||{}); +if(_152.containment){ +_152._containers=[]; +var _153=_152.containment; +if((typeof _153=="object")&&(_153.constructor==Array)){ +_153.each(function(c){ +_152._containers.push($(c)); }); }else{ -_4._containers.push($(_5)); +_152._containers.push($(_153)); } } -if(_4.accept){ -_4.accept=[_4.accept].flatten(); +if(_152.accept){ +_152.accept=[_152.accept].flatten(); } -Element.makePositioned(_3); -_4.element=_3; -this.drops.push(_4); -},isContained:function(_7,_8){ -var _9=_7.parentNode; -return _8._containers.detect(function(c){ -return _9==c; +Element.makePositioned(_151); +_152.element=_151; +this.drops.push(_152); +},isContained:function(_154,drop){ +var _156=_154.parentNode; +return drop._containers.detect(function(c){ +return _156==c; }); -},isAffected:function(_10,_11,_12){ -return ((_12.element!=_11)&&((!_12._containers)||this.isContained(_11,_12))&&((!_12.accept)||(Element.classNames(_11).detect(function(v){ -return _12.accept.include(v); -})))&&Position.within(_12.element,_10[0],_10[1])); -},deactivate:function(_14){ -if(_14.hoverclass){ -Element.removeClassName(_14.element,_14.hoverclass); +},isAffected:function(_157,_158,drop){ +return ((drop.element!=_158)&&((!drop._containers)||this.isContained(_158,drop))&&((!drop.accept)||(Element.classNames(_158).detect(function(v){ +return drop.accept.include(v); +})))&&Position.within(drop.element,_157[0],_157[1])); +},deactivate:function(drop){ +if(drop.hoverclass){ +Element.removeClassName(drop.element,drop.hoverclass); } this.last_active=null; -},activate:function(_15){ -if(_15.hoverclass){ -Element.addClassName(_15.element,_15.hoverclass); +},activate:function(drop){ +if(drop.hoverclass){ +Element.addClassName(drop.element,drop.hoverclass); } -this.last_active=_15; -},show:function(_16,_17){ +this.last_active=drop; +},show:function(_160,_161){ if(!this.drops.length){ return; } if(this.last_active){ this.deactivate(this.last_active); } -this.drops.each(function(_18){ -if(Droppables.isAffected(_16,_17,_18)){ -if(_18.onHover){ -_18.onHover(_17,_18.element,Position.overlap(_18.overlap,_18.element)); +this.drops.each(function(drop){ +if(Droppables.isAffected(_160,_161,drop)){ +if(drop.onHover){ +drop.onHover(_161,drop.element,Position.overlap(drop.overlap,drop.element)); } -if(_18.greedy){ -Droppables.activate(_18); +if(drop.greedy){ +Droppables.activate(drop); throw $break; } } }); -},fire:function(_19,_20){ +},fire:function(_162,_163){ if(!this.last_active){ return; } Position.prepare(); -if(this.isAffected([Event.pointerX(_19),Event.pointerY(_19)],_20,this.last_active)){ +if(this.isAffected([Event.pointerX(_162),Event.pointerY(_162)],_163,this.last_active)){ if(this.last_active.onDrop){ -this.last_active.onDrop(_20,this.last_active.element,_19); +this.last_active.onDrop(_163,this.last_active.element,_162); } } },reset:function(){ @@ -1326,7 +1322,7 @@ if(this.last_active){ this.deactivate(this.last_active); } }}; -var Draggables={drags:[],observers:[],register:function(_21){ +var Draggables={drags:[],observers:[],register:function(_164){ if(this.drags.length==0){ this.eventMouseUp=this.endDrag.bindAsEventListener(this); this.eventMouseMove=this.updateDrag.bindAsEventListener(this); @@ -1335,88 +1331,88 @@ Event.observe(document,"mouseup",this.eventMouseUp); Event.observe(document,"mousemove",this.eventMouseMove); Event.observe(document,"keypress",this.eventKeypress); } -this.drags.push(_21); -},unregister:function(_22){ +this.drags.push(_164); +},unregister:function(_165){ this.drags=this.drags.reject(function(d){ -return d==_22; +return d==_165; }); if(this.drags.length==0){ Event.stopObserving(document,"mouseup",this.eventMouseUp); Event.stopObserving(document,"mousemove",this.eventMouseMove); Event.stopObserving(document,"keypress",this.eventKeypress); } -},activate:function(_23){ +},activate:function(_166){ window.focus(); -this.activeDraggable=_23; -},deactivate:function(_24){ +this.activeDraggable=_166; +},deactivate:function(_167){ this.activeDraggable=null; -},updateDrag:function(_25){ +},updateDrag:function(_168){ if(!this.activeDraggable){ return; } -var _26=[Event.pointerX(_25),Event.pointerY(_25)]; -if(this._lastPointer&&(this._lastPointer.inspect()==_26.inspect())){ +var _169=[Event.pointerX(_168),Event.pointerY(_168)]; +if(this._lastPointer&&(this._lastPointer.inspect()==_169.inspect())){ return; } -this._lastPointer=_26; -this.activeDraggable.updateDrag(_25,_26); -},endDrag:function(_27){ +this._lastPointer=_169; +this.activeDraggable.updateDrag(_168,_169); +},endDrag:function(_170){ if(!this.activeDraggable){ return; } this._lastPointer=null; -this.activeDraggable.endDrag(_27); +this.activeDraggable.endDrag(_170); this.activeDraggable=null; -},keyPress:function(_28){ +},keyPress:function(_171){ if(this.activeDraggable){ -this.activeDraggable.keyPress(_28); +this.activeDraggable.keyPress(_171); } -},addObserver:function(_29){ -this.observers.push(_29); +},addObserver:function(_172){ +this.observers.push(_172); this._cacheObserverCallbacks(); -},removeObserver:function(_30){ +},removeObserver:function(_173){ this.observers=this.observers.reject(function(o){ -return o.element==_30; +return o.element==_173; }); this._cacheObserverCallbacks(); -},notify:function(_32,_33,_34){ -if(this[_32+"Count"]>0){ +},notify:function(_175,_176,_177){ +if(this[_175+"Count"]>0){ this.observers.each(function(o){ -if(o[_32]){ -o[_32](_32,_33,_34); +if(o[_175]){ +o[_175](_175,_176,_177); } }); } },_cacheObserverCallbacks:function(){ -["onStart","onEnd","onDrag"].each(function(_35){ -Draggables[_35+"Count"]=Draggables.observers.select(function(o){ -return o[_35]; +["onStart","onEnd","onDrag"].each(function(_178){ +Draggables[_178+"Count"]=Draggables.observers.select(function(o){ +return o[_178]; }).length; }); }}; var Draggable=Class.create(); -Draggable.prototype={initialize:function(_36){ -var _37=Object.extend({handle:false,starteffect:function(_36){ -new Effect.Opacity(_36,{duration:0.2,from:1,to:0.7}); -},reverteffect:function(_38,_39,_40){ -var dur=Math.sqrt(Math.abs(_39^2)+Math.abs(_40^2))*0.02; -_38._revert=new Effect.Move(_38,{x:-_40,y:-_39,duration:dur}); -},endeffect:function(_42){ -new Effect.Opacity(_42,{duration:0.2,from:0.7,to:1}); +Draggable.prototype={initialize:function(_179){ +var _180=Object.extend({handle:false,starteffect:function(_179){ +new Effect.Opacity(_179,{duration:0.2,from:1,to:0.7}); +},reverteffect:function(_181,_182,_183){ +var dur=Math.sqrt(Math.abs(_182^2)+Math.abs(_183^2))*0.02; +_181._revert=new Effect.Move(_181,{x:-_183,y:-_182,duration:dur}); +},endeffect:function(_185){ +new Effect.Opacity(_185,{duration:0.2,from:0.7,to:1}); },zindex:1000,revert:false,snap:false},arguments[1]||{}); this.element=$(element); -if(_37.handle&&(typeof _37.handle=="string")){ -this.handle=Element.childrenWithClassName(this.element,_37.handle)[0]; +if(_180.handle&&(typeof _180.handle=="string")){ +this.handle=Element.childrenWithClassName(this.element,_180.handle)[0]; } if(!this.handle){ -this.handle=$(_37.handle); +this.handle=$(_180.handle); } if(!this.handle){ this.handle=this.element; } Element.makePositioned(this.element); this.delta=this.currentDelta(); -this.options=_37; +this.options=_180; this.dragging=false; this.eventMouseDown=this.initDrag.bindAsEventListener(this); Event.observe(this.handle,"mousedown",this.eventMouseDown); @@ -1426,9 +1422,9 @@ Event.stopObserving(this.handle,"mousedown",this.eventMouseDown); Draggables.unregister(this); },currentDelta:function(){ return ([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]); -},initDrag:function(_43){ -if(Event.isLeftClick(_43)){ -var src=Event.element(_43); +},initDrag:function(_186){ +if(Event.isLeftClick(_186)){ +var src=Event.element(_186); if(src.tagName&&(src.tagName=="INPUT"||src.tagName=="SELECT"||src.tagName=="BUTTON"||src.tagName=="TEXTAREA")){ return; } @@ -1436,15 +1432,15 @@ if(this.element._revert){ this.element._revert.cancel(); this.element._revert=null; } -var _45=[Event.pointerX(_43),Event.pointerY(_43)]; +var _188=[Event.pointerX(_186),Event.pointerY(_186)]; var pos=Position.cumulativeOffset(this.element); this.offset=[0,1].map(function(i){ -return (_45[i]-pos[i]); +return (_188[i]-pos[i]); }); Draggables.activate(this); -Event.stop(_43); +Event.stop(_186); } -},startDrag:function(_48){ +},startDrag:function(_190){ this.dragging=true; if(this.options.zindex){ this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0); @@ -1455,42 +1451,42 @@ this._clone=this.element.cloneNode(true); Position.absolutize(this.element); this.element.parentNode.insertBefore(this._clone,this.element); } -Draggables.notify("onStart",this,_48); +Draggables.notify("onStart",this,_190); if(this.options.starteffect){ this.options.starteffect(this.element); } -},updateDrag:function(_49,_50){ +},updateDrag:function(_191,_192){ if(!this.dragging){ -this.startDrag(_49); +this.startDrag(_191); } Position.prepare(); -Droppables.show(_50,this.element); -Draggables.notify("onDrag",this,_49); -this.draw(_50); +Droppables.show(_192,this.element); +Draggables.notify("onDrag",this,_191); +this.draw(_192); if(this.options.change){ this.options.change(this); } if(navigator.appVersion.indexOf("AppleWebKit")>0){ window.scrollBy(0,0); } -Event.stop(_49); -},finishDrag:function(_51,_52){ +Event.stop(_191); +},finishDrag:function(_193,_194){ this.dragging=false; if(this.options.ghosting){ Position.relativize(this.element); Element.remove(this._clone); this._clone=null; } -if(_52){ -Droppables.fire(_51,this.element); +if(_194){ +Droppables.fire(_193,this.element); } -Draggables.notify("onEnd",this,_51); -var _53=this.options.revert; -if(_53&&typeof _53=="function"){ -_53=_53(this.element); +Draggables.notify("onEnd",this,_193); +var _195=this.options.revert; +if(_195&&typeof _195=="function"){ +_195=_195(this.element); } var d=this.currentDelta(); -if(_53&&this.options.reverteffect){ +if(_195&&this.options.reverteffect){ this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0]); }else{ this.delta=d; @@ -1503,25 +1499,25 @@ this.options.endeffect(this.element); } Draggables.deactivate(this); Droppables.reset(); -},keyPress:function(_54){ -if(!_54.keyCode==Event.KEY_ESC){ +},keyPress:function(_196){ +if(!_196.keyCode==Event.KEY_ESC){ return; } -this.finishDrag(_54,false); -Event.stop(_54); -},endDrag:function(_55){ +this.finishDrag(_196,false); +Event.stop(_196); +},endDrag:function(_197){ if(!this.dragging){ return; } -this.finishDrag(_55,true); -Event.stop(_55); -},draw:function(_56){ +this.finishDrag(_197,true); +Event.stop(_197); +},draw:function(_198){ var pos=Position.cumulativeOffset(this.element); var d=this.currentDelta(); pos[0]-=d[0]; pos[1]-=d[1]; var p=[0,1].map(function(i){ -return (_56[i]-pos[i]-this.offset[i]); +return (_198[i]-pos[i]-this.offset[i]); }.bind(this)); if(this.options.snap){ if(typeof this.options.snap=="function"){ @@ -1538,21 +1534,21 @@ return Math.round(v/this.options.snap)*this.options.snap; } } } -var _58=this.element.style; +var _200=this.element.style; if((!this.options.constraint)||(this.options.constraint=="horizontal")){ -_58.left=p[0]+"px"; +_200.left=p[0]+"px"; } if((!this.options.constraint)||(this.options.constraint=="vertical")){ -_58.top=p[1]+"px"; +_200.top=p[1]+"px"; } -if(_58.visibility=="hidden"){ -_58.visibility=""; +if(_200.visibility=="hidden"){ +_200.visibility=""; } }}; var SortableObserver=Class.create(); -SortableObserver.prototype={initialize:function(_59,_60){ -this.element=$(_59); -this.observer=_60; +SortableObserver.prototype={initialize:function(_201,_202){ +this.element=$(_201); +this.observer=_202; this.lastValue=Sortable.serialize(this.element); },onStart:function(){ this.lastValue=Sortable.serialize(this.element); @@ -1562,15 +1558,15 @@ if(this.lastValue!=Sortable.serialize(this.element)){ this.observer(this.element); } }}; -var Sortable={sortables:new Array(),options:function(_61){ -_61=$(_61); +var Sortable={sortables:new Array(),options:function(_203){ +_203=$(_203); return this.sortables.detect(function(s){ -return s.element==_61; +return s.element==_203; }); -},destroy:function(_63){ -_63=$(_63); +},destroy:function(_205){ +_205=$(_205); this.sortables.findAll(function(s){ -return s.element==_63; +return s.element==_205; }).each(function(s){ Draggables.removeObserver(s.element); s.droppables.each(function(d){ @@ -1579,104 +1575,104 @@ Droppables.remove(d); s.draggables.invoke("destroy"); }); this.sortables=this.sortables.reject(function(s){ -return s.element==_63; +return s.element==_205; }); -},create:function(_64){ -_64=$(_64); -var _65=Object.extend({element:_64,tag:"li",dropOnEmpty:false,tree:false,overlap:"vertical",constraint:"vertical",containment:_64,handle:false,only:false,hoverclass:null,ghosting:false,format:null,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{}); -this.destroy(_64); -var _66={revert:true,ghosting:_65.ghosting,constraint:_65.constraint,handle:_65.handle}; -if(_65.starteffect){ -_66.starteffect=_65.starteffect; -} -if(_65.reverteffect){ -_66.reverteffect=_65.reverteffect; +},create:function(_206){ +_206=$(_206); +var _207=Object.extend({element:_206,tag:"li",dropOnEmpty:false,tree:false,overlap:"vertical",constraint:"vertical",containment:_206,handle:false,only:false,hoverclass:null,ghosting:false,format:null,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{}); +this.destroy(_206); +var _208={revert:true,ghosting:_207.ghosting,constraint:_207.constraint,handle:_207.handle}; +if(_207.starteffect){ +_208.starteffect=_207.starteffect; +} +if(_207.reverteffect){ +_208.reverteffect=_207.reverteffect; }else{ -if(_65.ghosting){ -_66.reverteffect=function(_64){ -_64.style.top=0; -_64.style.left=0; +if(_207.ghosting){ +_208.reverteffect=function(_206){ +_206.style.top=0; +_206.style.left=0; }; } } -if(_65.endeffect){ -_66.endeffect=_65.endeffect; +if(_207.endeffect){ +_208.endeffect=_207.endeffect; } -if(_65.zindex){ -_66.zindex=_65.zindex; +if(_207.zindex){ +_208.zindex=_207.zindex; } -var _67={overlap:_65.overlap,containment:_65.containment,hoverclass:_65.hoverclass,onHover:Sortable.onHover,greedy:!_65.dropOnEmpty}; +var _209={overlap:_207.overlap,containment:_207.containment,hoverclass:_207.hoverclass,onHover:Sortable.onHover,greedy:!_207.dropOnEmpty}; Element.cleanWhitespace(element); -_65.draggables=[]; -_65.droppables=[]; -if(_65.dropOnEmpty){ -Droppables.add(element,{containment:_65.containment,onHover:Sortable.onEmptyHover,greedy:false}); -_65.droppables.push(element); -} -(this.findElements(element,_65)||[]).each(function(e){ -var _69=_65.handle?Element.childrenWithClassName(e,_65.handle)[0]:e; -_65.draggables.push(new Draggable(e,Object.extend(_66,{handle:_69}))); -Droppables.add(e,_67); -_65.droppables.push(e); +_207.draggables=[]; +_207.droppables=[]; +if(_207.dropOnEmpty){ +Droppables.add(element,{containment:_207.containment,onHover:Sortable.onEmptyHover,greedy:false}); +_207.droppables.push(element); +} +(this.findElements(element,_207)||[]).each(function(e){ +var _210=_207.handle?Element.childrenWithClassName(e,_207.handle)[0]:e; +_207.draggables.push(new Draggable(e,Object.extend(_208,{handle:_210}))); +Droppables.add(e,_209); +_207.droppables.push(e); }); -this.sortables.push(_65); -Draggables.addObserver(new SortableObserver(element,_65.onUpdate)); -},findElements:function(_70,_71){ -if(!_70.hasChildNodes()){ +this.sortables.push(_207); +Draggables.addObserver(new SortableObserver(element,_207.onUpdate)); +},findElements:function(_211,_212){ +if(!_211.hasChildNodes()){ return null; } -var _72=[]; -$A(_70.childNodes).each(function(e){ -if(e.tagName&&e.tagName.toUpperCase()==_71.tag.toUpperCase()&&(!_71.only||(Element.hasClassName(e,_71.only)))){ -_72.push(e); +var _213=[]; +$A(_211.childNodes).each(function(e){ +if(e.tagName&&e.tagName.toUpperCase()==_212.tag.toUpperCase()&&(!_212.only||(Element.hasClassName(e,_212.only)))){ +_213.push(e); } -if(_71.tree){ -var _73=this.findElements(e,_71); -if(_73){ -_72.push(_73); +if(_212.tree){ +var _214=this.findElements(e,_212); +if(_214){ +_213.push(_214); } } }); -return (_72.length>0?_72.flatten():null); -},onHover:function(_74,_75,_76){ -if(_76>0.5){ -Sortable.mark(_75,"before"); -if(_75.previousSibling!=_74){ -var _77=_74.parentNode; -_74.style.visibility="hidden"; -_75.parentNode.insertBefore(_74,_75); -if(_75.parentNode!=_77){ -Sortable.options(_77).onChange(_74); -} -Sortable.options(_75.parentNode).onChange(_74); +return (_213.length>0?_213.flatten():null); +},onHover:function(_215,_216,_217){ +if(_217>0.5){ +Sortable.mark(_216,"before"); +if(_216.previousSibling!=_215){ +var _218=_215.parentNode; +_215.style.visibility="hidden"; +_216.parentNode.insertBefore(_215,_216); +if(_216.parentNode!=_218){ +Sortable.options(_218).onChange(_215); +} +Sortable.options(_216.parentNode).onChange(_215); } }else{ -Sortable.mark(_75,"after"); -var _78=_75.nextSibling||null; -if(_78!=_74){ -var _77=_74.parentNode; -_74.style.visibility="hidden"; -_75.parentNode.insertBefore(_74,_78); -if(_75.parentNode!=_77){ -Sortable.options(_77).onChange(_74); +Sortable.mark(_216,"after"); +var _219=_216.nextSibling||null; +if(_219!=_215){ +var _218=_215.parentNode; +_215.style.visibility="hidden"; +_216.parentNode.insertBefore(_215,_219); +if(_216.parentNode!=_218){ +Sortable.options(_218).onChange(_215); } -Sortable.options(_75.parentNode).onChange(_74); +Sortable.options(_216.parentNode).onChange(_215); } } -},onEmptyHover:function(_79,_80){ -if(_79.parentNode!=_80){ -var _81=_79.parentNode; -_80.appendChild(_79); -Sortable.options(_81).onChange(_79); -Sortable.options(_80).onChange(_79); +},onEmptyHover:function(_220,_221){ +if(_220.parentNode!=_221){ +var _222=_220.parentNode; +_221.appendChild(_220); +Sortable.options(_222).onChange(_220); +Sortable.options(_221).onChange(_220); } },unmark:function(){ if(Sortable._marker){ Element.hide(Sortable._marker); } -},mark:function(_82,_83){ -var _84=Sortable.options(_82.parentNode); -if(_84&&!_84.ghosting){ +},mark:function(_223,_224){ +var _225=Sortable.options(_223.parentNode); +if(_225&&!_225.ghosting){ return; } if(!Sortable._marker){ @@ -1686,41 +1682,40 @@ Element.addClassName(Sortable._marker,"dropmarker"); Sortable._marker.style.position="absolute"; document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); } -var _85=Position.cumulativeOffset(_82); -Sortable._marker.style.left=_85[0]+"px"; -Sortable._marker.style.top=_85[1]+"px"; -if(_83=="after"){ -if(_84.overlap=="horizontal"){ -Sortable._marker.style.left=(_85[0]+_82.clientWidth)+"px"; +var _226=Position.cumulativeOffset(_223); +Sortable._marker.style.left=_226[0]+"px"; +Sortable._marker.style.top=_226[1]+"px"; +if(_224=="after"){ +if(_225.overlap=="horizontal"){ +Sortable._marker.style.left=(_226[0]+_223.clientWidth)+"px"; }else{ -Sortable._marker.style.top=(_85[1]+_82.clientHeight)+"px"; +Sortable._marker.style.top=(_226[1]+_223.clientHeight)+"px"; } } Element.show(Sortable._marker); -},serialize:function(_86){ -_86=$(_86); -var _87=this.options(_86); -var _88=Object.extend({tag:_87.tag,only:_87.only,name:_86.id,format:_87.format||/^[^_]*_(.*)$/},arguments[1]||{}); -return $(this.findElements(_86,_88)||[]).map(function(_89){ -return (encodeURIComponent(_88.name)+"[]="+encodeURIComponent(_89.id.match(_88.format)?_89.id.match(_88.format)[1]:"")); +},serialize:function(_227){ +_227=$(_227); +var _228=this.options(_227); +var _229=Object.extend({tag:_228.tag,only:_228.only,name:_227.id,format:_228.format||/^[^_]*_(.*)$/},arguments[1]||{}); +return $(this.findElements(_227,_229)||[]).map(function(item){ +return (encodeURIComponent(_229.name)+"[]="+encodeURIComponent(item.id.match(_229.format)?item.id.match(_229.format)[1]:"")); }).join("&"); }}; - if(!Control){ var Control={}; } Control.Slider=Class.create(); -Control.Slider.prototype={initialize:function(_1,_2,_3){ -var _4=this; -if(_1 instanceof Array){ -this.handles=_1.collect(function(e){ +Control.Slider.prototype={initialize:function(_231,_232,_233){ +var _234=this; +if(_231 instanceof Array){ +this.handles=_231.collect(function(e){ return $(e); }); }else{ -this.handles=[$(_1)]; +this.handles=[$(_231)]; } -this.track=$(_2); -this.options=_3||{}; +this.track=$(_232); +this.options=_233||{}; this.axis=this.options.axis||"horizontal"; this.increment=this.options.increment||1; this.step=parseInt(this.options.step||"1"); @@ -1756,86 +1751,86 @@ this.eventMouseDown=this.startDrag.bindAsEventListener(this); this.eventMouseUp=this.endDrag.bindAsEventListener(this); this.eventMouseMove=this.update.bindAsEventListener(this); this.handles.each(function(h,i){ -i=_4.handles.length-1-i; -_4.setValue(parseFloat((_4.options.sliderValue instanceof Array?_4.options.sliderValue[i]:_4.options.sliderValue)||_4.range.start),i); +i=_234.handles.length-1-i; +_234.setValue(parseFloat((_234.options.sliderValue instanceof Array?_234.options.sliderValue[i]:_234.options.sliderValue)||_234.range.start),i); Element.makePositioned(h); -Event.observe(h,"mousedown",_4.eventMouseDown); +Event.observe(h,"mousedown",_234.eventMouseDown); }); Event.observe(this.track,"mousedown",this.eventMouseDown); Event.observe(document,"mouseup",this.eventMouseUp); Event.observe(document,"mousemove",this.eventMouseMove); this.initialized=true; },dispose:function(){ -var _9=this; +var _236=this; Event.stopObserving(this.track,"mousedown",this.eventMouseDown); Event.stopObserving(document,"mouseup",this.eventMouseUp); Event.stopObserving(document,"mousemove",this.eventMouseMove); this.handles.each(function(h){ -Event.stopObserving(h,"mousedown",_9.eventMouseDown); +Event.stopObserving(h,"mousedown",_236.eventMouseDown); }); },setDisabled:function(){ this.disabled=true; },setEnabled:function(){ this.disabled=false; -},getNearestValue:function(_10){ +},getNearestValue:function(_237){ if(this.allowedValues){ -if(_10>=this.allowedValues.max()){ +if(_237>=this.allowedValues.max()){ return (this.allowedValues.max()); } -if(_10<=this.allowedValues.min()){ +if(_237<=this.allowedValues.min()){ return (this.allowedValues.min()); } -var _11=Math.abs(this.allowedValues[0]-_10); -var _12=this.allowedValues[0]; +var _238=Math.abs(this.allowedValues[0]-_237); +var _239=this.allowedValues[0]; this.allowedValues.each(function(v){ -var _14=Math.abs(v-_10); -if(_14<=_11){ -_12=v; -_11=_14; +var _240=Math.abs(v-_237); +if(_240<=_238){ +_239=v; +_238=_240; } }); -return _12; +return _239; } -if(_10>this.range.end){ +if(_237>this.range.end){ return this.range.end; } -if(_100)&&(_150)&&(_241this.values[_16+1])){ -_15=this.values[_16+1]; +if((_242<(this.handles.length-1))&&(_241>this.values[_242+1])){ +_241=this.values[_242+1]; } } -_15=this.getNearestValue(_15); -this.values[_16]=_15; +_241=this.getNearestValue(_241); +this.values[_242]=_241; this.value=this.values[0]; -this.handles[_16].style[this.isVertical()?"top":"left"]=this.translateToPx(_15); +this.handles[_242].style[this.isVertical()?"top":"left"]=this.translateToPx(_241); this.drawSpans(); if(!this.dragging||!this.event){ this.updateFinished(); } -},setValueBy:function(_17,_18){ -this.setValue(this.values[_18||this.activeHandleIdx||0]+_17,_18||this.activeHandleIdx||0); -},translateToPx:function(_19){ -return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(_19-this.range.start))+"px"; -},translateToValue:function(_20){ -return ((_20/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start); -},getRange:function(_21){ +},setValueBy:function(_243,_244){ +this.setValue(this.values[_244||this.activeHandleIdx||0]+_243,_244||this.activeHandleIdx||0); +},translateToPx:function(_245){ +return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(_245-this.range.start))+"px"; +},translateToValue:function(_246){ +return ((_246/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start); +},getRange:function(_247){ var v=this.values.sortBy(Prototype.K); -_21=_21||0; -return $R(v[_21],v[_21+1]); +_247=_247||0; +return $R(v[_247],v[_247+1]); },minimumOffset:function(){ return (this.isVertical()?this.alignY:this.alignX); },maximumOffset:function(){ @@ -1843,10 +1838,10 @@ return (this.isVertical()?this.track.offsetHeight-this.alignY:this.track.offsetW },isVertical:function(){ return (this.axis=="vertical"); },drawSpans:function(){ -var _22=this; +var _248=this; if(this.spans){ $R(0,this.spans.length-1).each(function(r){ -_22.setSpan(_22.spans[r],_22.getRange(r)); +_248.setSpan(_248.spans[r],_248.getRange(r)); }); } if(this.options.startSpan){ @@ -1855,75 +1850,75 @@ this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).m if(this.options.endSpan){ this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum)); } -},setSpan:function(_24,_25){ +},setSpan:function(span,_251){ if(this.isVertical()){ -_24.style.top=this.translateToPx(_25.start); -_24.style.height=this.translateToPx(_25.end-_25.start); +span.style.top=this.translateToPx(_251.start); +span.style.height=this.translateToPx(_251.end-_251.start); }else{ -_24.style.left=this.translateToPx(_25.start); -_24.style.width=this.translateToPx(_25.end-_25.start); +span.style.left=this.translateToPx(_251.start); +span.style.width=this.translateToPx(_251.end-_251.start); } },updateStyles:function(){ this.handles.each(function(h){ Element.removeClassName(h,"selected"); }); Element.addClassName(this.activeHandle,"selected"); -},startDrag:function(_26){ -if(Event.isLeftClick(_26)){ +},startDrag:function(_252){ +if(Event.isLeftClick(_252)){ if(!this.disabled){ this.active=true; -var _27=Event.element(_26); -var _28=[Event.pointerX(_26),Event.pointerY(_26)]; -if(_27==this.track){ -var _29=Position.cumulativeOffset(this.track); -this.event=_26; -this.setValue(this.translateToValue((this.isVertical()?_28[1]-_29[1]:_28[0]-_29[0])-(this.handleLength/2))); -var _29=Position.cumulativeOffset(this.activeHandle); -this.offsetX=(_28[0]-_29[0]); -this.offsetY=(_28[1]-_29[1]); +var _253=Event.element(_252); +var _254=[Event.pointerX(_252),Event.pointerY(_252)]; +if(_253==this.track){ +var _255=Position.cumulativeOffset(this.track); +this.event=_252; +this.setValue(this.translateToValue((this.isVertical()?_254[1]-_255[1]:_254[0]-_255[0])-(this.handleLength/2))); +var _255=Position.cumulativeOffset(this.activeHandle); +this.offsetX=(_254[0]-_255[0]); +this.offsetY=(_254[1]-_255[1]); }else{ -while((this.handles.indexOf(_27)==-1)&&_27.parentNode){ -_27=_27.parentNode; +while((this.handles.indexOf(_253)==-1)&&_253.parentNode){ +_253=_253.parentNode; } -this.activeHandle=_27; +this.activeHandle=_253; this.activeHandleIdx=this.handles.indexOf(this.activeHandle); this.updateStyles(); -var _29=Position.cumulativeOffset(this.activeHandle); -this.offsetX=(_28[0]-_29[0]); -this.offsetY=(_28[1]-_29[1]); +var _255=Position.cumulativeOffset(this.activeHandle); +this.offsetX=(_254[0]-_255[0]); +this.offsetY=(_254[1]-_255[1]); } } -Event.stop(_26); +Event.stop(_252); } -},update:function(_30){ +},update:function(_256){ if(this.active){ if(!this.dragging){ this.dragging=true; } -this.draw(_30); +this.draw(_256); if(navigator.appVersion.indexOf("AppleWebKit")>0){ window.scrollBy(0,0); } -Event.stop(_30); +Event.stop(_256); } -},draw:function(_31){ -var _32=[Event.pointerX(_31),Event.pointerY(_31)]; -var _33=Position.cumulativeOffset(this.track); -_32[0]-=this.offsetX+_33[0]; -_32[1]-=this.offsetY+_33[1]; -this.event=_31; -this.setValue(this.translateToValue(this.isVertical()?_32[1]:_32[0])); +},draw:function(_257){ +var _258=[Event.pointerX(_257),Event.pointerY(_257)]; +var _259=Position.cumulativeOffset(this.track); +_258[0]-=this.offsetX+_259[0]; +_258[1]-=this.offsetY+_259[1]; +this.event=_257; +this.setValue(this.translateToValue(this.isVertical()?_258[1]:_258[0])); if(this.initialized&&this.options.onSlide){ this.options.onSlide(this.values.length>1?this.values:this.value,this); } -},endDrag:function(_34){ +},endDrag:function(_260){ if(this.active&&this.dragging){ -this.finishDrag(_34,true); -Event.stop(_34); +this.finishDrag(_260,true); +Event.stop(_260); } this.active=false; this.dragging=false; -},finishDrag:function(_35,_36){ +},finishDrag:function(_261,_262){ this.active=false; this.dragging=false; this.updateFinished(); @@ -1933,85 +1928,84 @@ this.options.onChange(this.values.length>1?this.values:this.value,this); } this.event=null; }}; - Prado.AutoCompleter=Class.create(); Prado.AutoCompleter.Base=function(){ }; -Prado.AutoCompleter.Base.prototype=Object.extend(Autocompleter.Base.prototype,{updateElement:function(_1){ +Prado.AutoCompleter.Base.prototype=Object.extend(Autocompleter.Base.prototype,{updateElement:function(_263){ if(this.options.updateElement){ -this.options.updateElement(_1); +this.options.updateElement(_263); return; } -var _2=Element.collectTextNodesIgnoreClass(_1,"informal"); -var _3=this.findLastToken(); -if(_3!=-1){ -var _4=this.element.value.substr(0,_3+1); -var _5=this.element.value.substr(_3+1).match(/^\s+/); -if(_5){ -_4+=_5[0]; +var _264=Element.collectTextNodesIgnoreClass(_263,"informal"); +var _265=this.findLastToken(); +if(_265!=-1){ +var _266=this.element.value.substr(0,_265+1); +var _267=this.element.value.substr(_265+1).match(/^\s+/); +if(_267){ +_266+=_267[0]; } -this.element.value=(_4+_2).trim(); +this.element.value=(_266+_264).trim(); }else{ -this.element.value=_2.trim(); +this.element.value=_264.trim(); } this.element.focus(); if(this.options.afterUpdateElement){ -this.options.afterUpdateElement(this.element,_1); +this.options.afterUpdateElement(this.element,_263); } }}); -Prado.AutoCompleter.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_6,_7,_8){ -this.baseInitialize(_6,_7,_8); -},onUpdateReturn:function(_9){ -if(isString(_9)&&_9.length>0){ -this.updateChoices(_9); +Prado.AutoCompleter.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(_268,_269,_270){ +this.baseInitialize(_268,_269,_270); +},onUpdateReturn:function(_271){ +if(isString(_271)&&_271.length>0){ +this.updateChoices(_271); } },getUpdatedChoices:function(){ Prado.Callback(this.element.id,this.getToken(),this.onUpdateReturn.bind(this)); }}); -Prado.ActivePanel={callbacks:{},register:function(id,_11){ -Prado.ActivePanel.callbacks[id]=_11; -},update:function(id,_12){ -var _13=new Prado.ActivePanel.Request(id,Prado.ActivePanel.callbacks[id]); -_13.callback(_12); +Prado.ActivePanel={callbacks:{},register:function(id,_272){ +Prado.ActivePanel.callbacks[id]=_272; +},update:function(id,_273){ +var _274=new Prado.ActivePanel.Request(id,Prado.ActivePanel.callbacks[id]); +_274.callback(_273); }}; Prado.ActivePanel.Request=Class.create(); -Prado.ActivePanel.Request.prototype={initialize:function(_14,_15){ -this.element=_14; -this.setOptions(_15); -},setOptions:function(_16){ +Prado.ActivePanel.Request.prototype={initialize:function(_275,_276){ +this.element=_275; +this.setOptions(_276); +},setOptions:function(_277){ this.options={onSuccess:this.onSuccess.bind(this)}; -Object.extend(this.options,_16||{}); -},callback:function(_17){ -this.options.params=[_17]; +Object.extend(this.options,_277||{}); +},callback:function(_278){ +this.options.params=[_278]; new Prado.AJAX.Callback(this.element,this.options); -},onSuccess:function(_18,_19){ +},onSuccess:function(_279,_280){ if(this.options.update){ if(!this.options.evalScripts){ -_19=_19.stripScripts(); +_280=_280.stripScripts(); } -Element.update(this.options.update,_19); +Element.update(this.options.update,_280); } }}; Prado.DropContainer=Class.create(); -Prado.DropContainer.prototype=Object.extend(new Prado.ActivePanel.Request(),{initialize:function(_20,_21){ -this.element=_20; -this.setOptions(_21); -Object.extend(this.options,{onDrop:this.onDrop.bind(this),evalScripts:true,onSuccess:_21.onSuccess||this.onSuccess.bind(this)}); -Droppables.add(_20,this.options); -},onDrop:function(_22,_23){ -this.callback(_22.id); +Prado.DropContainer.prototype=Object.extend(new Prado.ActivePanel.Request(),{initialize:function(_281,_282){ +this.element=_281; +this.setOptions(_282); +Object.extend(this.options,{onDrop:this.onDrop.bind(this),evalScripts:true,onSuccess:_282.onSuccess||this.onSuccess.bind(this)}); +Droppables.add(_281,this.options); +},onDrop:function(_283,_284){ +this.callback(_283.id); }}); Prado.ActiveImageButton=Class.create(); -Prado.ActiveImageButton.prototype={initialize:function(_24,_25){ -this.element=$(_24); -this.options=_25; +Prado.ActiveImageButton.prototype={initialize:function(_285,_286){ +this.element=$(_285); +this.options=_286; Event.observe(this.element,"click",this.click.bind(this)); },click:function(e){ var el=$("{$this->ClientID}"); -var _28=Position.cumulativeOffset(this.element); -var _29=[e.clientX,e.clientY]; -var _30=(_29[0]-_28[0]+1)+","+(_29[1]-_28[1]+1); -Prado.Callback(this.element,_30,null,this.options); +var _287=Position.cumulativeOffset(this.element); +var _288=[e.clientX,e.clientY]; +var _289=(_288[0]-_287[0]+1)+","+(_288[1]-_287[1]+1); +Prado.Callback(this.element,_289,null,this.options); Event.stop(e); }}; diff --git a/framework/Web/Javascripts/js/prado.js b/framework/Web/Javascripts/js/prado.js index 9d6ec1b7..dd33345b 100644 --- a/framework/Web/Javascripts/js/prado.js +++ b/framework/Web/Javascripts/js/prado.js @@ -2,28 +2,27 @@ var Prototype={Version:"1.4.0",ScriptFragment:"(?:)((\n|\r|.)*?)(?:]+>/gi,""); },stripScripts:function(){ return this.replace(new RegExp(Prototype.ScriptFragment,"img"),""); },extractScripts:function(){ -var _1=new RegExp(Prototype.ScriptFragment,"img"); -var _2=new RegExp(Prototype.ScriptFragment,"im"); -return (this.match(_1)||[]).map(function(_3){ -return (_3.match(_2)||["",""])[1]; +var _27=new RegExp(Prototype.ScriptFragment,"img"); +var _28=new RegExp(Prototype.ScriptFragment,"im"); +return (this.match(_27)||[]).map(function(_29){ +return (_29.match(_28)||["",""])[1]; }); },evalScripts:function(){ return this.extractScripts().map(eval); },escapeHTML:function(){ -var _4=document.createElement("div"); -var _5=document.createTextNode(this); -_4.appendChild(_5); -return _4.innerHTML; +var div=document.createElement("div"); +var _31=document.createTextNode(this); +div.appendChild(_31); +return div.innerHTML; },unescapeHTML:function(){ -var _6=document.createElement("div"); -_6.innerHTML=this.stripTags(); -return _6.childNodes[0]?_6.childNodes[0].nodeValue:""; +var div=document.createElement("div"); +div.innerHTML=this.stripTags(); +return div.childNodes[0]?div.childNodes[0].nodeValue:""; },toQueryParams:function(){ -var _7=this.match(/^\??(.*)$/)[1].split("&"); -return _7.inject({},function(_8,_9){ -var _10=_9.split("="); -_8[_10[0]]=_10[1]; -return _8; +var _32=this.match(/^\??(.*)$/)[1].split("&"); +return _32.inject({},function(_33,_34){ +var _35=_34.split("="); +_33[_35[0]]=_35[1]; +return _33; }); },toArray:function(){ return this.split(""); },camelize:function(){ -var _11=this.split("-"); -if(_11.length==1){ -return _11[0]; +var _36=this.split("-"); +if(_36.length==1){ +return _36[0]; } -var _12=this.indexOf("-")==0?_11[0].charAt(0).toUpperCase()+_11[0].substring(1):_11[0]; -for(var i=1,len=_11.length;i0?m[2]:"0")+"."+m[4]; -var num=parseFloat(_18); +var _50=m[1]+(m[2].length>0?m[2]:"0")+"."+m[4]; +var num=parseFloat(_50); return (isNaN(num)?null:num); -},toCurrency:function(_19,_20,_21){ -_19=_19||","; -_21=_21||"."; -_20=typeof (_20)=="undefined"?2:_20; -var exp=new RegExp("^\\s*([-\\+])?(((\\d+)\\"+_19+")*)(\\d+)"+((_20>0)?"(\\"+_21+"(\\d{1,"+_20+"}))?":"")+"\\s*$"); +},toCurrency:function(_51,_52,_53){ +_51=_51||","; +_53=_53||"."; +_52=typeof (_52)=="undefined"?2:_52; +var exp=new RegExp("^\\s*([-\\+])?(((\\d+)\\"+_51+")*)(\\d+)"+((_52>0)?"(\\"+_53+"(\\d{1,"+_52+"}))?":"")+"\\s*$"); var m=this.match(exp); if(m==null){ return null; } -var _22=m[2]+m[5]; -var _23=m[1]+_22.replace(new RegExp("(\\"+_19+")","g"),"")+((_20>0)?"."+m[7]:""); -var num=parseFloat(_23); +var _54=m[2]+m[5]; +var _55=m[1]+_54.replace(new RegExp("(\\"+_51+")","g"),"")+((_52>0)?"."+m[7]:""); +var num=parseFloat(_55); return (isNaN(num)?null:num); }}); - var $break=new Object(); var $continue=new Object(); -var Enumerable={each:function(_1){ -var _2=0; +var Enumerable={each:function(_56){ +var _57=0; try{ -this._each(function(_3){ +this._each(function(_58){ try{ -_1(_3,_2++); +_56(_58,_57++); } catch(e){ if(e!=$continue){ @@ -331,155 +325,154 @@ if(e!=$break){ throw e; } } -},all:function(_4){ -var _5=true; -this.each(function(_6,_7){ -_5=_5&&!!(_4||Prototype.K)(_6,_7); -if(!_5){ +},all:function(_59){ +var _60=true; +this.each(function(_61,_62){ +_60=_60&&!!(_59||Prototype.K)(_61,_62); +if(!_60){ throw $break; } }); -return _5; -},any:function(_8){ -var _9=true; -this.each(function(_10,_11){ -if(_9=!!(_8||Prototype.K)(_10,_11)){ +return _60; +},any:function(_63){ +var _64=true; +this.each(function(_65,_66){ +if(_64=!!(_63||Prototype.K)(_65,_66)){ throw $break; } }); -return _9; -},collect:function(_12){ -var _13=[]; -this.each(function(_14,_15){ -_13.push(_12(_14,_15)); +return _64; +},collect:function(_67){ +var _68=[]; +this.each(function(_69,_70){ +_68.push(_67(_69,_70)); }); -return _13; -},detect:function(_16){ -var _17; -this.each(function(_18,_19){ -if(_16(_18,_19)){ -_17=_18; +return _68; +},detect:function(_71){ +var _72; +this.each(function(_73,_74){ +if(_71(_73,_74)){ +_72=_73; throw $break; } }); -return _17; -},findAll:function(_20){ -var _21=[]; -this.each(function(_22,_23){ -if(_20(_22,_23)){ -_21.push(_22); +return _72; +},findAll:function(_75){ +var _76=[]; +this.each(function(_77,_78){ +if(_75(_77,_78)){ +_76.push(_77); } }); -return _21; -},grep:function(_24,_25){ -var _26=[]; -this.each(function(_27,_28){ -var _29=_27.toString(); -if(_29.match(_24)){ -_26.push((_25||Prototype.K)(_27,_28)); +return _76; +},grep:function(_79,_80){ +var _81=[]; +this.each(function(_82,_83){ +var _84=_82.toString(); +if(_84.match(_79)){ +_81.push((_80||Prototype.K)(_82,_83)); } }); -return _26; -},include:function(_30){ -var _31=false; -this.each(function(_32){ -if(_32==_30){ -_31=true; +return _81; +},include:function(_85){ +var _86=false; +this.each(function(_87){ +if(_87==_85){ +_86=true; throw $break; } }); -return _31; -},inject:function(_33,_34){ -this.each(function(_35,_36){ -_33=_34(_33,_35,_36); +return _86; +},inject:function(_88,_89){ +this.each(function(_90,_91){ +_88=_89(_88,_90,_91); }); -return _33; -},invoke:function(_37){ -var _38=$A(arguments).slice(1); -return this.collect(function(_39){ -return _39[_37].apply(_39,_38); +return _88; +},invoke:function(_92){ +var _93=$A(arguments).slice(1); +return this.collect(function(_94){ +return _94[_92].apply(_94,_93); }); -},max:function(_40){ -var _41; -this.each(function(_42,_43){ -_42=(_40||Prototype.K)(_42,_43); -if(_42>=(_41||_42)){ -_41=_42; +},max:function(_95){ +var _96; +this.each(function(_97,_98){ +_97=(_95||Prototype.K)(_97,_98); +if(_97>=(_96||_97)){ +_96=_97; } }); -return _41; -},min:function(_44){ -var _45; -this.each(function(_46,_47){ -_46=(_44||Prototype.K)(_46,_47); -if(_46<=(_45||_46)){ -_45=_46; +return _96; +},min:function(_99){ +var _100; +this.each(function(_101,_102){ +_101=(_99||Prototype.K)(_101,_102); +if(_101<=(_100||_101)){ +_100=_101; } }); -return _45; -},partition:function(_48){ -var _49=[],falses=[]; -this.each(function(_50,_51){ -((_48||Prototype.K)(_50,_51)?_49:falses).push(_50); +return _100; +},partition:function(_103){ +var _104=[],falses=[]; +this.each(function(_105,_106){ +((_103||Prototype.K)(_105,_106)?_104:falses).push(_105); }); -return [_49,falses]; -},pluck:function(_52){ -var _53=[]; -this.each(function(_54,_55){ -_53.push(_54[_52]); +return [_104,falses]; +},pluck:function(_107){ +var _108=[]; +this.each(function(_109,_110){ +_108.push(_109[_107]); }); -return _53; -},reject:function(_56){ -var _57=[]; -this.each(function(_58,_59){ -if(!_56(_58,_59)){ -_57.push(_58); +return _108; +},reject:function(_111){ +var _112=[]; +this.each(function(_113,_114){ +if(!_111(_113,_114)){ +_112.push(_113); } }); -return _57; -},sortBy:function(_60){ -return this.collect(function(_61,_62){ -return {value:_61,criteria:_60(_61,_62)}; -}).sort(function(_63,_64){ -var a=_63.criteria,b=_64.criteria; +return _112; +},sortBy:function(_115){ +return this.collect(function(_116,_117){ +return {value:_116,criteria:_115(_116,_117)}; +}).sort(function(left,_119){ +var a=left.criteria,b=_119.criteria; return ab?1:0; }).pluck("value"); },toArray:function(){ return this.collect(Prototype.K); },zip:function(){ -var _66=Prototype.K,args=$A(arguments); +var _120=Prototype.K,args=$A(arguments); if(typeof args.last()=="function"){ -_66=args.pop(); +_120=args.pop(); } -var _67=[this].concat(args).map($A); -return this.map(function(_68,_69){ -_66(_68=_67.pluck(_69)); -return _68; +var _121=[this].concat(args).map($A); +return this.map(function(_122,_123){ +_120(_122=_121.pluck(_123)); +return _122; }); },inspect:function(){ return "#"; }}; Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray}); - -var $A=Array.from=function(_1){ -if(!_1){ +var $A=Array.from=function(_124){ +if(!_124){ return []; } -if(_1.toArray){ -return _1.toArray(); +if(_124.toArray){ +return _124.toArray(); }else{ -var _2=[]; -for(var i=0;i<_1.length;i++){ -_2.push(_1[i]); +var _125=[]; +for(var i=0;i<_124.length;i++){ +_125.push(_124[i]); } -return _2; +return _125; } }; Object.extend(Array.prototype,Enumerable); Array.prototype._reverse=Array.prototype.reverse; -Object.extend(Array.prototype,{_each:function(_4){ +Object.extend(Array.prototype,{_each:function(_126){ for(var i=0;i"; }}; -function $H(_9){ -var _10=Object.extend({},_9||{}); -Object.extend(_10,Enumerable); -Object.extend(_10,Hash); -return _10; +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(_1,_2,_3){ -this.start=_1; -this.end=_2; -this.exclusive=_3; -},_each:function(_4){ -var _5=this.start; +Object.extend(ObjectRange.prototype,{initialize:function(_141,end,_143){ +this.start=_141; +this.end=end; +this.exclusive=_143; +},_each:function(_144){ +var _145=this.start; do{ -_4(_5); -_5=_5.succ(); -}while(this.include(_5)); -},include:function(_6){ -if(_60; -})._each(_57); -},set:function(_59){ -this.element.className=_59; -},add:function(_60){ -if(this.include(_60)){ +Element.ClassNames.prototype={initialize:function(_201){ +this.element=$(_201); +},_each:function(_202){ +this.element.className.split(/\s+/).select(function(name){ +return name.length>0; +})._each(_202); +},set:function(_204){ +this.element.className=_204; +},add:function(_205){ +if(this.include(_205)){ return; } -this.set(this.toArray().concat(_60).join(" ")); -},remove:function(_61){ -if(!this.include(_61)){ +this.set(this.toArray().concat(_205).join(" ")); +},remove:function(_206){ +if(!this.include(_206)){ return; } -this.set(this.select(function(_62){ -return _62!=_61; +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(_1,_2,_3){ -(_3?Element.addClassName:Element.removeClassName)(_1,_2); +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=_41.options[index]; -_42=opt.value; -if(!_42&&!("value" in opt)){ -_42=opt.text; +opt=_242.options[index]; +_243=opt.value; +if(!_243&&!("value" in opt)){ +_243=opt.text; } } -return [_41.name,_42]; -},selectMany:function(_43){ -var _44=new Array(); -for(var i=0;i<_43.length;i++){ -var opt=_43.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 _46=opt.value; -if(!_46&&!("value" in opt)){ -_46=opt.text; +var _247=opt.value; +if(!_247&&!("value" in opt)){ +_247=opt.text; } -_44.push(_46); +_245.push(_247); } } -return [_43.name,_44]; +return [_244.name,_245]; }}; var $F=Form.Element.getValue; Abstract.TimedObserver=function(){ }; -Abstract.TimedObserver.prototype={initialize:function(_47,_48,_49){ -this.frequency=_48; -this.element=$(_47); -this.callback=_49; +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 _50=this.getValue(); -if(this.lastValue!=_50){ -this.callback(this.element,_50); -this.lastValue=_50; +var _251=this.getValue(); +if(this.lastValue!=_251){ +this.callback(this.element,_251); +this.lastValue=_251; } }}; Form.Element.Observer=Class.create(); @@ -1002,9 +990,9 @@ return Form.serialize(this.element); }}); Abstract.EventObserver=function(){ }; -Abstract.EventObserver.prototype={initialize:function(_51,_52){ -this.element=$(_51); -this.callback=_52; +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(); @@ -1012,29 +1000,29 @@ this.registerFormCallbacks(); this.registerCallback(this.element); } },onElementEvent:function(){ -var _53=this.getValue(); -if(this.lastValue!=_53){ -this.callback(this.element,_53); -this.lastValue=_53; +var _254=this.getValue(); +if(this.lastValue!=_254){ +this.callback(this.element,_254); +this.lastValue=_254; } },registerFormCallbacks:function(){ -var _54=Form.getElements(this.element); -for(var i=0;i<_54.length;i++){ -this.registerCallback(_54[i]); +var _255=Form.getElements(this.element); +for(var i=0;i<_255.length;i++){ +this.registerCallback(_255[i]); } -},registerCallback:function(_55){ -if(_55.type){ -switch(_55.type.toLowerCase()){ +},registerCallback:function(_256){ +if(_256.type){ +switch(_256.type.toLowerCase()){ case "checkbox": case "radio": -Event.observe(_55,"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(_55,"change",this.onElementEvent.bind(this)); +Event.observe(_256,"change",this.onElementEvent.bind(this)); break; } } @@ -1047,43 +1035,42 @@ Form.EventObserver=Class.create(); Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){ 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(_1){ -return _1.target||_1.srcElement; -},isLeftClick:function(_2){ -return (((_2.which)&&(_2.which==1))||((_2.button)&&(_2.button==1))); -},pointerX:function(_3){ -return _3.pageX||(_3.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)); -},pointerY:function(_4){ -return _4.pageY||(_4.clientY+(document.documentElement.scrollTop||document.body.scrollTop)); -},stop:function(_5){ -if(_5.preventDefault){ -_5.preventDefault(); -_5.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{ -_5.returnValue=false; -_5.cancelBubble=true; +_261.returnValue=false; +_261.cancelBubble=true; } -},findElement:function(_6,_7){ -var _8=Event.element(_6); -while(_8.parentNode&&(!_8.tagName||(_8.tagName.toUpperCase()!=_7.toUpperCase()))){ -_8=_8.parentNode; +},findElement:function(_262,_263){ +var _264=Event.element(_262); +while(_264.parentNode&&(!_264.tagName||(_264.tagName.toUpperCase()!=_263.toUpperCase()))){ +_264=_264.parentNode; } -return _8; -},observers:false,_observeAndCache:function(_9,_10,_11,_12){ +return _264; +},observers:false,_observeAndCache:function(_265,name,_266,_267){ if(!this.observers){ this.observers=[]; } -if(_9.addEventListener){ -this.observers.push([_9,_10,_11,_12]); -_9.addEventListener(_10,_11,_12); +if(_265.addEventListener){ +this.observers.push([_265,name,_266,_267]); +_265.addEventListener(name,_266,_267); }else{ -if(_9.attachEvent){ -this.observers.push([_9,_10,_11,_12]); -_9.attachEvent("on"+_10,_11); +if(_265.attachEvent){ +this.observers.push([_265,name,_266,_267]); +_265.attachEvent("on"+name,_266); } } },unloadCache:function(){ @@ -1095,578 +1082,571 @@ Event.stopObserving.apply(this,Event.observers[i]); Event.observers[i][0]=null; } Event.observers=false; -},observe:function(_14,_15,_16,_17){ -var _14=$(_14); -_17=_17||false; -if(_15=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_14.attachEvent)){ -_15="keydown"; -} -this._observeAndCache(_14,_15,_16,_17); -},stopObserving:function(_18,_19,_20,_21){ -var _18=$(_18); -_21=_21||false; -if(_19=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_18.detachEvent)){ -_19="keydown"; -} -if(_18.removeEventListener){ -_18.removeEventListener(_19,_20,_21); +},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(_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(_271.removeEventListener){ +_271.removeEventListener(name,_272,_273); }else{ -if(_18.detachEvent){ -_18.detachEvent("on"+_19,_20); +if(_271.detachEvent){ +_271.detachEvent("on"+name,_272); } } }}); 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(_3,_4,_5,_6){ -if(!isList(_3)){ -return this.__observe(_3,_4,_5,_6); +},observe:function(_276,name,_277,_278){ +if(!isList(_276)){ +return this.__observe(_276,name,_277,_278); } -for(var i=0;i<_3.length;i++){ -this.__observe(_3[i],_4,_5,_6); +for(var i=0;i<_276.length;i++){ +this.__observe(_276[i],name,_277,_278); } -},__observe:function(_8,_9,_10,_11){ -var _8=$(_8); -_11=_11||false; -if(_9=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_8.attachEvent)){ -_9="keydown"; +},__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(_8,_9,_10,_11); +this._observeAndCache(_279,name,_280,_281); },keyCode:function(e){ return e.keyCode!=null?e.keyCode:e.charCode; -},isHTMLEvent:function(_13){ -var _14=["abort","blur","change","error","focus","load","reset","resize","scroll","select","submit","unload"]; -return _14.include(_13); -},isMouseEvent:function(_15){ -var _16=["click","mousedown","mousemove","mouseout","mouseover","mouseup"]; -return _16.include(_15); -},fireEvent:function(_17,_18){ +},isHTMLEvent:function(type){ +var _284=["abort","blur","change","error","focus","load","reset","resize","scroll","select","submit","unload"]; +return _284.include(type); +},isMouseEvent:function(type){ +var _285=["click","mousedown","mousemove","mouseout","mouseover","mouseup"]; +return _285.include(type); +},fireEvent:function(_286,type){ if(document.createEvent){ -if(Event.isHTMLEvent(_18)){ -var _19=document.createEvent("HTMLEvents"); -_19.initEvent(_18,true,true); +if(Event.isHTMLEvent(type)){ +var _287=document.createEvent("HTMLEvents"); +_287.initEvent(type,true,true); }else{ -if(Event.isMouseEvent(_18)){ -var _19=document.createEvent("MouseEvents"); -_19.initMouseEvent(_18,true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null); +if(Event.isMouseEvent(type)){ +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",_18); +Logger.error("undefined event",type); } return; } } -_17.dispatchEvent(_19); +_286.dispatchEvent(_287); }else{ -if(_17.fireEvent){ -_17.fireEvent("on"+_18); -_17[_18](); +if(_286.fireEvent){ +_286.fireEvent("on"+type); +_286[type](); }else{ -_17[_18](); +_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(_1){ -var _2=0,valueL=0; +},realOffset:function(_288){ +var _289=0,valueL=0; do{ -_2+=_1.scrollTop||0; -valueL+=_1.scrollLeft||0; -_1=_1.parentNode; -}while(_1); -return [valueL,_2]; -},cumulativeOffset:function(_3){ -var _4=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{ -_4+=_3.offsetTop||0; -valueL+=_3.offsetLeft||0; -_3=_3.offsetParent; -}while(_3); -return [valueL,_4]; -},positionedOffset:function(_5){ -var _6=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{ -_6+=_5.offsetTop||0; -valueL+=_5.offsetLeft||0; -_5=_5.offsetParent; -if(_5){ -p=Element.getStyle(_5,"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(_5); -return [valueL,_6]; -},offsetParent:function(_7){ -if(_7.offsetParent){ -return _7.offsetParent; +}while(_292); +return [valueL,_293]; +},offsetParent:function(_294){ +if(_294.offsetParent){ +return _294.offsetParent; } -if(_7==document.body){ -return _7; +if(_294==document.body){ +return _294; } -while((_7=_7.parentNode)&&_7!=document.body){ -if(Element.getStyle(_7,"position")!="static"){ -return _7; +while((_294=_294.parentNode)&&_294!=document.body){ +if(Element.getStyle(_294,"position")!="static"){ +return _294; } } return document.body; -},within:function(_8,x,y){ +},within:function(_295,x,y){ if(this.includeScrollOffsets){ -return this.withinIncludingScrolloffsets(_8,x,y); +return this.withinIncludingScrolloffsets(_295,x,y); } this.xcomp=x; this.ycomp=y; -this.offset=this.cumulativeOffset(_8); -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 _4=_3.firstChild||null; -if(_4&&(_4.tagName!=_1)){ -_4=_4.getElementsByTagName(_1)[0]; +var _323=_322.firstChild||null; +if(_323&&(_323.tagName!=_320)){ +_323=_323.getElementsByTagName(_320)[0]; } -if(!_4){ -_4=document.createElement(_1); +if(!_323){ +_323=document.createElement(_320); } -if(!_4){ +if(!_323){ return; } if(arguments[1]){ if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)){ -this._children(_4,arguments[1]); +this._children(_323,arguments[1]); }else{ -var _5=this._attributes(arguments[1]); -if(_5.length){ +var _324=this._attributes(arguments[1]); +if(_324.length){ try{ -_3.innerHTML="<"+_1+" "+_5+">"; +_322.innerHTML="<"+_320+" "+_324+">"; } catch(e){ } -_4=_3.firstChild||null; -if(!_4){ -_4=document.createElement(_1); +_323=_322.firstChild||null; +if(!_323){ +_323=document.createElement(_320); for(attr in arguments[1]){ -_4[attr=="class"?"className":attr]=arguments[1][attr]; +_323[attr=="class"?"className":attr]=arguments[1][attr]; } } -if(_4.tagName!=_1){ -_4=_3.getElementsByTagName(_1)[0]; +if(_323.tagName!=_320){ +_323=_322.getElementsByTagName(_320)[0]; } } } } if(arguments[2]){ -this._children(_4,arguments[2]); -} -return _4; -},_text:function(_6){ -return document.createTextNode(_6); -},_attributes:function(_7){ -var _8=[]; -for(attribute in _7){ -_8.push((attribute=="className"?"class":attribute)+"=\""+_7[attribute].toString().escapeHTML()+"\""); -} -return _8.join(" "); -},_children:function(_9,_10){ -if(typeof _10=="object"){ -_10.flatten().each(function(e){ +this._children(_323,arguments[2]); +} +return _323; +},_text:function(text){ +return document.createTextNode(text); +},_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"){ -_9.appendChild(e); +_328.appendChild(e); }else{ if(Builder._isStringOrNumber(e)){ -_9.appendChild(Builder._text(e)); +_328.appendChild(Builder._text(e)); } } }); }else{ -if(Builder._isStringOrNumber(_10)){ -_9.appendChild(Builder._text(_10)); +if(Builder._isStringOrNumber(_329)){ +_328.appendChild(Builder._text(_329)); } } -},_isStringOrNumber:function(_12){ -return (typeof _12=="string"||typeof _12=="number"); +},_isStringOrNumber:function(_330){ +return (typeof _330=="string"||typeof _330=="number"); }}; - Object.extend(Builder,{exportTags:function(){ -var _1=["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"]; -_1.each(function(_2){ -window[_2]=function(){ -var _3=$A(arguments); -if(_3.length==0){ -return Builder.node(_2,null); +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"]; +tags.each(function(tag){ +window[tag]=function(){ +var args=$A(arguments); +if(args.length==0){ +return Builder.node(tag,null); } -if(_3.length==1){ -return Builder.node(_2,_3[1]); +if(args.length==1){ +return Builder.node(tag,args[1]); } -if(_3.length>1){ -return Builder.node(_2,_3.shift(),_3); +if(args.length>1){ +return Builder.node(tag,args.shift(),args); } }; }); }}); Builder.exportTags(); - -Object.extend(Date.prototype,{SimpleFormat:function(_1,_2){ -_2=_2||{}; -var _3=new Array(); -_3["d"]=this.getDate(); -_3["dd"]=String(this.getDate()).zerofill(2); -_3["M"]=this.getMonth()+1; -_3["MM"]=String(this.getMonth()+1).zerofill(2); -if(_2.AbbreviatedMonthNames){ -_3["MMM"]=_2.AbbreviatedMonthNames[this.getMonth()]; -} -if(_2.MonthNames){ -_3["MMMM"]=_2.MonthNames[this.getMonth()]; -} -var _4=""+this.getFullYear(); -_4=(_4.length==2)?"19"+_4:_4; -_3["yyyy"]=_4; -_3["yy"]=_3["yyyy"].toString().substr(2,2); -var _5=new String(_1); -for(var _6 in _3){ -var _7=new RegExp("\\b"+_6+"\\b","g"); -_5=_5.replace(_7,_3[_6]); -} -return _5; +Object.extend(Date.prototype,{SimpleFormat:function(_334,data){ +data=data||{}; +var bits=new Array(); +bits["d"]=this.getDate(); +bits["dd"]=String(this.getDate()).zerofill(2); +bits["M"]=this.getMonth()+1; +bits["MM"]=String(this.getMonth()+1).zerofill(2); +if(data.AbbreviatedMonthNames){ +bits["MMM"]=data.AbbreviatedMonthNames[this.getMonth()]; +} +if(data.MonthNames){ +bits["MMMM"]=data.MonthNames[this.getMonth()]; +} +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(_334); +for(var sect in bits){ +var reg=new RegExp("\\b"+sect+"\\b","g"); +frm=frm.replace(reg,bits[sect]); +} +return frm; },toISODate:function(){ var y=this.getFullYear(); 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(_11,_12){ -val=String(_11); -_12=String(_12); +Object.extend(Date,{SimpleParse:function(_341,_342){ +val=String(_341); +_342=String(_342); if(val.length<=0){ return null; } -if(_12.length<=0){ -return new Date(_11); +if(_342.length<=0){ +return new Date(_341); } -var _13=function(val){ -var _15="1234567890"; +var _343=function(val){ +var _345="1234567890"; for(var i=0;i=_19;x--){ -var _22=str.substring(i,i+x); -if(_22.length<_19){ +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(_13(_22)){ -return _22; +if(_343(_350)){ +return _350; } } return null; }; -var _23=0; -var _24=0; +var _351=0; +var _352=0; var c=""; -var _26=""; -var _27=""; +var _354=""; +var _355=""; var x,y; var now=new Date(); -var _29=now.getFullYear(); -var _30=now.getMonth()+1; -var _31=1; -while(_24<_12.length){ -c=_12.charAt(_24); -_26=""; -while((_12.charAt(_24)==c)&&(_24<_12.length)){ -_26+=_12.charAt(_24++); -} -if(_26=="yyyy"||_26=="yy"||_26=="y"){ -if(_26=="yyyy"){ +var year=now.getFullYear(); +var _358=now.getMonth()+1; +var date=1; +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(_26=="yy"){ +if(_354=="yy"){ x=2; y=2; } -if(_26=="y"){ +if(_354=="y"){ x=2; y=4; } -_29=_17(val,_23,x,y); -if(_29==null){ +year=_346(val,_351,x,y); +if(year==null){ return null; } -_23+=_29.length; -if(_29.length==2){ -if(_29>70){ -_29=1900+(_29-0); +_351+=year.length; +if(year.length==2){ +if(year>70){ +year=1900+(year-0); }else{ -_29=2000+(_29-0); +year=2000+(year-0); } } }else{ -if(_26=="MM"||_26=="M"){ -_30=_17(val,_23,_26.length,2); -if(_30==null||(_30<1)||(_30>12)){ +if(_354=="MM"||_354=="M"){ +_358=_346(val,_351,_354.length,2); +if(_358==null||(_358<1)||(_358>12)){ return null; } -_23+=_30.length; +_351+=_358.length; }else{ -if(_26=="dd"||_26=="d"){ -_31=_17(val,_23,_26.length,2); -if(_31==null||(_31<1)||(_31>31)){ +if(_354=="dd"||_354=="d"){ +date=_346(val,_351,_354.length,2); +if(date==null||(date<1)||(date>31)){ return null; } -_23+=_31.length; +_351+=date.length; }else{ -if(val.substring(_23,_23+_26.length)!=_26){ +if(val.substring(_351,_351+_354.length)!=_354){ return null; }else{ -_23+=_26.length; +_351+=_354.length; } } } } } -if(_23!=val.length){ +if(_351!=val.length){ return null; } -if(_30==2){ -if(((_29%4==0)&&(_29%100!=0))||(_29%400==0)){ -if(_31>29){ +if(_358==2){ +if(((year%4==0)&&(year%100!=0))||(year%400==0)){ +if(date>29){ return null; } }else{ -if(_31>28){ +if(date>28){ return null; } } } -if((_30==4)||(_30==6)||(_30==9)||(_30==11)){ -if(_31>30){ +if((_358==4)||(_358==6)||(_358==9)||(_358==11)){ +if(date>30){ return null; } } -var _32=new Date(_29,_30-1,_31,0,0,0); -return _32; +var _360=new Date(year,_358-1,date,0,0,0); +return _360; }}); - var Prado={Version:"3.0a",Browser:function(){ -var _1={Version:"1.0"}; -var _2=parseInt(navigator.appVersion); -_1.nver=_2; -_1.ver=navigator.appVersion; -_1.agent=navigator.userAgent; -_1.dom=document.getElementById?1:0; -_1.opera=window.opera?1:0; -_1.ie5=(_1.ver.indexOf("MSIE 5")>-1&&_1.dom&&!_1.opera)?1:0; -_1.ie6=(_1.ver.indexOf("MSIE 6")>-1&&_1.dom&&!_1.opera)?1:0; -_1.ie4=(document.all&&!_1.dom&&!_1.opera)?1:0; -_1.ie=_1.ie4||_1.ie5||_1.ie6; -_1.mac=_1.agent.indexOf("Mac")>-1; -_1.ns6=(_1.dom&&parseInt(_1.ver)>=5)?1:0; -_1.ie3=(_1.ver.indexOf("MSIE")&&(_2<4)); -_1.hotjava=(_1.agent.toLowerCase().indexOf("hotjava")!=-1)?1:0; -_1.ns4=(document.layers&&!_1.dom&&!_1.hotjava)?1:0; -_1.bw=(_1.ie6||_1.ie5||_1.ie4||_1.ns4||_1.ns6||_1.opera); -_1.ver3=(_1.hotjava||_1.ie3); -_1.opera7=((_1.agent.toLowerCase().indexOf("opera 7")>-1)||(_1.agent.toLowerCase().indexOf("opera/7")>-1)); -_1.operaOld=_1.opera&&!_1.opera7; -return _1; -},ImportCss:function(_3,_4){ +var info={Version:"1.0"}; +var _362=parseInt(navigator.appVersion); +info.nver=_362; +info.ver=navigator.appVersion; +info.agent=navigator.userAgent; +info.dom=document.getElementById?1:0; +info.opera=window.opera?1:0; +info.ie5=(info.ver.indexOf("MSIE 5")>-1&&info.dom&&!info.opera)?1:0; +info.ie6=(info.ver.indexOf("MSIE 6")>-1&&info.dom&&!info.opera)?1:0; +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")&&(_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); +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,_364){ if(Prado.Browser().ie){ -var _5=_3.createStyleSheet(_4); +var _365=doc.createStyleSheet(_364); }else{ -var _6=_3.createElement("link"); -_6.rel="stylesheet"; -_6.href=_4; -if(headArr=_3.getElementsByTagName("head")){ -headArr[0].appendChild(_6); +var elm=doc.createElement("link"); +elm.rel="stylesheet"; +elm.href=_364; +if(headArr=doc.getElementsByTagName("head")){ +headArr[0].appendChild(elm); } } }}; - Prado.Focus=Class.create(); Prado.Focus.setFocus=function(id){ -var _2=document.getElementById?document.getElementById(id):document.all[id]; -if(_2&&!Prado.Focus.canFocusOn(_2)){ -_2=Prado.Focus.findTarget(_2); +var _368=document.getElementById?document.getElementById(id):document.all[id]; +if(_368&&!Prado.Focus.canFocusOn(_368)){ +_368=Prado.Focus.findTarget(_368); } -if(_2){ +if(_368){ try{ -_2.focus(); -_2.scrollIntoView(false); +_368.focus(); +_368.scrollIntoView(false); if(window.__smartNav){ -window.__smartNav.ae=_2.id; +window.__smartNav.ae=_368.id; } } catch(e){ } } }; -Prado.Focus.canFocusOn=function(_3){ -if(!_3||!(_3.tagName)){ +Prado.Focus.canFocusOn=function(_369){ +if(!_369||!(_369.tagName)){ return false; } -var _4=_3.tagName.toLowerCase(); -return !_3.disabled&&(!_3.type||_3.type.toLowerCase()!="hidden")&&Prado.Focus.isFocusableTag(_4)&&Prado.Focus.isVisible(_3); +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(_5){ -return (_5=="input"||_5=="textarea"||_5=="select"||_5=="button"||_5=="a"); +Prado.Focus.isFocusableTag=function(_371){ +return (_371=="input"||_371=="textarea"||_371=="select"||_371=="button"||_371=="a"); }; -Prado.Focus.findTarget=function(_6){ -if(!_6||!(_6.tagName)){ +Prado.Focus.findTarget=function(_372){ +if(!_372||!(_372.tagName)){ return null; } -var _7=_6.tagName.toLowerCase(); -if(_7=="undefined"){ +var _373=_372.tagName.toLowerCase(); +if(_373=="undefined"){ return null; } -var _8=_6.childNodes; -if(_8){ -for(var i=0;i<_8.length;i++){ +var _374=_372.childNodes; +if(_374){ +for(var i=0;i<_374.length;i++){ try{ -if(Prado.Focus.canFocusOn(_8[i])){ -return _8[i]; +if(Prado.Focus.canFocusOn(_374[i])){ +return _374[i]; }else{ -var _10=Prado.Focus.findTarget(_8[i]); -if(_10){ -return _10; +var _375=Prado.Focus.findTarget(_374[i]); +if(_375){ +return _375; } } } @@ -1676,68 +1656,67 @@ catch(e){ } return null; }; -Prado.Focus.isVisible=function(_11){ -var _12=_11; -while((typeof (_12)!="undefined")&&(_12!=null)){ -if(_12.disabled||(typeof (_12.style)!="undefined"&&((typeof (_12.style.display)!="undefined"&&_12.style.display=="none")||(typeof (_12.style.visibility)!="undefined"&&_12.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 (_12.parentNode)!="undefined"&&_12.parentNode!=null&&_12.parentNode!=_12&&_12.parentNode.tagName.toLowerCase()!="body"){ -_12=_12.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(_13,_14){ -var _15=$(_14["FormID"]); -var _16=true; -if(_14["CausesValidation"]&&Prado.Validation){ -if(Prado.Validation.IsValid(_15)==false){ +Prado.PostBack=function(_378,_379){ +var form=$(_379["FormID"]); +var _380=true; +if(_379["CausesValidation"]&&Prado.Validation){ +if(Prado.Validation.IsValid(form)==false){ return; } } -if(_14["PostBackUrl"]&&_14["PostBackUrl"].length>0){ -_15.action=_14["PostBackUrl"]; +if(_379["PostBackUrl"]&&_379["PostBackUrl"].length>0){ +form.action=_379["PostBackUrl"]; } -if(_14["TrackFocus"]){ -var _17=$("PRADO_LASTFOCUS"); -if(_17){ -var _18=document.activeElement; -if(_18){ -_17.value=_18.id; +if(_379["TrackFocus"]){ +var _381=$("PRADO_LASTFOCUS"); +if(_381){ +var _382=document.activeElement; +if(_382){ +_381.value=_382.id; }else{ -_17.value=_14["EventTarget"]; +_381.value=_379["EventTarget"]; } } } -$("PRADO_POSTBACK_TARGET").value=_14["EventTarget"]; -$("PRADO_POSTBACK_PARAMETER").value=_14["EventParameter"]; -Event.fireEvent(_15,"submit"); -if(_14["StopEvent"]){ -Event.stop(_13); +$("PRADO_POSTBACK_TARGET").value=_379["EventTarget"]; +$("PRADO_POSTBACK_PARAMETER").value=_379["EventParameter"]; +Event.fireEvent(form,"submit"); +if(_379["StopEvent"]){ +Event.stop(_378); } }; - -Prado.Element={setValue:function(_1,_2){ -var el=$(_1); +Prado.Element={setValue:function(_383,_384){ +var el=$(_383); if(el&&typeof (el.value)!="undefined"){ -el.value=_2; +el.value=_384; } -},select:function(_4,_5,_6){ -var el=$(_4); -var _7=_4.indexOf("[]")>-1; -if(!el&&!_7){ +},select:function(_386,_387,_388){ +var el=$(_386); +var _389=_386.indexOf("[]")>-1; +if(!el&&!_389){ return; } -_5=_7?"check"+_5:el.tagName.toLowerCase()+_5; -var _8=Prado.Element.Selection; -if(isFunction(_8[_5])){ -_8[_5](_7?_4:el,_6); +_387=_389?"check"+_387:el.tagName.toLowerCase()+_387; +var _390=Prado.Element.Selection; +if(isFunction(_390[_387])){ +_390[_387](_389?_386:el,_388); } -},click:function(_9){ -var el=$(_9); +},click:function(_391){ +var el=$(_391); if(!el){ return; } @@ -1753,25 +1732,25 @@ el.onclick(); } } } -},setAttribute:function(_11,_12,_13){ -var el=$(_11); -if(_12=="disabled"&&_13==false){ -el.removeAttribute(_12); +},setAttribute:function(_393,_394,_395){ +var el=$(_393); +if(_394=="disabled"&&_395==false){ +el.removeAttribute(_394); }else{ -el.setAttribute(_12,_13); +el.setAttribute(_394,_395); } -},setOptions:function(_14,_15){ -var el=$(_14); +},setOptions:function(_396,_397){ +var el=$(_396); if(el&&el.tagName.toLowerCase()=="select"){ while(el.length>0){ el.remove(0); } -for(var i=0;i<_15.length;i++){ -el.options[el.options.length]=new Option(_15[i][0],_15[i][1]); +for(var i=0;i<_397.length;i++){ +el.options[el.options.length]=new Option(_397[i][0],_397[i][1]); } } -},focus:function(_17){ -var obj=$(_17); +},focus:function(_398){ +var obj=$(_398); if(isObject(obj)&&isdef(obj.focus)){ setTimeout(function(){ obj.focus(); @@ -1779,22 +1758,22 @@ obj.focus(); } return false; }}; -Prado.Element.Selection={inputValue:function(el,_19){ +Prado.Element.Selection={inputValue:function(el,_400){ switch(el.type.toLowerCase()){ case "checkbox": case "radio": -return el.checked=_19; +return el.checked=_400; } -},selectValue:function(el,_20){ -$A(el.options).each(function(_21){ -_21.selected=_21.value==_20; +},selectValue:function(el,_401){ +$A(el.options).each(function(_402){ +_402.selected=_402.value==_401; }); -},selectIndex:function(el,_22){ +},selectIndex:function(el,_403){ if(el.type=="select-one"){ -el.selectedIndex=_22; +el.selectedIndex=_403; }else{ for(var i=0;i0){ -window.clipboardData.setData("Text",_20); +if(text.length>0){ +window.clipboardData.setData("Text",text); } },hover:function(obj){ obj.parentNode.className="copycode copycode_hover"; diff --git a/framework/Web/Javascripts/js/rico.js b/framework/Web/Javascripts/js/rico.js index 7cc64193..a68f5952 100644 --- a/framework/Web/Javascripts/js/rico.js +++ b/framework/Web/Javascripts/js/rico.js @@ -1793,62 +1793,61 @@ return 0; } } }}; - Prado.RicoLiveGrid=Class.create(); -Prado.RicoLiveGrid.prototype=Object.extend(Rico.LiveGrid.prototype,{initialize:function(_1,_2){ -this.options={tableClass:$(_1).className||"",loadingClass:$(_1).className||"",scrollerBorderRight:"1px solid #ababab",bufferTimeout:20000,sortAscendImg:"images/sort_asc.gif",sortDescendImg:"images/sort_desc.gif",sortImageWidth:9,sortImageHeight:5,ajaxSortURLParms:[],onRefreshComplete:null,requestParameters:null,inlineStyles:true,visibleRows:10,totalRows:0,initialOffset:0}; -Object.extend(this.options,_2||{}); -this.tableId=_1; -this.table=$(_1); +Prado.RicoLiveGrid.prototype=Object.extend(Rico.LiveGrid.prototype,{initialize:function(_391,_392){ +this.options={tableClass:$(_391).className||"",loadingClass:$(_391).className||"",scrollerBorderRight:"1px solid #ababab",bufferTimeout:20000,sortAscendImg:"images/sort_asc.gif",sortDescendImg:"images/sort_desc.gif",sortImageWidth:9,sortImageHeight:5,ajaxSortURLParms:[],onRefreshComplete:null,requestParameters:null,inlineStyles:true,visibleRows:10,totalRows:0,initialOffset:0}; +Object.extend(this.options,_392||{}); +this.tableId=_391; +this.table=$(_391); this.addLiveGridHtml(); -var _3=this.table.rows[0].cells.length; -this.metaData=new Rico.LiveGridMetaData(this.options.visibleRows,this.options.totalRows,_3,_2); +var _393=this.table.rows[0].cells.length; +this.metaData=new Rico.LiveGridMetaData(this.options.visibleRows,this.options.totalRows,_393,_392); this.buffer=new Rico.LiveGridBuffer(this.metaData); -var _4=this.table.rows.length; -this.viewPort=new Rico.GridViewPort(this.table,this.table.offsetHeight/_4,this.options.visibleRows,this.buffer,this); +var _394=this.table.rows.length; +this.viewPort=new Rico.GridViewPort(this.table,this.table.offsetHeight/_394,this.options.visibleRows,this.buffer,this); this.scroller=new Rico.LiveGridScroller(this,this.viewPort); this.options.sortHandler=this.sortHandler.bind(this); -if($(_1+"_header")){ -this.sort=new Rico.LiveGridSort(_1+"_header",this.options); +if($(_391+"_header")){ +this.sort=new Rico.LiveGridSort(_391+"_header",this.options); } this.processingRequest=null; this.unprocessedRequest=null; if(this.options.initialOffset>=0){ -var _5=this.options.initialOffset; -this.scroller.moveScroll(_5); -this.viewPort.scrollTo(this.scroller.rowToPixel(_5)); +var _395=this.options.initialOffset; +this.scroller.moveScroll(_395); +this.viewPort.scrollTo(this.scroller.rowToPixel(_395)); if(this.options.sortCol){ -this.sortCol=_2.sortCol; -this.sortDir=_2.sortDir; +this.sortCol=_392.sortCol; +this.sortDir=_392.sortDir; } -var _6=this; +var grid=this; setTimeout(function(){ -_6.requestContentRefresh(_5); +grid.requestContentRefresh(_395); },100); } -},fetchBuffer:function(_7){ -if(this.buffer.isInRange(_7)&&!this.buffer.isNearingLimit(_7)){ +},fetchBuffer:function(_397){ +if(this.buffer.isInRange(_397)&&!this.buffer.isNearingLimit(_397)){ return; } if(this.processingRequest){ -this.unprocessedRequest=new Rico.LiveGridRequest(_7); +this.unprocessedRequest=new Rico.LiveGridRequest(_397); return; } -var _8=this.buffer.getFetchOffset(_7); -this.processingRequest=new Rico.LiveGridRequest(_7); -this.processingRequest.bufferOffset=_8; -var _9=this.buffer.getFetchSize(_7); -var _10=false; -var _11={"page_size":_9,"offset":_8}; +var _398=this.buffer.getFetchOffset(_397); +this.processingRequest=new Rico.LiveGridRequest(_397); +this.processingRequest.bufferOffset=_398; +var _399=this.buffer.getFetchSize(_397); +var _400=false; +var _401={"page_size":_399,"offset":_398}; if(this.sortCol){ -Object.extend(_11,{"sort_col":this.sortCol,"sort_dir":this.sortDir}); +Object.extend(_401,{"sort_col":this.sortCol,"sort_dir":this.sortDir}); } -Prado.Callback(this.tableId,_11,this.ajaxUpdate.bind(this),this.options); +Prado.Callback(this.tableId,_401,this.ajaxUpdate.bind(this),this.options); this.timeoutHandler=setTimeout(this.handleTimedOut.bind(this),this.options.bufferTimeout); -},ajaxUpdate:function(_12,_13){ +},ajaxUpdate:function(_402,_403){ try{ clearTimeout(this.timeoutHandler); -this.buffer.update(_12,this.processingRequest.bufferOffset); +this.buffer.update(_402,this.processingRequest.bufferOffset); this.viewPort.bufferChanged(); } catch(err){ @@ -1858,42 +1857,42 @@ this.processingRequest=null; } this.processQueuedRequest(); }}); -Object.extend(Rico.LiveGridBuffer.prototype,{update:function(_14,_15){ +Object.extend(Rico.LiveGridBuffer.prototype,{update:function(_404,_405){ if(this.rows.length==0){ -this.rows=_14; +this.rows=_404; this.size=this.rows.length; -this.startPos=_15; +this.startPos=_405; return; } -if(_15>this.startPos){ -if(this.startPos+this.rows.length<_15){ -this.rows=_14; -this.startPos=_15; +if(_405>this.startPos){ +if(this.startPos+this.rows.length<_405){ +this.rows=_404; +this.startPos=_405; }else{ -this.rows=this.rows.concat(_14.slice(0,_14.length)); +this.rows=this.rows.concat(_404.slice(0,_404.length)); if(this.rows.length>this.maxBufferSize){ -var _16=this.rows.length; +var _406=this.rows.length; this.rows=this.rows.slice(this.rows.length-this.maxBufferSize,this.rows.length); -this.startPos=this.startPos+(_16-this.rows.length); +this.startPos=this.startPos+(_406-this.rows.length); } } }else{ -if(_15+_14.lengththis.maxBufferSize){ this.rows=this.rows.slice(0,this.maxBufferSize); } } -this.startPos=_15; +this.startPos=_405; } this.size=this.rows.length; }}); -Object.extend(Rico.GridViewPort.prototype,{populateRow:function(_17,row){ -if(isdef(_17)){ +Object.extend(Rico.GridViewPort.prototype,{populateRow:function(_407,row){ +if(isdef(_407)){ for(var j=0;j=parseFloat(_10))&&(parseFloat(_9)<=parseFloat(_11)); +var _85=this.attr.type; +if(undef(_85)){ +return (parseFloat(_82)>=parseFloat(_83))&&(parseFloat(_82)<=parseFloat(_84)); } -var min=this.convert(_12,_10); -var max=this.convert(_12,_11); -_9=this.convert(_12,_9); -return _9>=min&&_9<=max; +var min=this.convert(_85,_83); +var max=this.convert(_85,_84); +_82=this.convert(_85,_82); +return _82>=min&&_82<=max; }; Prado.Validation.TCompareValidator=function(){ -var _15=Prado.Validation.trim($F(this.control)); -if(_15.length==0){ +var _87=Prado.Validation.trim($F(this.control)); +if(_87.length==0){ return true; } -var _16; -var _17=$(this.attr.controlhookup); -if(_17){ -_16=Prado.Validation.trim($F(_17)); +var _88; +var _89=$(this.attr.controlhookup); +if(_89){ +_88=Prado.Validation.trim($F(_89)); }else{ -_16=isString(this.attr.valuetocompare)?this.attr.valuetocompare:""; +_88=isString(this.attr.valuetocompare)?this.attr.valuetocompare:""; } -var _18=Prado.Validation.TCompareValidator.compare; -var _19=_18.bind(this)(_15,_16); -if(_17){ -var _20=this.attr.controlcssclass; -if(isString(_20)&&_20.length>0){ -Element.condClassName(_17,_20,!_19); +var _90=Prado.Validation.TCompareValidator.compare; +var _91=_90.bind(this)(_87,_88); +if(_89){ +var _92=this.attr.controlcssclass; +if(isString(_92)&&_92.length>0){ +Element.condClassName(_89,_92,!_91); } if(undef(this.observingComparee)){ -Event.observe(_17,"change",this.validate.bind(this)); +Event.observe(_89,"change",this.validate.bind(this)); this.observingComparee=true; } } -return _19; +return _91; }; -Prado.Validation.TCompareValidator.compare=function(_21,_22){ +Prado.Validation.TCompareValidator.compare=function(_93,_94){ var op1,op2; -if((op1=this.convert(this.attr.type,_21))==null){ +if((op1=this.convert(this.attr.type,_93))==null){ return false; } if(this.attr.operator=="DataTypeCheck"){ return true; } -if((op2=this.convert(this.attr.type,_22))==null){ +if((op2=this.convert(this.attr.type,_94))==null){ return true; } switch(this.attr.operator){ @@ -502,72 +501,72 @@ return (op1==op2); Prado.Validation.TRequiredListValidator=function(){ var min=undef(this.attr.min)?Number.NEGATIVE_INFINITY:parseInt(this.attr.min); var max=undef(this.attr.max)?Number.POSITIVE_INFINITY:parseInt(this.attr.max); -var _24=document.getElementsByName(this.attr.selector); -if(_24.length<=0){ +var _96=document.getElementsByName(this.attr.selector); +if(_96.length<=0){ return true; } -var _25=new Array(); +var _97=new Array(); if(isString(this.attr.required)&&this.attr.required.length>0){ -_25=this.attr.required.split(/,\s* /); +_97=this.attr.required.split(/,\s* /); } -var _26=true; -var _27=Prado.Validation.TRequiredListValidator; -switch(_24[0].type){ +var _98=true; +var _99=Prado.Validation.TRequiredListValidator; +switch(_96[0].type){ case "radio": case "checkbox": -_26=_27.IsValidRadioList(_24,min,max,_25); +_98=_99.IsValidRadioList(_96,min,max,_97); break; case "select-multiple": -_26=_27.IsValidSelectMultipleList(_24,min,max,_25); +_98=_99.IsValidSelectMultipleList(_96,min,max,_97); break; } -var _28=this.attr.elementcssclass; -if(isString(_28)&&_28.length>0){ -map(_24,function(_29){ -condClass(_29,_28,!_26); +var _100=this.attr.elementcssclass; +if(isString(_100)&&_100.length>0){ +map(_96,function(_101){ +condClass(_101,_100,!_98); }); } if(undef(this.observingRequiredList)){ -Event.observe(_24,"change",this.validate.bind(this)); +Event.observe(_96,"change",this.validate.bind(this)); this.observingRequiredList=true; } -return _26; +return _98; }; -Prado.Validation.TRequiredListValidator.IsValidRadioList=function(_30,min,max,_31){ -var _32=0; -var _33=new Array(); -for(var i=0;i<_30.length;i++){ -if(_30[i].checked){ -_32++; -_33.push(_30[i].value); +Prado.Validation.TRequiredListValidator.IsValidRadioList=function(_102,min,max,_103){ +var _104=0; +var _105=new Array(); +for(var i=0;i<_102.length;i++){ +if(_102[i].checked){ +_104++; +_105.push(_102[i].value); } } -return Prado.Validation.TRequiredListValidator.IsValidList(_32,_33,min,max,_31); +return Prado.Validation.TRequiredListValidator.IsValidList(_104,_105,min,max,_103); }; -Prado.Validation.TRequiredListValidator.IsValidSelectMultipleList=function(_35,min,max,_36){ -var _37=0; -var _38=new Array(); -for(var i=0;i<_35.length;i++){ -var _39=_35[i]; -for(var j=0;j<_39.options.length;j++){ -if(_39.options[j].selected){ -_37++; -_38.push(_39.options[j].value); +Prado.Validation.TRequiredListValidator.IsValidSelectMultipleList=function(_106,min,max,_107){ +var _108=0; +var _109=new Array(); +for(var i=0;i<_106.length;i++){ +var _110=_106[i]; +for(var j=0;j<_110.options.length;j++){ +if(_110.options[j].selected){ +_108++; +_109.push(_110.options[j].value); } } } -return Prado.Validation.TRequiredListValidator.IsValidList(_37,_38,min,max,_36); +return Prado.Validation.TRequiredListValidator.IsValidList(_108,_109,min,max,_107); }; -Prado.Validation.TRequiredListValidator.IsValidList=function(_41,_42,min,max,_43){ -var _44=true; -if(_43.length>0){ -if(_42.length<_43.length){ +Prado.Validation.TRequiredListValidator.IsValidList=function(_112,_113,min,max,_114){ +var _115=true; +if(_114.length>0){ +if(_113.length<_114.length){ return false; } -for(var k=0;k<_43.length;k++){ -_44=_44&&_42.contains(_43[k]); +for(var k=0;k<_114.length;k++){ +_115=_115&&_113.contains(_114[k]); } } -return _44&&_41>=min&&_41<=max; +return _115&&_112>=min&&_112<=max; }; diff --git a/framework/Web/Javascripts/prado/controls.js b/framework/Web/Javascripts/prado/controls.js index 370741d4..c472c1be 100644 --- a/framework/Web/Javascripts/prado/controls.js +++ b/framework/Web/Javascripts/prado/controls.js @@ -32,9 +32,33 @@ Prado.WebUI.TButton = Prado.WebUI.createPostBackComponent(); Prado.WebUI.ClickableComponent = Prado.WebUI.createPostBackComponent( { + _elementOnClick : null, //capture the element's onclick function + onInit : function(options) { - Event.observe(this.element, "click", Prado.PostBack.bindEvent(this,options)); + if(isFunction(this.element.onclick)) + { + this._elementOnClick = this.element.onclick; + this.element.onclick = null; + } + Event.observe(this.element, "click", this.onClick.bindEvent(this,options)); + }, + + onClick : function(event, options) + { + var src = Event.element(event); + var doPostBack = true; + var onclicked = null; + if(this._elementOnClick) + { + var onclicked = this._elementOnClick(event); + if(isBoolean(onclicked)) + doPostBack = onclicked; + } + if(doPostBack) + Prado.PostBack(event,options); + if(isBoolean(onclicked) && !onclicked) + Event.stop(event); } }); @@ -49,7 +73,7 @@ Prado.WebUI.TTextBox = Prado.WebUI.createPostBackComponent( onInit : function(options) { if(options['TextMode'] != 'MultiLine') - Event.observe(this.element, "down", this.handleReturnKey.bind(this)); + Event.observe(this.element, "keydown", this.handleReturnKey.bind(this)); Event.observe(this.element, "change", Prado.PostBack.bindEvent(this,options)); }, diff --git a/tests/FunctionalTests/index.php b/tests/FunctionalTests/index.php index 47ef19ce..d104f10e 100644 --- a/tests/FunctionalTests/index.php +++ b/tests/FunctionalTests/index.php @@ -9,10 +9,11 @@ class BrowserTestConfig extends PradoTestConfig { $groups = array(); + //tests for quickstart samples $this->get_directories(dirname(__FILE__).'/quickstart_tests', $groups); - //for tests in the protected dirs - //$this->get_directories($this->tests_directory(),$groups); + //tests to verify tickets + $this->get_directories($this->tests_directory(),$groups); return $groups; } diff --git a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page index 24cb9831..e13eecf2 100644 --- a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page +++ b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page @@ -1,4 +1,4 @@ -<%@ Title="Basic I18N Test" Culture="zh_CN" %> +<%@ Title="Basic I18N Test" Application.Globalization.Culture="zh_CN" %>

    Basic I18N Test

    diff --git a/tests/FunctionalTests/protected/pages/Layout.tpl b/tests/FunctionalTests/protected/pages/Layout.tpl index 8fd64429..d58acd5d 100644 --- a/tests/FunctionalTests/protected/pages/Layout.tpl +++ b/tests/FunctionalTests/protected/pages/Layout.tpl @@ -20,9 +20,10 @@ - + - + +
    Validate XHTML 1.0 diff --git a/tests/FunctionalTests/protected/pages/UI/DatePicker.page b/tests/FunctionalTests/protected/pages/UI/DatePicker.page index c6204408..5c826a85 100644 --- a/tests/FunctionalTests/protected/pages/UI/DatePicker.page +++ b/tests/FunctionalTests/protected/pages/UI/DatePicker.page @@ -1,5 +1,4 @@ -
    @@ -43,5 +42,4 @@ d
    asd
    a
    sd
    -
    \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page index 753550d8..68b5445e 100644 --- a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page +++ b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page @@ -1,17 +1,16 @@ +<%@ Title="Test DefaultButton On Panel" %> - +

    Test DefaultButton On Panel

    This is panel content with a and two buttons:
    - - - + + +
    When you change focus to the panel and hit 'enter' key, button2 will be clicked because it is set as the default button of the panel.
    - - -
    +
    \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php index 2b0ba466..49418efd 100644 --- a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php +++ b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php @@ -26,8 +26,19 @@ class DefaultButtonTest extends SeleniumTestCase function testClick() { - $this->clickAndWait("ctl0_Content_Button2"); - $this->assertTextPresent("You have clicked on 'button2'."); + $this->verifyTitle("Test DefaultButton On Panel", ""); + $this->assertTextNotPresent("You have clicked on", ""); + $this->clickAndWait("link=button 3", ""); + $this->verifyTextPresent("You have clicked on 'button 3'.", ""); + $this->clickAndWait("//input[@type='submit' and @value='button1']", ""); + $this->verifyTextPresent("You have clicked on 'button1'. ", ""); + $this->clickAndWait("//input[@type='submit' and @value='button2']", ""); + $this->verifyTextPresent("You have clicked on 'button2'. ", ""); + $this->clickAndWait("link=button 3", ""); + $this->verifyTextPresent("You have clicked on 'button 3'. ", ""); + $this->click("ctl0_Content_check1", ""); + $this->clickAndWait("//input[@type='submit' and @value='button2']", ""); + $this->verifyTextPresent("You have clicked on 'button2'. ", ""); } } ?> \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page b/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page index f1e46544..248e0cc5 100644 --- a/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page +++ b/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page @@ -1,6 +1,4 @@ - - \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page new file mode 100644 index 00000000..31381c40 --- /dev/null +++ b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page @@ -0,0 +1,7 @@ +<%@ Title="Test Attributes.OnClick" %> + +

    Test Attributes.OnClick

    + + +
    \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php new file mode 100644 index 00000000..3d9fc840 --- /dev/null +++ b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php @@ -0,0 +1,36 @@ + + * @version $Revision: $ $Date: $ + * @package System.Web.UI.WebControls + * @since 3.0 + */ +class testOnClickAttribute extends TPage +{ + function doClick() + { + $this->clickState->setText("Post Back clicked!"); + } +} + +class OnClickAttributeTestCase extends SeleniumTestCase +{ + function test() + { + $page = Prado::getApplication()->getTestPage(__FILE__); + $this->open($page); + $this->assertTitle("Test Attributes.OnClick"); + $this->click("link=Click me"); + $this->assertConfirmation("Are you sure?"); + $this->chooseCancelOnNextConfirmation(); + $this->assertTextNotPresent("Post Back clicked!"); + $this->clickAndWait("link=Click me"); + $this->assertConfirmation("Are you sure?"); + $this->assertTextPresent("Post Back clicked!"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/CheckBox.page b/tests/FunctionalTests/protected/pages/Validation/CheckBox.page index 109710fb..0653a0c2 100644 --- a/tests/FunctionalTests/protected/pages/Validation/CheckBox.page +++ b/tests/FunctionalTests/protected/pages/Validation/CheckBox.page @@ -1,6 +1,5 @@ <%@ Title="An AutoPostBack CheckBox" %> -

    An AutoPostBack CheckBox

    @@ -33,7 +32,4 @@ Input: ID="validator1" />
    - - -
    \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page b/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page index e6b67c8d..5447b834 100644 --- a/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page +++ b/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page @@ -1,6 +1,5 @@ <%@ Title="Basic TRequiredFieldValidator" %> -

    Basic TRequiredFieldValidator Test1

    - -
    \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page new file mode 100644 index 00000000..62cf761c --- /dev/null +++ b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page @@ -0,0 +1,11 @@ +<%@ Title="InitialValue Validation Test" %> + +

    InitialValue Validation Test

    + + + + +
    \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php new file mode 100644 index 00000000..cc35accc --- /dev/null +++ b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php @@ -0,0 +1,25 @@ +getTestPage(__FILE__); + $this->open($page); + $this->assertTitle("InitialValue Validation Test"); + $this->assertNotVisible("ctl0_Content_validator1"); + $this->type("ctl0_Content_text1", "hello"); + $this->clickAndWait("ctl0_Content_submit"); + $this->assertNotVisible("ctl0_Content_validator1"); + $this->type("ctl0_Content_text1", "test"); + $this->click("ctl0_Content_submit"); + $this->assertVisible("ctl0_Content_validator1"); + } +} + +?> \ No newline at end of file -- cgit v1.2.3