Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of yuisource.corp.yahoo.com:yui3

  • Loading branch information...
commit 0f6400e29698d4802163ebb52ad72c68db4e280c 2 parents fda0ebb + f61a03f
@sdesai sdesai authored
Showing with 2,954 additions and 804 deletions.
  1. +5 −2 build/escape/escape-debug.js
  2. +1 −1  build/escape/escape-min.js
  3. +5 −2 build/escape/escape.js
  4. +266 −64 build/loader-base/loader-base-debug.js
  5. +4 −3 build/loader-base/loader-base-min.js
  6. +256 −59 build/loader-base/loader-base.js
  7. +266 −64 build/loader/loader-debug.js
  8. +5 −5 build/loader/loader-min.js
  9. +256 −59 build/loader/loader.js
  10. +15 −0 build/yui-base/yui-base-debug.js
  11. +3 −3 build/yui-base/yui-base-min.js
  12. +15 −0 build/yui-base/yui-base.js
  13. +15 −0 build/yui-core/yui-core-debug.js
  14. +3 −3 build/yui-core/yui-core-min.js
  15. +15 −0 build/yui-core/yui-core.js
  16. +281 −64 build/yui-nodejs/yui-nodejs-debug.js
  17. +7 −7 build/yui-nodejs/yui-nodejs-min.js
  18. +271 −59 build/yui-nodejs/yui-nodejs.js
  19. +281 −64 build/yui/yui-debug.js
  20. +9 −8 build/yui/yui-min.js
  21. +271 −59 build/yui/yui.js
  22. +18 −0 sandbox/loader/alias.html
  23. +3 −0  sandbox/loader/davglass.js
  24. +4 −4 sandbox/loader/gallery.html
  25. +41 −0 sandbox/loader/index.html
  26. +31 −0 sandbox/loader/pattern.html
  27. +1 −0  src/common/tests/coverage.xml
  28. +1 −1  src/common/tests/unit.xml
  29. +11 −4 src/escape/HISTORY.md
  30. +5 −2 src/escape/js/escape.js
  31. +1 −1  src/escape/tests/functional/escape-test.js
  32. +27 −0 src/get/build.xml
  33. +8 −0 src/get/get-nodejs.properties
  34. 0  src/{yui → get}/get-nodejs.xml
  35. +6 −0 src/get/get.properties
  36. 0  src/{yui → get}/get.xml
  37. 0  src/{yui → get}/js/get-nodejs.js
  38. 0  src/{yui → get}/js/get.js
  39. +5 −0 src/get/meta/get.json
  40. +156 −156 src/{yui/tests/get-tests.js → get/tests/get-test.js}
  41. +3 −3 src/{yui → get}/tests/get.html
  42. 0  src/{yui → get}/tests/getfiles/a.css
  43. 0  src/{yui → get}/tests/getfiles/a.js
  44. 0  src/{yui → get}/tests/getfiles/b.css
  45. 0  src/{yui → get}/tests/getfiles/b.js
  46. 0  src/{yui → get}/tests/getfiles/c.css
  47. 0  src/{yui → get}/tests/getfiles/c.js
  48. 0  src/{yui → get}/tests/getfiles/delay.js
  49. 0  src/{yui → get}/tests/getfiles/ib.css
  50. 0  src/{yui → get}/tests/manual/get.html
  51. +266 −64 src/loader/js/loader.js
  52. +3 −0  src/loader/tests/assets/mod.js
  53. +89 −0 src/loader/tests/loader-tests.js
  54. +1 −1  src/loader/tests/server/combo_template.html
  55. +1 −1  src/loader/tests/server/loader_template.html
  56. +2 −2 src/widget/docs/index.mustache
  57. +2 −2 src/yui/build.properties
  58. +0 −15 src/yui/get-nodejs.properties
  59. +0 −15 src/yui/get.properties
  60. +15 −0 src/yui/js/yui.js
  61. +0 −3  src/yui/meta/yui.json
  62. +2 −2 src/yui/nodejs-seed.properties
  63. +2 −2 src/yui/yui-base.properties
