loader-min.js revision 88f849e5723c03ee1476b48a345c791034ab5681
a63439dd5ac49dc996fe68dc5863aabb3ed430d5Luke SmithYUI.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?",skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["reset","fonts","grids","base"]},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"]},"node-event-simulate":{requires:["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-custom"]},base:{requires:["attribute"]},compat:{requires:["node","dump","substitute"]},classnamemanager:{},console:{requires:["widget","substitute"],skinnable:true},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:["event-custom"]},"event-custom":{requires:["oop"]},"event-simulate":{requires:["event"]},get:{requires:["yui-base"]},io:{submodules:{"io-base":{requires:["node"]},"io-xdr":{requires:["io-base"]},"io-form":{requires:["io-base"]},"io-upload-iframe":{requires:["io-base"]},"io-queue":{requires:["io-base"]}}},json:{submodules:{"json-parse":{},"json-stringify":{}}},loader:{requires:["get"]},"node-menunav":{requires:["node","classnamemanager"],skinnable:true},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-position","widget-position-ext","widget-stack","widget-stdmod"],skinnable:true},plugin:{requires:["base"]},profiler:{},queue:{requires:["node"]},slider:{requires:["widget","dd-constrain"],skinnable:true},stylesheet:{},substitute:{optional:["dump"]},widget:{requires:["base","node","classnamemanager"],plugins:{"widget-position":{},"widget-position-ext":{requires:["widget-position"]},"widget-stack":{skinnable:true},"widget-stdmod":{}},skinnable:true},yui:{supersedes:["yui-base","get","loader"]},"yui-base":{},test:{requires:["substitute","node","json"]}}};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={};this.skin=C.merge(C.Env.meta.skin);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"}},SKIN_PREFIX:"skin-",_config:function(Z){if(Z){for(var W in Z){if(Z.hasOwnProperty(W)){var Y=Z[W];if(W=="require"){this.require(Y);}else{if(W=="modules"){for(var L in Y){if(Y.hasOwnProperty(L)){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];}},formatSkin:function(X,L){var W=this.SKIN_PREFIX+X;if(L){W=W+"-"+L;}return W;},parseSkin:function(W){if(W.indexOf(this.SKIN_PREFIX)===0){var L=W.split("-");return{skin:L[1],module:L[2]};}return null;},_addSkin:function(d,b,c){var L=this.formatSkin(d),Y=this.moduleInfo,W=this.skin,X=Y[b]&&Y[b].ext;if(b){L=this.formatSkin(d,b);if(!Y[L]){var a=Y[b],Z=a.pkg||b;this.addModule({"name":L,"type":"css","after":W.after,"path":(c||Z)+"/"+W.base+d+"/"+b+".css","ext":X});}}return L;},addModule:function(X,W){W=W||X.name;X.name=W;if(!X||!X.name){return false;}if(!X.type){X.type=M;}if(!X.path&&!X.fullpath){X.path=H(W,W,X.type);}X.ext=("ext" in X)?X.ext:(this._internal)?false:true;X.requires=X.requires||[];this.moduleInfo[W]=X;var a=X.submodules,b;if(a){var c=[],Y=0;for(b in a){if(a.hasOwnProperty(b)){var e=a[b];e.path=H(W,b,X.type);this.addModule(e,b);c.push(b);if(X.skinnable){var d=this._addSkin(this.skin.defaultSkin,b,W);c.push(d.name);}Y++;}}X.supersedes=c;X.rollup=Math.min(Y-1,4);}var Z=X.plugins;if(Z){for(b in Z){if(Z.hasOwnProperty(b)){var L=Z[b];L.path=H(W,b,X.type);L.requires=L.requires||[];L.requires.push(W);this.addModule(L,b);if(X.skinnable){this._addSkin(this.skin.defaultSkin,b,W);}}}}this.dirty=true;return X;},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;
a63439dd5ac49dc996fe68dc5863aabb3ed430d5Luke Smith}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 b=this.moduleInfo,Z,a,Y;for(Z in b){if(b.hasOwnProperty(Z)){var W=b[Z];if(W&&W.skinnable){var c=this.skin.overrides,L;if(c&&c[Z]){for(a=0;a<c[Z].length;a=a+1){L=this._addSkin(c[Z][a],Z);}}else{L=this._addSkin(this.skin.defaultSkin,Z);}W.requires.push(L);}}}var X=C.merge(this.inserted);if(!this.ignoreRegistered){C.mix(X,YUI.Env.mods);}if(this.ignore){C.mix(X,C.Array.hash(this.ignore));}for(Y in X){if(X.hasOwnProperty(Y)){C.mix(X,this.getProvides(Y));}}if(this.force){for(a=0;a<this.force.length;a=a+1){if(this.force[a] in X){delete X[this.force[a]];}}}this.loaded=X;},_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(e.hasOwnProperty(b)){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(Z.hasOwnProperty(X)){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();var L=this.skipped;for(var W in L){if(L.hasOwnProperty(W)){delete this.inserted[W];}}this.skipped={};var X=this.onSuccess;if(X){X.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&&a.type==O){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={};this.loadType=W;this.loadNext();},loadNext:function(a){if(!this._loading){return;}var g,Z,Y,X,L,f=this,b=this.loadType,c;if(this.combine&&(!this._combineComplete[b])){this._combining=[];g=this.sorted;Z=g.length;L=this.comboBase;for(Y=0;Y<Z;Y=Y+1){X=this.getModule(g[Y]);if(X&&X.type===this.loadType&&!X.ext){L+=this.root+X.path;if(Y<Z-1){L+="&";}this._combining.push(g[Y]);}}if(this._combining.length){var d=function(l){this._combineComplete[b]=true;var n=this._combining,j=n.length,k,h;for(k=0;k<j;k=k+1){this.inserted[n[k]]=true;}this.loadNext(l.data);};c=(b===O)?C.Get.css:C.Get.script;c(this._filter(L),{data:this._loading,onSuccess:d,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,timeout:this.timeout,context:f});return;}else{this._combineComplete[b]=true;}}if(a){if(a!==this._loading){return;}this.inserted[a]=true;if(this.onProgress){this.onProgress.call(this.context,{name:a,data:this.data});}}g=this.sorted;Z=g.length;for(Y=0;Y<Z;Y=Y+1){if(g[Y] in this.inserted){continue;}if(g[Y]===this._loading){return;}X=this.getModule(g[Y]);if(!X){var W="Undefined module "+g[Y]+" skipped";this.inserted[g[Y]]=true;this.skipped[g[Y]]=true;continue;}if(!b||b===X.type){this._loading=g[Y];c=(X.type===O)?C.Get.css:C.Get.script;var e=function(h){f.loadNext(h.data);};L=(X.fullpath)?this._filter(X.fullpath):this._url(X.path,g[Y]);c(L,{data:g[Y],onSuccess:e,insertBefore:this.insertBefore,charset:this.charset,onFailure:this._onFailure,onTimeout:this._onTimeout,timeout:this.timeout,context:f});return;}}this._loading=null;c=this._internalCallback;if(c){this._internalCallback=null;c.call(this);}else{this._onSuccess();}},_pushEvents:function(){if(C.Event){C.Event._load();}},_filter:function(X){var Y=this.filter;if(X&&Y){var W=true;if(this.filterName=="DEBUG"){var L=this.logExclude,Z=this.logInclude;if(Z&&!(name in Z)){W=false;}else{if(L&&(name in L)){W=false;}}}if(W){X=X.replace(new RegExp(Y.searchExp,"g"),Y.replaceStr);
6144917bac1af010e9866655e5adc105c8ea34d3Jeff Conniff}}return X;},_url:function(W,L){return this._filter((this.base||"")+W);}};},"@VERSION@");