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