View
7 build/escape/escape-debug.js
@@ -52,7 +52,7 @@ Escape = {
characters escaped, allowing the string to be used safely inside a regex.
The following characters, and all whitespace characters, are escaped:
- - # $ ^ * ( ) + [ ] { } | \ , . ?
+ - $ ^ * ( ) + [ ] { } | \ , . ?
If _string_ is not already a string, it will be coerced to a string.
@@ -62,7 +62,10 @@ Escape = {
@static
**/
regex: function (string) {
- return (string + '').replace(/[\-#$\^*()+\[\]{}|\\,.?\s]/g, '\\$&');
+ // There's no need to escape !, =, and : since they only have meaning
+ // when they follow a parenthesized ?, as in (?:...), and we already
+ // escape parens and question marks.
+ return (string + '').replace(/[\-$\^*()+\[\]{}|\\,.?\s]/g, '\\$&');
},
// -- Protected Static Methods ---------------------------------------------
View
2  build/escape/escape-min.js
@@ -1 +1 @@
-YUI.add("escape",function(c){var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},b={html:function(d){return(d+"").replace(/[&<>"'\/`]/g,b._htmlReplacer);},regex:function(d){return(d+"").replace(/[\-#$\^*()+\[\]{}|\\,.?\s]/g,"\\$&");},_htmlReplacer:function(d){return a[d];}};b.regexp=b.regex;c.Escape=b;},"@VERSION@",{requires:["yui-base"]});
+YUI.add("escape",function(c){var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},b={html:function(d){return(d+"").replace(/[&<>"'\/`]/g,b._htmlReplacer);},regex:function(d){return(d+"").replace(/[\-$\^*()+\[\]{}|\\,.?\s]/g,"\\$&");},_htmlReplacer:function(d){return a[d];}};b.regexp=b.regex;c.Escape=b;},"@VERSION@",{requires:["yui-base"]});
View
7 build/escape/escape.js
@@ -52,7 +52,7 @@ Escape = {
characters escaped, allowing the string to be used safely inside a regex.
The following characters, and all whitespace characters, are escaped:
- - # $ ^ * ( ) + [ ] { } | \ , . ?
+ - $ ^ * ( ) + [ ] { } | \ , . ?
If _string_ is not already a string, it will be coerced to a string.
@@ -62,7 +62,10 @@ Escape = {
@static
**/
regex: function (string) {
- return (string + '').replace(/[\-#$\^*()+\[\]{}|\\,.?\s]/g, '\\$&');
+ // There's no need to escape !, =, and : since they only have meaning
+ // when they follow a parenthesized ?, as in (?:...), and we already
+ // escape parens and question marks.
+ return (string + '').replace(/[\-$\^*()+\[\]{}|\\,.?\s]/g, '\\$&');
},
// -- Protected Static Methods ---------------------------------------------
View
330 build/loader-base/loader-base-debug.js
@@ -133,10 +133,6 @@ var NOT_FOUND = {},
return path;
};
-if (YUI.Env.aliases) {
- YUI.Env.aliases = {}; //Don't need aliases if Loader is present
-}
-
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
@@ -1192,7 +1188,12 @@ Y.Loader.prototype = {
}
}
+ if (o.supersedes) {
+ o.supersedes = this.filterRequires(o.supersedes);
+ }
+
if (o.after) {
+ o.after = this.filterRequires(o.after);
o.after_map = YArray.hash(o.after);
}
@@ -1298,13 +1299,20 @@ Y.Loader.prototype = {
*/
getRequires: function(mod) {
- if (!mod || mod._parsed) {
- // Y.log('returning no reqs for ' + mod.name);
+ if (!mod) {
+ //console.log('returning no reqs for ' + mod.name);
return NO_REQUIREMENTS;
}
+ if (mod._parsed) {
+ //console.log('returning requires for ' + mod.name, mod.requires);
+ return mod.expanded || NO_REQUIREMENTS;
+ }
+
+ //TODO add modue cache here out of scope..
+
var i, m, j, add, packName, lang, testresults = this.testresults,
- name = mod.name, cond, go,
+ name = mod.name, cond,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
@@ -1336,7 +1344,6 @@ Y.Loader.prototype = {
d = [];
hash = {};
-
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
@@ -1418,6 +1425,8 @@ Y.Loader.prototype = {
cond = this.conditions[name];
if (cond) {
+ //Set the module to not parsed since we have conditionals and this could change the dependency tree.
+ mod._parsed = false;
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
@@ -1434,19 +1443,19 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
hash[condmod] = true;
d.push(condmod);
m = this.getModule(condmod);
- // Y.log('conditional', m);
if (m) {
add = this.getRequires(m);
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
+
}
}
}
@@ -1680,6 +1689,7 @@ Y.Loader.prototype = {
* @private
*/
_explode: function() {
+ //TODO Move done out of scope
var r = this.required, m, reqs, done = {},
self = this;
@@ -1734,10 +1744,18 @@ Y.Loader.prototype = {
if (patterns.hasOwnProperty(pname)) {
// Y.log('testing pattern ' + i);
p = patterns[pname];
+
+ //There is no test method, create a default one that tests
+ // the pattern against the mod name
+ if (!p.test) {
+ p.test = function(mname, pname) {
+ return (mname.indexOf(pname) > -1);
+ };
+ }
- // use the metadata supplied for the pattern
- // as the module definition.
- if (mname.indexOf(pname) > -1) {
+ if (p.test(mname, pname)) {
+ // use the metadata supplied for the pattern
+ // as the module definition.
found = p;
break;
}
@@ -1867,6 +1885,20 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
self._finish(msg, success);
},
/**
+ * The default Loader onProgress handler, calls this.onProgress with a payload
+ * @method _onProgress
+ * @private
+ */
+ _onProgress: function(e) {
+ var self = this;
+ if (self.onProgress) {
+ self.onProgress.call(self.context, {
+ name: e.url,
+ data: e.data
+ });
+ }
+ },
+ /**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
@@ -1912,6 +1944,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
+ //TODO Move this out of scope
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
@@ -1981,6 +2014,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
this.sorted = partial;
this.insert(o, type, true);
},
+
/**
* Handles the actual insertion of script/link tags
* @method _insert
@@ -1991,7 +2025,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
*/
_insert: function(source, o, type, skipcalc) {
-// Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
+ Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
// restore the state at the time of the request
if (source) {
@@ -2005,6 +2039,92 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
this.calculate(o);
}
+ var modules = this.resolve(),
+ self = this, comp = 0, actions = 0;
+
+ if (type) {
+ var m = modules[type];
+ modules = {};
+ modules[type] = m;
+ comp++;
+ } else {
+ if (modules.js.length) {
+ comp++;
+ }
+ if (modules.css.length) {
+ comp++;
+ }
+ }
+
+ //console.log('Resolved Modules: ', modules);
+
+ var complete = function(d) {
+ actions++;
+
+ if (d && d.data && d.data.length) {
+ for (var i = 0; i < d.data.length; i++) {
+ self.inserted[d.data[i].name] = true;
+ }
+ }
+
+ if (actions === comp) {
+ self._loading = null;
+ Y.log('Loader actions complete!', 'info', 'loader');
+ self._onSuccess();
+ }
+ };
+
+ this._loading = true;
+
+ if (!modules.js.length && !modules.css.length) {
+ Y.log('No modules resolved..', 'warn', 'loader');
+ actions = -1;
+ complete();
+ return;
+ }
+
+
+ if (modules.css.length) { //Load CSS first
+ Y.log('Loading CSS modules', 'info', 'loader');
+ Y.Get.css(modules.css, {
+ data: modules.cssMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onSuccess: complete
+ });
+ }
+
+ if (modules.js.length) {
+ Y.log('Loading JS modules', 'info', 'loader');
+ Y.Get.script(modules.js, {
+ data: modules.jsMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onSuccess: complete
+ });
+ }
+
+
+ /*
+
this.loadType = type;
if (!type) {
@@ -2052,6 +2172,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
// start the load
this.loadNext();
+ */
},
/**
@@ -2075,8 +2196,8 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
* @param {string} type the type of dependency to insert.
*/
insert: function(o, type, skipsort) {
- // Y.log('public insert() ' + (type || '') + ', ' +
- // Y.Object.keys(this.required), "info", "loader");
+ Y.log('public insert() ' + (type || '') + ', ' +
+ Y.Object.keys(this.required), "info", "loader");
var self = this, copy = Y.merge(this);
delete copy.require;
delete copy.dirty;
@@ -2097,6 +2218,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
* one).
*/
loadNext: function(mname) {
+ Y.log('loadNext was called..', 'warn', 'loader');
// It is possible that this function is executed due to something
// else on the page loading a YUI module. Only react when we
// are actively loading something
@@ -2430,68 +2552,148 @@ Y.log('attempting to load ' + s[i] + ', ' + self.base, 'info', 'loader');
*
*/
resolve: function(calc, s) {
- var self = this, i, m, url, out = { js: [], css: [] };
+
+ var len, i, m, url, fn, msg, attr, group, groupName, j, frag,
+ comboSource, comboSources, mods, comboBase,
+ base, urls, u = [], tmpBase, baseLen, resCombos = {},
+ self = this,
+ resolved = { js: [], jsMods: [], css: [], cssMods: [] },
+ type = self.loadType || 'js';
if (calc) {
self.calculate();
}
s = s || self.sorted;
- for (i = 0; i < s.length; i++) {
- m = self.getModule(s[i]);
- if (m) {
- if (self.combine) {
- url = self._filter((self.root + m.path), m.name, self.root);
- } else {
- url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
+ if (self.combine) {
+
+ len = s.length;
+
+ // the default combo base
+ comboBase = self.comboBase;
+
+ url = comboBase;
+
+ comboSources = {};
+
+ for (i = 0; i < len; i++) {
+ comboSource = comboBase;
+ m = self.getModule(s[i]);
+ groupName = m && m.group;
+ if (groupName) {
+
+ group = self.groups[groupName];
+
+ if (!group.combine) {
+ m.combine = false;
+ continue;
+ }
+ m.combine = true;
+ if (group.comboBase) {
+ comboSource = group.comboBase;
+ }
+
+ if ("root" in group && L.isValue(group.root)) {
+ m.root = group.root;
+ }
+
}
- out[m.type].push(url);
+
+ comboSources[comboSource] = comboSources[comboSource] || [];
+ comboSources[comboSource].push(m);
}
- }
- if (self.combine) {
- out.js = [self.comboBase + out.js.join(self.comboSep)];
- out.css = [self.comboBase + out.css.join(self.comboSep)];
- }
- return out;
- },
- /**
- * Returns an Object hash of hashes built from `loader.sorted` or from an arbitrary list of sorted modules.
- * @method hash
- * @private
- * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
- * @param {Array} [s=loader.sorted] An override for the loader.sorted array
- * @return {Object} Object hash (js and css) of two object hashes of file lists, with the module name as the key
- * @example This method can be used as an off-line dep calculator
- *
- * var Y = YUI();
- * var loader = new Y.Loader({
- * filter: 'debug',
- * base: '../../',
- * root: 'build/',
- * combine: true,
- * require: ['node', 'dd', 'console']
- * });
- * var out = loader.hash(true);
- *
- */
- hash: function(calc, s) {
- var self = this, i, m, url, out = { js: {}, css: {} };
+ for (j in comboSources) {
+ if (comboSources.hasOwnProperty(j)) {
+ resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };
+ url = j;
+ mods = comboSources[j];
+ len = mods.length;
+
+ if (len) {
+ for (i = 0; i < len; i++) {
+ m = mods[i];
+ // Do not try to combine non-yui JS unless combo def
+ // is found
+ if (m && (m.combine || !m.ext)) {
+
+ frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
+ frag = self._filter(frag, m.name);
+ resCombos[j][m.type].push(frag);
+ resCombos[j][m.type + 'Mods'].push(m);
+ }
- if (calc) {
- self.calculate();
- }
- s = s || self.sorted;
+ }
+ }
+ }
+ }
- for (i = 0; i < s.length; i++) {
- m = self.getModule(s[i]);
- if (m) {
- url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
- out[m.type][m.name] = url;
+ for (j in resCombos) {
+ base = j;
+ for (type in resCombos[base]) {
+ if (type === JS || type === CSS) {
+ urls = resCombos[base][type];
+ mods = resCombos[base][type + 'Mods'];
+ len = urls.length;
+ tmpBase = base + urls.join(self.comboSep);
+ baseLen = tmpBase.length;
+
+ if (len) {
+ if (baseLen > self.maxURLLength) {
+ Y.log('Exceeded maxURLLength for ' + type + ', splitting', 'info', 'loader');
+ u = [];
+ m = [];
+ for (s = 0; s < len; s++) {
+ tmpBase = base + u.join(self.comboSep);
+ if (tmpBase.length < self.maxURLLength) {
+ u.push(urls[s]);
+ m.push(mods[s]);
+ } else {
+ resolved[type].push(tmpBase);
+ u = [];
+ m = [];
+ }
+ }
+ } else {
+ resolved[type].push(tmpBase);
+ resolved[type + 'Mods'] = mods;
+ }
+ }
+ }
+ }
+ }
+
+ resCombos = null;
+
+ } else {
+
+ s = self.sorted;
+ len = s.length;
+
+ for (i = 0; i < len; i = i + 1) {
+
+ m = self.getModule(s[i]);
+
+ if (!m) {
+ if (!self.skipped[s[i]]) {
+ msg = 'Undefined module ' + s[i] + ' skipped';
+ Y.log(msg, 'warn', 'loader');
+ }
+ continue;
+
+ }
+
+ group = (m.group && self.groups[m.group]) || NOT_FOUND;
+
+ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
+ self._url(m.path, s[i], group.base || m.base);
+
+ resolved[m.type].push(url);
+ resolved[m.type + 'Mods'].push(m);
}
}
- return out;
+ return resolved;
}
};
View
7 build/loader-base/loader-base-min.js
@@ -1,3 +1,4 @@
-YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var I=d.version,E="/build/",F=I+E,D=d.Env.base,A="gallery-2011.10.20-23-28",C="2in3",B="4",z="2.9.0",G=D+"combo?",H={version:I,root:F,base:d.Env.base,comboBase:G,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},y=H.groups,x=function(K,L){var J=C+"."+(K||B)+"/"+(L||z)+E;y.yui2.base=D+J;y.yui2.root=J;},w=function(J){var K=(J||A)+E;y.gallery.base=D+K;y.gallery.root=K;};y[I]={};y.gallery={ext:false,combine:true,comboBase:G,update:w,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}};y.yui2={combine:true,ext:false,comboBase:G,update:x,patterns:{"yui2-":{configFn:function(J){if(/-skin|reset|fonts|grids|base/.test(J.name)){J.type="css";J.path=J.path.replace(/\.js/,".css");J.path=J.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};w();x();YUI.Env[I]=H;}());}var f={},c=[],m=2048,a=YUI.Env,p=a._loaded,q="css",k="js",v="intl",s=d.version,u="",e=d.Object,r=e.each,j=d.Array,h=a._loaderQueue,t=a[s],b="skin-",i=d.Lang,n=a.mods,l,o,g=function(x,y,z,w){var A=x+"/"+y;if(!w){A+="-min";}A+="."+(z||q);return A;};if(YUI.Env.aliases){YUI.Env.aliases={};}d.Env.meta=t;d.Loader=function(A){var z=t.modules,x=this;l=t.md5;x.context=d;x.base=d.Env.meta.base+d.Env.meta.root;x.comboBase=d.Env.meta.comboBase;x.combine=A.base&&(A.base.indexOf(x.comboBase.substr(0,20))>-1);x.comboSep="&";x.maxURLLength=m;x.root=d.Env.meta.root;x.timeout=0;x.forceMap={};x.allowRollup=false;x.filters={};x.required={};x.patterns={};x.moduleInfo={};x.groups=d.merge(d.Env.meta.groups);x.skin=d.merge(d.Env.meta.skin);x.conditions={};x.config=A;x._internal=true;o=a._renderedMods;if(o){r(o,function y(C,B){x.moduleInfo[B]=C;});o=a._conditions;r(o,function w(C,B){x.conditions[B]=C;});}else{r(z,x.addModule,x);}if(!a._renderedMods){a._renderedMods=x.moduleInfo;a._conditions=x.conditions;}x._inspectPage();x._internal=false;x._config(A);x.forceMap=(x.force)?d.Array.hash(x.force):{};x.testresults=null;if(d.config.tests){x.testresults=d.config.tests;}x.sorted=[];x.loaded=p[s];x.dirty=true;x.inserted={};x.skipped={};x.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){r(n,function(y,x){if(y.details){var w=this.moduleInfo[x],A=y.details.requires,z=w&&w.requires;if(w){if(!w._inspected&&A&&z.length!=A.length){delete w.expanded;}}else{w=this.addModule(y.details,x);}w._inspected=true;}},this);},_requires:function(C,B){var y,A,D,E,w=this.moduleInfo,x=w[C],z=w[B];if(!x||!z){return false;}A=x.expanded_map;D=x.after_map;if(D&&(B in D)){return true;}D=z.after_map;if(D&&(C in D)){return false;}E=w[B]&&w[B].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(C,E[y])){return true;}}}E=w[C]&&w[C].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(B,E[y])){return false;}}}if(A&&(B in A)){return true;}if(x.ext&&x.type==q&&!z.ext&&z.type==q){return true;}return false;},_config:function(C){var y,x,B,z,A,D,w=this;if(C){for(y in C){if(C.hasOwnProperty(y)){B=C[y];if(y=="require"){w.require(B);}else{if(y=="skin"){d.mix(w.skin,C[y],true);}else{if(y=="groups"){for(x in B){if(B.hasOwnProperty(x)){D=x;A=B[x];w.addGroup(A,D);}}}else{if(y=="modules"){r(B,w.addModule,w);}else{if(y=="gallery"){this.groups.gallery.update(B);}else{if(y=="yui2"||y=="2in3"){this.groups.yui2.update(C["2in3"],C.yui2);}else{if(y=="maxURLLength"){w[y]=Math.min(m,B);}else{w[y]=B;}}}}}}}}}}z=w.filter;if(i.isString(z)){z=z.toUpperCase();w.filterName=z;w.filter=w.FILTER_DEFS[z];if(z=="DEBUG"){w.require("yui-log","dump");}}if(w.lang){w.require("intl-base","intl");}},formatSkin:function(y,w){var x=b+y;if(w){x=x+"-"+w;}return x;},_addSkin:function(F,D,E){var C,B,x,w,A=this.moduleInfo,y=this.skin,z=A[D]&&A[D].ext;if(D){x=this.formatSkin(F,D);if(!A[x]){C=A[D];B=C.pkg||D;w={name:x,group:C.group,type:"css",after:y.after,path:(E||B)+"/"+y.base+F+"/"+D+".css",ext:z};if(C.base){w.base=C.base;}if(C.configFn){w.configFn=C.configFn;}this.addModule(w,x);}}return x;},addGroup:function(z,x){var y=z.modules,w=this;x=x||z.name;z.name=x;w.groups[x]=z;if(z.patterns){r(z.patterns,function(B,A){B.group=x;w.patterns[A]=B;});}if(y){r(y,function(B,A){B.group=x;w.addModule(B,A);},w);}},addModule:function(M,T){T=T||M.name;if(this.moduleInfo[T]&&this.moduleInfo[T].temp){M=d.merge(this.moduleInfo[T],M);}M.name=T;if(!M||!M.name){return null;}if(!M.type){M.type=k;}if(!M.path&&!M.fullpath){M.path=g(T,T,M.type);}M.supersedes=M.supersedes||M.use;M.ext=("ext" in M)?M.ext:(this._internal)?false:true;M.requires=this.filterRequires(M.requires)||[];var Q=M.submodules,P,N,H,w,I,y,L,x,O,J,F,C,A,z,S,R,G,B,D,E=this.conditions,K;this.moduleInfo[T]=M;if(!M.langPack&&M.lang){J=j(M.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}}}if(Q){w=M.supersedes||[];N=0;for(P in Q){if(Q.hasOwnProperty(P)){I=Q[P];I.path=I.path||g(T,P,M.type);I.pkg=T;I.group=M.group;if(I.supersedes){w=w.concat(I.supersedes);}y=this.addModule(I,P);w.push(P);if(y.skinnable){M.skinnable=true;G=this.skin.overrides;if(G&&G[P]){for(O=0;O<G[P].length;O++){B=this._addSkin(G[P][O],P,T);w.push(B);}}B=this._addSkin(this.skin.defaultSkin,P,T);w.push(B);}if(I.lang&&I.lang.length){J=j(I.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);C=this.getLangPackName(S,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}A=A||j.hash(y.supersedes);if(!(C in A)){y.supersedes.push(C);}M.lang=M.lang||[];z=z||j.hash(M.lang);if(!(S in z)){M.lang.push(S);}F=this.getLangPackName(u,T);C=this.getLangPackName(u,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}if(!(C in A)){y.supersedes.push(C);}}}N++;}}M.supersedes=j.dedupe(w);if(this.allowRollup){M.rollup=(N<4)?N:Math.min(N-1,4);}}L=M.plugins;if(L){for(P in L){if(L.hasOwnProperty(P)){x=L[P];x.pkg=T;x.path=x.path||g(T,P,M.type);
-x.requires=x.requires||[];x.group=M.group;this.addModule(x,P);if(M.skinnable){this._addSkin(this.skin.defaultSkin,P,T);}}}}if(M.condition){H=M.condition.trigger;if(YUI.Env.aliases[H]){H=YUI.Env.aliases[H];}if(!d.Lang.isArray(H)){H=[H];}for(P=0;P<H.length;P++){K=H[P];D=M.condition.when;E[K]=E[K]||{};E[K][T]=M.condition;if(D&&D!="after"){if(D=="instead"){M.supersedes=M.supersedes||[];M.supersedes.push(K);}else{}}else{M.after=M.after||[];M.after.push(K);}}}if(M.after){M.after_map=j.hash(M.after);}if(M.configFn){R=M.configFn(M);if(R===false){delete this.moduleInfo[T];M=null;}}return M;},require:function(x){var w=(typeof x==="string")?j(arguments):x;this.dirty=true;this.required=d.merge(this.required,j.hash(this.filterRequires(w)));this._explodeRollups();},_explodeRollups:function(){var x=this,w,y=x.required;if(!x.allowRollup){r(y,function(z,A){w=x.getModule(A);if(w&&w.use){j.each(w.use,function(B){w=x.getModule(B);if(w&&w.use){j.each(w.use,function(C){y[C]=true;});}else{y[B]=true;}});}});x.required=y;}},filterRequires:function(z){if(z){if(!d.Lang.isArray(z)){z=[z];}z=d.Array(z);var B=[],y,x,A,w;for(y=0;y<z.length;y++){x=this.getModule(z[y]);if(x&&x.use){for(A=0;A<x.use.length;A++){w=this.getModule(x.use[A]);if(w&&w.use){B=d.Array.dedupe([].concat(B,this.filterRequires(w.use)));}else{B.push(x.use[A]);}}}else{B.push(z[y]);}}z=B;}return z;},getRequires:function(S){if(!S||S._parsed){return c;}var M,H,L,D,C,U,A=this.testresults,V=S.name,B,I,T=n[V]&&n[V].details,O,J,w,E,P,F,z,Q,R,y,G=S.lang||S.intl,N=this.moduleInfo,K=d.Features&&d.Features.tests.load,x;if(S.temp&&T){P=S;S=this.addModule(T,V);S.group=P.group;S.pkg=P.pkg;delete S.expanded;}if(S.expanded&&(!this.lang||S.langCache===this.lang)){return S.expanded;}O=[];x={};E=this.filterRequires(S.requires);if(S.lang){O.unshift("intl");E.unshift("intl");G=true;}F=this.filterRequires(S.optional);S._parsed=true;S.langCache=this.lang;for(M=0;M<E.length;M++){if(!x[E[M]]){O.push(E[M]);x[E[M]]=true;H=this.getModule(E[M]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(L=0;L<D.length;L++){O.push(D[L]);}}}}E=this.filterRequires(S.supersedes);if(E){for(M=0;M<E.length;M++){if(!x[E[M]]){if(S.submodules){O.push(E[M]);}x[E[M]]=true;H=this.getModule(E[M]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(L=0;L<D.length;L++){O.push(D[L]);}}}}}if(F&&this.loadOptional){for(M=0;M<F.length;M++){if(!x[F[M]]){O.push(F[M]);x[F[M]]=true;H=N[F[M]];if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(L=0;L<D.length;L++){O.push(D[L]);}}}}}B=this.conditions[V];if(B){if(A&&K){r(A,function(W,Y){var X=K[Y].name;if(!x[X]&&K[Y].trigger==V){if(W&&K[Y]){x[X]=true;O.push(X);}}});}else{r(B,function(X,W){if(!x[W]){I=X&&((X.ua&&d.UA[X.ua])||(X.test&&X.test(d,E)));if(I){x[W]=true;O.push(W);H=this.getModule(W);if(H){D=this.getRequires(H);for(L=0;L<D.length;L++){O.push(D[L]);}}}}},this);}}if(S.skinnable){Q=this.skin.overrides;r(YUI.Env.aliases,function(W,X){if(d.Array.indexOf(W,V)>-1){R=X;}});if(Q&&(Q[V]||(R&&Q[R]))){y=V;if(Q[R]){y=R;}for(M=0;M<Q[y].length;M++){z=this._addSkin(Q[y][M],V);O.push(z);}}else{z=this._addSkin(this.skin.defaultSkin,V);O.push(z);}}S._parsed=false;if(G){if(S.lang&&!S.langPack&&d.Intl){U=d.Intl.lookupBestLang(this.lang||u,S.lang);C=this.getLangPackName(U,V);if(C){O.unshift(C);}}O.unshift(v);}S.expanded_map=j.hash(O);S.expanded=e.keys(S.expanded_map);return S.expanded;},getProvides:function(x){var w=this.getModule(x),z,y;if(!w){return f;}if(w&&!w.provides){z={};y=w.supersedes;if(y){j.each(y,function(A){d.mix(z,this.getProvides(A));},this);}z[x]=true;w.provides=z;}return w.provides;},calculate:function(x,w){if(x||w||this.dirty){if(x){this._config(x);}if(!this._init){this._setup();}this._explode();if(this.allowRollup){this._rollup();}else{this._explodeRollups();}this._reduce();this._sort();}},_addLangPack:function(B,w,A){var y=w.name,x,z=this.moduleInfo[A];if(!z){x=g((w.pkg||y),A,k,true);this.addModule({path:x,intl:true,langPack:true,ext:w.ext,group:w.group,supersedes:[]},A);if(B){d.Env.lang=d.Env.lang||{};d.Env.lang[B]=d.Env.lang[B]||{};d.Env.lang[B][y]=true;}}return this.moduleInfo[A];},_setup:function(){var C=this.moduleInfo,z,A,y,w,x,B;for(z in C){if(C.hasOwnProperty(z)){w=C[z];if(w){w.requires=j.dedupe(w.requires);if(w.lang&&w.lang.length){B=this.getLangPackName(u,z);this._addLangPack(null,w,B);}}}}x={};if(!this.ignoreRegistered){d.mix(x,a.mods);}if(this.ignore){d.mix(x,j.hash(this.ignore));}for(y in x){if(x.hasOwnProperty(y)){d.mix(x,this.getProvides(y));}}if(this.force){for(A=0;A<this.force.length;A++){if(this.force[A] in x){delete x[this.force[A]];}}}d.mix(this.loaded,x);this._init=true;},getLangPackName:function(x,w){return("lang/"+w+((x)?"_"+x:""));},_explode:function(){var A=this.required,w,z,x={},y=this;y.dirty=false;y._explodeRollups();A=y.required;r(A,function(B,C){if(!x[C]){x[C]=true;w=y.getModule(C);if(w){var D=w.expound;if(D){A[D]=y.getModule(D);z=y.getRequires(A[D]);d.mix(A,j.hash(z));}z=y.getRequires(w);d.mix(A,j.hash(z));}}});},getModule:function(B){if(!B){return null;}var A,z,x,w=this.moduleInfo[B],y=this.patterns;if(!w){for(x in y){if(y.hasOwnProperty(x)){A=y[x];if(B.indexOf(x)>-1){z=A;break;}}}if(z){if(A.action){A.action.call(this,B,x);}else{w=this.addModule(d.merge(z),B);w.temp=true;}}}return w;},_rollup:function(){},_reduce:function(B){B=B||this.required;var y,x,A,w,z=this.loadType,C=this.ignore?j.hash(this.ignore):false;for(y in B){if(B.hasOwnProperty(y)){w=this.getModule(y);if(((this.loaded[y]||n[y])&&!this.forceMap[y]&&!this.ignoreRegistered)||(z&&w&&w.type!=z)){delete B[y];}if(C&&C[y]){delete B[y];}A=w&&w.supersedes;if(A){for(x=0;x<A.length;x++){if(A[x] in B){delete B[A[x]];}}}}}return B;},_finish:function(y,x){h.running=false;var w=this.onEnd;if(w){w.call(this.context,{msg:y,data:this.data,success:x});}this._continue();},_onSuccess:function(){var y=this,x=d.merge(y.skipped),A,w=[],z=y.requireRegistration,C,B;r(x,function(D){delete y.inserted[D];});y.skipped={};r(y.inserted,function(E,D){var F=y.getModule(D);
-if(F&&z&&F.type==k&&!(D in YUI.Env.mods)){w.push(D);}else{d.mix(y.loaded,y.getProvides(D));}});A=y.onSuccess;B=(w.length)?"notregistered":"success";C=!(w.length);if(A){A.call(y.context,{msg:B,data:y.data,success:C,failed:w,skipped:x});}y._finish(B,C);},_onFailure:function(y){var w=this.onFailure,x="failure: "+y.msg;if(w){w.call(this.context,{msg:x,data:this.data,success:false});}this._finish(x,false);},_onTimeout:function(){var w=this.onTimeout;if(w){w.call(this.context,{msg:"timeout",data:this.data,success:false});}this._finish("timeout",false);},_sort:function(){var F=e.keys(this.required),B={},w=0,y,E,D,A,z,C,x;for(;;){y=F.length;C=false;for(A=w;A<y;A++){E=F[A];for(z=A+1;z<y;z++){x=E+F[z];if(!B[x]&&this._requires(E,F[z])){D=F.splice(z,1);F.splice(A,0,D[0]);B[x]=true;C=true;break;}}if(C){break;}else{w++;}}if(!C){break;}}this.sorted=F;},partial:function(w,y,x){this.sorted=w;this.insert(y,x,true);},_insert:function(z,A,y,x){if(z){this._config(z);}if(!x){this.calculate(A);}this.loadType=y;if(!y){var w=this;this._internalCallback=function(){var C=w.onCSS,E,D,B;if(this.insertBefore&&d.UA.ie){E=d.config.doc.getElementById(this.insertBefore);D=E.parentNode;B=E.nextSibling;D.removeChild(E);if(B){D.insertBefore(E,B);}else{D.appendChild(E);}}if(C){C.call(w.context,d);}w._internalCallback=null;w._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(z,x,y){var w=this,A=d.merge(this);delete A.require;delete A.dirty;h.add(function(){w._insert(A,z,x,y);});this._continue();},loadNext:function(A){if(!this._loading){return;}var H,P,O,M,z,E,B,L,D,G,N,w,C,K,y,F,Q,R,J=this,x=J.loadType,S=function(T){J.loadNext(T.data);},I=function(V){J._combineComplete[x]=true;var U,T=F.length;for(U=0;U<T;U++){J.inserted[F[U]]=true;}S(V);};if(J.combine&&(!J._combineComplete[x])){F=[];J._combining=F;H=J.sorted;P=H.length;R=J.comboBase;z=R;Q=[];K={};for(O=0;O<P;O++){C=R;M=J.getModule(H[O]);G=M&&M.group;if(G){D=J.groups[G];if(!D.combine){M.combine=false;continue;}M.combine=true;if(D.comboBase){C=D.comboBase;}if("root" in D&&i.isValue(D.root)){M.root=D.root;}}K[C]=K[C]||[];K[C].push(M);}for(N in K){if(K.hasOwnProperty(N)){z=N;y=K[N];P=y.length;for(O=0;O<P;O++){M=y[O];if(M&&(M.type===x)&&(M.combine||!M.ext)){w=((i.isValue(M.root))?M.root:J.root)+M.path;w=J._filter(w,M.name);if((z!==N)&&(O<=(P-1))&&((w.length+z.length)>J.maxURLLength)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));z=N;}z+=w;if(O<(P-1)){z+=J.comboSep;}F.push(M.name);}}if(F.length&&(z!=N)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));}}}if(F.length){if(x===q){E=d.Get.css;L=J.cssAttributes;}else{E=d.Get.script;L=J.jsAttributes;}E(Q,{data:J._loading,onSuccess:I,onFailure:J._onFailure,onTimeout:J._onTimeout,insertBefore:J.insertBefore,charset:J.charset,attributes:L,timeout:J.timeout,autopurge:false,context:J});return;}else{J._combineComplete[x]=true;}}if(A){if(A!==J._loading){return;}J.inserted[A]=true;if(J.onProgress){J.onProgress.call(J.context,{name:A,data:J.data});}}H=J.sorted;P=H.length;for(O=0;O<P;O=O+1){if(H[O] in J.inserted){continue;}if(H[O]===J._loading){return;}M=J.getModule(H[O]);if(!M){if(!J.skipped[H[O]]){B="Undefined module "+H[O]+" skipped";J.skipped[H[O]]=true;}continue;}D=(M.group&&J.groups[M.group])||f;if(!x||x===M.type){J._loading=H[O];if(M.type===q){E=d.Get.css;L=J.cssAttributes;if(M.cssAttributes){L=d.mix(L||{},M.cssAttributes);}}else{E=d.Get.script;L=J.jsAttributes;if(M.jsAttributes){L=d.mix(L||{},M.jsAttributes);}}z=(M.fullpath)?J._filter(M.fullpath,H[O]):J._url(M.path,H[O],D.base||M.base);E(z,{data:H[O],onSuccess:S,insertBefore:J.insertBefore,charset:J.charset,attributes:L,onFailure:J._onFailure,onTimeout:J._onTimeout,timeout:J.timeout,autopurge:false,context:J});return;}}J._loading=null;E=J._internalCallback;if(E){J._internalCallback=null;E.call(J);}else{J._onSuccess();}},_filter:function(y,x){var A=this.filter,w=x&&(x in this.filters),z=w&&this.filters[x],B=this.moduleInfo[x]?this.moduleInfo[x].group:null;if(B&&this.groups[B].filter){z=this.groups[B].filter;w=true;}if(y){if(w){A=(i.isString(z))?this.FILTER_DEFS[z.toUpperCase()]||null:z;}if(A){y=y.replace(new RegExp(A.searchExp,"g"),A.replaceStr);}}return y;},_url:function(y,w,x){return this._filter((x||this.base||"")+y,w);},resolve:function(A,C){var x=this,B,w,z,y={js:[],css:[]};if(A){x.calculate();}C=C||x.sorted;for(B=0;B<C.length;B++){w=x.getModule(C[B]);if(w){if(x.combine){z=x._filter((x.root+w.path),w.name,x.root);}else{z=x._filter(w.fullpath,w.name,"")||x._url(w.path,w.name);}y[w.type].push(z);}}if(x.combine){y.js=[x.comboBase+y.js.join(x.comboSep)];y.css=[x.comboBase+y.css.join(x.comboSep)];}return y;},hash:function(A,C){var x=this,B,w,z,y={js:{},css:{}};if(A){x.calculate();}C=C||x.sorted;for(B=0;B<C.length;B++){w=x.getModule(C[B]);if(w){z=x._filter(w.fullpath,w.name,"")||x._url(w.path,w.name);y[w.type][w.name]=z;}}return y;}};},"@VERSION@",{requires:["get"]});
+YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var I=d.version,E="/build/",F=I+E,D=d.Env.base,A="gallery-2011.10.20-23-28",C="2in3",B="4",z="2.9.0",G=D+"combo?",H={version:I,root:F,base:d.Env.base,comboBase:G,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},y=H.groups,x=function(K,L){var J=C+"."+(K||B)+"/"+(L||z)+E;y.yui2.base=D+J;y.yui2.root=J;},w=function(J){var K=(J||A)+E;y.gallery.base=D+K;y.gallery.root=K;};y[I]={};y.gallery={ext:false,combine:true,comboBase:G,update:w,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}};y.yui2={combine:true,ext:false,comboBase:G,update:x,patterns:{"yui2-":{configFn:function(J){if(/-skin|reset|fonts|grids|base/.test(J.name)){J.type="css";J.path=J.path.replace(/\.js/,".css");J.path=J.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};w();x();YUI.Env[I]=H;}());}var f={},c=[],m=2048,a=YUI.Env,p=a._loaded,q="css",k="js",v="intl",s=d.version,u="",e=d.Object,r=e.each,j=d.Array,h=a._loaderQueue,t=a[s],b="skin-",i=d.Lang,n=a.mods,l,o,g=function(x,y,z,w){var A=x+"/"+y;if(!w){A+="-min";}A+="."+(z||q);return A;};d.Env.meta=t;d.Loader=function(A){var z=t.modules,x=this;l=t.md5;x.context=d;x.base=d.Env.meta.base+d.Env.meta.root;x.comboBase=d.Env.meta.comboBase;x.combine=A.base&&(A.base.indexOf(x.comboBase.substr(0,20))>-1);x.comboSep="&";x.maxURLLength=m;x.root=d.Env.meta.root;x.timeout=0;x.forceMap={};x.allowRollup=false;x.filters={};x.required={};x.patterns={};x.moduleInfo={};x.groups=d.merge(d.Env.meta.groups);x.skin=d.merge(d.Env.meta.skin);x.conditions={};x.config=A;x._internal=true;o=a._renderedMods;if(o){r(o,function y(C,B){x.moduleInfo[B]=C;});o=a._conditions;r(o,function w(C,B){x.conditions[B]=C;});}else{r(z,x.addModule,x);}if(!a._renderedMods){a._renderedMods=x.moduleInfo;a._conditions=x.conditions;}x._inspectPage();x._internal=false;x._config(A);x.forceMap=(x.force)?d.Array.hash(x.force):{};x.testresults=null;if(d.config.tests){x.testresults=d.config.tests;}x.sorted=[];x.loaded=p[s];x.dirty=true;x.inserted={};x.skipped={};x.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){r(n,function(y,x){if(y.details){var w=this.moduleInfo[x],A=y.details.requires,z=w&&w.requires;if(w){if(!w._inspected&&A&&z.length!=A.length){delete w.expanded;}}else{w=this.addModule(y.details,x);}w._inspected=true;}},this);},_requires:function(C,B){var y,A,D,E,w=this.moduleInfo,x=w[C],z=w[B];if(!x||!z){return false;}A=x.expanded_map;D=x.after_map;if(D&&(B in D)){return true;}D=z.after_map;if(D&&(C in D)){return false;}E=w[B]&&w[B].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(C,E[y])){return true;}}}E=w[C]&&w[C].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(B,E[y])){return false;}}}if(A&&(B in A)){return true;}if(x.ext&&x.type==q&&!z.ext&&z.type==q){return true;}return false;},_config:function(C){var y,x,B,z,A,D,w=this;if(C){for(y in C){if(C.hasOwnProperty(y)){B=C[y];if(y=="require"){w.require(B);}else{if(y=="skin"){d.mix(w.skin,C[y],true);}else{if(y=="groups"){for(x in B){if(B.hasOwnProperty(x)){D=x;A=B[x];w.addGroup(A,D);}}}else{if(y=="modules"){r(B,w.addModule,w);}else{if(y=="gallery"){this.groups.gallery.update(B);}else{if(y=="yui2"||y=="2in3"){this.groups.yui2.update(C["2in3"],C.yui2);}else{if(y=="maxURLLength"){w[y]=Math.min(m,B);}else{w[y]=B;}}}}}}}}}}z=w.filter;if(i.isString(z)){z=z.toUpperCase();w.filterName=z;w.filter=w.FILTER_DEFS[z];if(z=="DEBUG"){w.require("yui-log","dump");}}if(w.lang){w.require("intl-base","intl");}},formatSkin:function(y,w){var x=b+y;if(w){x=x+"-"+w;}return x;},_addSkin:function(F,D,E){var C,B,x,w,A=this.moduleInfo,y=this.skin,z=A[D]&&A[D].ext;if(D){x=this.formatSkin(F,D);if(!A[x]){C=A[D];B=C.pkg||D;w={name:x,group:C.group,type:"css",after:y.after,path:(E||B)+"/"+y.base+F+"/"+D+".css",ext:z};if(C.base){w.base=C.base;}if(C.configFn){w.configFn=C.configFn;}this.addModule(w,x);}}return x;},addGroup:function(z,x){var y=z.modules,w=this;x=x||z.name;z.name=x;w.groups[x]=z;if(z.patterns){r(z.patterns,function(B,A){B.group=x;w.patterns[A]=B;});}if(y){r(y,function(B,A){B.group=x;w.addModule(B,A);},w);}},addModule:function(M,T){T=T||M.name;if(this.moduleInfo[T]&&this.moduleInfo[T].temp){M=d.merge(this.moduleInfo[T],M);}M.name=T;if(!M||!M.name){return null;}if(!M.type){M.type=k;}if(!M.path&&!M.fullpath){M.path=g(T,T,M.type);}M.supersedes=M.supersedes||M.use;M.ext=("ext" in M)?M.ext:(this._internal)?false:true;M.requires=this.filterRequires(M.requires)||[];var Q=M.submodules,P,N,H,w,I,y,L,x,O,J,F,C,A,z,S,R,G,B,D,E=this.conditions,K;this.moduleInfo[T]=M;if(!M.langPack&&M.lang){J=j(M.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}}}if(Q){w=M.supersedes||[];N=0;for(P in Q){if(Q.hasOwnProperty(P)){I=Q[P];I.path=I.path||g(T,P,M.type);I.pkg=T;I.group=M.group;if(I.supersedes){w=w.concat(I.supersedes);}y=this.addModule(I,P);w.push(P);if(y.skinnable){M.skinnable=true;G=this.skin.overrides;if(G&&G[P]){for(O=0;O<G[P].length;O++){B=this._addSkin(G[P][O],P,T);w.push(B);}}B=this._addSkin(this.skin.defaultSkin,P,T);w.push(B);}if(I.lang&&I.lang.length){J=j(I.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);C=this.getLangPackName(S,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}A=A||j.hash(y.supersedes);if(!(C in A)){y.supersedes.push(C);}M.lang=M.lang||[];z=z||j.hash(M.lang);if(!(S in z)){M.lang.push(S);}F=this.getLangPackName(u,T);C=this.getLangPackName(u,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}if(!(C in A)){y.supersedes.push(C);}}}N++;}}M.supersedes=j.dedupe(w);if(this.allowRollup){M.rollup=(N<4)?N:Math.min(N-1,4);}}L=M.plugins;if(L){for(P in L){if(L.hasOwnProperty(P)){x=L[P];x.pkg=T;x.path=x.path||g(T,P,M.type);x.requires=x.requires||[];
+x.group=M.group;this.addModule(x,P);if(M.skinnable){this._addSkin(this.skin.defaultSkin,P,T);}}}}if(M.condition){H=M.condition.trigger;if(YUI.Env.aliases[H]){H=YUI.Env.aliases[H];}if(!d.Lang.isArray(H)){H=[H];}for(P=0;P<H.length;P++){K=H[P];D=M.condition.when;E[K]=E[K]||{};E[K][T]=M.condition;if(D&&D!="after"){if(D=="instead"){M.supersedes=M.supersedes||[];M.supersedes.push(K);}else{}}else{M.after=M.after||[];M.after.push(K);}}}if(M.supersedes){M.supersedes=this.filterRequires(M.supersedes);}if(M.after){M.after=this.filterRequires(M.after);M.after_map=j.hash(M.after);}if(M.configFn){R=M.configFn(M);if(R===false){delete this.moduleInfo[T];M=null;}}return M;},require:function(x){var w=(typeof x==="string")?j(arguments):x;this.dirty=true;this.required=d.merge(this.required,j.hash(this.filterRequires(w)));this._explodeRollups();},_explodeRollups:function(){var x=this,w,y=x.required;if(!x.allowRollup){r(y,function(z,A){w=x.getModule(A);if(w&&w.use){j.each(w.use,function(B){w=x.getModule(B);if(w&&w.use){j.each(w.use,function(C){y[C]=true;});}else{y[B]=true;}});}});x.required=y;}},filterRequires:function(z){if(z){if(!d.Lang.isArray(z)){z=[z];}z=d.Array(z);var B=[],y,x,A,w;for(y=0;y<z.length;y++){x=this.getModule(z[y]);if(x&&x.use){for(A=0;A<x.use.length;A++){w=this.getModule(x.use[A]);if(w&&w.use){B=d.Array.dedupe([].concat(B,this.filterRequires(w.use)));}else{B.push(x.use[A]);}}}else{B.push(z[y]);}}z=B;}return z;},getRequires:function(R){if(!R){return c;}if(R._parsed){return R.expanded||c;}var L,H,K,D,C,T,A=this.testresults,U=R.name,B,S=n[U]&&n[U].details,N,I,w,E,O,F,z,P,Q,y,G=R.lang||R.intl,M=this.moduleInfo,J=d.Features&&d.Features.tests.load,x;if(R.temp&&S){O=R;R=this.addModule(S,U);R.group=O.group;R.pkg=O.pkg;delete R.expanded;}if(R.expanded&&(!this.lang||R.langCache===this.lang)){return R.expanded;}N=[];x={};E=this.filterRequires(R.requires);if(R.lang){N.unshift("intl");E.unshift("intl");G=true;}F=this.filterRequires(R.optional);R._parsed=true;R.langCache=this.lang;for(L=0;L<E.length;L++){if(!x[E[L]]){N.push(E[L]);x[E[L]]=true;H=this.getModule(E[L]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(K=0;K<D.length;K++){N.push(D[K]);}}}}E=this.filterRequires(R.supersedes);if(E){for(L=0;L<E.length;L++){if(!x[E[L]]){if(R.submodules){N.push(E[L]);}x[E[L]]=true;H=this.getModule(E[L]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(K=0;K<D.length;K++){N.push(D[K]);}}}}}if(F&&this.loadOptional){for(L=0;L<F.length;L++){if(!x[F[L]]){N.push(F[L]);x[F[L]]=true;H=M[F[L]];if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(K=0;K<D.length;K++){N.push(D[K]);}}}}}B=this.conditions[U];if(B){R._parsed=false;if(A&&J){r(A,function(V,X){var W=J[X].name;if(!x[W]&&J[X].trigger==U){if(V&&J[X]){x[W]=true;N.push(W);}}});}else{r(B,function(X,W){if(!x[W]){var V=X&&((X.ua&&d.UA[X.ua])||(X.test&&X.test(d,E)));if(V){x[W]=true;N.push(W);H=this.getModule(W);if(H){D=this.getRequires(H);for(K=0;K<D.length;K++){N.push(D[K]);}}}}},this);}}if(R.skinnable){P=this.skin.overrides;r(YUI.Env.aliases,function(V,W){if(d.Array.indexOf(V,U)>-1){Q=W;}});if(P&&(P[U]||(Q&&P[Q]))){y=U;if(P[Q]){y=Q;}for(L=0;L<P[y].length;L++){z=this._addSkin(P[y][L],U);N.push(z);}}else{z=this._addSkin(this.skin.defaultSkin,U);N.push(z);}}R._parsed=false;if(G){if(R.lang&&!R.langPack&&d.Intl){T=d.Intl.lookupBestLang(this.lang||u,R.lang);C=this.getLangPackName(T,U);if(C){N.unshift(C);}}N.unshift(v);}R.expanded_map=j.hash(N);R.expanded=e.keys(R.expanded_map);return R.expanded;},getProvides:function(x){var w=this.getModule(x),z,y;if(!w){return f;}if(w&&!w.provides){z={};y=w.supersedes;if(y){j.each(y,function(A){d.mix(z,this.getProvides(A));},this);}z[x]=true;w.provides=z;}return w.provides;},calculate:function(x,w){if(x||w||this.dirty){if(x){this._config(x);}if(!this._init){this._setup();}this._explode();if(this.allowRollup){this._rollup();}else{this._explodeRollups();}this._reduce();this._sort();}},_addLangPack:function(B,w,A){var y=w.name,x,z=this.moduleInfo[A];if(!z){x=g((w.pkg||y),A,k,true);this.addModule({path:x,intl:true,langPack:true,ext:w.ext,group:w.group,supersedes:[]},A);if(B){d.Env.lang=d.Env.lang||{};d.Env.lang[B]=d.Env.lang[B]||{};d.Env.lang[B][y]=true;}}return this.moduleInfo[A];},_setup:function(){var C=this.moduleInfo,z,A,y,w,x,B;for(z in C){if(C.hasOwnProperty(z)){w=C[z];if(w){w.requires=j.dedupe(w.requires);if(w.lang&&w.lang.length){B=this.getLangPackName(u,z);this._addLangPack(null,w,B);}}}}x={};if(!this.ignoreRegistered){d.mix(x,a.mods);}if(this.ignore){d.mix(x,j.hash(this.ignore));}for(y in x){if(x.hasOwnProperty(y)){d.mix(x,this.getProvides(y));}}if(this.force){for(A=0;A<this.force.length;A++){if(this.force[A] in x){delete x[this.force[A]];}}}d.mix(this.loaded,x);this._init=true;},getLangPackName:function(x,w){return("lang/"+w+((x)?"_"+x:""));},_explode:function(){var A=this.required,w,z,x={},y=this;y.dirty=false;y._explodeRollups();A=y.required;r(A,function(B,C){if(!x[C]){x[C]=true;w=y.getModule(C);if(w){var D=w.expound;if(D){A[D]=y.getModule(D);z=y.getRequires(A[D]);d.mix(A,j.hash(z));}z=y.getRequires(w);d.mix(A,j.hash(z));}}});},getModule:function(B){if(!B){return null;}var A,z,x,w=this.moduleInfo[B],y=this.patterns;if(!w){for(x in y){if(y.hasOwnProperty(x)){A=y[x];if(!A.test){A.test=function(D,C){return(D.indexOf(C)>-1);};}if(A.test(B,x)){z=A;break;}}}if(z){if(A.action){A.action.call(this,B,x);}else{w=this.addModule(d.merge(z),B);w.temp=true;}}}return w;},_rollup:function(){},_reduce:function(B){B=B||this.required;var y,x,A,w,z=this.loadType,C=this.ignore?j.hash(this.ignore):false;for(y in B){if(B.hasOwnProperty(y)){w=this.getModule(y);if(((this.loaded[y]||n[y])&&!this.forceMap[y]&&!this.ignoreRegistered)||(z&&w&&w.type!=z)){delete B[y];}if(C&&C[y]){delete B[y];}A=w&&w.supersedes;if(A){for(x=0;x<A.length;x++){if(A[x] in B){delete B[A[x]];}}}}}return B;},_finish:function(y,x){h.running=false;var w=this.onEnd;if(w){w.call(this.context,{msg:y,data:this.data,success:x});
+}this._continue();},_onSuccess:function(){var y=this,x=d.merge(y.skipped),A,w=[],z=y.requireRegistration,C,B;r(x,function(D){delete y.inserted[D];});y.skipped={};r(y.inserted,function(E,D){var F=y.getModule(D);if(F&&z&&F.type==k&&!(D in YUI.Env.mods)){w.push(D);}else{d.mix(y.loaded,y.getProvides(D));}});A=y.onSuccess;B=(w.length)?"notregistered":"success";C=!(w.length);if(A){A.call(y.context,{msg:B,data:y.data,success:C,failed:w,skipped:x});}y._finish(B,C);},_onProgress:function(x){var w=this;if(w.onProgress){w.onProgress.call(w.context,{name:x.url,data:x.data});}},_onFailure:function(y){var w=this.onFailure,x="failure: "+y.msg;if(w){w.call(this.context,{msg:x,data:this.data,success:false});}this._finish(x,false);},_onTimeout:function(){var w=this.onTimeout;if(w){w.call(this.context,{msg:"timeout",data:this.data,success:false});}this._finish("timeout",false);},_sort:function(){var F=e.keys(this.required),B={},w=0,y,E,D,A,z,C,x;for(;;){y=F.length;C=false;for(A=w;A<y;A++){E=F[A];for(z=A+1;z<y;z++){x=E+F[z];if(!B[x]&&this._requires(E,F[z])){D=F.splice(z,1);F.splice(A,0,D[0]);B[x]=true;C=true;break;}}if(C){break;}else{w++;}}if(!C){break;}}this.sorted=F;},partial:function(w,y,x){this.sorted=w;this.insert(y,x,true);},_insert:function(w,z,E,y){if(w){this._config(w);}if(!y){this.calculate(z);}var B=this.resolve(),F=this,D=0,C=0;if(E){var A=B[E];B={};B[E]=A;D++;}else{if(B.js.length){D++;}if(B.css.length){D++;}}var x=function(H){C++;if(H&&H.data&&H.data.length){for(var G=0;G<H.data.length;G++){F.inserted[H.data[G].name]=true;}}if(C===D){F._loading=null;F._onSuccess();}};this._loading=true;if(!B.js.length&&!B.css.length){C=-1;x();return;}if(B.css.length){d.Get.css(B.css,{data:B.cssMods,insertBefore:F.insertBefore,charset:F.charset,timeout:F.timeout,autopurge:false,context:F,async:true,onFailure:F._onFailure,onTimeout:F._onTimeout,onProgress:function(G){F._onProgress.call(F,G);},onSuccess:x});}if(B.js.length){d.Get.script(B.js,{data:B.jsMods,insertBefore:F.insertBefore,charset:F.charset,timeout:F.timeout,autopurge:false,context:F,async:true,onProgress:function(G){F._onProgress.call(F,G);},onFailure:F._onFailure,onTimeout:F._onTimeout,onSuccess:x});}},_continue:function(){if(!(h.running)&&h.size()>0){h.running=true;h.next()();}},insert:function(z,x,y){var w=this,A=d.merge(this);delete A.require;delete A.dirty;h.add(function(){w._insert(A,z,x,y);});this._continue();},loadNext:function(A){if(!this._loading){return;}var H,P,O,M,z,E,B,L,D,G,N,w,C,K,y,F,Q,R,J=this,x=J.loadType,S=function(T){J.loadNext(T.data);},I=function(V){J._combineComplete[x]=true;var U,T=F.length;for(U=0;U<T;U++){J.inserted[F[U]]=true;}S(V);};if(J.combine&&(!J._combineComplete[x])){F=[];J._combining=F;H=J.sorted;P=H.length;R=J.comboBase;z=R;Q=[];K={};for(O=0;O<P;O++){C=R;M=J.getModule(H[O]);G=M&&M.group;if(G){D=J.groups[G];if(!D.combine){M.combine=false;continue;}M.combine=true;if(D.comboBase){C=D.comboBase;}if("root" in D&&i.isValue(D.root)){M.root=D.root;}}K[C]=K[C]||[];K[C].push(M);}for(N in K){if(K.hasOwnProperty(N)){z=N;y=K[N];P=y.length;for(O=0;O<P;O++){M=y[O];if(M&&(M.type===x)&&(M.combine||!M.ext)){w=((i.isValue(M.root))?M.root:J.root)+M.path;w=J._filter(w,M.name);if((z!==N)&&(O<=(P-1))&&((w.length+z.length)>J.maxURLLength)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));z=N;}z+=w;if(O<(P-1)){z+=J.comboSep;}F.push(M.name);}}if(F.length&&(z!=N)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));}}}if(F.length){if(x===q){E=d.Get.css;L=J.cssAttributes;}else{E=d.Get.script;L=J.jsAttributes;}E(Q,{data:J._loading,onSuccess:I,onFailure:J._onFailure,onTimeout:J._onTimeout,insertBefore:J.insertBefore,charset:J.charset,attributes:L,timeout:J.timeout,autopurge:false,context:J});return;}else{J._combineComplete[x]=true;}}if(A){if(A!==J._loading){return;}J.inserted[A]=true;if(J.onProgress){J.onProgress.call(J.context,{name:A,data:J.data});}}H=J.sorted;P=H.length;for(O=0;O<P;O=O+1){if(H[O] in J.inserted){continue;}if(H[O]===J._loading){return;}M=J.getModule(H[O]);if(!M){if(!J.skipped[H[O]]){B="Undefined module "+H[O]+" skipped";J.skipped[H[O]]=true;}continue;}D=(M.group&&J.groups[M.group])||f;if(!x||x===M.type){J._loading=H[O];if(M.type===q){E=d.Get.css;L=J.cssAttributes;if(M.cssAttributes){L=d.mix(L||{},M.cssAttributes);}}else{E=d.Get.script;L=J.jsAttributes;if(M.jsAttributes){L=d.mix(L||{},M.jsAttributes);}}z=(M.fullpath)?J._filter(M.fullpath,H[O]):J._url(M.path,H[O],D.base||M.base);E(z,{data:H[O],onSuccess:S,insertBefore:J.insertBefore,charset:J.charset,attributes:L,onFailure:J._onFailure,onTimeout:J._onTimeout,timeout:J.timeout,autopurge:false,context:J});return;}}J._loading=null;E=J._internalCallback;if(E){J._internalCallback=null;E.call(J);}else{J._onSuccess();}},_filter:function(y,x){var A=this.filter,w=x&&(x in this.filters),z=w&&this.filters[x],B=this.moduleInfo[x]?this.moduleInfo[x].group:null;if(B&&this.groups[B].filter){z=this.groups[B].filter;w=true;}if(y){if(w){A=(i.isString(z))?this.FILTER_DEFS[z.toUpperCase()]||null:z;}if(A){y=y.replace(new RegExp(A.searchExp,"g"),A.replaceStr);}}return y;},_url:function(y,w,x){return this._filter((x||this.base||"")+y,w);},resolve:function(w,K){var T,S,Q,B,G,D,P,F,J,R,x,E,N,A,V,C,U,I=[],H,M,y={},L=this,O={js:[],jsMods:[],css:[],cssMods:[]},z=L.loadType||"js";if(w){L.calculate();}K=K||L.sorted;if(L.combine){T=K.length;V=L.comboBase;B=V;N={};for(S=0;S<T;S++){E=V;Q=L.getModule(K[S]);J=Q&&Q.group;if(J){F=L.groups[J];if(!F.combine){Q.combine=false;continue;}Q.combine=true;if(F.comboBase){E=F.comboBase;}if("root" in F&&i.isValue(F.root)){Q.root=F.root;}}N[E]=N[E]||[];N[E].push(Q);}for(R in N){if(N.hasOwnProperty(R)){y[R]=y[R]||{js:[],jsMods:[],css:[],cssMods:[]};B=R;A=N[R];T=A.length;if(T){for(S=0;S<T;S++){Q=A[S];if(Q&&(Q.combine||!Q.ext)){x=((i.isValue(Q.root))?Q.root:L.root)+Q.path;x=L._filter(x,Q.name);y[R][Q.type].push(x);y[R][Q.type+"Mods"].push(Q);}}}}}for(R in y){C=R;for(z in y[C]){if(z===k||z===q){U=y[C][z];A=y[C][z+"Mods"];
+T=U.length;H=C+U.join(L.comboSep);M=H.length;if(T){if(M>L.maxURLLength){I=[];Q=[];for(K=0;K<T;K++){H=C+I.join(L.comboSep);if(H.length<L.maxURLLength){I.push(U[K]);Q.push(A[K]);}else{O[z].push(H);I=[];Q=[];}}}else{O[z].push(H);O[z+"Mods"]=A;}}}}}y=null;}else{K=L.sorted;T=K.length;for(S=0;S<T;S=S+1){Q=L.getModule(K[S]);if(!Q){if(!L.skipped[K[S]]){D="Undefined module "+K[S]+" skipped";}continue;}F=(Q.group&&L.groups[Q.group])||f;B=(Q.fullpath)?L._filter(Q.fullpath,K[S]):L._url(Q.path,K[S],F.base||Q.base);O[Q.type].push(B);O[Q.type+"Mods"].push(Q);}}return O;}};},"@VERSION@",{requires:["get"]});
View
315 build/loader-base/loader-base.js
@@ -133,10 +133,6 @@ var NOT_FOUND = {},
return path;
};
-if (YUI.Env.aliases) {
- YUI.Env.aliases = {}; //Don't need aliases if Loader is present
-}
-
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
@@ -1188,7 +1184,12 @@ Y.Loader.prototype = {
}
}
+ if (o.supersedes) {
+ o.supersedes = this.filterRequires(o.supersedes);
+ }
+
if (o.after) {
+ o.after = this.filterRequires(o.after);
o.after_map = YArray.hash(o.after);
}
@@ -1294,12 +1295,20 @@ Y.Loader.prototype = {
*/
getRequires: function(mod) {
- if (!mod || mod._parsed) {
+ if (!mod) {
+ //console.log('returning no reqs for ' + mod.name);
return NO_REQUIREMENTS;
}
+ if (mod._parsed) {
+ //console.log('returning requires for ' + mod.name, mod.requires);
+ return mod.expanded || NO_REQUIREMENTS;
+ }
+
+ //TODO add modue cache here out of scope..
+
var i, m, j, add, packName, lang, testresults = this.testresults,
- name = mod.name, cond, go,
+ name = mod.name, cond,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
@@ -1330,7 +1339,6 @@ Y.Loader.prototype = {
d = [];
hash = {};
-
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
@@ -1409,6 +1417,8 @@ Y.Loader.prototype = {
cond = this.conditions[name];
if (cond) {
+ //Set the module to not parsed since we have conditionals and this could change the dependency tree.
+ mod._parsed = false;
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
@@ -1425,7 +1435,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
@@ -1437,6 +1447,7 @@ Y.Loader.prototype = {
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
+
}
}
}
@@ -1669,6 +1680,7 @@ Y.Loader.prototype = {
* @private
*/
_explode: function() {
+ //TODO Move done out of scope
var r = this.required, m, reqs, done = {},
self = this;
@@ -1720,10 +1732,18 @@ Y.Loader.prototype = {
for (pname in patterns) {
if (patterns.hasOwnProperty(pname)) {
p = patterns[pname];
+
+ //There is no test method, create a default one that tests
+ // the pattern against the mod name
+ if (!p.test) {
+ p.test = function(mname, pname) {
+ return (mname.indexOf(pname) > -1);
+ };
+ }
- // use the metadata supplied for the pattern
- // as the module definition.
- if (mname.indexOf(pname) > -1) {
+ if (p.test(mname, pname)) {
+ // use the metadata supplied for the pattern
+ // as the module definition.
found = p;
break;
}
@@ -1848,6 +1868,20 @@ Y.Loader.prototype = {
self._finish(msg, success);
},
/**
+ * The default Loader onProgress handler, calls this.onProgress with a payload
+ * @method _onProgress
+ * @private
+ */
+ _onProgress: function(e) {
+ var self = this;
+ if (self.onProgress) {
+ self.onProgress.call(self.context, {
+ name: e.url,
+ data: e.data
+ });
+ }
+ },
+ /**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
@@ -1891,6 +1925,7 @@ Y.Loader.prototype = {
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
+ //TODO Move this out of scope
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
@@ -1960,6 +1995,7 @@ Y.Loader.prototype = {
this.sorted = partial;
this.insert(o, type, true);
},
+
/**
* Handles the actual insertion of script/link tags
* @method _insert
@@ -1983,6 +2019,88 @@ Y.Loader.prototype = {
this.calculate(o);
}
+ var modules = this.resolve(),
+ self = this, comp = 0, actions = 0;
+
+ if (type) {
+ var m = modules[type];
+ modules = {};
+ modules[type] = m;
+ comp++;
+ } else {
+ if (modules.js.length) {
+ comp++;
+ }
+ if (modules.css.length) {
+ comp++;
+ }
+ }
+
+ //console.log('Resolved Modules: ', modules);
+
+ var complete = function(d) {
+ actions++;
+
+ if (d && d.data && d.data.length) {
+ for (var i = 0; i < d.data.length; i++) {
+ self.inserted[d.data[i].name] = true;
+ }
+ }
+
+ if (actions === comp) {
+ self._loading = null;
+ self._onSuccess();
+ }
+ };
+
+ this._loading = true;
+
+ if (!modules.js.length && !modules.css.length) {
+ actions = -1;
+ complete();
+ return;
+ }
+
+
+ if (modules.css.length) { //Load CSS first
+ Y.Get.css(modules.css, {
+ data: modules.cssMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onSuccess: complete
+ });
+ }
+
+ if (modules.js.length) {
+ Y.Get.script(modules.js, {
+ data: modules.jsMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onSuccess: complete
+ });
+ }
+
+
+ /*
+
this.loadType = type;
if (!type) {
@@ -2029,6 +2147,7 @@ Y.Loader.prototype = {
// start the load
this.loadNext();
+ */
},
/**
@@ -2397,68 +2516,146 @@ Y.Loader.prototype = {
*
*/
resolve: function(calc, s) {
- var self = this, i, m, url, out = { js: [], css: [] };
+
+ var len, i, m, url, fn, msg, attr, group, groupName, j, frag,
+ comboSource, comboSources, mods, comboBase,
+ base, urls, u = [], tmpBase, baseLen, resCombos = {},
+ self = this,
+ resolved = { js: [], jsMods: [], css: [], cssMods: [] },
+ type = self.loadType || 'js';
if (calc) {
self.calculate();
}
s = s || self.sorted;
- for (i = 0; i < s.length; i++) {
- m = self.getModule(s[i]);
- if (m) {
- if (self.combine) {
- url = self._filter((self.root + m.path), m.name, self.root);
- } else {
- url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
+ if (self.combine) {
+
+ len = s.length;
+
+ // the default combo base
+ comboBase = self.comboBase;
+
+ url = comboBase;
+
+ comboSources = {};
+
+ for (i = 0; i < len; i++) {
+ comboSource = comboBase;
+ m = self.getModule(s[i]);
+ groupName = m && m.group;
+ if (groupName) {
+
+ group = self.groups[groupName];
+
+ if (!group.combine) {
+ m.combine = false;
+ continue;
+ }
+ m.combine = true;
+ if (group.comboBase) {
+ comboSource = group.comboBase;
+ }
+
+ if ("root" in group && L.isValue(group.root)) {
+ m.root = group.root;
+ }
+
}
- out[m.type].push(url);
+
+ comboSources[comboSource] = comboSources[comboSource] || [];
+ comboSources[comboSource].push(m);
}
- }
- if (self.combine) {
- out.js = [self.comboBase + out.js.join(self.comboSep)];
- out.css = [self.comboBase + out.css.join(self.comboSep)];
- }
- return out;
- },
- /**
- * Returns an Object hash of hashes built from `loader.sorted` or from an arbitrary list of sorted modules.
- * @method hash
- * @private
- * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
- * @param {Array} [s=loader.sorted] An override for the loader.sorted array
- * @return {Object} Object hash (js and css) of two object hashes of file lists, with the module name as the key
- * @example This method can be used as an off-line dep calculator
- *
- * var Y = YUI();
- * var loader = new Y.Loader({
- * filter: 'debug',
- * base: '../../',
- * root: 'build/',
- * combine: true,
- * require: ['node', 'dd', 'console']
- * });
- * var out = loader.hash(true);
- *
- */
- hash: function(calc, s) {
- var self = this, i, m, url, out = { js: {}, css: {} };
+ for (j in comboSources) {
+ if (comboSources.hasOwnProperty(j)) {
+ resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };
+ url = j;
+ mods = comboSources[j];
+ len = mods.length;
+
+ if (len) {
+ for (i = 0; i < len; i++) {
+ m = mods[i];
+ // Do not try to combine non-yui JS unless combo def
+ // is found
+ if (m && (m.combine || !m.ext)) {
+
+ frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
+ frag = self._filter(frag, m.name);
+ resCombos[j][m.type].push(frag);
+ resCombos[j][m.type + 'Mods'].push(m);
+ }
- if (calc) {
- self.calculate();
- }
- s = s || self.sorted;
+ }
+ }
+ }
+ }
- for (i = 0; i < s.length; i++) {
- m = self.getModule(s[i]);
- if (m) {
- url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
- out[m.type][m.name] = url;
+ for (j in resCombos) {
+ base = j;
+ for (type in resCombos[base]) {
+ if (type === JS || type === CSS) {
+ urls = resCombos[base][type];
+ mods = resCombos[base][type + 'Mods'];
+ len = urls.length;
+ tmpBase = base + urls.join(self.comboSep);
+ baseLen = tmpBase.length;
+
+ if (len) {
+ if (baseLen > self.maxURLLength) {
+ u = [];
+ m = [];
+ for (s = 0; s < len; s++) {
+ tmpBase = base + u.join(self.comboSep);
+ if (tmpBase.length < self.maxURLLength) {
+ u.push(urls[s]);
+ m.push(mods[s]);
+ } else {
+ resolved[type].push(tmpBase);
+ u = [];
+ m = [];
+ }
+ }
+ } else {
+ resolved[type].push(tmpBase);
+ resolved[type + 'Mods'] = mods;
+ }
+ }
+ }
+ }
+ }
+
+ resCombos = null;
+
+ } else {
+
+ s = self.sorted;
+ len = s.length;
+
+ for (i = 0; i < len; i = i + 1) {
+
+ m = self.getModule(s[i]);
+
+ if (!m) {
+ if (!self.skipped[s[i]]) {
+ msg = 'Undefined module ' + s[i] + ' skipped';
+ }
+ continue;
+
+ }
+
+ group = (m.group && self.groups[m.group]) || NOT_FOUND;
+
+ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
+ self._url(m.path, s[i], group.base || m.base);
+
+ resolved[m.type].push(url);
+ resolved[m.type + 'Mods'].push(m);
}
}
- return out;
+ return resolved;
}
};
View
330 build/loader/loader-debug.js
@@ -133,10 +133,6 @@ var NOT_FOUND = {},
return path;
};
-if (YUI.Env.aliases) {
- YUI.Env.aliases = {}; //Don't need aliases if Loader is present
-}
-
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
@@ -1192,7 +1188,12 @@ Y.Loader.prototype = {
}
}
+ if (o.supersedes) {
+ o.supersedes = this.filterRequires(o.supersedes);
+ }
+
if (o.after) {
+ o.after = this.filterRequires(o.after);
o.after_map = YArray.hash(o.after);
}
@@ -1298,13 +1299,20 @@ Y.Loader.prototype = {
*/
getRequires: function(mod) {
- if (!mod || mod._parsed) {
- // Y.log('returning no reqs for ' + mod.name);
+ if (!mod) {
+ //console.log('returning no reqs for ' + mod.name);
return NO_REQUIREMENTS;
}
+ if (mod._parsed) {
+ //console.log('returning requires for ' + mod.name, mod.requires);
+ return mod.expanded || NO_REQUIREMENTS;
+ }
+
+ //TODO add modue cache here out of scope..
+
var i, m, j, add, packName, lang, testresults = this.testresults,
- name = mod.name, cond, go,
+ name = mod.name, cond,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
@@ -1336,7 +1344,6 @@ Y.Loader.prototype = {
d = [];
hash = {};
-
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
@@ -1418,6 +1425,8 @@ Y.Loader.prototype = {
cond = this.conditions[name];
if (cond) {
+ //Set the module to not parsed since we have conditionals and this could change the dependency tree.
+ mod._parsed = false;
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
@@ -1434,19 +1443,19 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
hash[condmod] = true;
d.push(condmod);
m = this.getModule(condmod);
- // Y.log('conditional', m);
if (m) {
add = this.getRequires(m);
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
+
}
}
}
@@ -1680,6 +1689,7 @@ Y.Loader.prototype = {
* @private
*/
_explode: function() {
+ //TODO Move done out of scope
var r = this.required, m, reqs, done = {},
self = this;
@@ -1734,10 +1744,18 @@ Y.Loader.prototype = {
if (patterns.hasOwnProperty(pname)) {
// Y.log('testing pattern ' + i);
p = patterns[pname];
+
+ //There is no test method, create a default one that tests
+ // the pattern against the mod name
+ if (!p.test) {
+ p.test = function(mname, pname) {
+ return (mname.indexOf(pname) > -1);
+ };
+ }
- // use the metadata supplied for the pattern
- // as the module definition.
- if (mname.indexOf(pname) > -1) {
+ if (p.test(mname, pname)) {
+ // use the metadata supplied for the pattern
+ // as the module definition.
found = p;
break;
}
@@ -1867,6 +1885,20 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
self._finish(msg, success);
},
/**
+ * The default Loader onProgress handler, calls this.onProgress with a payload
+ * @method _onProgress
+ * @private
+ */
+ _onProgress: function(e) {
+ var self = this;
+ if (self.onProgress) {
+ self.onProgress.call(self.context, {
+ name: e.url,
+ data: e.data
+ });
+ }
+ },
+ /**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
@@ -1912,6 +1944,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
+ //TODO Move this out of scope
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
@@ -1981,6 +2014,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
this.sorted = partial;
this.insert(o, type, true);
},
+
/**
* Handles the actual insertion of script/link tags
* @method _insert
@@ -1991,7 +2025,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
*/
_insert: function(source, o, type, skipcalc) {
-// Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
+ Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
// restore the state at the time of the request
if (source) {
@@ -2005,6 +2039,92 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
this.calculate(o);
}
+ var modules = this.resolve(),
+ self = this, comp = 0, actions = 0;
+
+ if (type) {
+ var m = modules[type];
+ modules = {};
+ modules[type] = m;
+ comp++;
+ } else {
+ if (modules.js.length) {
+ comp++;
+ }
+ if (modules.css.length) {
+ comp++;
+ }
+ }
+
+ //console.log('Resolved Modules: ', modules);
+
+ var complete = function(d) {
+ actions++;
+
+ if (d && d.data && d.data.length) {
+ for (var i = 0; i < d.data.length; i++) {
+ self.inserted[d.data[i].name] = true;
+ }
+ }
+
+ if (actions === comp) {
+ self._loading = null;
+ Y.log('Loader actions complete!', 'info', 'loader');
+ self._onSuccess();
+ }
+ };
+
+ this._loading = true;
+
+ if (!modules.js.length && !modules.css.length) {
+ Y.log('No modules resolved..', 'warn', 'loader');
+ actions = -1;
+ complete();
+ return;
+ }
+
+
+ if (modules.css.length) { //Load CSS first
+ Y.log('Loading CSS modules', 'info', 'loader');
+ Y.Get.css(modules.css, {
+ data: modules.cssMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onSuccess: complete
+ });
+ }
+
+ if (modules.js.length) {
+ Y.log('Loading JS modules', 'info', 'loader');
+ Y.Get.script(modules.js, {
+ data: modules.jsMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onSuccess: complete
+ });
+ }
+
+
+ /*
+
this.loadType = type;
if (!type) {
@@ -2052,6 +2172,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
// start the load
this.loadNext();
+ */
},
/**
@@ -2075,8 +2196,8 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
* @param {string} type the type of dependency to insert.
*/
insert: function(o, type, skipsort) {
- // Y.log('public insert() ' + (type || '') + ', ' +
- // Y.Object.keys(this.required), "info", "loader");
+ Y.log('public insert() ' + (type || '') + ', ' +
+ Y.Object.keys(this.required), "info", "loader");
var self = this, copy = Y.merge(this);
delete copy.require;
delete copy.dirty;
@@ -2097,6 +2218,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
* one).
*/
loadNext: function(mname) {
+ Y.log('loadNext was called..', 'warn', 'loader');
// It is possible that this function is executed due to something
// else on the page loading a YUI module. Only react when we
// are actively loading something
@@ -2430,68 +2552,148 @@ Y.log('attempting to load ' + s[i] + ', ' + self.base, 'info', 'loader');
*
*/
resolve: function(calc, s) {
- var self = this, i, m, url, out = { js: [], css: [] };
+
+ var len, i, m, url, fn, msg, attr, group, groupName, j, frag,
+ comboSource, comboSources, mods, comboBase,
+ base, urls, u = [], tmpBase, baseLen, resCombos = {},
+ self = this,
+ resolved = { js: [], jsMods: [], css: [], cssMods: [] },
+ type = self.loadType || 'js';
if (calc) {
self.calculate();
}
s = s || self.sorted;
- for (i = 0; i < s.length; i++) {
- m = self.getModule(s[i]);
- if (m) {
- if (self.combine) {
- url = self._filter((self.root + m.path), m.name, self.root);
- } else {
- url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
+ if (self.combine) {
+
+ len = s.length;
+
+ // the default combo base
+ comboBase = self.comboBase;
+
+ url = comboBase;
+
+ comboSources = {};
+
+ for (i = 0; i < len; i++) {
+ comboSource = comboBase;
+ m = self.getModule(s[i]);
+ groupName = m && m.group;
+ if (groupName) {
+
+ group = self.groups[groupName];
+
+ if (!group.combine) {
+ m.combine = false;
+ continue;
+ }
+ m.combine = true;
+ if (group.comboBase) {
+ comboSource = group.comboBase;
+ }
+
+ if ("root" in group && L.isValue(group.root)) {
+ m.root = group.root;
+ }
+
}
- out[m.type].push(url);
+
+ comboSources[comboSource] = comboSources[comboSource] || [];
+ comboSources[comboSource].push(m);
}
- }
- if (self.combine) {
- out.js = [self.comboBase + out.js.join(self.comboSep)];
- out.css = [self.comboBase + out.css.join(self.comboSep)];
- }
- return out;
- },
- /**
- * Returns an Object hash of hashes built from `loader.sorted` or from an arbitrary list of sorted modules.
- * @method hash
- * @private
- * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
- * @param {Array} [s=loader.sorted] An override for the loader.sorted array
- * @return {Object} Object hash (js and css) of two object hashes of file lists, with the module name as the key
- * @example This method can be used as an off-line dep calculator
- *
- * var Y = YUI();
- * var loader = new Y.Loader({
- * filter: 'debug',
- * base: '../../',
- * root: 'build/',
- * combine: true,
- * require: ['node', 'dd', 'console']
- * });
- * var out = loader.hash(true);
- *
- */
- hash: function(calc, s) {
- var self = this, i, m, url, out = { js: {}, css: {} };
+ for (j in comboSources) {
+ if (comboSources.hasOwnProperty(j)) {
+ resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };
+ url = j;
+ mods = comboSources[j];
+ len = mods.length;
+
+ if (len) {
+ for (i = 0; i < len; i++) {
+ m = mods[i];
+ // Do not try to combine non-yui JS unless combo def
+ // is found
+ if (m && (m.combine || !m.ext)) {
+
+ frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
+ frag = self._filter(frag, m.name);
+ resCombos[j][m.type].push(frag);
+ resCombos[j][m.type + 'Mods'].push(m);
+ }
- if (calc) {
- self.calculate();
- }
- s = s || self.sorted;
+ }
+ }
+ }
+ }
- for (i = 0; i < s.length; i++) {
- m = self.getModule(s[i]);
- if (m) {
- url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
- out[m.type][m.name] = url;
+ for (j in resCombos) {
+ base = j;
+ for (type in resCombos[base]) {
+ if (type === JS || type === CSS) {
+ urls = resCombos[base][type];
+ mods = resCombos[base][type + 'Mods'];
+ len = urls.length;
+ tmpBase = base + urls.join(self.comboSep);
+ baseLen = tmpBase.length;
+
+ if (len) {
+ if (baseLen > self.maxURLLength) {
+ Y.log('Exceeded maxURLLength for ' + type + ', splitting', 'info', 'loader');
+ u = [];
+ m = [];
+ for (s = 0; s < len; s++) {
+ tmpBase = base + u.join(self.comboSep);
+ if (tmpBase.length < self.maxURLLength) {
+ u.push(urls[s]);
+ m.push(mods[s]);
+ } else {
+ resolved[type].push(tmpBase);
+ u = [];
+ m = [];
+ }
+ }
+ } else {
+ resolved[type].push(tmpBase);
+ resolved[type + 'Mods'] = mods;
+ }
+ }
+ }
+ }
+ }
+
+ resCombos = null;
+
+ } else {
+
+ s = self.sorted;
+ len = s.length;
+
+ for (i = 0; i < len; i = i + 1) {
+
+ m = self.getModule(s[i]);
+
+ if (!m) {
+ if (!self.skipped[s[i]]) {
+ msg = 'Undefined module ' + s[i] + ' skipped';
+ Y.log(msg, 'warn', 'loader');
+ }
+ continue;
+
+ }
+
+ group = (m.group && self.groups[m.group]) || NOT_FOUND;
+
+ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
+ self._url(m.path, s[i], group.base || m.base);
+
+ resolved[m.type].push(url);
+ resolved[m.type + 'Mods'].push(m);
}
}
- return out;
+ return resolved;
}
};
View
10 build/loader/loader-min.js
@@ -1,6 +1,6 @@
-YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var I=d.version,E="/build/",F=I+E,D=d.Env.base,A="gallery-2011.10.20-23-28",C="2in3",B="4",z="2.9.0",G=D+"combo?",H={version:I,root:F,base:d.Env.base,comboBase:G,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},y=H.groups,x=function(K,L){var J=C+"."+(K||B)+"/"+(L||z)+E;y.yui2.base=D+J;y.yui2.root=J;},w=function(J){var K=(J||A)+E;y.gallery.base=D+K;y.gallery.root=K;};y[I]={};y.gallery={ext:false,combine:true,comboBase:G,update:w,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}};y.yui2={combine:true,ext:false,comboBase:G,update:x,patterns:{"yui2-":{configFn:function(J){if(/-skin|reset|fonts|grids|base/.test(J.name)){J.type="css";J.path=J.path.replace(/\.js/,".css");J.path=J.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};w();x();YUI.Env[I]=H;}());}var f={},c=[],m=2048,a=YUI.Env,p=a._loaded,q="css",k="js",v="intl",s=d.version,u="",e=d.Object,r=e.each,j=d.Array,h=a._loaderQueue,t=a[s],b="skin-",i=d.Lang,n=a.mods,l,o,g=function(x,y,z,w){var A=x+"/"+y;if(!w){A+="-min";}A+="."+(z||q);return A;};if(YUI.Env.aliases){YUI.Env.aliases={};}d.Env.meta=t;d.Loader=function(A){var z=t.modules,x=this;l=t.md5;x.context=d;x.base=d.Env.meta.base+d.Env.meta.root;x.comboBase=d.Env.meta.comboBase;x.combine=A.base&&(A.base.indexOf(x.comboBase.substr(0,20))>-1);x.comboSep="&";x.maxURLLength=m;x.root=d.Env.meta.root;x.timeout=0;x.forceMap={};x.allowRollup=false;x.filters={};x.required={};x.patterns={};x.moduleInfo={};x.groups=d.merge(d.Env.meta.groups);x.skin=d.merge(d.Env.meta.skin);x.conditions={};x.config=A;x._internal=true;o=a._renderedMods;if(o){r(o,function y(C,B){x.moduleInfo[B]=C;});o=a._conditions;r(o,function w(C,B){x.conditions[B]=C;});}else{r(z,x.addModule,x);}if(!a._renderedMods){a._renderedMods=x.moduleInfo;a._conditions=x.conditions;}x._inspectPage();x._internal=false;x._config(A);x.forceMap=(x.force)?d.Array.hash(x.force):{};x.testresults=null;if(d.config.tests){x.testresults=d.config.tests;}x.sorted=[];x.loaded=p[s];x.dirty=true;x.inserted={};x.skipped={};x.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){r(n,function(y,x){if(y.details){var w=this.moduleInfo[x],A=y.details.requires,z=w&&w.requires;if(w){if(!w._inspected&&A&&z.length!=A.length){delete w.expanded;}}else{w=this.addModule(y.details,x);}w._inspected=true;}},this);},_requires:function(C,B){var y,A,D,E,w=this.moduleInfo,x=w[C],z=w[B];if(!x||!z){return false;}A=x.expanded_map;D=x.after_map;if(D&&(B in D)){return true;}D=z.after_map;if(D&&(C in D)){return false;}E=w[B]&&w[B].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(C,E[y])){return true;}}}E=w[C]&&w[C].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(B,E[y])){return false;}}}if(A&&(B in A)){return true;}if(x.ext&&x.type==q&&!z.ext&&z.type==q){return true;}return false;},_config:function(C){var y,x,B,z,A,D,w=this;if(C){for(y in C){if(C.hasOwnProperty(y)){B=C[y];if(y=="require"){w.require(B);}else{if(y=="skin"){d.mix(w.skin,C[y],true);}else{if(y=="groups"){for(x in B){if(B.hasOwnProperty(x)){D=x;A=B[x];w.addGroup(A,D);}}}else{if(y=="modules"){r(B,w.addModule,w);}else{if(y=="gallery"){this.groups.gallery.update(B);}else{if(y=="yui2"||y=="2in3"){this.groups.yui2.update(C["2in3"],C.yui2);}else{if(y=="maxURLLength"){w[y]=Math.min(m,B);}else{w[y]=B;}}}}}}}}}}z=w.filter;if(i.isString(z)){z=z.toUpperCase();w.filterName=z;w.filter=w.FILTER_DEFS[z];if(z=="DEBUG"){w.require("yui-log","dump");}}if(w.lang){w.require("intl-base","intl");}},formatSkin:function(y,w){var x=b+y;if(w){x=x+"-"+w;}return x;},_addSkin:function(F,D,E){var C,B,x,w,A=this.moduleInfo,y=this.skin,z=A[D]&&A[D].ext;if(D){x=this.formatSkin(F,D);if(!A[x]){C=A[D];B=C.pkg||D;w={name:x,group:C.group,type:"css",after:y.after,path:(E||B)+"/"+y.base+F+"/"+D+".css",ext:z};if(C.base){w.base=C.base;}if(C.configFn){w.configFn=C.configFn;}this.addModule(w,x);}}return x;},addGroup:function(z,x){var y=z.modules,w=this;x=x||z.name;z.name=x;w.groups[x]=z;if(z.patterns){r(z.patterns,function(B,A){B.group=x;w.patterns[A]=B;});}if(y){r(y,function(B,A){B.group=x;w.addModule(B,A);},w);}},addModule:function(M,T){T=T||M.name;if(this.moduleInfo[T]&&this.moduleInfo[T].temp){M=d.merge(this.moduleInfo[T],M);}M.name=T;if(!M||!M.name){return null;}if(!M.type){M.type=k;}if(!M.path&&!M.fullpath){M.path=g(T,T,M.type);}M.supersedes=M.supersedes||M.use;M.ext=("ext" in M)?M.ext:(this._internal)?false:true;M.requires=this.filterRequires(M.requires)||[];var Q=M.submodules,P,N,H,w,I,y,L,x,O,J,F,C,A,z,S,R,G,B,D,E=this.conditions,K;this.moduleInfo[T]=M;if(!M.langPack&&M.lang){J=j(M.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}}}if(Q){w=M.supersedes||[];N=0;for(P in Q){if(Q.hasOwnProperty(P)){I=Q[P];I.path=I.path||g(T,P,M.type);I.pkg=T;I.group=M.group;if(I.supersedes){w=w.concat(I.supersedes);}y=this.addModule(I,P);w.push(P);if(y.skinnable){M.skinnable=true;G=this.skin.overrides;if(G&&G[P]){for(O=0;O<G[P].length;O++){B=this._addSkin(G[P][O],P,T);w.push(B);}}B=this._addSkin(this.skin.defaultSkin,P,T);w.push(B);}if(I.lang&&I.lang.length){J=j(I.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);C=this.getLangPackName(S,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}A=A||j.hash(y.supersedes);if(!(C in A)){y.supersedes.push(C);}M.lang=M.lang||[];z=z||j.hash(M.lang);if(!(S in z)){M.lang.push(S);}F=this.getLangPackName(u,T);C=this.getLangPackName(u,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}if(!(C in A)){y.supersedes.push(C);}}}N++;}}M.supersedes=j.dedupe(w);if(this.allowRollup){M.rollup=(N<4)?N:Math.min(N-1,4);}}L=M.plugins;if(L){for(P in L){if(L.hasOwnProperty(P)){x=L[P];x.pkg=T;x.path=x.path||g(T,P,M.type);
-x.requires=x.requires||[];x.group=M.group;this.addModule(x,P);if(M.skinnable){this._addSkin(this.skin.defaultSkin,P,T);}}}}if(M.condition){H=M.condition.trigger;if(YUI.Env.aliases[H]){H=YUI.Env.aliases[H];}if(!d.Lang.isArray(H)){H=[H];}for(P=0;P<H.length;P++){K=H[P];D=M.condition.when;E[K]=E[K]||{};E[K][T]=M.condition;if(D&&D!="after"){if(D=="instead"){M.supersedes=M.supersedes||[];M.supersedes.push(K);}else{}}else{M.after=M.after||[];M.after.push(K);}}}if(M.after){M.after_map=j.hash(M.after);}if(M.configFn){R=M.configFn(M);if(R===false){delete this.moduleInfo[T];M=null;}}return M;},require:function(x){var w=(typeof x==="string")?j(arguments):x;this.dirty=true;this.required=d.merge(this.required,j.hash(this.filterRequires(w)));this._explodeRollups();},_explodeRollups:function(){var x=this,w,y=x.required;if(!x.allowRollup){r(y,function(z,A){w=x.getModule(A);if(w&&w.use){j.each(w.use,function(B){w=x.getModule(B);if(w&&w.use){j.each(w.use,function(C){y[C]=true;});}else{y[B]=true;}});}});x.required=y;}},filterRequires:function(z){if(z){if(!d.Lang.isArray(z)){z=[z];}z=d.Array(z);var B=[],y,x,A,w;for(y=0;y<z.length;y++){x=this.getModule(z[y]);if(x&&x.use){for(A=0;A<x.use.length;A++){w=this.getModule(x.use[A]);if(w&&w.use){B=d.Array.dedupe([].concat(B,this.filterRequires(w.use)));}else{B.push(x.use[A]);}}}else{B.push(z[y]);}}z=B;}return z;},getRequires:function(S){if(!S||S._parsed){return c;}var M,H,L,D,C,U,A=this.testresults,V=S.name,B,I,T=n[V]&&n[V].details,O,J,w,E,P,F,z,Q,R,y,G=S.lang||S.intl,N=this.moduleInfo,K=d.Features&&d.Features.tests.load,x;if(S.temp&&T){P=S;S=this.addModule(T,V);S.group=P.group;S.pkg=P.pkg;delete S.expanded;}if(S.expanded&&(!this.lang||S.langCache===this.lang)){return S.expanded;}O=[];x={};E=this.filterRequires(S.requires);if(S.lang){O.unshift("intl");E.unshift("intl");G=true;}F=this.filterRequires(S.optional);S._parsed=true;S.langCache=this.lang;for(M=0;M<E.length;M++){if(!x[E[M]]){O.push(E[M]);x[E[M]]=true;H=this.getModule(E[M]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(L=0;L<D.length;L++){O.push(D[L]);}}}}E=this.filterRequires(S.supersedes);if(E){for(M=0;M<E.length;M++){if(!x[E[M]]){if(S.submodules){O.push(E[M]);}x[E[M]]=true;H=this.getModule(E[M]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(L=0;L<D.length;L++){O.push(D[L]);}}}}}if(F&&this.loadOptional){for(M=0;M<F.length;M++){if(!x[F[M]]){O.push(F[M]);x[F[M]]=true;H=N[F[M]];if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(L=0;L<D.length;L++){O.push(D[L]);}}}}}B=this.conditions[V];if(B){if(A&&K){r(A,function(W,Y){var X=K[Y].name;if(!x[X]&&K[Y].trigger==V){if(W&&K[Y]){x[X]=true;O.push(X);}}});}else{r(B,function(X,W){if(!x[W]){I=X&&((X.ua&&d.UA[X.ua])||(X.test&&X.test(d,E)));if(I){x[W]=true;O.push(W);H=this.getModule(W);if(H){D=this.getRequires(H);for(L=0;L<D.length;L++){O.push(D[L]);}}}}},this);}}if(S.skinnable){Q=this.skin.overrides;r(YUI.Env.aliases,function(W,X){if(d.Array.indexOf(W,V)>-1){R=X;}});if(Q&&(Q[V]||(R&&Q[R]))){y=V;if(Q[R]){y=R;}for(M=0;M<Q[y].length;M++){z=this._addSkin(Q[y][M],V);O.push(z);}}else{z=this._addSkin(this.skin.defaultSkin,V);O.push(z);}}S._parsed=false;if(G){if(S.lang&&!S.langPack&&d.Intl){U=d.Intl.lookupBestLang(this.lang||u,S.lang);C=this.getLangPackName(U,V);if(C){O.unshift(C);}}O.unshift(v);}S.expanded_map=j.hash(O);S.expanded=e.keys(S.expanded_map);return S.expanded;},getProvides:function(x){var w=this.getModule(x),z,y;if(!w){return f;}if(w&&!w.provides){z={};y=w.supersedes;if(y){j.each(y,function(A){d.mix(z,this.getProvides(A));},this);}z[x]=true;w.provides=z;}return w.provides;},calculate:function(x,w){if(x||w||this.dirty){if(x){this._config(x);}if(!this._init){this._setup();}this._explode();if(this.allowRollup){this._rollup();}else{this._explodeRollups();}this._reduce();this._sort();}},_addLangPack:function(B,w,A){var y=w.name,x,z=this.moduleInfo[A];if(!z){x=g((w.pkg||y),A,k,true);this.addModule({path:x,intl:true,langPack:true,ext:w.ext,group:w.group,supersedes:[]},A);if(B){d.Env.lang=d.Env.lang||{};d.Env.lang[B]=d.Env.lang[B]||{};d.Env.lang[B][y]=true;}}return this.moduleInfo[A];},_setup:function(){var C=this.moduleInfo,z,A,y,w,x,B;for(z in C){if(C.hasOwnProperty(z)){w=C[z];if(w){w.requires=j.dedupe(w.requires);if(w.lang&&w.lang.length){B=this.getLangPackName(u,z);this._addLangPack(null,w,B);}}}}x={};if(!this.ignoreRegistered){d.mix(x,a.mods);}if(this.ignore){d.mix(x,j.hash(this.ignore));}for(y in x){if(x.hasOwnProperty(y)){d.mix(x,this.getProvides(y));}}if(this.force){for(A=0;A<this.force.length;A++){if(this.force[A] in x){delete x[this.force[A]];}}}d.mix(this.loaded,x);this._init=true;},getLangPackName:function(x,w){return("lang/"+w+((x)?"_"+x:""));},_explode:function(){var A=this.required,w,z,x={},y=this;y.dirty=false;y._explodeRollups();A=y.required;r(A,function(B,C){if(!x[C]){x[C]=true;w=y.getModule(C);if(w){var D=w.expound;if(D){A[D]=y.getModule(D);z=y.getRequires(A[D]);d.mix(A,j.hash(z));}z=y.getRequires(w);d.mix(A,j.hash(z));}}});},getModule:function(B){if(!B){return null;}var A,z,x,w=this.moduleInfo[B],y=this.patterns;if(!w){for(x in y){if(y.hasOwnProperty(x)){A=y[x];if(B.indexOf(x)>-1){z=A;break;}}}if(z){if(A.action){A.action.call(this,B,x);}else{w=this.addModule(d.merge(z),B);w.temp=true;}}}return w;},_rollup:function(){},_reduce:function(B){B=B||this.required;var y,x,A,w,z=this.loadType,C=this.ignore?j.hash(this.ignore):false;for(y in B){if(B.hasOwnProperty(y)){w=this.getModule(y);if(((this.loaded[y]||n[y])&&!this.forceMap[y]&&!this.ignoreRegistered)||(z&&w&&w.type!=z)){delete B[y];}if(C&&C[y]){delete B[y];}A=w&&w.supersedes;if(A){for(x=0;x<A.length;x++){if(A[x] in B){delete B[A[x]];}}}}}return B;},_finish:function(y,x){h.running=false;var w=this.onEnd;if(w){w.call(this.context,{msg:y,data:this.data,success:x});}this._continue();},_onSuccess:function(){var y=this,x=d.merge(y.skipped),A,w=[],z=y.requireRegistration,C,B;r(x,function(D){delete y.inserted[D];});y.skipped={};r(y.inserted,function(E,D){var F=y.getModule(D);
-if(F&&z&&F.type==k&&!(D in YUI.Env.mods)){w.push(D);}else{d.mix(y.loaded,y.getProvides(D));}});A=y.onSuccess;B=(w.length)?"notregistered":"success";C=!(w.length);if(A){A.call(y.context,{msg:B,data:y.data,success:C,failed:w,skipped:x});}y._finish(B,C);},_onFailure:function(y){var w=this.onFailure,x="failure: "+y.msg;if(w){w.call(this.context,{msg:x,data:this.data,success:false});}this._finish(x,false);},_onTimeout:function(){var w=this.onTimeout;if(w){w.call(this.context,{msg:"timeout",data:this.data,success:false});}this._finish("timeout",false);},_sort:function(){var F=e.keys(this.required),B={},w=0,y,E,D,A,z,C,x;for(;;){y=F.length;C=false;for(A=w;A<y;A++){E=F[A];for(z=A+1;z<y;z++){x=E+F[z];if(!B[x]&&this._requires(E,F[z])){D=F.splice(z,1);F.splice(A,0,D[0]);B[x]=true;C=true;break;}}if(C){break;}else{w++;}}if(!C){break;}}this.sorted=F;},partial:function(w,y,x){this.sorted=w;this.insert(y,x,true);},_insert:function(z,A,y,x){if(z){this._config(z);}if(!x){this.calculate(A);}this.loadType=y;if(!y){var w=this;this._internalCallback=function(){var C=w.onCSS,E,D,B;if(this.insertBefore&&d.UA.ie){E=d.config.doc.getElementById(this.insertBefore);D=E.parentNode;B=E.nextSibling;D.removeChild(E);if(B){D.insertBefore(E,B);}else{D.appendChild(E);}}if(C){C.call(w.context,d);}w._internalCallback=null;w._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(z,x,y){var w=this,A=d.merge(this);delete A.require;delete A.dirty;h.add(function(){w._insert(A,z,x,y);});this._continue();},loadNext:function(A){if(!this._loading){return;}var H,P,O,M,z,E,B,L,D,G,N,w,C,K,y,F,Q,R,J=this,x=J.loadType,S=function(T){J.loadNext(T.data);},I=function(V){J._combineComplete[x]=true;var U,T=F.length;for(U=0;U<T;U++){J.inserted[F[U]]=true;}S(V);};if(J.combine&&(!J._combineComplete[x])){F=[];J._combining=F;H=J.sorted;P=H.length;R=J.comboBase;z=R;Q=[];K={};for(O=0;O<P;O++){C=R;M=J.getModule(H[O]);G=M&&M.group;if(G){D=J.groups[G];if(!D.combine){M.combine=false;continue;}M.combine=true;if(D.comboBase){C=D.comboBase;}if("root" in D&&i.isValue(D.root)){M.root=D.root;}}K[C]=K[C]||[];K[C].push(M);}for(N in K){if(K.hasOwnProperty(N)){z=N;y=K[N];P=y.length;for(O=0;O<P;O++){M=y[O];if(M&&(M.type===x)&&(M.combine||!M.ext)){w=((i.isValue(M.root))?M.root:J.root)+M.path;w=J._filter(w,M.name);if((z!==N)&&(O<=(P-1))&&((w.length+z.length)>J.maxURLLength)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));z=N;}z+=w;if(O<(P-1)){z+=J.comboSep;}F.push(M.name);}}if(F.length&&(z!=N)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));}}}if(F.length){if(x===q){E=d.Get.css;L=J.cssAttributes;}else{E=d.Get.script;L=J.jsAttributes;}E(Q,{data:J._loading,onSuccess:I,onFailure:J._onFailure,onTimeout:J._onTimeout,insertBefore:J.insertBefore,charset:J.charset,attributes:L,timeout:J.timeout,autopurge:false,context:J});return;}else{J._combineComplete[x]=true;}}if(A){if(A!==J._loading){return;}J.inserted[A]=true;if(J.onProgress){J.onProgress.call(J.context,{name:A,data:J.data});}}H=J.sorted;P=H.length;for(O=0;O<P;O=O+1){if(H[O] in J.inserted){continue;}if(H[O]===J._loading){return;}M=J.getModule(H[O]);if(!M){if(!J.skipped[H[O]]){B="Undefined module "+H[O]+" skipped";J.skipped[H[O]]=true;}continue;}D=(M.group&&J.groups[M.group])||f;if(!x||x===M.type){J._loading=H[O];if(M.type===q){E=d.Get.css;L=J.cssAttributes;if(M.cssAttributes){L=d.mix(L||{},M.cssAttributes);}}else{E=d.Get.script;L=J.jsAttributes;if(M.jsAttributes){L=d.mix(L||{},M.jsAttributes);}}z=(M.fullpath)?J._filter(M.fullpath,H[O]):J._url(M.path,H[O],D.base||M.base);E(z,{data:H[O],onSuccess:S,insertBefore:J.insertBefore,charset:J.charset,attributes:L,onFailure:J._onFailure,onTimeout:J._onTimeout,timeout:J.timeout,autopurge:false,context:J});return;}}J._loading=null;E=J._internalCallback;if(E){J._internalCallback=null;E.call(J);}else{J._onSuccess();}},_filter:function(y,x){var A=this.filter,w=x&&(x in this.filters),z=w&&this.filters[x],B=this.moduleInfo[x]?this.moduleInfo[x].group:null;if(B&&this.groups[B].filter){z=this.groups[B].filter;w=true;}if(y){if(w){A=(i.isString(z))?this.FILTER_DEFS[z.toUpperCase()]||null:z;}if(A){y=y.replace(new RegExp(A.searchExp,"g"),A.replaceStr);}}return y;},_url:function(y,w,x){return this._filter((x||this.base||"")+y,w);},resolve:function(A,C){var x=this,B,w,z,y={js:[],css:[]};if(A){x.calculate();}C=C||x.sorted;for(B=0;B<C.length;B++){w=x.getModule(C[B]);if(w){if(x.combine){z=x._filter((x.root+w.path),w.name,x.root);}else{z=x._filter(w.fullpath,w.name,"")||x._url(w.path,w.name);}y[w.type].push(z);}}if(x.combine){y.js=[x.comboBase+y.js.join(x.comboSep)];y.css=[x.comboBase+y.css.join(x.comboSep)];}return y;},hash:function(A,C){var x=this,B,w,z,y={js:{},css:{}};if(A){x.calculate();}C=C||x.sorted;for(B=0;B<C.length;B++){w=x.getModule(C[B]);if(w){z=x._filter(w.fullpath,w.name,"")||x._url(w.path,w.name);y[w.type][w.name]=z;}}return y;}};},"@VERSION@",{requires:["get"]});YUI.add("loader-rollup",function(a){a.Loader.prototype._rollup=function(){var k,h,g,o,b=this.required,e,f=this.moduleInfo,d,l,n;if(this.dirty||!this.rollups){this.rollups={};for(k in f){if(f.hasOwnProperty(k)){g=this.getModule(k);if(g&&g.rollup){this.rollups[k]=g;}}}}for(;;){d=false;for(k in this.rollups){if(this.rollups.hasOwnProperty(k)){if(!b[k]&&((!this.loaded[k])||this.forceMap[k])){g=this.getModule(k);o=g.supersedes||[];e=false;if(!g.rollup){continue;}l=0;for(h=0;h<o.length;h++){n=f[o[h]];if(this.loaded[o[h]]&&!this.forceMap[o[h]]){e=false;break;}else{if(b[o[h]]&&g.type==n.type){l++;e=(l>=g.rollup);if(e){break;}}}}if(e){b[k]=true;d=true;this.getRequires(g);}}}}if(!d){break;}}};},"@VERSION@",{requires:["loader-base"]});YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"anim":{"use":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]},"app":{"use":["model","model-list","router","view"]},"array-extras":{"requires":["yui-base"]},"array-invoke":{"requires":["yui-base"]},"arraylist":{"requires":["yui-base"]},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"use":["attribute-base","attribute-complex"]},"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]},"autocomplete":{"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{"optional":["autocomplete-sources"],"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{"requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"requires":["array-extras","highlight-accentfold"]},"autocomplete-list":{"after":["autocomplete-sources"],"lang":["en"],"requires":["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);
-},"trigger":"autocomplete-list"},"requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"requires":["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]},"base":{"use":["base-base","base-pluginhost","base-build"]},"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]},"cache":{"use":["cache-base","cache-offline","cache-plugin"]},"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]},"calendar":{"lang":["en","ja","ru"],"requires":["calendar-base","calendarnavigator"],"skinnable":true},"calendar-base":{"lang":["en","ja","ru"],"requires":["widget","substitute","datatype-date","datatype-date-math","cssgrids"],"skinnable":true},"calendarnavigator":{"requires":["plugin","classnamemanager","datatype-date","node","substitute"],"skinnable":true},"charts":{"requires":["dom","datatype-number","datatype-date","event-custom","event-mouseenter","widget","widget-position","widget-stack","graphics"]},"classnamemanager":{"requires":["yui-base"]},"clickable-rail":{"requires":["slider-base"]},"collection":{"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"console":{"lang":["en","es","ja"],"requires":["yui-log","widget","substitute"],"skinnable":true},"console-filters":{"requires":["plugin","console"],"skinnable":true},"controller":{"use":["router"]},"cookie":{"requires":["yui-base"]},"createlink-base":{"requires":["editor-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"type":"css"},"cssfonts":{"type":"css"},"cssfonts-context":{"type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"type":"css"},"cssreset":{"type":"css"},"cssreset-context":{"type":"css"},"dataschema":{"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]},"datasource":{"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]},"datatable":{"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]},"datatype":{"use":["datatype-number","datatype-date","datatype-xml"]},"datatype-date":{"supersedes":["datatype-date-format"],"use":["datatype-date-parse","datatype-date-format"]},"datatype-date-format":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{"requires":["yui-base"]},"datatype-date-parse":{},"datatype-number":{"use":["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{"use":["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},"dd":{"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome));},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","event-key","transition","intl"],"skinnable":true},"dom":{"use":["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-deprecated":{"requires":["dom-base"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;
-g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"dump":{"requires":["yui-base"]},"editor":{"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"escape":{"requires":["yui-base"]},"event":{"after":["node-base"],"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside"]},"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-custom":{"use":["event-custom-base","event-custom-complex"]},"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-focus":{"requires":["event-synthetic"]},"event-gestures":{"use":["event-flick","event-move"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]},"event-outside":{"requires":["event-synthetic"]},"event-resize":{"requires":["node-base","event-synthetic"]},"event-simulate":{"requires":["event-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]},"event-touch":{"requires":["node-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"exec-command":{"requires":["frame"]},"features":{"requires":["yui-base"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"get":{"requires":["yui-base"]},"graphics":{"requires":["node","event-custom","pluginhost"]},"graphics-canvas":{"condition":{"name":"graphics-canvas","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(b&&b.getContext&&b.getContext("2d")));},"trigger":"graphics"},"requires":["graphics"]},"graphics-canvas-default":{"condition":{"name":"graphics-canvas-default","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(b&&b.getContext&&b.getContext("2d")));},"trigger":"graphics"}},"graphics-svg":{"condition":{"name":"graphics-svg","test":function(c){var b=c.config.doc;return(b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));},"trigger":"graphics"},"requires":["graphics"]},"graphics-svg-default":{"condition":{"name":"graphics-svg-default","test":function(c){var b=c.config.doc;return(b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));},"trigger":"graphics"}},"graphics-vml":{"condition":{"name":"graphics-vml","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!b||!b.getContext||!b.getContext("2d")));},"trigger":"graphics"},"requires":["graphics"]},"graphics-vml-default":{"condition":{"name":"graphics-vml-default","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!b||!b.getContext||!b.getContext("2d")));},"trigger":"graphics"}},"handlebars":{"use":["handlebars-compiler"]},"handlebars-base":{"requires":["escape"]},"handlebars-compiler":{"requires":["handlebars-base"]},"highlight":{"use":["highlight-base","highlight-accentfold"]},"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","classnamemanager","escape","text-wordbreak"]},"history":{"use":["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"intl-base":{"requires":["yui-base"]},"io":{"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml-parse"]},"json":{"use":["json-parse","json-stringify"]},"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]},"jsonp":{"requires":["get","oop"]},"jsonp-url":{"requires":["jsonp"]},"loader":{"use":["loader-base","loader-rollup","loader-yui3"]},"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]},"model":{"requires":["base-build","escape","json-parse"]},"model-list":{"requires":["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"node":{"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{"requires":["event-base","node-core","dom-base"]},"node-core":{"requires":["dom-core","selector"]},"node-deprecated":{"requires":["node-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-event-html5":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{"requires":["node-base","io-base"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"panel":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain","widget-modality","widget-autohide","widget-buttons"],"skinnable":true},"parallel":{"requires":["yui-base"]},"pjax":{"requires":["pjax-base","io-base"]},"pjax-base":{"requires":["classnamemanager","node-event-delegate","router"]},"pjax-plugin":{"requires":["node-pluginhost","pjax","plugin"]},"plugin":{"requires":["base-base"]},"pluginhost":{"use":["pluginhost-base","pluginhost-config"]},"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]},"profiler":{"requires":["yui-base"]},"querystring":{"use":["querystring-parse","querystring-stringify"]},"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-parse-simple":{"requires":["yui-base"]},"querystring-stringify":{"requires":["yui-base"]},"querystring-stringify-simple":{"requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"recordset":{"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]},"resize":{"use":["resize-base","resize-proxy","resize-constrain"]},"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]},"resize-proxy":{"requires":["plugin","resize-base"]},"rls":{"requires":["get","features"]},"router":{"optional":["querystring-parse"],"requires":["array-extras","base-build","history"]},"scrollview":{"requires":["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{"requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-list":{"requires":["plugin","classnamemanager"],"skinnable":true},"scrollview-paginator":{"requires":["plugin"]},"scrollview-scrollbars":{"requires":["classnamemanager","transition","plugin"],"skinnable":true},"selection":{"requires":["node"]},"selector":{"requires":["selector-native"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);
+YUI.add("loader-base",function(d){if(!YUI.Env[d.version]){(function(){var I=d.version,E="/build/",F=I+E,D=d.Env.base,A="gallery-2011.10.20-23-28",C="2in3",B="4",z="2.9.0",G=D+"combo?",H={version:I,root:F,base:d.Env.base,comboBase:G,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},y=H.groups,x=function(K,L){var J=C+"."+(K||B)+"/"+(L||z)+E;y.yui2.base=D+J;y.yui2.root=J;},w=function(J){var K=(J||A)+E;y.gallery.base=D+K;y.gallery.root=K;};y[I]={};y.gallery={ext:false,combine:true,comboBase:G,update:w,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}};y.yui2={combine:true,ext:false,comboBase:G,update:x,patterns:{"yui2-":{configFn:function(J){if(/-skin|reset|fonts|grids|base/.test(J.name)){J.type="css";J.path=J.path.replace(/\.js/,".css");J.path=J.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin");}}}}};w();x();YUI.Env[I]=H;}());}var f={},c=[],m=2048,a=YUI.Env,p=a._loaded,q="css",k="js",v="intl",s=d.version,u="",e=d.Object,r=e.each,j=d.Array,h=a._loaderQueue,t=a[s],b="skin-",i=d.Lang,n=a.mods,l,o,g=function(x,y,z,w){var A=x+"/"+y;if(!w){A+="-min";}A+="."+(z||q);return A;};d.Env.meta=t;d.Loader=function(A){var z=t.modules,x=this;l=t.md5;x.context=d;x.base=d.Env.meta.base+d.Env.meta.root;x.comboBase=d.Env.meta.comboBase;x.combine=A.base&&(A.base.indexOf(x.comboBase.substr(0,20))>-1);x.comboSep="&";x.maxURLLength=m;x.root=d.Env.meta.root;x.timeout=0;x.forceMap={};x.allowRollup=false;x.filters={};x.required={};x.patterns={};x.moduleInfo={};x.groups=d.merge(d.Env.meta.groups);x.skin=d.merge(d.Env.meta.skin);x.conditions={};x.config=A;x._internal=true;o=a._renderedMods;if(o){r(o,function y(C,B){x.moduleInfo[B]=C;});o=a._conditions;r(o,function w(C,B){x.conditions[B]=C;});}else{r(z,x.addModule,x);}if(!a._renderedMods){a._renderedMods=x.moduleInfo;a._conditions=x.conditions;}x._inspectPage();x._internal=false;x._config(A);x.forceMap=(x.force)?d.Array.hash(x.force):{};x.testresults=null;if(d.config.tests){x.testresults=d.config.tests;}x.sorted=[];x.loaded=p[s];x.dirty=true;x.inserted={};x.skipped={};x.tested={};};d.Loader.prototype={FILTER_DEFS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},_inspectPage:function(){r(n,function(y,x){if(y.details){var w=this.moduleInfo[x],A=y.details.requires,z=w&&w.requires;if(w){if(!w._inspected&&A&&z.length!=A.length){delete w.expanded;}}else{w=this.addModule(y.details,x);}w._inspected=true;}},this);},_requires:function(C,B){var y,A,D,E,w=this.moduleInfo,x=w[C],z=w[B];if(!x||!z){return false;}A=x.expanded_map;D=x.after_map;if(D&&(B in D)){return true;}D=z.after_map;if(D&&(C in D)){return false;}E=w[B]&&w[B].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(C,E[y])){return true;}}}E=w[C]&&w[C].supersedes;if(E){for(y=0;y<E.length;y++){if(this._requires(B,E[y])){return false;}}}if(A&&(B in A)){return true;}if(x.ext&&x.type==q&&!z.ext&&z.type==q){return true;}return false;},_config:function(C){var y,x,B,z,A,D,w=this;if(C){for(y in C){if(C.hasOwnProperty(y)){B=C[y];if(y=="require"){w.require(B);}else{if(y=="skin"){d.mix(w.skin,C[y],true);}else{if(y=="groups"){for(x in B){if(B.hasOwnProperty(x)){D=x;A=B[x];w.addGroup(A,D);}}}else{if(y=="modules"){r(B,w.addModule,w);}else{if(y=="gallery"){this.groups.gallery.update(B);}else{if(y=="yui2"||y=="2in3"){this.groups.yui2.update(C["2in3"],C.yui2);}else{if(y=="maxURLLength"){w[y]=Math.min(m,B);}else{w[y]=B;}}}}}}}}}}z=w.filter;if(i.isString(z)){z=z.toUpperCase();w.filterName=z;w.filter=w.FILTER_DEFS[z];if(z=="DEBUG"){w.require("yui-log","dump");}}if(w.lang){w.require("intl-base","intl");}},formatSkin:function(y,w){var x=b+y;if(w){x=x+"-"+w;}return x;},_addSkin:function(F,D,E){var C,B,x,w,A=this.moduleInfo,y=this.skin,z=A[D]&&A[D].ext;if(D){x=this.formatSkin(F,D);if(!A[x]){C=A[D];B=C.pkg||D;w={name:x,group:C.group,type:"css",after:y.after,path:(E||B)+"/"+y.base+F+"/"+D+".css",ext:z};if(C.base){w.base=C.base;}if(C.configFn){w.configFn=C.configFn;}this.addModule(w,x);}}return x;},addGroup:function(z,x){var y=z.modules,w=this;x=x||z.name;z.name=x;w.groups[x]=z;if(z.patterns){r(z.patterns,function(B,A){B.group=x;w.patterns[A]=B;});}if(y){r(y,function(B,A){B.group=x;w.addModule(B,A);},w);}},addModule:function(M,T){T=T||M.name;if(this.moduleInfo[T]&&this.moduleInfo[T].temp){M=d.merge(this.moduleInfo[T],M);}M.name=T;if(!M||!M.name){return null;}if(!M.type){M.type=k;}if(!M.path&&!M.fullpath){M.path=g(T,T,M.type);}M.supersedes=M.supersedes||M.use;M.ext=("ext" in M)?M.ext:(this._internal)?false:true;M.requires=this.filterRequires(M.requires)||[];var Q=M.submodules,P,N,H,w,I,y,L,x,O,J,F,C,A,z,S,R,G,B,D,E=this.conditions,K;this.moduleInfo[T]=M;if(!M.langPack&&M.lang){J=j(M.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}}}if(Q){w=M.supersedes||[];N=0;for(P in Q){if(Q.hasOwnProperty(P)){I=Q[P];I.path=I.path||g(T,P,M.type);I.pkg=T;I.group=M.group;if(I.supersedes){w=w.concat(I.supersedes);}y=this.addModule(I,P);w.push(P);if(y.skinnable){M.skinnable=true;G=this.skin.overrides;if(G&&G[P]){for(O=0;O<G[P].length;O++){B=this._addSkin(G[P][O],P,T);w.push(B);}}B=this._addSkin(this.skin.defaultSkin,P,T);w.push(B);}if(I.lang&&I.lang.length){J=j(I.lang);for(O=0;O<J.length;O++){S=J[O];F=this.getLangPackName(S,T);C=this.getLangPackName(S,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}A=A||j.hash(y.supersedes);if(!(C in A)){y.supersedes.push(C);}M.lang=M.lang||[];z=z||j.hash(M.lang);if(!(S in z)){M.lang.push(S);}F=this.getLangPackName(u,T);C=this.getLangPackName(u,P);y=this.moduleInfo[F];if(!y){y=this._addLangPack(S,M,F);}if(!(C in A)){y.supersedes.push(C);}}}N++;}}M.supersedes=j.dedupe(w);if(this.allowRollup){M.rollup=(N<4)?N:Math.min(N-1,4);}}L=M.plugins;if(L){for(P in L){if(L.hasOwnProperty(P)){x=L[P];x.pkg=T;x.path=x.path||g(T,P,M.type);x.requires=x.requires||[];
+x.group=M.group;this.addModule(x,P);if(M.skinnable){this._addSkin(this.skin.defaultSkin,P,T);}}}}if(M.condition){H=M.condition.trigger;if(YUI.Env.aliases[H]){H=YUI.Env.aliases[H];}if(!d.Lang.isArray(H)){H=[H];}for(P=0;P<H.length;P++){K=H[P];D=M.condition.when;E[K]=E[K]||{};E[K][T]=M.condition;if(D&&D!="after"){if(D=="instead"){M.supersedes=M.supersedes||[];M.supersedes.push(K);}else{}}else{M.after=M.after||[];M.after.push(K);}}}if(M.supersedes){M.supersedes=this.filterRequires(M.supersedes);}if(M.after){M.after=this.filterRequires(M.after);M.after_map=j.hash(M.after);}if(M.configFn){R=M.configFn(M);if(R===false){delete this.moduleInfo[T];M=null;}}return M;},require:function(x){var w=(typeof x==="string")?j(arguments):x;this.dirty=true;this.required=d.merge(this.required,j.hash(this.filterRequires(w)));this._explodeRollups();},_explodeRollups:function(){var x=this,w,y=x.required;if(!x.allowRollup){r(y,function(z,A){w=x.getModule(A);if(w&&w.use){j.each(w.use,function(B){w=x.getModule(B);if(w&&w.use){j.each(w.use,function(C){y[C]=true;});}else{y[B]=true;}});}});x.required=y;}},filterRequires:function(z){if(z){if(!d.Lang.isArray(z)){z=[z];}z=d.Array(z);var B=[],y,x,A,w;for(y=0;y<z.length;y++){x=this.getModule(z[y]);if(x&&x.use){for(A=0;A<x.use.length;A++){w=this.getModule(x.use[A]);if(w&&w.use){B=d.Array.dedupe([].concat(B,this.filterRequires(w.use)));}else{B.push(x.use[A]);}}}else{B.push(z[y]);}}z=B;}return z;},getRequires:function(R){if(!R){return c;}if(R._parsed){return R.expanded||c;}var L,H,K,D,C,T,A=this.testresults,U=R.name,B,S=n[U]&&n[U].details,N,I,w,E,O,F,z,P,Q,y,G=R.lang||R.intl,M=this.moduleInfo,J=d.Features&&d.Features.tests.load,x;if(R.temp&&S){O=R;R=this.addModule(S,U);R.group=O.group;R.pkg=O.pkg;delete R.expanded;}if(R.expanded&&(!this.lang||R.langCache===this.lang)){return R.expanded;}N=[];x={};E=this.filterRequires(R.requires);if(R.lang){N.unshift("intl");E.unshift("intl");G=true;}F=this.filterRequires(R.optional);R._parsed=true;R.langCache=this.lang;for(L=0;L<E.length;L++){if(!x[E[L]]){N.push(E[L]);x[E[L]]=true;H=this.getModule(E[L]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(K=0;K<D.length;K++){N.push(D[K]);}}}}E=this.filterRequires(R.supersedes);if(E){for(L=0;L<E.length;L++){if(!x[E[L]]){if(R.submodules){N.push(E[L]);}x[E[L]]=true;H=this.getModule(E[L]);if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(K=0;K<D.length;K++){N.push(D[K]);}}}}}if(F&&this.loadOptional){for(L=0;L<F.length;L++){if(!x[F[L]]){N.push(F[L]);x[F[L]]=true;H=M[F[L]];if(H){D=this.getRequires(H);G=G||(H.expanded_map&&(v in H.expanded_map));for(K=0;K<D.length;K++){N.push(D[K]);}}}}}B=this.conditions[U];if(B){R._parsed=false;if(A&&J){r(A,function(V,X){var W=J[X].name;if(!x[W]&&J[X].trigger==U){if(V&&J[X]){x[W]=true;N.push(W);}}});}else{r(B,function(X,W){if(!x[W]){var V=X&&((X.ua&&d.UA[X.ua])||(X.test&&X.test(d,E)));if(V){x[W]=true;N.push(W);H=this.getModule(W);if(H){D=this.getRequires(H);for(K=0;K<D.length;K++){N.push(D[K]);}}}}},this);}}if(R.skinnable){P=this.skin.overrides;r(YUI.Env.aliases,function(V,W){if(d.Array.indexOf(V,U)>-1){Q=W;}});if(P&&(P[U]||(Q&&P[Q]))){y=U;if(P[Q]){y=Q;}for(L=0;L<P[y].length;L++){z=this._addSkin(P[y][L],U);N.push(z);}}else{z=this._addSkin(this.skin.defaultSkin,U);N.push(z);}}R._parsed=false;if(G){if(R.lang&&!R.langPack&&d.Intl){T=d.Intl.lookupBestLang(this.lang||u,R.lang);C=this.getLangPackName(T,U);if(C){N.unshift(C);}}N.unshift(v);}R.expanded_map=j.hash(N);R.expanded=e.keys(R.expanded_map);return R.expanded;},getProvides:function(x){var w=this.getModule(x),z,y;if(!w){return f;}if(w&&!w.provides){z={};y=w.supersedes;if(y){j.each(y,function(A){d.mix(z,this.getProvides(A));},this);}z[x]=true;w.provides=z;}return w.provides;},calculate:function(x,w){if(x||w||this.dirty){if(x){this._config(x);}if(!this._init){this._setup();}this._explode();if(this.allowRollup){this._rollup();}else{this._explodeRollups();}this._reduce();this._sort();}},_addLangPack:function(B,w,A){var y=w.name,x,z=this.moduleInfo[A];if(!z){x=g((w.pkg||y),A,k,true);this.addModule({path:x,intl:true,langPack:true,ext:w.ext,group:w.group,supersedes:[]},A);if(B){d.Env.lang=d.Env.lang||{};d.Env.lang[B]=d.Env.lang[B]||{};d.Env.lang[B][y]=true;}}return this.moduleInfo[A];},_setup:function(){var C=this.moduleInfo,z,A,y,w,x,B;for(z in C){if(C.hasOwnProperty(z)){w=C[z];if(w){w.requires=j.dedupe(w.requires);if(w.lang&&w.lang.length){B=this.getLangPackName(u,z);this._addLangPack(null,w,B);}}}}x={};if(!this.ignoreRegistered){d.mix(x,a.mods);}if(this.ignore){d.mix(x,j.hash(this.ignore));}for(y in x){if(x.hasOwnProperty(y)){d.mix(x,this.getProvides(y));}}if(this.force){for(A=0;A<this.force.length;A++){if(this.force[A] in x){delete x[this.force[A]];}}}d.mix(this.loaded,x);this._init=true;},getLangPackName:function(x,w){return("lang/"+w+((x)?"_"+x:""));},_explode:function(){var A=this.required,w,z,x={},y=this;y.dirty=false;y._explodeRollups();A=y.required;r(A,function(B,C){if(!x[C]){x[C]=true;w=y.getModule(C);if(w){var D=w.expound;if(D){A[D]=y.getModule(D);z=y.getRequires(A[D]);d.mix(A,j.hash(z));}z=y.getRequires(w);d.mix(A,j.hash(z));}}});},getModule:function(B){if(!B){return null;}var A,z,x,w=this.moduleInfo[B],y=this.patterns;if(!w){for(x in y){if(y.hasOwnProperty(x)){A=y[x];if(!A.test){A.test=function(D,C){return(D.indexOf(C)>-1);};}if(A.test(B,x)){z=A;break;}}}if(z){if(A.action){A.action.call(this,B,x);}else{w=this.addModule(d.merge(z),B);w.temp=true;}}}return w;},_rollup:function(){},_reduce:function(B){B=B||this.required;var y,x,A,w,z=this.loadType,C=this.ignore?j.hash(this.ignore):false;for(y in B){if(B.hasOwnProperty(y)){w=this.getModule(y);if(((this.loaded[y]||n[y])&&!this.forceMap[y]&&!this.ignoreRegistered)||(z&&w&&w.type!=z)){delete B[y];}if(C&&C[y]){delete B[y];}A=w&&w.supersedes;if(A){for(x=0;x<A.length;x++){if(A[x] in B){delete B[A[x]];}}}}}return B;},_finish:function(y,x){h.running=false;var w=this.onEnd;if(w){w.call(this.context,{msg:y,data:this.data,success:x});
+}this._continue();},_onSuccess:function(){var y=this,x=d.merge(y.skipped),A,w=[],z=y.requireRegistration,C,B;r(x,function(D){delete y.inserted[D];});y.skipped={};r(y.inserted,function(E,D){var F=y.getModule(D);if(F&&z&&F.type==k&&!(D in YUI.Env.mods)){w.push(D);}else{d.mix(y.loaded,y.getProvides(D));}});A=y.onSuccess;B=(w.length)?"notregistered":"success";C=!(w.length);if(A){A.call(y.context,{msg:B,data:y.data,success:C,failed:w,skipped:x});}y._finish(B,C);},_onProgress:function(x){var w=this;if(w.onProgress){w.onProgress.call(w.context,{name:x.url,data:x.data});}},_onFailure:function(y){var w=this.onFailure,x="failure: "+y.msg;if(w){w.call(this.context,{msg:x,data:this.data,success:false});}this._finish(x,false);},_onTimeout:function(){var w=this.onTimeout;if(w){w.call(this.context,{msg:"timeout",data:this.data,success:false});}this._finish("timeout",false);},_sort:function(){var F=e.keys(this.required),B={},w=0,y,E,D,A,z,C,x;for(;;){y=F.length;C=false;for(A=w;A<y;A++){E=F[A];for(z=A+1;z<y;z++){x=E+F[z];if(!B[x]&&this._requires(E,F[z])){D=F.splice(z,1);F.splice(A,0,D[0]);B[x]=true;C=true;break;}}if(C){break;}else{w++;}}if(!C){break;}}this.sorted=F;},partial:function(w,y,x){this.sorted=w;this.insert(y,x,true);},_insert:function(w,z,E,y){if(w){this._config(w);}if(!y){this.calculate(z);}var B=this.resolve(),F=this,D=0,C=0;if(E){var A=B[E];B={};B[E]=A;D++;}else{if(B.js.length){D++;}if(B.css.length){D++;}}var x=function(H){C++;if(H&&H.data&&H.data.length){for(var G=0;G<H.data.length;G++){F.inserted[H.data[G].name]=true;}}if(C===D){F._loading=null;F._onSuccess();}};this._loading=true;if(!B.js.length&&!B.css.length){C=-1;x();return;}if(B.css.length){d.Get.css(B.css,{data:B.cssMods,insertBefore:F.insertBefore,charset:F.charset,timeout:F.timeout,autopurge:false,context:F,async:true,onFailure:F._onFailure,onTimeout:F._onTimeout,onProgress:function(G){F._onProgress.call(F,G);},onSuccess:x});}if(B.js.length){d.Get.script(B.js,{data:B.jsMods,insertBefore:F.insertBefore,charset:F.charset,timeout:F.timeout,autopurge:false,context:F,async:true,onProgress:function(G){F._onProgress.call(F,G);},onFailure:F._onFailure,onTimeout:F._onTimeout,onSuccess:x});}},_continue:function(){if(!(h.running)&&h.size()>0){h.running=true;h.next()();}},insert:function(z,x,y){var w=this,A=d.merge(this);delete A.require;delete A.dirty;h.add(function(){w._insert(A,z,x,y);});this._continue();},loadNext:function(A){if(!this._loading){return;}var H,P,O,M,z,E,B,L,D,G,N,w,C,K,y,F,Q,R,J=this,x=J.loadType,S=function(T){J.loadNext(T.data);},I=function(V){J._combineComplete[x]=true;var U,T=F.length;for(U=0;U<T;U++){J.inserted[F[U]]=true;}S(V);};if(J.combine&&(!J._combineComplete[x])){F=[];J._combining=F;H=J.sorted;P=H.length;R=J.comboBase;z=R;Q=[];K={};for(O=0;O<P;O++){C=R;M=J.getModule(H[O]);G=M&&M.group;if(G){D=J.groups[G];if(!D.combine){M.combine=false;continue;}M.combine=true;if(D.comboBase){C=D.comboBase;}if("root" in D&&i.isValue(D.root)){M.root=D.root;}}K[C]=K[C]||[];K[C].push(M);}for(N in K){if(K.hasOwnProperty(N)){z=N;y=K[N];P=y.length;for(O=0;O<P;O++){M=y[O];if(M&&(M.type===x)&&(M.combine||!M.ext)){w=((i.isValue(M.root))?M.root:J.root)+M.path;w=J._filter(w,M.name);if((z!==N)&&(O<=(P-1))&&((w.length+z.length)>J.maxURLLength)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));z=N;}z+=w;if(O<(P-1)){z+=J.comboSep;}F.push(M.name);}}if(F.length&&(z!=N)){if(z.substr(z.length-1,1)===J.comboSep){z=z.substr(0,(z.length-1));}Q.push(J._filter(z));}}}if(F.length){if(x===q){E=d.Get.css;L=J.cssAttributes;}else{E=d.Get.script;L=J.jsAttributes;}E(Q,{data:J._loading,onSuccess:I,onFailure:J._onFailure,onTimeout:J._onTimeout,insertBefore:J.insertBefore,charset:J.charset,attributes:L,timeout:J.timeout,autopurge:false,context:J});return;}else{J._combineComplete[x]=true;}}if(A){if(A!==J._loading){return;}J.inserted[A]=true;if(J.onProgress){J.onProgress.call(J.context,{name:A,data:J.data});}}H=J.sorted;P=H.length;for(O=0;O<P;O=O+1){if(H[O] in J.inserted){continue;}if(H[O]===J._loading){return;}M=J.getModule(H[O]);if(!M){if(!J.skipped[H[O]]){B="Undefined module "+H[O]+" skipped";J.skipped[H[O]]=true;}continue;}D=(M.group&&J.groups[M.group])||f;if(!x||x===M.type){J._loading=H[O];if(M.type===q){E=d.Get.css;L=J.cssAttributes;if(M.cssAttributes){L=d.mix(L||{},M.cssAttributes);}}else{E=d.Get.script;L=J.jsAttributes;if(M.jsAttributes){L=d.mix(L||{},M.jsAttributes);}}z=(M.fullpath)?J._filter(M.fullpath,H[O]):J._url(M.path,H[O],D.base||M.base);E(z,{data:H[O],onSuccess:S,insertBefore:J.insertBefore,charset:J.charset,attributes:L,onFailure:J._onFailure,onTimeout:J._onTimeout,timeout:J.timeout,autopurge:false,context:J});return;}}J._loading=null;E=J._internalCallback;if(E){J._internalCallback=null;E.call(J);}else{J._onSuccess();}},_filter:function(y,x){var A=this.filter,w=x&&(x in this.filters),z=w&&this.filters[x],B=this.moduleInfo[x]?this.moduleInfo[x].group:null;if(B&&this.groups[B].filter){z=this.groups[B].filter;w=true;}if(y){if(w){A=(i.isString(z))?this.FILTER_DEFS[z.toUpperCase()]||null:z;}if(A){y=y.replace(new RegExp(A.searchExp,"g"),A.replaceStr);}}return y;},_url:function(y,w,x){return this._filter((x||this.base||"")+y,w);},resolve:function(w,K){var T,S,Q,B,G,D,P,F,J,R,x,E,N,A,V,C,U,I=[],H,M,y={},L=this,O={js:[],jsMods:[],css:[],cssMods:[]},z=L.loadType||"js";if(w){L.calculate();}K=K||L.sorted;if(L.combine){T=K.length;V=L.comboBase;B=V;N={};for(S=0;S<T;S++){E=V;Q=L.getModule(K[S]);J=Q&&Q.group;if(J){F=L.groups[J];if(!F.combine){Q.combine=false;continue;}Q.combine=true;if(F.comboBase){E=F.comboBase;}if("root" in F&&i.isValue(F.root)){Q.root=F.root;}}N[E]=N[E]||[];N[E].push(Q);}for(R in N){if(N.hasOwnProperty(R)){y[R]=y[R]||{js:[],jsMods:[],css:[],cssMods:[]};B=R;A=N[R];T=A.length;if(T){for(S=0;S<T;S++){Q=A[S];if(Q&&(Q.combine||!Q.ext)){x=((i.isValue(Q.root))?Q.root:L.root)+Q.path;x=L._filter(x,Q.name);y[R][Q.type].push(x);y[R][Q.type+"Mods"].push(Q);}}}}}for(R in y){C=R;for(z in y[C]){if(z===k||z===q){U=y[C][z];A=y[C][z+"Mods"];
+T=U.length;H=C+U.join(L.comboSep);M=H.length;if(T){if(M>L.maxURLLength){I=[];Q=[];for(K=0;K<T;K++){H=C+I.join(L.comboSep);if(H.length<L.maxURLLength){I.push(U[K]);Q.push(A[K]);}else{O[z].push(H);I=[];Q=[];}}}else{O[z].push(H);O[z+"Mods"]=A;}}}}}y=null;}else{K=L.sorted;T=K.length;for(S=0;S<T;S=S+1){Q=L.getModule(K[S]);if(!Q){if(!L.skipped[K[S]]){D="Undefined module "+K[S]+" skipped";}continue;}F=(Q.group&&L.groups[Q.group])||f;B=(Q.fullpath)?L._filter(Q.fullpath,K[S]):L._url(Q.path,K[S],F.base||Q.base);O[Q.type].push(B);O[Q.type+"Mods"].push(Q);}}return O;}};},"@VERSION@",{requires:["get"]});YUI.add("loader-rollup",function(a){a.Loader.prototype._rollup=function(){var k,h,g,o,b=this.required,e,f=this.moduleInfo,d,l,n;if(this.dirty||!this.rollups){this.rollups={};for(k in f){if(f.hasOwnProperty(k)){g=this.getModule(k);if(g&&g.rollup){this.rollups[k]=g;}}}}for(;;){d=false;for(k in this.rollups){if(this.rollups.hasOwnProperty(k)){if(!b[k]&&((!this.loaded[k])||this.forceMap[k])){g=this.getModule(k);o=g.supersedes||[];e=false;if(!g.rollup){continue;}l=0;for(h=0;h<o.length;h++){n=f[o[h]];if(this.loaded[o[h]]&&!this.forceMap[o[h]]){e=false;break;}else{if(b[o[h]]&&g.type==n.type){l++;e=(l>=g.rollup);if(e){break;}}}}if(e){b[k]=true;d=true;this.getRequires(g);}}}}if(!d){break;}}};},"@VERSION@",{requires:["loader-base"]});YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{"align-plugin":{"requires":["node-screen","node-pluginhost"]},"anim":{"use":["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{"requires":["base-base","node-style"]},"anim-color":{"requires":["anim-base"]},"anim-curve":{"requires":["anim-xy"]},"anim-easing":{"requires":["anim-base"]},"anim-node-plugin":{"requires":["node-pluginhost","anim-base"]},"anim-scroll":{"requires":["anim-base"]},"anim-xy":{"requires":["anim-base","node-screen"]},"app":{"use":["model","model-list","router","view"]},"array-extras":{"requires":["yui-base"]},"array-invoke":{"requires":["yui-base"]},"arraylist":{"requires":["yui-base"]},"arraylist-add":{"requires":["arraylist"]},"arraylist-filter":{"requires":["arraylist"]},"arraysort":{"requires":["yui-base"]},"async-queue":{"requires":["event-custom"]},"attribute":{"use":["attribute-base","attribute-complex"]},"attribute-base":{"requires":["event-custom"]},"attribute-complex":{"requires":["attribute-base"]},"autocomplete":{"use":["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{"optional":["autocomplete-sources"],"requires":["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{"requires":["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{"requires":["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{"requires":["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{"requires":["array-extras","highlight-accentfold"]},"autocomplete-list":{"after":["autocomplete-sources"],"lang":["en"],"requires":["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],"skinnable":true},"autocomplete-list-keys":{"condition":{"name":"autocomplete-list-keys","test":function(b){return !(b.UA.ios||b.UA.android);},"trigger":"autocomplete-list"},"requires":["autocomplete-list","base-build"]},"autocomplete-plugin":{"requires":["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{"optional":["io-base","json-parse","jsonp","yql"],"requires":["autocomplete-base"]},"base":{"use":["base-base","base-pluginhost","base-build"]},"base-base":{"after":["attribute-complex"],"requires":["attribute-base"]},"base-build":{"requires":["base-base"]},"base-pluginhost":{"requires":["base-base","pluginhost"]},"cache":{"use":["cache-base","cache-offline","cache-plugin"]},"cache-base":{"requires":["base"]},"cache-offline":{"requires":["cache-base","json"]},"cache-plugin":{"requires":["plugin","cache-base"]},"calendar":{"lang":["en","ja","ru"],"requires":["calendar-base","calendarnavigator"],"skinnable":true},"calendar-base":{"lang":["en","ja","ru"],"requires":["widget","substitute","datatype-date","datatype-date-math","cssgrids"],"skinnable":true},"calendarnavigator":{"requires":["plugin","classnamemanager","datatype-date","node","substitute"],"skinnable":true},"charts":{"requires":["dom","datatype-number","datatype-date","event-custom","event-mouseenter","widget","widget-position","widget-stack","graphics"]},"classnamemanager":{"requires":["yui-base"]},"clickable-rail":{"requires":["slider-base"]},"collection":{"use":["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},"console":{"lang":["en","es","ja"],"requires":["yui-log","widget","substitute"],"skinnable":true},"console-filters":{"requires":["plugin","console"],"skinnable":true},"controller":{"use":["router"]},"cookie":{"requires":["yui-base"]},"createlink-base":{"requires":["editor-base"]},"cssbase":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"type":"css"},"cssbase-context":{"after":["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],"type":"css"},"cssfonts":{"type":"css"},"cssfonts-context":{"type":"css"},"cssgrids":{"optional":["cssreset","cssfonts"],"type":"css"},"cssreset":{"type":"css"},"cssreset-context":{"type":"css"},"dataschema":{"use":["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{"requires":["dataschema-base"]},"dataschema-base":{"requires":["base"]},"dataschema-json":{"requires":["dataschema-base","json"]},"dataschema-text":{"requires":["dataschema-base"]},"dataschema-xml":{"requires":["dataschema-base"]},"datasource":{"use":["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{"requires":["datasource-local","plugin","dataschema-array"]},"datasource-cache":{"requires":["datasource-local","plugin","cache-base"]},"datasource-function":{"requires":["datasource-local"]},"datasource-get":{"requires":["datasource-local","get"]},"datasource-io":{"requires":["datasource-local","io-base"]},"datasource-jsonschema":{"requires":["datasource-local","plugin","dataschema-json"]},"datasource-local":{"requires":["base"]},"datasource-polling":{"requires":["datasource-local"]},"datasource-textschema":{"requires":["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{"requires":["datasource-local","plugin","dataschema-xml"]},"datatable":{"use":["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"]},"datatable-base":{"requires":["recordset-base","widget","substitute","event-mouseenter"],"skinnable":true},"datatable-datasource":{"requires":["datatable-base","plugin","datasource-local"]},"datatable-scroll":{"requires":["datatable-base","plugin"]},"datatable-sort":{"lang":["en"],"requires":["datatable-base","plugin","recordset-sort"]},"datatype":{"use":["datatype-number","datatype-date","datatype-xml"]},"datatype-date":{"supersedes":["datatype-date-format"],"use":["datatype-date-parse","datatype-date-format"]},"datatype-date-format":{"lang":["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{"requires":["yui-base"]},"datatype-date-parse":{},"datatype-number":{"use":["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{"use":["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},"dd":{"use":["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{"requires":["dd-drag"]},"dd-ddm":{"requires":["dd-ddm-base","event-resize"]},"dd-ddm-base":{"requires":["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{"requires":["dd-ddm"]},"dd-delegate":{"requires":["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{"requires":["dd-ddm-base"]},"dd-drop":{"requires":["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{"requires":["dd-drop"]},"dd-gestures":{"condition":{"name":"dd-gestures","test":function(b){return(b.config.win&&("ontouchstart" in b.config.win&&!b.UA.chrome));
+},"trigger":"dd-drag"},"requires":["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{"optional":["dd-constrain","dd-proxy"],"requires":["dd-drag"]},"dd-proxy":{"requires":["dd-drag"]},"dd-scroll":{"requires":["dd-drag"]},"dial":{"lang":["en","es"],"requires":["widget","dd-drag","substitute","event-mouseenter","event-move","event-key","transition","intl"],"skinnable":true},"dom":{"use":["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{"requires":["dom-core"]},"dom-core":{"requires":["oop","features"]},"dom-deprecated":{"requires":["dom-base"]},"dom-screen":{"requires":["dom-base","dom-style"]},"dom-style":{"requires":["dom-base"]},"dom-style-ie":{"condition":{"name":"dom-style-ie","test":function(h){var f=h.Features.test,g=h.Features.add,d=h.config.win,e=h.config.doc,b="documentElement",c=false;g("style","computedStyle",{test:function(){return d&&"getComputedStyle" in d;}});g("style","opacity",{test:function(){return e&&"opacity" in e[b].style;}});c=(!f("style","opacity")&&!f("style","computedStyle"));return c;},"trigger":"dom-style"},"requires":["dom-style"]},"dump":{"requires":["yui-base"]},"editor":{"use":["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{"requires":["base","frame","node","exec-command","selection"]},"editor-bidi":{"requires":["editor-base"]},"editor-br":{"requires":["editor-base"]},"editor-lists":{"requires":["editor-base"]},"editor-para":{"requires":["editor-base"]},"editor-tab":{"requires":["editor-base"]},"escape":{"requires":["yui-base"]},"event":{"after":["node-base"],"use":["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside"]},"event-base":{"after":["node-base"],"requires":["event-custom-base"]},"event-base-ie":{"after":["event-base"],"condition":{"name":"event-base-ie","test":function(c){var b=c.config.doc&&c.config.doc.implementation;return(b&&(!b.hasFeature("Events","2.0")));},"trigger":"node-base"},"requires":["node-base"]},"event-custom":{"use":["event-custom-base","event-custom-complex"]},"event-custom-base":{"requires":["oop"]},"event-custom-complex":{"requires":["event-custom-base"]},"event-delegate":{"requires":["node-base"]},"event-flick":{"requires":["node-base","event-touch","event-synthetic"]},"event-focus":{"requires":["event-synthetic"]},"event-gestures":{"use":["event-flick","event-move"]},"event-hover":{"requires":["event-mouseenter"]},"event-key":{"requires":["event-synthetic"]},"event-mouseenter":{"requires":["event-synthetic"]},"event-mousewheel":{"requires":["node-base"]},"event-move":{"requires":["node-base","event-touch","event-synthetic"]},"event-outside":{"requires":["event-synthetic"]},"event-resize":{"requires":["node-base","event-synthetic"]},"event-simulate":{"requires":["event-base"]},"event-synthetic":{"requires":["node-base","event-custom-complex"]},"event-touch":{"requires":["node-base"]},"event-valuechange":{"requires":["event-focus","event-synthetic"]},"exec-command":{"requires":["frame"]},"features":{"requires":["yui-base"]},"frame":{"requires":["base","node","selector-css3","substitute","yui-throttle"]},"get":{"requires":["yui-base"]},"graphics":{"requires":["node","event-custom","pluginhost"]},"graphics-canvas":{"condition":{"name":"graphics-canvas","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(b&&b.getContext&&b.getContext("2d")));},"trigger":"graphics"},"requires":["graphics"]},"graphics-canvas-default":{"condition":{"name":"graphics-canvas-default","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(b&&b.getContext&&b.getContext("2d")));},"trigger":"graphics"}},"graphics-svg":{"condition":{"name":"graphics-svg","test":function(c){var b=c.config.doc;return(b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));},"trigger":"graphics"},"requires":["graphics"]},"graphics-svg-default":{"condition":{"name":"graphics-svg-default","test":function(c){var b=c.config.doc;return(b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"));},"trigger":"graphics"}},"graphics-vml":{"condition":{"name":"graphics-vml","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!b||!b.getContext||!b.getContext("2d")));},"trigger":"graphics"},"requires":["graphics"]},"graphics-vml-default":{"condition":{"name":"graphics-vml-default","test":function(d){var c=d.config.doc,b=c&&c.createElement("canvas");return(c&&!c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!b||!b.getContext||!b.getContext("2d")));},"trigger":"graphics"}},"handlebars":{"use":["handlebars-compiler"]},"handlebars-base":{"requires":["escape"]},"handlebars-compiler":{"requires":["handlebars-base"]},"highlight":{"use":["highlight-base","highlight-accentfold"]},"highlight-accentfold":{"requires":["highlight-base","text-accentfold"]},"highlight-base":{"requires":["array-extras","classnamemanager","escape","text-wordbreak"]},"history":{"use":["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{"requires":["event-custom-complex"]},"history-hash":{"after":["history-html5"],"requires":["event-synthetic","history-base","yui-later"]},"history-hash-ie":{"condition":{"name":"history-hash-ie","test":function(c){var b=c.config.doc&&c.config.doc.documentMode;return c.UA.ie&&(!("onhashchange" in c.config.win)||!b||b<8);},"trigger":"history-hash"},"requires":["history-hash","node-base"]},"history-html5":{"optional":["json"],"requires":["event-base","history-base","node-base"]},"imageloader":{"requires":["base-base","node-style","node-screen"]},"intl":{"requires":["intl-base","event-custom"]},"intl-base":{"requires":["yui-base"]},"io":{"use":["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{"requires":["event-custom-base","querystring-stringify-simple"]},"io-form":{"requires":["io-base","node-base"]},"io-queue":{"requires":["io-base","queue-promote"]},"io-upload-iframe":{"requires":["io-base","node-base"]},"io-xdr":{"requires":["io-base","datatype-xml-parse"]},"json":{"use":["json-parse","json-stringify"]},"json-parse":{"requires":["yui-base"]},"json-stringify":{"requires":["yui-base"]},"jsonp":{"requires":["get","oop"]},"jsonp-url":{"requires":["jsonp"]},"loader":{"use":["loader-base","loader-rollup","loader-yui3"]},"loader-base":{"requires":["get"]},"loader-rollup":{"requires":["loader-base"]},"loader-yui3":{"requires":["loader-base"]},"model":{"requires":["base-build","escape","json-parse"]},"model-list":{"requires":["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"node":{"use":["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{"requires":["event-base","node-core","dom-base"]},"node-core":{"requires":["dom-core","selector"]},"node-deprecated":{"requires":["node-base"]},"node-event-delegate":{"requires":["node-base","event-delegate"]},"node-event-html5":{"requires":["node-base"]},"node-event-simulate":{"requires":["node-base","event-simulate"]},"node-flick":{"requires":["classnamemanager","transition","event-flick","plugin"],"skinnable":true},"node-focusmanager":{"requires":["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{"requires":["node-base","io-base"]},"node-menunav":{"requires":["node","classnamemanager","plugin","node-focusmanager"],"skinnable":true},"node-pluginhost":{"requires":["node-base","pluginhost"]},"node-screen":{"requires":["dom-screen","node-base"]},"node-style":{"requires":["dom-style","node-base"]},"oop":{"requires":["yui-base"]},"overlay":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],"skinnable":true},"panel":{"requires":["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain","widget-modality","widget-autohide","widget-buttons"],"skinnable":true},"parallel":{"requires":["yui-base"]},"pjax":{"requires":["pjax-base","io-base"]},"pjax-base":{"requires":["classnamemanager","node-event-delegate","router"]},"pjax-plugin":{"requires":["node-pluginhost","pjax","plugin"]},"plugin":{"requires":["base-base"]},"pluginhost":{"use":["pluginhost-base","pluginhost-config"]},"pluginhost-base":{"requires":["yui-base"]},"pluginhost-config":{"requires":["pluginhost-base"]},"profiler":{"requires":["yui-base"]},"querystring":{"use":["querystring-parse","querystring-stringify"]},"querystring-parse":{"requires":["yui-base","array-extras"]},"querystring-parse-simple":{"requires":["yui-base"]},"querystring-stringify":{"requires":["yui-base"]},"querystring-stringify-simple":{"requires":["yui-base"]},"queue-promote":{"requires":["yui-base"]},"range-slider":{"requires":["slider-base","slider-value-range","clickable-rail"]},"recordset":{"use":["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{"requires":["base","arraylist"]},"recordset-filter":{"requires":["recordset-base","array-extras","plugin"]},"recordset-indexer":{"requires":["recordset-base","plugin"]},"recordset-sort":{"requires":["arraysort","recordset-base","plugin"]},"resize":{"use":["resize-base","resize-proxy","resize-constrain"]},"resize-base":{"requires":["base","widget","substitute","event","oop","dd-drag","dd-delegate","dd-drop"],"skinnable":true},"resize-constrain":{"requires":["plugin","resize-base"]},"resize-plugin":{"optional":["resize-constrain"],"requires":["resize-base","plugin"]},"resize-proxy":{"requires":["plugin","resize-base"]},"rls":{"requires":["get","features"]},"router":{"optional":["querystring-parse"],"requires":["array-extras","base-build","history"]},"scrollview":{"requires":["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{"requires":["widget","event-gestures","transition"],"skinnable":true},"scrollview-base-ie":{"condition":{"name":"scrollview-base-ie","trigger":"scrollview-base","ua":"ie"},"requires":["scrollview-base"]},"scrollview-list":{"requires":["plugin","classnamemanager"],"skinnable":true},"scrollview-paginator":{"requires":["plugin"]},"scrollview-scrollbars":{"requires":["classnamemanager","transition","plugin"],"skinnable":true},"selection":{"requires":["node"]},"selector":{"requires":["selector-native"]},"selector-css2":{"condition":{"name":"selector-css2","test":function(d){var c=d.config.doc,b=c&&!("querySelectorAll" in c);
return b;},"trigger":"selector"},"requires":["selector-native"]},"selector-css3":{"requires":["selector-native","selector-css2"]},"selector-native":{"requires":["dom-base"]},"shim-plugin":{"requires":["node-style","node-pluginhost"]},"slider":{"use":["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{"requires":["widget","dd-constrain","substitute"],"skinnable":true},"slider-value-range":{"requires":["slider-base"]},"sortable":{"requires":["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{"requires":["dd-scroll","sortable"]},"stylesheet":{"requires":["yui-base"]},"substitute":{"optional":["dump"],"requires":["yui-base"]},"swf":{"requires":["event-custom","node","swfdetect","escape"]},"swfdetect":{"requires":["yui-base"]},"tabview":{"requires":["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],"skinnable":true},"tabview-base":{"requires":["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{"requires":["tabview-base"]},"test":{"requires":["event-simulate","event-custom","substitute","json-stringify"],"skinnable":true},"test-console":{"requires":["console-filters","test"],"skinnable":true},"text":{"use":["text-accentfold","text-wordbreak"]},"text-accentfold":{"requires":["array-extras","text-data-accentfold"]},"text-data-accentfold":{"requires":["yui-base"]},"text-data-wordbreak":{"requires":["yui-base"]},"text-wordbreak":{"requires":["array-extras","text-data-wordbreak"]},"transition":{"requires":["node-style"]},"transition-timer":{"condition":{"name":"transition-timer","test":function(e){var d=e.config.doc,c=(d)?d.documentElement:null,b=true;if(c&&c.style){b=!("MozTransition" in c.style||"WebkitTransition" in c.style);}return b;},"trigger":"transition"},"requires":["transition"]},"uploader":{"requires":["event-custom","node","base","swf"]},"view":{"requires":["base-build","node-event-delegate"]},"widget":{"use":["widget-base","widget-htmlparser","widget-uievents","widget-skin"]},"widget-anim":{"requires":["plugin","anim-base","widget"]},"widget-autohide":{"requires":["widget","event-outside","base-build","event-key"],"skinnable":false},"widget-base":{"requires":["attribute","event-focus","base-base","base-pluginhost","node-base","node-style","classnamemanager"],"skinnable":true},"widget-base-ie":{"condition":{"name":"widget-base-ie","trigger":"widget-base","ua":"ie"},"requires":["widget-base"]},"widget-buttons":{"requires":["widget","base-build","widget-stdmod"],"skinnable":true},"widget-child":{"requires":["base-build","widget"]},"widget-htmlparser":{"requires":["widget-base"]},"widget-locale":{"requires":["widget-base"]},"widget-modality":{"requires":["widget","event-outside","base-build"],"skinnable":false},"widget-parent":{"requires":["base-build","arraylist","widget"]},"widget-position":{"requires":["base-build","node-screen","widget"]},"widget-position-align":{"requires":["widget-position"]},"widget-position-constrain":{"requires":["widget-position"]},"widget-skin":{"requires":["widget-base"]},"widget-stack":{"requires":["base-build","widget"],"skinnable":true},"widget-stdmod":{"requires":["base-build","widget"]},"widget-uievents":{"requires":["widget-base","node-event-delegate"]},"yql":{"requires":["jsonp","jsonp-url"]},"yui":{},"yui-base":{},"yui-later":{"requires":["yui-base"]},"yui-log":{"requires":["yui-base"]},"yui-rls":{},"yui-throttle":{"requires":["yui-base"]}};YUI.Env[a.version].md5="7f3e2a182ac855f60af5ab295f71fefe";},"@VERSION@",{requires:["loader-base"]});YUI.add("loader",function(a){},"@VERSION@",{use:["loader-base","loader-rollup","loader-yui3"]});
View
315 build/loader/loader.js
@@ -133,10 +133,6 @@ var NOT_FOUND = {},
return path;
};
-if (YUI.Env.aliases) {
- YUI.Env.aliases = {}; //Don't need aliases if Loader is present
-}
-
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
@@ -1188,7 +1184,12 @@ Y.Loader.prototype = {
}
}
+ if (o.supersedes) {
+ o.supersedes = this.filterRequires(o.supersedes);
+ }
+
if (o.after) {
+ o.after = this.filterRequires(o.after);
o.after_map = YArray.hash(o.after);
}
@@ -1294,12 +1295,20 @@ Y.Loader.prototype = {
*/
getRequires: function(mod) {
- if (!mod || mod._parsed) {
+ if (!mod) {
+ //console.log('returning no reqs for ' + mod.name);
return NO_REQUIREMENTS;
}
+ if (mod._parsed) {
+ //console.log('returning requires for ' + mod.name, mod.requires);
+ return mod.expanded || NO_REQUIREMENTS;
+ }
+
+ //TODO add modue cache here out of scope..
+
var i, m, j, add, packName, lang, testresults = this.testresults,
- name = mod.name, cond, go,
+ name = mod.name, cond,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
@@ -1330,7 +1339,6 @@ Y.Loader.prototype = {
d = [];
hash = {};
-
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
@@ -1409,6 +1417,8 @@ Y.Loader.prototype = {
cond = this.conditions[name];
if (cond) {
+ //Set the module to not parsed since we have conditionals and this could change the dependency tree.
+ mod._parsed = false;
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
@@ -1425,7 +1435,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
@@ -1437,6 +1447,7 @@ Y.Loader.prototype = {
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
+
}
}
}
@@ -1669,6 +1680,7 @@ Y.Loader.prototype = {
* @private
*/
_explode: function() {
+ //TODO Move done out of scope
var r = this.required, m, reqs, done = {},
self = this;
@@ -1720,10 +1732,18 @@ Y.Loader.prototype = {
for (pname in patterns) {
if (patterns.hasOwnProperty(pname)) {
p = patterns[pname];
+
+ //There is no test method, create a default one that tests
+ // the pattern against the mod name
+ if (!p.test) {
+ p.test = function(mname, pname) {
+ return (mname.indexOf(pname) > -1);
+ };
+ }
- // use the metadata supplied for the pattern
- // as the module definition.
- if (mname.indexOf(pname) > -1) {
+ if (p.test(mname, pname)) {
+ // use the metadata supplied for the pattern
+ // as the module definition.
found = p;
break;
}
@@ -1848,6 +1868,20 @@ Y.Loader.prototype = {
self._finish(msg, success);
},
/**
+ * The default Loader onProgress handler, calls this.onProgress with a payload
+ * @method _onProgress
+ * @private
+ */
+ _onProgress: function(e) {
+ var self = this;
+ if (self.onProgress) {
+ self.onProgress.call(self.context, {
+ name: e.url,
+ data: e.data
+ });
+ }
+ },
+ /**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
@@ -1891,6 +1925,7 @@ Y.Loader.prototype = {
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
+ //TODO Move this out of scope
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
@@ -1960,6 +1995,7 @@ Y.Loader.prototype = {
this.sorted = partial;
this.insert(o, type, true);
},
+
/**
* Handles the actual insertion of script/link tags
* @method _insert
@@ -1983,6 +2019,88 @@ Y.Loader.prototype = {
this.calculate(o);
}
+ var modules = this.resolve(),
+ self = this, comp = 0, actions = 0;
+
+ if (type) {
+ var m = modules[type];
+ modules = {};
+ modules[type] = m;
+ comp++;
+ } else {
+ if (modules.js.length) {
+ comp++;
+ }
+ if (modules.css.length) {
+ comp++;
+ }
+ }
+
+ //console.log('Resolved Modules: ', modules);
+
+ var complete = function(d) {
+ actions++;
+
+ if (d && d.data && d.data.length) {
+ for (var i = 0; i < d.data.length; i++) {
+ self.inserted[d.data[i].name] = true;
+ }
+ }
+
+ if (actions === comp) {
+ self._loading = null;
+ self._onSuccess();
+ }
+ };
+
+ this._loading = true;
+
+ if (!modules.js.length && !modules.css.length) {
+ actions = -1;
+ complete();
+ return;
+ }
+
+
+ if (modules.css.length) { //Load CSS first
+ Y.Get.css(modules.css, {
+ data: modules.cssMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onSuccess: complete
+ });
+ }
+
+ if (modules.js.length) {
+ Y.Get.script(modules.js, {
+ data: modules.jsMods,
+ insertBefore: self.insertBefore,
+ charset: self.charset,
+ timeout: self.timeout,
+ autopurge: false,
+ context: self,
+ async: true,
+ onProgress: function(e) {
+ self._onProgress.call(self, e);
+ },
+ onFailure: self._onFailure,
+ onTimeout: self._onTimeout,
+ onSuccess: complete
+ });
+ }
+
+
+ /*
+
this.loadType = type;
if (!type) {
@@ -2029,6 +2147,7 @@ Y.Loader.prototype = {
// start the load
this.loadNext();
+ */
},
/**
@@ -2397,68 +2516,146 @@ Y.Loader.prototype = {
*
*/
resolve: function(calc, s) {
- var self = this, i, m, url, out = { js: [], css: [] };
+
+ var len, i, m, url, fn, msg, attr, group, groupName, j, frag,
+ comboSource, comboSources, mods, comboBase,
+ base, urls, u = [], tmpBase, baseLen, resCombos = {},
+ self = this,
+ resolved = { js: [], jsMods: [], css: [], cssMods: [] },
+ type = self.loadType || 'js';
if (calc) {
self.calculate();
}
s = s || self.sorted;
- for (i = 0; i < s.length; i++) {
- m = self.getModule(s[i]);
- if (m) {
- if (self.combine) {
- url = self._filter((self.root + m.path), m.name, self.root);
- } else {
- url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
+ if (self.combine) {
+
+ len = s.length;
+
+ // the default combo base
+ comboBase = self.comboBase;
+
+ url = comboBase;
+
+ comboSources = {};
+
+ for (i = 0; i < len; i++) {
+ comboSource = comboBase;
+ m = self.getModule(s[i]);
+ groupName = m && m.group;
+ if (groupName) {
+
+ group = self.groups[groupName];
+
+ if (!group.combine) {
+ m.combine = false;
+ continue;
+ }
+ m.combine = true;
+ if (group.comboBase) {
+ comboSource = group.comboBase;
+ }
+
+ if ("root" in group && L.isValue(group.root)) {
+ m.root = group.root;
+ }
+
}
- out[m.type].push(url);
+
+ comboSources[comboSource] = comboSources[comboSource] || [];
+ comboSources[comboSource].push(m);
}
- }
- if (self.combine) {
- out.js = [self.comboBase + out.js.join(self.comboSep)];
- out.css = [self.comboBase + out.css.join(self.comboSep)];
- }
- return out;
- },
- /**
- * Returns an Object hash of hashes built from `loader.sorted` or from an arbitrary list of sorted modules.
- * @method hash
- * @private
- * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
- * @param {Array} [s=loader.sorted] An override for the loader.sorted array
- * @return {Object} Object hash (js and css) of two object hashes of file lists, with the module name as the key
- * @example This method can be used as an off-line dep calculator
- *
- * var Y = YUI();
- * var loader = new Y.Loader({
- * filter: 'debug',
- * base: '../../',
- * root: 'build/',
- * combine: true,
- * require: ['node', 'dd', 'console']
- * });
- * var out = loader.hash(true);
- *
- */
- hash: function(calc, s) {
- var self = this, i, m, url, out = { js: {}, css: {} };
+ for (j in comboSources) {
+ if (comboSources.hasOwnProperty(j)) {
+ resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };
+ url = j;
+ mods = comboSources[j];
+ len = mods.length;
+
+ if (len) {