rls-min.js revision e94e3f2ab78d38f63e97045370fae4a1e6b076be
YUI.add("rls",function(a){a.rls_handleTimeout=function(b){a.Get.abort(b.tId);b.purge();b.message="RLS request timed out, fetching loader";a.rls_failure(b);};a.rls_handleFailure=function(b){b.message="RLS request failed, fetching loader";a.rls_failure(b);};a.rls_failure=function(b){YUI.Env.rls_disabled=true;a.config.use_rls=false;if(b.data){b.data.unshift("loader");a._use(b.data,function(d,c){d._notify(d.rls_callback,c,b.data);d.rls_advance();});}};a.rls_locals=function(i,e,c){if(YUI.Env.rls_disabled){var g={message:"RLS is disabled, moving to loader",data:e};a.rls_failure(g);return;}if(i.config.modules){var b=[],d=a.Array.hash(e),k="fullpath",h,j=i.config.modules;for(h in j){if(j[h][k]){if(d[h]){b.push(j[h][k]);if(j[h].requires){a.Array.each(j[h].requires,function(l){if(!YUI.Env.mods[l]){if(j[l]){if(j[l][k]){b.push(j[l][k]);e.push(l);}}}});}}}}if(b.length){a.Get.script(b,{onEnd:function(f){c(i,e);},data:e});}else{c(i,e);}}else{c(i,e);}};a.rls_needs=function(e,b){var c=b||this,d=c.config;if(!YUI.Env.mods[e]&&!(d.modules&&d.modules[e])){return true;}return false;};a._rls=function(s){s.push("intl");var f=a.config,v=f.modules,r=a.Array,p=a.Object,e=f.rls||{m:1,v:a.version,gv:f.gallery,env:1,lang:f.lang,"2in3v":f["2in3"],"2v":f.yui2,filt:f.filter,filts:f.filters,ignore:f.ignore,tests:1},g=f.rls_base||"http://l.yimg.com/py/load?httpcache=rls-seed&gzip=1&",u=f.rls_tmpl||function(){var d=[],i;for(i in e){if(i in e&&e[i]){d.push(i+"={"+i+"}");}}return d.join("&");}(),h=[],j={},c,n,q,t=[],k,l=s.length,b;for(k=0;k<l;k++){j[s[k]]=1;if(a.rls_needs(s[k])){h.push(s[k]);}else{}}if(v){for(k in v){if(j[k]&&v[k].requires&&!v[k].noop){l=v[k].requires.length;for(c=0;c<l;c++){q=v[k].requires[c];if(a.rls_needs(q)){h.push(q);}else{n=YUI.Env.mods[q]||v[q];if(n){n=n.details||n;if(!n.noop){if(n.requires){r.each(n.requires,function(d){if(a.rls_needs(d)){h.push(d);}});}}}}}}}}p.each(YUI.Env.mods,function(d){if(j[d.name]){if(d.details&&d.details.requires){if(!d.noop){r.each(d.details.requires,function(i){if(a.rls_needs(i)){h.push(i);}});}}}});h=r.dedupe(h);if(e.filt==="debug"){h.unshift("dump","yui-log");}h=r.dedupe(h);s=r.dedupe(s);if(!h.length){return false;}e.m=h.sort();e.env=[].concat(p.keys(YUI.Env.mods),r.dedupe(YUI._rls_skins)).sort();e.tests=a.Features.all("load",[a]);b=a.Lang.sub(g+u,e);f.rls=e;f.rls_tmpl=u;YUI._rls_active={asked:s,attach:h,inst:a,url:b};return b;};a.rls_oncomplete=function(b){YUI._rls_active.cb=b;};a.rls_advance=function(){var b=YUI.Env;b._rls_in_progress=false;if(b._rls_queue.size()){b._rls_queue.next()();}};a.rls_done=function(b){YUI._rls_active.cb(b);};if(!YUI._rls_active){YUI._rls_active={};}if(!YUI._rls_skins){YUI._rls_skins=[];}if(!YUI.$rls){YUI.$rls=function(d){var f=YUI._rls_active,e=f.inst;if(e){if(d.error){e.rls_failure({message:d.error,data:d.modules});}if(YUI.Env&&YUI.Env.rls_disabled){return;}if(d.css&&e.config.fetchCSS){e.Get.css(f.url+"&css=1");}if(d.modules&&!d.css){if(d.modules.length){var c=e.Array.some(d.modules,function(g){return(g.indexOf("lang")===0);});if(c){d.modules.unshift("intl");}}e.Env.bootstrapped=true;e.Array.each(d.modules,function(g){if(g.indexOf("skin-")>-1){YUI._rls_skins.push(g);}});e._attach(d.modules);if(d.missing&&e.Loader){var b=new e.Loader(f.inst.config);b.onEnd=e.rls_done;b.context=e;b.data=d.missing;b.ignoreRegistered=false;b.require(d.missing);b.insert(null,(e.config.fetchCSS)?null:"js");}else{e.rls_done({data:d.modules});}}}};}},"@VERSION@",{requires:["get","features"]});