loader.js revision 77cb3c93f213a335da49d4204794aa69920b8355
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp(function() {
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * Loader dynamically loads script and css files. It includes the dependency
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * info for the version of the library in use, and will automatically pull in
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * dependencies for the modules requested. It supports rollup files and will
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * automatically use these when appropriate in order to minimize the number of
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * http connections required to load all of the dependencies. It can load the
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * files from the Yahoo! CDN, and it can utilize the combo service provided on
2cf39f73ff3df5a2421fadc3c7fb24ed07e051b9Tripp * this network to reduce the number of http connections required to download
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * YUI files.
* The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
* minified version of the files (e.g., event-min.js). The filter property
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
* 'replaceStr': "-debug.js"
* <li>filters: per-component filter specification. If specified for a given component, this overrides the filter config</li>
* Use the YUI combo service to reduce the number of http connections required to load your dependencies</li>
* A list of modules that should always be loaded when required, even if already present on the page</li>
* number of milliseconds before a timeout occurs when dynamically loading nodes. in not set, there is no timeout</li>
var NOT_FOUND = {},
META = {
skin: {
modules: {
dom: {
submodules: {
plugins: {
node: {
submodules: {
plugins: {
anim: {
submodules: {
attribute: {
submodules: {
base: {
submodules: {
cache: {
compat: {
collection: {
console: {
skinnable: true,
plugins: {
skinnable: true
cookie: {
submodules: {
submodules: {
datatype:{
submodules: {
dd:{
submodules: {
dump: {
event: {
submodules: {
submodules: {
history: {
imageloader: {
io:{
submodules: {
json: {
submodules: {
loader: {
skinnable: true
oop: {
overlay: {
skinnable: true
plugin: {
pluginhost: {
profiler: {
submodules: {
slider: {
skinnable: true
sortable: {
stylesheet: {
substitute: {
widget: {
submodules : {
plugins: {
skinnable: true
skinnable: true
yui: {
submodules: {
get: {},
test: {
patterns: {
filter: {
L = Y.Lang;
Y.Loader = function(o) {
this.context = Y;
// this.jsAttributes = null;
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
* @default http://yui.yahooapis.com/combo?
this.forceMap = {};
this.allowRollup = true;
* minified version of the files (e.g., event-min.js). The filter property
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
* 'replaceStr': "-debug.js"
this.filters = {};
this.required = {};
this.moduleInfo = {};
this._internal = true;
for (i in defaults) {
for (i in onPage) {
this._internal = false;
this.sorted = [];
this.dirty = true;
this.inserted = {};
this.skipped = {};
this._config(o);
FILTER_DEFS: {
RAW: {
DEBUG: {
_config: function(o) {
var i, j, val, f;
if (o.hasOwnProperty(i)) {
val = o[i];
for (j in val) {
this[i] = val;
f = this.filter;
if (L.isString(f)) {
f = f.toUpperCase();
this.filterName = f;
if (mod) {
if (mod) {
this.addModule({
return name;
* <dt>after:</dt> <dd>array of modules the components which, if present, should be sorted above this one</dd>
* <dt>fullpath:</dt> <dd>If fullpath is specified, this is used instead of the configured base + path</dd>
if (!o || !o.name) {
if (!o.type) {
if (subs) {
sup = [];
for (i in subs) {
s = subs[i];
this.addModule(s, i);
if (o.skinnable) {
if (plugins) {
for (i in plugins) {
if (o.skinnable) {
this.dirty = true;
this.dirty = true;
d.push(r[i]);
m = this.getModule(r[i]);
d.push(r[i]);
m = this.getModule(r[i]);
if (o && this.loadOptional) {
d.push(o[i]);
return NOT_FOUND;
if (m && !m.provides) {
s = m.supersedes;
Y.Array.each(s, function(v) {
o[name] = true;
m.provides = o;
return m.provides;
this._config(o);
this._setup();
this._explode();
if (this.allowRollup) {
this._rollup();
this._reduce();
this._sort();
this.dirty = false;
_setup: function() {
if (m && m.skinnable) {
if (o && o[name]) {
if (!this.ignoreRegistered) {
if (this.ignore) {
if (l.hasOwnProperty(j)) {
if (this.force) {
if (this.force[i] in l) {
delete l[this.force[i]];
_explode: function() {
if (expound) {
if (name) {
for (i in patterns) {
p = patterns[i];
add = p;
if (add) {
_rollup: function() {
for (i in info) {
m = this.getModule(i);
if (m && m.rollup) {
rollups[i] = m;
rolled = false;
for (i in rollups) {
m = this.getModule(i);
s = m.supersedes || [];
roll = false;
if (!m.rollup) {
roll = false;
if (roll) {
if (roll) {
rolled = true;
this.getRequires(m);
if (!rolled) {
_reduce: function() {
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
if ((this.loaded[i] && (!this.forceMap[i]) && !this.ignoreRegistered) || (type && m && m.type != type)) {
s = m && m.supersedes;
_attach: function() {
if (this.attaching) {
_finish: function() {
this._continue();
_onSuccess: function() {
this._attach();
for (i in skipped) {
delete this.inserted[i];
this.skipped = {};
f = this.onSuccess;
success: true,
this._finish();
_onFailure: function(o) {
this._attach();
var f = this.onFailure;
success: false
this._finish();
_onTimeout: function() {
this._attach();
var f = this.onTimeout;
success: false
this._finish();
_sort: function() {
done = {},
r = m.expanded;
l = s.length;
moved = false;
doneKey = a + s[k];
moved = true;
if (moved) {
if (!moved) {
this.sorted = s;
if (source) {
if (!type) {
var self = this;
this._internalCallback = function() {
this._loading = true;
this._combineComplete = {};
this.loadNext();
_continue: function() {
this._continue();
if (!this._loading) {
callback=function(o) {
this.inserted[c[i]] = true;
onsuccess=function(o) {
this._combining = [];
s=this.sorted;
m = this.getModule(s[i]);
autopurge: false,
if (mname) {
if (this.onProgress) {
s=this.sorted;
if (s[i] in this.inserted) {
if (s[i] === this._loading) {
m = this.getModule(s[i]);
this.inserted[s[i]] = true;
this.skipped[s[i]] = true;
this._loading = s[i];
url = (m.fullpath) ? this._filter(m.fullpath, s[i]) : this._url(m.path, s[i], this.galleryBase || m.base);
data: s[i],
autopurge: false,
this._loading = null;
if (fn) {
this._internalCallback = null;
this._onSuccess();
var f = this.filter,
if (hasFilter) {