Skip to content

Commit

Permalink
Merge branch 'master' of yuisource.corp.yahoo.com:yui3
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrove committed Jun 28, 2011
2 parents 6854842 + e402a75 commit eb1a561
Show file tree
Hide file tree
Showing 24 changed files with 1,053 additions and 105 deletions.
51 changes: 49 additions & 2 deletions build/loader-base/loader-base-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Y.Loader = function(o) {
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base;
self.base = Y.Env.meta.base + Y.Env.meta.root;

/**
* Base path for the combo service
Expand Down Expand Up @@ -2062,7 +2062,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
*/
loadNext: function(mname) {
// It is possible that this function is executed due to something
// else one the page loading a YUI module. Only react when we
// else on the page loading a YUI module. Only react when we
// are actively loading something
if (!this._loading) {
return;
Expand Down Expand Up @@ -2347,11 +2347,58 @@ Y.log('attempting to load ' + s[i] + ', ' + self.base, 'info', 'loader');
* Generates the full url for a module
* method _url
* @param {string} path the path fragment.
* @param {String} name The name of the module
* @pamra {String} [base=self.base] The base url to use
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
},
/**
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method resolve
* @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 arrays of file lists
* @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.resolve(true);
*
*/
resolve: function(calc, s) {
var self = this, i, m, url, out = { js: [], css: [] };

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);
}
out[m.type].push(url);
}
}
if (self.combine) {
out.js = [self.comboBase + out.js.join(self.comboSep)];
out.css = [self.comboBase + out.css.join(self.comboSep)];
}

return out;
}
};

Expand Down
4 changes: 2 additions & 2 deletions build/loader-base/loader-base-min.js

Large diffs are not rendered by default.

51 changes: 49 additions & 2 deletions build/loader-base/loader-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Y.Loader = function(o) {
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base;
self.base = Y.Env.meta.base + Y.Env.meta.root;

/**
* Base path for the combo service
Expand Down Expand Up @@ -2037,7 +2037,7 @@ Y.Loader.prototype = {
*/
loadNext: function(mname) {
// It is possible that this function is executed due to something
// else one the page loading a YUI module. Only react when we
// else on the page loading a YUI module. Only react when we
// are actively loading something
if (!this._loading) {
return;
Expand Down Expand Up @@ -2314,11 +2314,58 @@ Y.Loader.prototype = {
* Generates the full url for a module
* method _url
* @param {string} path the path fragment.
* @param {String} name The name of the module
* @pamra {String} [base=self.base] The base url to use
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
},
/**
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method resolve
* @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 arrays of file lists
* @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.resolve(true);
*
*/
resolve: function(calc, s) {
var self = this, i, m, url, out = { js: [], css: [] };

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);
}
out[m.type].push(url);
}
}
if (self.combine) {
out.js = [self.comboBase + out.js.join(self.comboSep)];
out.css = [self.comboBase + out.css.join(self.comboSep)];
}

return out;
}
};

Expand Down
17 changes: 13 additions & 4 deletions build/loader-yui3/loader-yui3-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-canvas-default": {
"condition": {
Expand All @@ -1128,7 +1131,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-svg-default": {
"condition": {
Expand All @@ -1149,7 +1155,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-vml-default": {
"condition": {
Expand Down Expand Up @@ -1984,7 +1993,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
]
}
};
YUI.Env[Y.version].md5 = 'ea3b697e30a4b7bf0c41e10e098f5bab';
YUI.Env[Y.version].md5 = 'bfa4168f56b3fe75d19bfd18b6442f97';


}, '@VERSION@' ,{requires:['loader-base']});
4 changes: 2 additions & 2 deletions build/loader-yui3/loader-yui3-min.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions build/loader-yui3/loader-yui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-canvas-default": {
"condition": {
Expand All @@ -1128,7 +1131,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-svg-default": {
"condition": {
Expand All @@ -1149,7 +1155,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-vml-default": {
"condition": {
Expand Down Expand Up @@ -1984,7 +1993,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
]
}
};
YUI.Env[Y.version].md5 = 'ea3b697e30a4b7bf0c41e10e098f5bab';
YUI.Env[Y.version].md5 = 'bfa4168f56b3fe75d19bfd18b6442f97';


}, '@VERSION@' ,{requires:['loader-base']});
68 changes: 62 additions & 6 deletions build/loader/loader-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Y.Loader = function(o) {
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base;
self.base = Y.Env.meta.base + Y.Env.meta.root;

/**
* Base path for the combo service
Expand Down Expand Up @@ -2062,7 +2062,7 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
*/
loadNext: function(mname) {
// It is possible that this function is executed due to something
// else one the page loading a YUI module. Only react when we
// else on the page loading a YUI module. Only react when we
// are actively loading something
if (!this._loading) {
return;
Expand Down Expand Up @@ -2347,11 +2347,58 @@ Y.log('attempting to load ' + s[i] + ', ' + self.base, 'info', 'loader');
* Generates the full url for a module
* method _url
* @param {string} path the path fragment.
* @param {String} name The name of the module
* @pamra {String} [base=self.base] The base url to use
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
},
/**
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method resolve
* @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 arrays of file lists
* @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.resolve(true);
*
*/
resolve: function(calc, s) {
var self = this, i, m, url, out = { js: [], css: [] };

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);
}
out[m.type].push(url);
}
}
if (self.combine) {
out.js = [self.comboBase + out.js.join(self.comboSep)];
out.css = [self.comboBase + out.css.join(self.comboSep)];
}

return out;
}
};

Expand Down Expand Up @@ -3571,7 +3618,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-canvas-default": {
"condition": {
Expand All @@ -3592,7 +3642,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-svg-default": {
"condition": {
Expand All @@ -3613,7 +3666,10 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
"trigger": "graphics"
}
},
"requires": [
"graphics"
]
},
"graphics-vml-default": {
"condition": {
Expand Down Expand Up @@ -4448,7 +4504,7 @@ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
]
}
};
YUI.Env[Y.version].md5 = 'ea3b697e30a4b7bf0c41e10e098f5bab';
YUI.Env[Y.version].md5 = 'bfa4168f56b3fe75d19bfd18b6442f97';


}, '@VERSION@' ,{requires:['loader-base']});
Expand Down
Loading

0 comments on commit eb1a561

Please sign in to comment.