loader-base-min.js revision 61d446e861d5d0c0efea5adc3d2c706ebd466688
YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var H=d.version,D="/build/",E=H+D,C=d.Env.base,z="gallery-2010.08.11-20-39",B="2in3",A="3",y="2.8.1",F=C+"combo?",G={version:H,root:E,base:d.Env.base,comboBase:F,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},x=G.groups,w=function(J,K){var I=B+"."+(J||A)+"/"+(K||y)+D;x.yui2.base=C+I;x.yui2.root=I;},v=function(I){var J=(I||z)+D;x.gallery.base=C+J;x.gallery.root=J;};x[H]={};x.gallery={ext:false,combine:true,comboBase:F,update:v,patterns:{"gallery-":{},"gallerycss-":{type:"css"}}};x.yui2={combine:true,ext:false,comboBase:F,update:w,patterns:{"yui2-":{configFn:function(I){if(/-skin|reset|fonts|grids|base/.test(I.name)){I.type="css";I.path=I.path.replace(/\.js/,".css");I.path=I.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};v();w();YUI.Env[H]=G;}());}var f={},c=[],m=(d.UA.ie)?2048:8192,a=YUI.Env,p=a._loaded,q="css",k="js",u="intl",r=d.version,t="",e=d.Object,j=d.Array,h=a._loaderQueue,s=a[r],b="skin-",i=d.Lang,n=a.mods,l,o,g=function(w,x,y,v){var z=w+"/"+x;if(!v){z+="-min";}z+="."+(y||q);return z;};d.Env.meta=s;d.Loader=function(x){var w=s.modules,v=this;l=s.md5;v.context=d;v.base=d.Env.meta.base;v.comboBase=d.Env.meta.comboBase;v.combine=x.base&&(x.base.indexOf(v.comboBase.substr(0,20))>-1);v.maxURLLength=m;v.root=d.Env.meta.root;v.timeout=0;v.forceMap={};v.allowRollup=true;v.filters={};v.required={};v.patterns={};v.moduleInfo={};v.groups=d.merge(d.Env.meta.groups);v.skin=d.merge(d.Env.meta.skin);v.conditions={};v.config=x;v._internal=true;o=a._renderedMods;if(o){v.moduleInfo=d.merge(o);o=a._conditions;v.conditions=d.merge(o);}else{e.each(w,v.addModule,v);}if(!a._renderedMods){a._renderedMods=d.merge(v.moduleInfo);a._conditions=d.merge(v.conditions);}v._internal=false;v._config(x);v.sorted=[];v.loaded=p[r];v.dirty=true;v.inserted={};v.skipped={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_requires:function(C,B){var y,A,v,D,E,w=this.moduleInfo,x=w[C],z=w[B];if(!x||!z){return false;}A=x.expanded_map;v=x.after;D=x.after_map;if(A&&(B in A)){return true;}if(D&&(B in D)){return true;}else{if(v&&j.indexOf(v,B)>-1){return true;}}E=w[B]&&w[B].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(C,E[y])){return true;}}}if(x.ext&&x.type==q&&!z.ext&&z.type==q){return true;}return false;},_config:function(B){var x,w,A,y,z,C,v=this;if(B){for(x in B){if(B.hasOwnProperty(x)){A=B[x];if(x=="require"){v.require(A);}else{if(x=="skin"){d.mix(v.skin,B[x],true);}else{if(x=="groups"){for(w in A){if(A.hasOwnProperty(w)){C=w;z=A[w];v.addGroup(z,C);}}}else{if(x=="modules"){e.each(A,v.addModule,v);}else{if(x=="gallery"){this.groups.gallery.update(A);}else{if(x=="yui2"||x=="2in3"){this.groups.yui2.update(B["2in3"],B.yui2);}else{if(x=="maxURLLength"){v[x]=Math.min(m,A);}else{v[x]=A;}}}}}}}}}}y=v.filter;if(i.isString(y)){y=y.toUpperCase();v.filterName=y;v.filter=v.FILTER_DEFS[y];if(y=="DEBUG"){v.require("yui-log","dump");}}},formatSkin:function(x,v){var w=b+x;if(v){w=w+"-"+v;}return w;},_addSkin:function(D,B,C){var A,z,v,y=this.moduleInfo,w=this.skin,x=y[B]&&y[B].ext;if(B){v=this.formatSkin(D,B);if(!y[v]){A=y[B];z=A.pkg||B;this.addModule({name:v,group:A.group,type:"css",after:w.after,after_map:j.hash(w.after),path:(C||z)+"/"+w.base+D+"/"+B+".css",ext:x});}}return v;},addGroup:function(y,w){var x=y.modules,v=this;w=w||y.name;y.name=w;v.groups[w]=y;if(y.patterns){e.each(y.patterns,function(A,z){A.group=w;v.patterns[z]=A;});}if(x){e.each(x,function(A,z){A.group=w;v.addModule(A,z);},v);}},addModule:function(J,Q){Q=Q||J.name;J.name=Q;if(!J||!J.name){return null;}if(!J.type){J.type=k;}if(!J.path&&!J.fullpath){J.path=g(Q,Q,J.type);}J.ext=("ext" in J)?J.ext:(this._internal)?false:true;J.requires=J.requires||[];var N=J.submodules,M,K,v,G,x,I,w,L,H,E,B,z,y,P,O,F,A,C=this.conditions,D;this.moduleInfo[Q]=J;if(!J.langPack&&J.lang){H=j(J.lang);for(L=0;L<H.length;L++){P=H[L];E=this.getLangPackName(P,Q);x=this.moduleInfo[E];if(!x){x=this._addLangPack(P,J,E);}}}if(N){v=J.supersedes||[];K=0;for(M in N){if(N.hasOwnProperty(M)){G=N[M];G.path=G.path||g(Q,M,J.type);G.pkg=Q;G.group=J.group;if(G.supersedes){v=v.concat(G.supersedes);}x=this.addModule(G,M);v.push(M);if(x.skinnable){J.skinnable=true;F=this.skin.overrides;if(F&&F[M]){for(L=0;L<F[M].length;L++){A=this._addSkin(F[M][L],M,Q);v.push(A);}}A=this._addSkin(this.skin.defaultSkin,M,Q);v.push(A);}if(G.lang&&G.lang.length){H=j(G.lang);for(L=0;L<H.length;L++){P=H[L];E=this.getLangPackName(P,Q);B=this.getLangPackName(P,M);x=this.moduleInfo[E];if(!x){x=this._addLangPack(P,J,E);}z=z||j.hash(x.supersedes);if(!(B in z)){x.supersedes.push(B);}J.lang=J.lang||[];y=y||j.hash(J.lang);if(!(P in y)){J.lang.push(P);}}}K++;}}J.supersedes=e.keys(j.hash(v));J.rollup=(K<4)?K:Math.min(K-1,4);}I=J.plugins;if(I){for(M in I){if(I.hasOwnProperty(M)){w=I[M];w.pkg=Q;w.path=w.path||g(Q,M,J.type);w.requires=w.requires||[];w.group=J.group;this.addModule(w,M);if(J.skinnable){this._addSkin(this.skin.defaultSkin,M,Q);}}}}if(J.condition){D=J.condition.trigger;C[D]=C[D]||{};C[D][Q]=J.condition;}if(J.configFn){O=J.configFn(J);if(O===false){delete this.moduleInfo[Q];J=null;}}return J;},require:function(w){var v=(typeof w==="string")?arguments:w;this.dirty=true;d.mix(this.required,j.hash(v));},getRequires:function(K){if(!K||K._parsed){return c;}var G,C,E,L,w,A,x=K.name,J,D,z=n[x]&&n[x].details,I=[],v=K.requires,y=K.optional,H=K.lang||K.intl,B=this.moduleInfo,F={};if(K.temp&&z){delete K.expanded;delete K.temp;if(z.requires){K.requires=K.requires.concat(z.requires);}if(z.optional){K.optional=(K.optional)?K.optional.concat(z.optional):z.optional;}}if(K.expanded&&(!K.langCache||K.langCache==this.lang)){return K.expanded;}K._parsed=true;for(G=0;G<v.length;G++){if(!F[v[G]]){I.push(v[G]);F[v[G]]=true;C=this.getModule(v[G]);
if(C){L=this.getRequires(C);H=H||(C.expanded_map&&(u in C.expanded_map));for(E=0;E<L.length;E++){I.push(L[E]);}}}}v=K.supersedes;if(v){for(G=0;G<v.length;G++){if(!F[v[G]]){if(K.submodules){I.push(v[G]);}F[v[G]]=true;C=this.getModule(v[G]);if(C){L=this.getRequires(C);H=H||(C.expanded_map&&(u in C.expanded_map));for(E=0;E<L.length;E++){I.push(L[E]);}}}}}if(y&&this.loadOptional){for(G=0;G<y.length;G++){if(!F[y[G]]){I.push(y[G]);F[y[G]]=true;C=B[y[G]];L=this.getRequires(C);H=H||(C.expanded_map&&(u in C.expanded_map));for(E=0;E<L.length;E++){I.push(L[E]);}}}}J=this.conditions[x];if(J){e.each(J,function(N,M){if(!F[M]){D=N&&((N.ua&&d.UA[N.ua])||(N.test&&N.test(d,v)));if(D){F[M]=true;I.push(M);C=this.getModule(M);if(C){L=this.getRequires(C);for(E=0;E<L.length;E++){I.push(L[E]);}}}}},this);}K._parsed=false;if(H){if(K.lang&&!K.langPack&&d.Intl){A=d.Intl.lookupBestLang(this.lang||t,K.lang);K.langCache=this.lang;w=this.getLangPackName(A,x);if(w){I.unshift(w);}}I.unshift(u);}K.expanded_map=j.hash(I);K.expanded=e.keys(K.expanded_map);return K.expanded;},getProvides:function(w){var v=this.getModule(w),y,x;if(!v){return f;}if(v&&!v.provides){y={};x=v.supersedes;if(x){j.each(x,function(z){d.mix(y,this.getProvides(z));},this);}y[w]=true;v.provides=y;}return v.provides;},calculate:function(w,v){if(w||v||this.dirty){if(w){this._config(w);}if(!this._init){this._setup();}this._explode();if(this.allowRollup){this._rollup();}this._reduce();this._sort();}},_addLangPack:function(A,v,z){var x=v.name,w,y=this.moduleInfo[z];if(!y){w=g((v.pkg||x),z,k,true);this.addModule({path:w,intl:true,langPack:true,ext:v.ext,group:v.group,supersedes:[]},z,true);if(A){d.Env.lang=d.Env.lang||{};d.Env.lang[A]=d.Env.lang[A]||{};d.Env.lang[A][x]=true;}}return this.moduleInfo[z];},_setup:function(){var y=this.moduleInfo,w,C,B,z,x,A,D,v;for(w in y){if(y.hasOwnProperty(w)){z=y[w];if(z){if(z.skinnable){x=this.skin.overrides;if(x&&x[w]){for(C=0;C<x[w].length;C++){D=this._addSkin(x[w][C],w);z.requires.push(D);}}else{D=this._addSkin(this.skin.defaultSkin,w);z.requires.push(D);}}z.requires=e.keys(j.hash(z.requires));if(z.lang&&z.lang.length){v=this.getLangPackName(t,w);this._addLangPack(null,z,v);}}}}A={};if(!this.ignoreRegistered){d.mix(A,a.mods);}if(this.ignore){d.mix(A,j.hash(this.ignore));}for(B in A){if(A.hasOwnProperty(B)){d.mix(A,this.getProvides(B));}}if(this.force){for(C=0;C<this.force.length;C++){if(this.force[C] in A){delete A[this.force[C]];}}}d.mix(this.loaded,A);this._init=true;},getLangPackName:function(w,v){return("lang/"+v+((w)?"_"+w:""));},_explode:function(){var z=this.required,v,y,w={},x=this;x.dirty=false;e.each(z,function(A,B){if(!w[B]){w[B]=true;v=x.getModule(B);if(v){var C=v.expound;if(C){z[C]=x.getModule(C);y=x.getRequires(z[C]);d.mix(z,j.hash(y));}y=x.getRequires(v);d.mix(z,j.hash(y));}}});},getModule:function(A){if(!A){return null;}var z,y,w,v=this.moduleInfo[A],x=this.patterns;if(!v){for(w in x){if(x.hasOwnProperty(w)){z=x[w];if(A.indexOf(w)>-1){y=z;break;}}}if(y){if(z.action){z.action.call(this,A,w);}else{v=this.addModule(d.merge(y),A);v.temp=true;}}}return v;},_rollup:function(){},_reduce:function(A){A=A||this.required;var x,w,z,v,y=this.loadType;for(x in A){if(A.hasOwnProperty(x)){v=this.getModule(x);if(((this.loaded[x]||n[x])&&!this.forceMap[x]&&!this.ignoreRegistered)||(y&&v&&v.type!=y)){delete A[x];}z=v&&v.supersedes;if(z){for(w=0;w<z.length;w++){if(z[w] in A){delete A[z[w]];}}}}}return A;},_finish:function(x,w){h.running=false;var v=this.onEnd;if(v){v.call(this.context,{msg:x,data:this.data,success:w});}this._continue();},_onSuccess:function(){var v=d.merge(this.skipped),w;e.each(v,function(x){delete this.inserted[x];},this);this.skipped={};e.each(this.inserted,function(y,x){d.mix(this.loaded,this.getProvides(x));},this);w=this.onSuccess;if(w){w.call(this.context,{msg:"success",data:this.data,success:true,skipped:v});}this._finish("success",true);},_onFailure:function(x){var v=this.onFailure,w="failure: "+x.msg;if(v){v.call(this.context,{msg:w,data:this.data,success:false});}this._finish(w,false);},_onTimeout:function(){var v=this.onTimeout;if(v){v.call(this.context,{msg:"timeout",data:this.data,success:false});}this._finish("timeout",false);},_sort:function(){var E=e.keys(this.required),A={},v=0,x,D,C,z,y,B,w;for(;;){x=E.length;B=false;for(z=v;z<x;z++){D=E[z];for(y=z+1;y<x;y++){w=D+E[y];if(!A[w]&&this._requires(D,E[y])){C=E.splice(y,1);E.splice(z,0,C[0]);A[w]=true;B=true;break;}}if(B){break;}else{v++;}}if(!B){break;}}this.sorted=E;},_insert:function(x,y,w){if(x){this._config(x);}this.calculate(y);this.loadType=w;if(!w){var v=this;this._internalCallback=function(){var A=v.onCSS,C,B,z;if(this.insertBefore&&d.UA.ie){C=d.config.doc.getElementById(this.insertBefore);B=C.parentNode;z=C.nextSibling;B.removeChild(C);if(z){B.insertBefore(C,z);}else{B.appendChild(C);}}if(A){A.call(v.context,d);}v._internalCallback=null;v._insert(null,null,k);};this._insert(null,null,q);return;}this._loading=true;this._combineComplete={};this.loadNext();},_continue:function(){if(!(h.running)&&h.size()>0){h.running=true;h.next()();}},insert:function(x,w){var v=this,y=d.merge(this,true);delete y.require;delete y.dirty;h.add(function(){v._insert(y,x,w);});this._continue();},loadNext:function(z){if(!this._loading){return;}var G,O,N,L,y,D,A,K,C,F,M,v,B,J,x,E,P,Q,w=this.loadType,I=this,R=function(S){I.loadNext(S.data);},H=function(U){I._combineComplete[w]=true;var T,S=E.length;for(T=0;T<S;T++){I.inserted[E[T]]=true;}R(U);};if(this.combine&&(!this._combineComplete[w])){E=[];this._combining=E;G=this.sorted;O=G.length;Q=this.comboBase;y=Q;P=[];J={};for(N=0;N<O;N++){B=Q;L=this.getModule(G[N]);F=L&&L.group;if(F){C=this.groups[F];if(!C.combine){L.combine=false;continue;}L.combine=true;if(C.comboBase){B=C.comboBase;}if(C.root){L.root=C.root;}}J[B]=J[B]||[];J[B].push(L);}for(M in J){if(J.hasOwnProperty(M)){y=M;x=J[M];O=x.length;for(N=0;N<O;N++){L=x[N];if(L&&(L.type===w)&&(L.combine||!L.ext)){v=(L.root||this.root)+L.path;if((y!==M)&&(N<(O-1))&&((v.length+y.length)>this.maxURLLength)){P.push(this._filter(y));
y=M;}y+=v;if(N<(O-1)){y+="&";}E.push(L.name);}}if(E.length&&(y!=M)){P.push(this._filter(y));}}}if(E.length){if(w===q){D=d.Get.css;K=this.cssAttributes;}else{D=d.Get.script;K=this.jsAttributes;}D(P,{data:this._loading,onSuccess:H,onFailure:this._onFailure,onTimeout:this._onTimeout,insertBefore:this.insertBefore,charset:this.charset,attributes:K,timeout:this.timeout,autopurge:false,context:this});return;}else{this._combineComplete[w]=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});}}G=this.sorted;O=G.length;for(N=0;N<O;N=N+1){if(G[N] in this.inserted){continue;}if(G[N]===this._loading){return;}L=this.getModule(G[N]);if(!L){A="Undefined module "+G[N]+" skipped";this.skipped[G[N]]=true;continue;}C=(L.group&&this.groups[L.group])||f;if(!w||w===L.type){this._loading=G[N];if(L.type===q){D=d.Get.css;K=this.cssAttributes;}else{D=d.Get.script;K=this.jsAttributes;}y=(L.fullpath)?this._filter(L.fullpath,G[N]):this._url(L.path,G[N],C.base||L.base);D(y,{data:G[N],onSuccess:R,insertBefore:this.insertBefore,charset:this.charset,attributes:K,onFailure:this._onFailure,onTimeout:this._onTimeout,timeout:this.timeout,autopurge:false,context:I});return;}}this._loading=null;D=this._internalCallback;if(D){this._internalCallback=null;D.call(this);}else{this._onSuccess();}},_filter:function(x,w){var z=this.filter,v=w&&(w in this.filters),y=v&&this.filters[w];if(x){if(v){z=(i.isString(y))?this.FILTER_DEFS[y.toUpperCase()]||null:y;}if(z){x=x.replace(new RegExp(z.searchExp,"g"),z.replaceStr);}}return x;},_url:function(x,v,w){return this._filter((w||this.base||"")+x,v);}};},"@VERSION@",{requires:["get","features"]});