loader-min.js revision aca18adfbc860a76fb2e4bee2f2e1d3b89c52b1b
YUI.add("loader",function(A){(function(){YUI.Env._loaderQueue=YUI.Env._loaderQueue||new A.Queue();var u={},r=YUI.Env,z,l="base",V="css",y="js",K="cssreset",S="cssfonts",AA="cssgrids",C="cssbase",I=[K,S,AA,"cssreset-context","cssfonts-context","cssgrids-context"],Y=["reset","fonts","grids",l],Z=A.version,s=Z+"/build/",c="-context",h="anim-base",Q="attribute-base",B="base-base",v="dd-drag",f="dom",E="dataschema-base",o="datasource-local",j="dom-base",M="dom-style",G="dump",X="get",W="event-base",m="event-custom",U="event-custom-base",p="io-base",x="node",T="node-base",J="node-style",R="oop",g="pluginhost",F="selector-css2",k="substitute",P="widget",H="widget-position",q="yui-base",e="plugin",d={version:Z,root:s,base:"http://yui.yahooapis.com/"+s,comboBase:"http://yui.yahooapis.com/combo?",skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:I},modules:{dom:{requires:[R],submodules:{"dom-base":{requires:[R]},"dom-style":{requires:[j]},"dom-screen":{requires:[j,M]},"selector-native":{requires:[j]},"selector-css2":{requires:["selector-native"]},"selector":{requires:[j]}},plugins:{"selector-css3":{requires:[F]}}},node:{requires:[f,W],submodules:{"node-base":{requires:[j,F,W]},"node-style":{requires:[M,T]},"node-screen":{requires:["dom-screen",T]},"node-pluginhost":{requires:["node-base",g]}},plugins:{"node-event-simulate":{requires:[T,"event-simulate"]}}},anim:{requires:[B,x],submodules:{"anim-base":{requires:[B,J]},"anim-color":{requires:[h]},"anim-easing":{requires:[h]},"anim-scroll":{requires:[h]},"anim-xy":{requires:[h,"node-screen"]},"anim-curve":{requires:["anim-xy"]},"anim-node-plugin":{requires:["node-pluginhost",h]}}},attribute:{requires:[m],submodules:{"attribute-base":{requires:[m]},"base-complex":{requires:[Q]}}},base:{submodules:{"base-base":{requires:[Q]},"base-build":{requires:[B]},"base-pluginhost":{requires:[B,g]}}},cache:{requires:[e]},compat:{requires:[x,G,k]},classnamemanager:{requires:[q]},collection:{requires:[R]},console:{requires:[P,k],skinnable:true,plugins:{"console-filters":{requires:[e],skinnable:true}}},cookie:{requires:[q]},dataschema:{submodules:{"dataschema-base":{requires:[l]},"dataschema-array":{requires:[E]},"dataschema-json":{requires:[E,"json"]},"dataschema-text":{requires:[E]},"dataschema-xml":{requires:[E]}}},datasource:{submodules:{"datasource-local":{requires:[l]},"datasource-arrayschema":{requires:[o,e,"dataschema-array"]},"datasource-cache":{requires:[o,"cache"]},"datasource-function":{requires:[o]},"datasource-jsonschema":{requires:[o,e,"dataschema-json"]},"datasource-polling":{requires:[o]},"datasource-get":{requires:[o,X]},"datasource-textschema":{requires:[o,e,"dataschema-text"]},"datasource-io":{requires:[o,p]},"datasource-xmlschema":{requires:[o,e,"dataschema-xml"]}}},datatype:{submodules:{"datatype-date":{requires:[q]},"datatype-number":{requires:[q]},"datatype-xml":{requires:[q]}}},dd:{submodules:{"dd-ddm-base":{requires:[x,l]},"dd-ddm":{requires:["dd-ddm-base"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-ddm-drop"]},"dd-proxy":{requires:[v]},"dd-constrain":{requires:[v]},"dd-scroll":{requires:[v]},"dd-plugin":{requires:[v],optional:["dd-constrain","dd-proxy"]},"dd-drop-plugin":{requires:["dd-drop"]}}},dump:{requires:[q]},event:{expound:T,submodules:{"event-base":{expound:T,requires:[U]},"event-delegate":{requires:[W]},"event-focus":{requires:[W]},"event-key":{requires:[W]},"event-mouseenter":{requires:[W]},"event-mousewheel":{requires:[W]},"event-resize":{requires:[W]}}},"event-custom":{submodules:{"event-custom-base":{requires:[R]},"event-custom-complex":{requires:[U]}}},"event-simulate":{requires:[W]},"node-focusmanager":{requires:[x,"node-event-simulate","event-key","event-focus",e]},get:{requires:[q]},history:{requires:[x]},imageloader:{requires:[x]},io:{submodules:{"io-base":{requires:[U]},"io-xdr":{requires:[p]},"io-form":{requires:[p,T,J]},"io-upload-iframe":{requires:[p,T]},"io-queue":{requires:[p,"queue-promote"]}}},json:{submodules:{"json-parse":{requires:[q]},"json-stringify":{requires:[q]}}},loader:{requires:[X]},"node-menunav":{requires:[x,"classnamemanager",e,"node-focusmanager"],skinnable:true},oop:{requires:[q]},overlay:{requires:[P,H,"widget-position-ext","widget-stack","widget-stdmod"],skinnable:true},plugin:{requires:[B]},pluginhost:{requires:[q]},profiler:{requires:[q]},queue:{submodules:{"queue-base":{requires:[q]},"queue-run":{requires:["queue-base",m]}},plugins:{"queue-promote":{}}},slider:{requires:[P,"dd-constrain"],skinnable:true},stylesheet:{requires:[q]},substitute:{optional:[G]},widget:{requires:[l,x,"classnamemanager"],plugins:{"widget-position":{},"widget-position-ext":{requires:[H]},"widget-stack":{skinnable:true},"widget-stdmod":{}},skinnable:true},yui:{supersedes:[q,X,"queue-base"]},"yui-base":{},test:{requires:[k,x,"json","event-simulate"]}}},n=A.cached(function(L,i,AB){return L+"/"+i+"-min."+(AB||V);}),O=YUI.Env._loaderQueue,D=d.modules,t,b,a,w,N=A.Lang;for(t=0;t<Y.length;t=t+1){b=Y[t];a=V+b;D[a]={type:V,path:n(a,b)};w=a+c;b=b+c;D[w]={type:V,path:n(a,b)};if(a==AA){D[a].requires=[S];D[a].optional=[K];D[w].requires=[S+c];D[w].optional=[K+c];}else{if(a==C){D[a].after=I;D[w].after=I;}}}A.Env.meta=d;z=r._loaded;A.Loader=function(AD){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=null;this.onCSS=null;this.onProgress=null;this.onTimeout=null;this.context=A;this.data=null;this.insertBefore=null;this.charset=null;this.cssAttributes=null;this.jsAttributes=null;this.base=A.Env.meta.base;this.comboBase=A.Env.meta.comboBase;this.combine=(!(l in AD));this.ignoreRegistered=false;this.root=A.Env.meta.root;this.timeout=0;this.ignore=null;this.force=null;this.forceMap={};this.allowRollup=true;this.filter=null;this.filters={};this.required={};this.moduleInfo={};this.skin=A.merge(A.Env.meta.skin);var AC=A.Env.meta.modules,L,AB=YUI.Env.mods;this._internal=true;for(L in AC){if(AC.hasOwnProperty(L)){this.addModule(AC[L],L);
}}for(L in AB){if(AB.hasOwnProperty(L)&&!this.moduleInfo[L]&&AB[L].details){this.addModule(AB[L].details,L);}}this._internal=false;this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded=z[Z];this.attaching=null;this.dirty=true;this.inserted={};this.skipped={};this._config(AD);};A.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(AE){var AB,L,AD,AC;if(AE){for(AB in AE){if(AE.hasOwnProperty(AB)){AD=AE[AB];if(AB=="require"){this.require(AD);}else{if(AB=="modules"){for(L in AD){if(AD.hasOwnProperty(L)){this.addModule(AD[L],L);}}}else{this[AB]=AD;}}}}}AC=this.filter;if(N.isString(AC)){AC=AC.toUpperCase();this.filterName=AC;this.filter=this.FILTER_DEFS[AC];}},formatSkin:function(AB,L){var i=this.SKIN_PREFIX+AB;if(L){i=i+"-"+L;}return i;},_addSkin:function(AH,AF,AG){var L=this.formatSkin(AH),AC=this.moduleInfo,i=this.skin,AB=AC[AF]&&AC[AF].ext,AE,AD;if(AF){L=this.formatSkin(AH,AF);if(!AC[L]){AE=AC[AF];AD=AE.pkg||AF;this.addModule({"name":L,"type":"css","after":i.after,"path":(AG||AD)+"/"+i.base+AH+"/"+AF+".css","ext":AB});}}return L;},addModule:function(AC,AB){AB=AB||AC.name;AC.name=AB;if(!AC||!AC.name){return false;}if(!AC.type){AC.type=y;}if(!AC.path&&!AC.fullpath){AC.path=n(AB,AB,AC.type);}AC.ext=("ext" in AC)?AC.ext:(this._internal)?false:true;AC.requires=AC.requires||[];this.moduleInfo[AB]=AC;var AF=AC.submodules,AG,AD,AH,AJ,AI,AE,L;if(AF){AH=[];AD=0;for(AG in AF){if(AF.hasOwnProperty(AG)){AJ=AF[AG];AJ.path=n(AB,AG,AC.type);this.addModule(AJ,AG);AH.push(AG);if(AC.skinnable){AI=this._addSkin(this.skin.defaultSkin,AG,AB);AH.push(AI.name);}AD++;}}AC.supersedes=AH;AC.rollup=(AD<4)?AD:Math.min(AD-1,4);}AE=AC.plugins;if(AE){for(AG in AE){if(AE.hasOwnProperty(AG)){L=AE[AG];L.path=n(AB,AG,AC.type);L.requires=L.requires||[];L.requires.push(AB);this.addModule(L,AG);if(AC.skinnable){this._addSkin(this.skin.defaultSkin,AG,AB);}}}}this.dirty=true;return AC;},require:function(i){var L=(typeof i==="string")?arguments:i;this.dirty=true;A.mix(this.required,A.Array.hash(L));},getRequires:function(AH){if(!AH){return[];}if(!this.dirty&&AH.expanded){return AH.expanded;}var AF,AG=[],L=AH.requires,AB=AH.optional,AC=this.moduleInfo,AD,AE,AI;for(AF=0;AF<L.length;AF=AF+1){AG.push(L[AF]);AD=this.getModule(L[AF]);AI=this.getRequires(AD);for(AE=0;AE<AI.length;AE=AE+1){AG.push(AI[AE]);}}L=AH.supersedes;if(L){for(AF=0;AF<L.length;AF=AF+1){AG.push(L[AF]);AD=this.getModule(L[AF]);AI=this.getRequires(AD);for(AE=0;AE<AI.length;AE=AE+1){AG.push(AI[AE]);}}}if(AB&&this.loadOptional){for(AF=0;AF<AB.length;AF=AF+1){AG.push(AB[AF]);AI=this.getRequires(AC[AB[AF]]);for(AE=0;AE<AI.length;AE=AE+1){AG.push(AI[AE]);}}}AH.expanded=A.Object.keys(A.Array.hash(AG));return AH.expanded;},getProvides:function(i){var L=this.getModule(i),AC,AB;if(!L){return u;}if(L&&!L.provides){AC={};AB=L.supersedes;if(AB){A.Array.each(AB,function(AD){A.mix(AC,this.getProvides(AD));},this);}AC[i]=true;L.provides=AC;}return L.provides;},calculate:function(L){if(L||this.dirty){this._config(L);this._setup();this._explode();if(this.allowRollup&&!this.combine){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){var AG=this.moduleInfo,AE,AF,AD,AB,AH,AC,L;for(AE in AG){if(AG.hasOwnProperty(AE)){AB=AG[AE];if(AB&&AB.skinnable){AH=this.skin.overrides;if(AH&&AH[AE]){for(AF=0;AF<AH[AE].length;AF=AF+1){L=this._addSkin(AH[AE][AF],AE);}}else{L=this._addSkin(this.skin.defaultSkin,AE);}AB.requires.push(L);}}}AC=A.merge(this.inserted);if(!this.ignoreRegistered){A.mix(AC,r.mods);}if(this.ignore){A.mix(AC,A.Array.hash(this.ignore));}for(AD in AC){if(AC.hasOwnProperty(AD)){A.mix(AC,this.getProvides(AD));}}if(this.force){for(AF=0;AF<this.force.length;AF=AF+1){if(this.force[AF] in AC){delete AC[this.force[AF]];}}}A.mix(this.loaded,AC);},_explode:function(){var AB=this.required,L,i;A.Object.each(AB,function(AC,AD){L=this.getModule(AD);var AE=L&&L.expound;if(L){if(AE){AB[AE]=this.getModule(AE);i=this.getRequires(AB[AE]);A.mix(AB,A.Array.hash(i));}i=this.getRequires(L);A.mix(AB,A.Array.hash(i));}},this);},getModule:function(i){var L=this.moduleInfo[i];return L;},_rollup:function(){var AG,AF,AE,AJ,AI={},L=this.required,AC,AD=this.moduleInfo,AB,AH;if(this.dirty||!this.rollups){for(AG in AD){if(AD.hasOwnProperty(AG)){AE=this.getModule(AG);if(AE&&AE.rollup){AI[AG]=AE;}}}this.rollups=AI;this.forceMap=(this.force)?A.Array.hash(this.force):{};}for(;;){AB=false;for(AG in AI){if(AI.hasOwnProperty(AG)){if(!L[AG]&&((!this.loaded[AG])||this.forceMap[AG])){AE=this.getModule(AG);AJ=AE.supersedes||[];AC=false;if(!AE.rollup){continue;}AH=0;for(AF=0;AF<AJ.length;AF=AF+1){if(this.loaded[AJ[AF]]&&!this.forceMap[AJ[AF]]){AC=false;break;}else{if(L[AJ[AF]]){AH++;AC=(AH>=AE.rollup);if(AC){break;}}}}if(AC){L[AG]=true;AB=true;this.getRequires(AE);}}}}if(!AB){break;}}},_reduce:function(){var AC,AB,AD,L,AE=this.required;for(AC in AE){if(AE.hasOwnProperty(AC)){if(this.loaded[AC]&&(!this.forceMap[AC])&&!this.ignoreRegistered){delete AE[AC];}else{L=this.getModule(AC);AD=L&&L.supersedes;if(AD){for(AB=0;AB<AD.length;AB=AB+1){if(AD[AB] in AE){delete AE[AD[AB]];}}}}}}},_attach:function(){if(this.attaching){A._attach(this.attaching);}else{A._attach(this.sorted);}},_finish:function(){O.running=false;this._continue();},_onSuccess:function(){this._attach();var L=this.skipped,AB,AC;for(AB in L){if(L.hasOwnProperty(AB)){delete this.inserted[AB];}}this.skipped={};AC=this.onSuccess;if(AC){AC.call(this.context,{msg:"success",data:this.data,success:true});}this._finish();},_onFailure:function(i){this._attach();var L=this.onFailure;if(L){L.call(this.context,{msg:"failure: "+i.msg,data:this.data,success:false});}this._finish();},_onTimeout:function(){this._attach();var L=this.onTimeout;if(L){L.call(this.context,{msg:"timeout",data:this.data,success:false});}this._finish();},_sort:function(){var AL=A.Object.keys(this.required),AB=this.moduleInfo,AG=this.loaded,AF={},L=0,AC,AJ,AI,AE,AD,AH,i,AK=A.cached(function(AS,AQ){var AN=AB[AS],AO,AR,AT,AM,AP;
if(AG[AQ]||!AN){return false;}AR=AN.expanded;AT=AN.after;AM=AB[AQ];if(AR&&A.Array.indexOf(AR,AQ)>-1){return true;}if(AT&&A.Array.indexOf(AT,AQ)>-1){return true;}AP=AB[AQ]&&AB[AQ].supersedes;if(AP){for(AO=0;AO<AP.length;AO=AO+1){if(AK(AS,AP[AO])){return true;}}}if(AN.ext&&AN.type==V&&!AM.ext&&AM.type==V){return true;}return false;});for(;;){AC=AL.length;AH=false;for(AE=L;AE<AC;AE=AE+1){AJ=AL[AE];for(AD=AE+1;AD<AC;AD=AD+1){i=AJ+AL[AD];if(!AF[i]&&AK(AJ,AL[AD])){AI=AL.splice(AD,1);AL.splice(AE,0,AI[0]);AF[i]=true;AH=true;break;}}if(AH){break;}else{L=L+1;}}if(!AH){break;}}this.sorted=AL;},_insert:function(AB,AC,i){if(AB){this._config(AB);}this.calculate(AC);if(!i){var L=this;this._internalCallback=function(){var AD=L.onCSS;if(AD){AD.call(L.context,A);}L._internalCallback=null;L._insert(null,null,y);};this._insert(null,null,V);return;}this._loading=true;this._combineComplete={};this.loadType=i;this.loadNext();},_continue:function(){if(!(O.running)&&O.size()>0){O.running=true;O.next()();}},insert:function(AB,i){var L=this,AC;AC=A.merge(this,true);delete AC.require;delete AC.dirty;O.add(function(){L._insert(AC,AB,i);});this._continue();},loadNext:function(AG){if(!this._loading){return;}var AM,AE,AD,AC,L,AL=this,AH=this.loadType,AI,AB,AF,AJ=function(AP){this._combineComplete[AH]=true;var AQ=this._combining,AN=AQ.length,AO;for(AO=0;AO<AN;AO=AO+1){this.inserted[AQ[AO]]=true;}this.loadNext(AP.data);},AK=function(i){AL.loadNext(i.data);};if(this.combine&&(!this._combineComplete[AH])){this._combining=[];AM=this.sorted;AE=AM.length;L=this.comboBase;for(AD=0;AD<AE;AD=AD+1){AC=this.getModule(AM[AD]);if(AC&&AC.type===this.loadType&&!AC.ext){L+=this.root+AC.path;if(AD<AE-1){L+="&";}this._combining.push(AM[AD]);}}if(this._combining.length){if(this.loadType===V){AI=A.Get.css;AF=this.cssAttributes;}else{AI=A.Get.script;AF=this.jsAttributes;}AI(this._filter(L),{data:this._loading,onSuccess:AJ,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,attributes:AF,timeout:this.timeout,autopurge:false,context:AL});return;}else{this._combineComplete[AH]=true;}}if(AG){if(AG!==this._loading){return;}this.inserted[AG]=true;this.loaded[AG]=true;if(this.onProgress){this.onProgress.call(this.context,{name:AG,data:this.data});}}AM=this.sorted;AE=AM.length;for(AD=0;AD<AE;AD=AD+1){if(AM[AD] in this.inserted){continue;}if(AM[AD]===this._loading){return;}AC=this.getModule(AM[AD]);if(!AC){AB="Undefined module "+AM[AD]+" skipped";this.inserted[AM[AD]]=true;this.skipped[AM[AD]]=true;continue;}if(!AH||AH===AC.type){this._loading=AM[AD];if(AC.type===V){AI=A.Get.css;AF=this.cssAttributes;}else{AI=A.Get.script;AF=this.jsAttributes;}L=(AC.fullpath)?this._filter(AC.fullpath,AM[AD]):this._url(AC.path,AM[AD]);AI(L,{data:AM[AD],onSuccess:AK,insertBefore:this.insertBefore,charset:this.charset,attributes:AF,onFailure:this._onFailure,onTimeout:this._onTimeout,timeout:this.timeout,autopurge:false,context:AL});return;}}this._loading=null;AI=this._internalCallback;if(AI){this._internalCallback=null;AI.call(this);}else{this._onSuccess();}},_filter:function(AB,i){var AD=this.filter,L=i&&(i in this.filters),AC=L&&this.filters[i];if(AB){if(L){AD=(N.isString(AC))?this.FILTER_DEFS[AC.toUpperCase()]||null:AC;}if(AD){AB=AB.replace(new RegExp(AD.searchExp,"g"),AD.replaceStr);}}return AB;},_url:function(i,L){return this._filter((this.base||"")+i,L);}};})();},"@VERSION@");