loader-min.js revision 6a6ff069bf29ab249e439891f3d44bc52406f86d
YUI.add("loader",function(C){var P="base",O="css",M="js",G="cssreset",Q="cssfonts",N="cssgrids",B="cssbase",E=[G,Q,N,"cssreset-context","cssfonts-context","cssgrids-context"],J=["reset","fonts","grids","base"],T="@VERSION@",A=T+"/build/",R="-context",U={version:T,root:A,base:"http://yui.yahooapis.com/"+A,comboBase:"http://yui.yahooapis.com/combo?",modules:{dom:{requires:["event"],submodules:{"dom-base":{requires:["event"]},"dom-style":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},selector:{requires:["dom-base"]}}},node:{requires:["dom"],submodules:{"node-base":{requires:["dom-base","selector"]},"node-style":{requires:["dom-style","node-base"]},"node-screen":{requires:["dom-screen","node-base"]}}},anim:{requires:[P,"node"],submodules:{"anim-base":{requires:["base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{},"anim-scroll":{requires:["anim-base"]},"anim-xy":{requires:["anim-base","node-screen"]},"anim-node-plugin":{requires:["node","anim-base"]}}},attribute:{requires:["event"]},base:{requires:["attribute"]},compat:{requires:["node"]},cookie:{},dd:{submodules:{"dd-ddm-base":{requires:["node",P]},"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:["dd-drag"]},"dd-constrain":{requires:["dd-drag","dd-proxy"]},"dd-plugin":{requires:["dd-drag"],optional:["dd-constrain","dd-proxy"]},"dd-drop-plugin":{requires:["dd-drop"]}}},dump:{},event:{requires:["oop"]},get:{requires:["yui-base"]},io:{requires:["node"]},json:{submodules:{"json-parse":{},"json-stringify":{}}},loader:{requires:["get"]},oop:{requires:["yui-base"]},queue:{},substitute:{optional:["dump"]},yui:{supersedes:["yui-base","get","loader"]},"yui-base":{}}};var H=function(L,W,X){return L+"/"+W+"-min."+(X||O);};var F=function(){var X=U.modules;for(var W=0;W<J.length;W=W+1){var Z=J[W],Y=O+Z;X[Y]={type:O,path:H(Y,Z)};var L=Y+R;Z=Z+R;X[L]={type:O,path:H(Y,Z)};if(Y==N){X[Y].requires=[Q];X[Y].optional=[G];X[L].requires=[Q+R];X[L].optional=[G+R];}else{if(Y==B){X[Y].after=E;X[L].after=E;}}}}();C.Env.meta=U;var K=C.Lang,S=C.Env,I="_provides",V="_supersedes",D="expanded";C.Loader=function(X){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=null;this.onProgress=null;this.onTimeout=null;this.context=C;this.data=null;this.insertBefore=null;this.charset=null;this.base=C.Env.meta.base;this.comboBase=C.Env.meta.comboBase;this.combine=(!(P in X));this.ignoreRegistered=false;this.root=C.Env.meta.root;this.timeout=0;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo={};var W=C.Env.meta.modules;for(var L in W){if(W.hasOwnProperty(L)){this._internal=true;this.addModule(W[L],L);this._internal=false;}}this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.attaching=null;this.dirty=true;this.inserted={};this.skipped={};this._config(X);};C.Loader.prototype={FILTERS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_config:function(Z){if(Z){for(var W in Z){var Y=Z[W];if(Z.hasOwnProperty(W)){if(W=="require"){this.require(Y);}else{if(W=="modules"){for(var L in Y){this.addModule(Y[L],L);}}else{this[W]=Y;}}}}}var X=this.filter;if(K.isString(X)){X=X.toUpperCase();this.filterName=X;this.filter=this.FILTERS[X];}},addModule:function(b,X){X=X||b.name;b.name=X;if(!b||!b.name){return false;}if(!b.type){b.type=M;}if(!b.path&&!b.fullpath){b.path=H(X,X,b.type);}b.ext=("ext" in b)?b.ext:(this._internal)?false:true;b.requires=b.requires||[];var Z=b.submodules;if(Z){var W=[],L=0;for(var Y in Z){var a=Z[Y];a.path=H(X,Y,b.type);this.addModule(a,Y);W.push(Y);L++;}b.supersedes=W;b.rollup=Math.min(L-1,4);}this.moduleInfo[X]=b;this.dirty=true;return b;},require:function(W){var L=(typeof W==="string")?arguments:W;this.dirty=true;C.mix(this.required,C.Array.hash(L));},getRequires:function(c){if(!c){return[];}if(!this.dirty&&c.expanded){return c.expanded;}var a,b=[],L=c.requires,W=c.optional,X=this.moduleInfo,Y,Z,e;for(a=0;a<L.length;a=a+1){b.push(L[a]);Y=this.getModule(L[a]);e=this.getRequires(Y);for(Z=0;Z<e.length;Z=Z+1){b.push(e[Z]);}}L=c.supersedes;if(L){for(a=0;a<L.length;a=a+1){b.push(L[a]);Y=this.getModule(L[a]);e=this.getRequires(Y);for(Z=0;Z<e.length;Z=Z+1){b.push(e[Z]);}}}if(W&&this.loadOptional){for(a=0;a<W.length;a=a+1){b.push(W[a]);e=this.getRequires(X[W[a]]);for(Z=0;Z<e.length;Z=Z+1){b.push(e[Z]);}}}c.expanded=C.Object.keys(C.Array.hash(b));return c.expanded;},getProvides:function(X,c){var W=!(c),L=(W)?I:V,Z=this.getModule(X),Y={};if(!Z){return Y;}if(Z[L]){return Z[L];}var f=Z.supersedes,a={},d=this;var e=function(g){if(!a[g]){a[g]=true;C.mix(Y,d.getProvides(g));}};if(f){for(var b=0;b<f.length;b=b+1){e(f[b]);}}Z[V]=Y;Z[I]=C.merge(Y);Z[I][X]=true;return Z[L];},calculate:function(L){if(L||this.dirty){this._config(L);this._setup();this._explode();if(this.allowRollup){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){var Z=this.moduleInfo,X,Y,W;var L=C.merge(this.inserted);if(!this.ignoreRegistered){C.mix(L,YUI.Env.mods);}if(this.ignore){C.mix(L,C.Array.hash(this.ignore));}for(W in L){if(L.hasOwnProperty(W)){C.mix(L,this.getProvides(W));}}if(this.force){for(Y=0;Y<this.force.length;Y=Y+1){if(this.force[Y] in L){delete L[this.force[Y]];}}}this.loaded=L;},_explode:function(){var Y=this.required,W,L;for(W in Y){if(Y.hasOwnProperty(W)){L=this.getModule(W);var X=this.getRequires(L);if(X){C.mix(Y,C.Array.hash(X));}}}},getModule:function(W){var L=this.moduleInfo[W];return L;},_rollup:function(){var b,a,Z,f,e={},L=this.required,X,Y=this.moduleInfo;if(this.dirty||!this.rollups){for(b in Y){if(Y.hasOwnProperty(b)){Z=this.getModule(b);if(Z&&Z.rollup){e[b]=Z;}}}this.rollups=e;}for(;;){var W=false;for(b in e){if(!L[b]&&!this.loaded[b]){Z=this.getModule(b);f=Z.supersedes||[];X=false;if(!Z.rollup){continue;
}var d=0;for(a=0;a<f.length;a=a+1){if(this.loaded[f[a]]){X=false;break;}else{if(L[f[a]]){d++;X=(d>=Z.rollup);if(X){break;}}}}if(X){L[b]=true;W=true;this.getRequires(Z);}}}if(!W){break;}}},_reduce:function(){var X,W,Y,L,Z=this.required;for(X in Z){if(X in this.loaded){delete Z[X];}else{L=this.getModule(X);Y=L&&L.supersedes;if(Y){for(W=0;W<Y.length;W=W+1){if(Y[W] in Z){delete Z[Y[W]];}}}}}},_attach:function(){if(this.attaching){C._attach(this.attaching);}else{C._attach(this.sorted);}this._pushEvents();},_onSuccess:function(){this._attach();for(var L in this.skipped){delete this.inserted[L];}this.skipped={};var W=this.onSuccess;if(W){W.call(this.context,{msg:"success",data:this.data,success:true});}},_onFailure:function(W){this._attach();var L=this.onFailure;if(L){L.call(this.context,{msg:"failure: "+W,data:this.data,success:false});}},_onTimeout:function(){this._attach();var L=this.onTimeout;if(L){L.call(this.context,{msg:"timeout",data:this.data,success:false});}},_sort:function(){var h=C.Object.keys(this.required),W=this.moduleInfo,c=this.loaded,d=this;var i=function(l,o){var n=W[l];if(c[o]||!n){return false;}var k,b=n.expanded,m=n.after,a=W[o];if(b&&C.Array.indexOf(b,o)>-1){return true;}if(m&&C.Array.indexOf(m,o)>-1){return true;}var j=W[o]&&W[o].supersedes;if(j){for(k=0;k<j.length;k=k+1){if(i(l,j[k])){return true;}}}if(n.ext&&n.type==O&&(!a.ext)){return true;}return false;};var L=0;for(;;){var X=h.length,g,f,Z,Y,e=false;for(Z=L;Z<X;Z=Z+1){g=h[Z];for(Y=Z+1;Y<X;Y=Y+1){if(i(g,h[Y])){f=h.splice(Y,1);h.splice(Z,0,f[0]);e=true;break;}}if(e){break;}else{L=L+1;}}if(!e){break;}}this.sorted=h;},insert:function(X,W){this.calculate(X);if(!W){var L=this;this._internalCallback=function(){L._internalCallback=null;L.insert(null,M);};this.insert(null,O);return ;}this._loading=true;this._combineComplete=false;this.loadType=W;this.loadNext();},loadNext:function(b){if(!this._loading){return ;}var h,a,Y,X,L,g=this;if(this.loadType!==O&&this.combine&&(!this._combineComplete)){this._combining=[];h=this.sorted;a=h.length;L=this.comboBase;for(Y=0;Y<a;Y=Y+1){X=this.getModule(h[Y]);if(X&&X.type==M&&!X.ext){L+=this.root+X.path;if(Y<a-1){L+="&";}this._combining.push(h[Y]);}}if(this._combining.length){var d=function(l){this._combineComplete=true;var n=this._combining,j=n.length,k,f;for(k=0;k<j;k=k+1){this.inserted[n[k]]=true;}this.loadNext(l.data);};C.Get.script(L,{data:this._loading,onSuccess:d,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,context:g});return ;}else{this._combineComplete=true;}}if(b){if(b!==this._loading){return ;}this.inserted[b]=true;if(this.onProgress){this.onProgress.call(this.context,{name:b,data:this.data});}}h=this.sorted;a=h.length;for(Y=0;Y<a;Y=Y+1){if(h[Y] in this.inserted){continue;}if(h[Y]===this._loading){return ;}X=this.getModule(h[Y]);if(!X){var W="Undefined module "+h[Y]+" skipped";this.inserted[h[Y]]=true;this.skipped[h[Y]]=true;continue;}if(!this.loadType||this.loadType===X.type){this._loading=h[Y];var c=(X.type===O)?C.Get.css:C.Get.script,e=function(f){g.loadNext(f.data);};L=X.fullpath||this._url(X.path,h[Y]);g=this;c(L,{data:h[Y],onSuccess:e,insertBefore:this.insertBefore,charset:this.charset,onFailure:this._onFailure,onTimeout:this._onTimeout,timeout:this.timeout,context:g});return ;}}this._loading=null;if(this._internalCallback){var Z=this._internalCallback;this._internalCallback=null;Z.call(this);}else{this._onSuccess();}},_pushEvents:function(){if(C.Event){C.Event._load();}},_url:function(c,Z){var Y=(this.base||"")+c,a=this.filter;if(a){var W=true;if(this.filterName=="DEBUG"){var X=this,L=X.logExclude,b=X.logInclude;if(b&&!(Z in b)){W=false;}else{if(L&&(Z in L)){W=false;}}}if(W){Y=Y.replace(new RegExp(a.searchExp),a.replaceStr);}}return Y;}};},"@VERSION@");