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