rls.js revision 9825f8a484ba80b5b1ee965e60e0f0d4ee090f09
/**
* RLS (Remote Loader Service) Support
* @module yui
* @submodule rls
* @class rls
*/
/**
* Checks the environment for local modules and deals with them before firing off an RLS request.
* This needs to make sure that all dependencies are calculated before it can make an RLS request in
* order to make sure all remote dependencies are evaluated and their requirements are met.
* @method rls_locals
* @private
* @param {YUI} instance The YUI Instance we are working with.
* @param {Array} argz The requested modules.
* @param {Callback} cb The callback to be executed when we are done
* @param {YUI} cb.instance The instance is passed back to the callback
* @param {Array} cb.argz The modified list or modules needed to require
*/
PATH = 'fullpath', f,
for (f in mods) {
if (asked[f]) {
if (mods[f]) {
}
}
}
});
}
}
}
}
onEnd: function(o) {
},
});
} else {
}
} else {
}
};
/**
* Check the environment and the local config to determine if a module has already been registered.
* @method rls_needs
* @private
* @param {String} mod The module to check
* @param {YUI} instance The instance to check against.
*/
return true;
}
return false;
};
/**
* Implentation for building the remote loader service url.
* @method _rls
* @private
* @param {Array} what the requested modules.
* @since 3.2.0
* @return {string} the url for the remote loader service call, returns false if no modules are required to be fetched (they are in the ENV already).
*/
YArray = Y.Array,
YObject = Y.Object,
// the configuration
m: 1, // required in the template
v: Y.version,
},
// The rls base path
// the template
var s = [], param;
}
}
// console.log('rls_tmpl: ' + s);
return s.join('&');
}(),
w = [], gallery = [],
url;
for (i = 0; i < len; i++) {
Y.log('Did not find ' + what[i] + ' in YUI.Env.mods or config.modules adding to RLS', 'info', 'rls');
} else {
}
}
if (mods) {
for (i in mods) {
for (o = 0; o < len; o++) {
} else {
if (d) {
d = d.details || d;
if (d.requires) {
if (Y.rls_needs(o)) {
m.push(o);
}
});
}
}
}
}
}
}
}
if (Y.rls_needs(o)) {
m.push(o);
}
});
}
}
});
if (!Y.Loader) {
//Fetch Loader..
w.push('loader-base');
}
} else {
}
});
m = w;
}
//Strip Duplicates
if (!m.length) {
//Return here if there no modules to load.
return false;
}
// update the request
YUI._rls_active = {
attach: m,
inst: Y,
};
return url;
};
/**
*
* @method rls_oncomplete
* @param {Callback} cb The callback to execute when the RLS request is complete
*/
Y.rls_oncomplete = function(cb) {
};
/**
* Calls the callback registered with Y.rls_oncomplete when the RLS request (and it's dependency requests) is done.
* @method rls_done
* @param {Array} data The modules loaded
*/
};
/**
* Hash to hang on to the calling RLS instance so we can deal with the return from the server.
* @property _rls_active
* @private
* @type Object
* @static
*/
if (!YUI._rls_active) {
YUI._rls_active = {};
}
/**
* An array of skins loaded via RLS to populate the ENV with when making future requests.
* @property _rls_skins
* @private
* @type Array
* @static
*/
if (!YUI._rls_skins) {
YUI._rls_skins = [];
}
/**
*
* @method $rls
* @private
* @static
* @param {Object} req The data returned from the RLS server
* @param {String} req.css Does this request need CSS? If so, load the same RLS url with &css=1 attached
* @param {Array} req.module The sorted list of modules to attach to the page.
*/
Y = rls_active.inst;
if (Y) {
}
}
});
if (loadInt) {
}
}
Y.Env.bootstrapped = true;
}
});
loader.ignoreRegistered = false;
} else {
}
}
}
};
}