yui.js revision 81633afa56473067b37b848ef71bd39fc5c8d92e
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * @module yui
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo// @TODO: this needs to be created at build time from module metadata
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * The YUI global namespace object. If YUI is already defined, the
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * existing YUI object will not be overwritten so that defined
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * namespaces are preserved.
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * @constructor
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @uses Event.Target
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @param o Optional configuration object. Options:
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>------------------------------------------------------------------------</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>Global:</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>------------------------------------------------------------------------</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * Turn debug statements on or off</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>useConsole:
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * Log to the browser console if debug is on and the console is available</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>logInclude:
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * A hash of log sources that should be logged. If specified, only log messages from these sources will be logged.
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>logExclude:
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * A hash of log sources that should be not be logged. If specified, all sources are logged if not on this list.</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>throwFail:
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * If throwFail is set, Y.fail will generate or re-throw a JS error. Otherwise the failure is logged.
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * The target window/frame</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * A list of modules that defines the YUI core (overrides the default)</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>------------------------------------------------------------------------</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>For event and get:</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>------------------------------------------------------------------------</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>pollInterval:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * The default poll interval</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>-------------------------------------------------------------------------</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>For loader:</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>-------------------------------------------------------------------------</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * The base dir</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>secureBase:
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * The secure base dir (not implemented)</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>comboBase:
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * The root path to prepend to module names for the combo service. Ex: 2.5.2/build/</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>filter:
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * A filter to apply to result urls. This filter will modify the default
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * path for all modules. The default path for the YUI library is the
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * minified version of the files (e.g., event-min.js). The filter property
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * can be a predefined filter or a custom filter. The valid predefined
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * filters are:
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * <dt>DEBUG</dt>
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * <dd>Selects the debug versions of the library (e.g., event-debug.js).
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * This option will automatically include the logger widget</dd>
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * <dt>RAW</dt>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * You can also define a custom filter, which must be an object literal
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * containing a search expression and a replace string:
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * myFilter: {
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo * 'searchExp': "-min\\.js",
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * 'replaceStr': "-debug.js"
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>combine:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * Use the YUI combo service to reduce the number of http connections required to load your dependencies</li>
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * <li>ignore:
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * A list of modules that should never be dynamically loaded</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * A list of modules that should always be loaded when required, even if already present on the page</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>insertBefore:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * Node or id for a node that should be used as the insertion point for new nodes</li>
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo * <li>charset:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * charset for dynamic nodes</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>timeout:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * number of milliseconds before a timeout occurs when dynamically loading nodes. in not set, there is no timeout</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>context:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * execution context for all callbacks</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>onSuccess:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * callback for the 'success' event</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>onFailure:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * callback for the 'failure' event</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>onTimeout:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * callback for the 'timeout' event</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>onProgress:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * callback executed each time a script or css file is loaded</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * <li>modules:
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * A list of module definitions. See Loader.addModule for the supported module metadata</li>
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo /*global YUI*/
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo YUI = function(o) {
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo var Y = this;
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo // Allow var yui = YUI() instead of var yui = new YUI()
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo return new YUI(o);
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo // set up the core environment
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo // bind the specified additional modules for this instance
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo// The prototype contains the functions that are required to allow the external
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo// modules to be registered and for the instance to be initialized.
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * Initialize this YUI instance
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @param o config options
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo _init: function(o) {
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo // find targeted window and @TODO create facades
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo var w = (o.win) ? (o.win.contentWindow) : o.win || window;
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo o.useConsole = ('useConsole' in o) ? o.useConsole: true;
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo o.throwFail = ('throwFail' in o) ? o.debug : true;
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo // add a reference to o for anything that needs it
7d1348cc07acb3ce7fc3ed0e8352e6e65f782a68Eric Ferraiuolo // before _setup is called.
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo // @todo expand the new module metadata
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * Finishes the instance setup. Attaches whatever modules were defined
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * when the yui modules was registered.
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @method _setup
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo _setup: function(o) {
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo // @TODO eval the need to copy the config
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * Executes a method on a YUI instance with
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * the specified id if the specified method is whitelisted.
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @method applyTo
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @param id {string} the YUI instance id
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @param method {string} the name of the method to exectute.
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * Ex: 'Object.keys'
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @param args {Array} the arguments to apply to the method
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @return {object} the return value from the applied method or null
99d4ac376f33d146e113dfd79e8bc62392116203Eric Ferraiuolo this.fail(method + ': applyTo not allowed');
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * Register a module
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @method add
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * @param name {string} module name
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * @param fn {Function} entry point into the module that
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * is used to bind module to the YUI instance
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * @param version {string} version string
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * @return {YUI} the YUI instance
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * requires - features that should be present before loading
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * optional - optional features that should be present if load optional defined
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * use - features that should be attached automatically
d9d247a8a6f960720e449399984fa3be10134d61Eric Ferraiuolo * skinnable -
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * omit - features that should not be loaded if this module is present
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo // @todo expand this to include version mapping
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo // @todo may want to restore the build property
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo // @todo fire moduleAvailable event
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo return this; // chain support
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo var d = m.details, req = d.requires, use = d.use;
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * Bind a module to a YUI instance
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo * @param modules* {string} 1-n modules to bind (uses arguments array)
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo * @param *callback {function} callback function executed when
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo * the instance has the required functionality. If included, it
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo * must be the last parameter.
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo * Implement versioning? loader can load different versions?
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * Should sub-modules/plugins be normal modules, or do
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * we add syntax for specifying these?
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * YUI().use('dragdrop')
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * YUI().use('dragdrop:2.4.0'); // specific version
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * YUI().use('dragdrop:2.4.0-'); // at least this version
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * YUI().use('dragdrop:2.4.0-2.9999.9999'); // version range
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo * YUI().use('*'); // use all available modules
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * YUI().use('lang+dump+substitute'); // use lang and some plugins
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo * YUI().use('lang+*'); // use lang and all known plugins
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo * @return {YUI} the YUI instance
ce4cefb48a881b28475d82002d20aca07191acd7Eric Ferraiuolo use: function() {
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo var Y = this,
16e78d3096c92e820034cebbda137cb7fa2c6ac4Eric Ferraiuolo // The last argument supplied to use can be a load complete callback
a.pop();
callback = null;
for (var k in mods) {
a.push(k);
if (Y.Loader) {
dynamic = true;
if (req) {
f(req);
f(req[j]);
success: true,
if (Y.fire) {
Y._attach(r);
onComplete();
namespace: function() {
var a=arguments, o=null, i, j, d;
log: function() {
var instance = this;
stamp: function(o) {
if (!uid) {
return uid;
Y._init();
bail = false;
if (src) {
bail = true;
bail = true;
if (!bail) {
console[f](m);
* Testing typeof/instanceof/constructor of arrays across frame
L.isArray = function(o) {
L.isBoolean = function(o) {
L.isFunction = function(o) {
L.isDate = function(o) {
L.isNull = function(o) {
L.isNumber = function(o) {
L.isString = function(o) {
L.isUndefined = function(o) {
L.trim = function(s){
L.isValue = function(o) {
Y.Array = function(o, i, al) {
return (i) ? o.slice(o, i) : o;
A.test = function(o) {
if (L.isObject(o, true)) {
if (L.isArray(o)) {
} catch(ex) {}
var l = a.length, i;
f.call(o || Y, a[i], i, a);
A.hash = function(k, v) {
if (a[i] === val) {
var L = Y.Lang,
Y.merge = function() {
var a=arguments, o={};
Y.mix(o, a[i], true);
* @param merge {boolean} merge objects instead of overwriting/ignoring
for (var i in fs) {
if (!w || iwl || (i in w)) {
} else if (arr) {
switch (mode) {
f(r, sp, true);
f(rp, s);
F.prototype = o;
var O = Y.Object, L = Y.Lang;
O.owns = function(o, p) {
O.keys = function(o) {
if (o.hasOwnProperty(i)) {
a.push(i);
f.call(s, o[i], i, o);
Y.UA = function() {
mobile: null
* YUI setTimeout/setInterval abstraction
var L = Y.Lang;
m = o[fn];
if (!L.isArray(d)) {
d = [data];
m.apply(o, d);
cancel: function() {
if (this.interval) {
clearInterval(r);
clearTimeout(r);
L=Y.Lang;
Y.Get = function() {
var queues={},
purging=false;
for (var i in attr) {
}, win);
}, win);
if (q.timer) {
if (q.onFailure) {
if (q.insertBefore) {
h = s.parentNode;
h.removeChild(n[i]);
q.nodes = [];
purge: function() {
if (q.timer) {
q.finished = true;
if (q.aborted) {
if (q.onSuccess) {
if (q.onTimeout) {
if (q.timer) {
if (q.aborted) {
if (loaded) {
if (q.varName) {
if (q.varName) {
if (!url) {
if (q.timeout) {
if (q.insertBefore) {
h.appendChild(n);
var _autoPurge = function() {
if (purging) {
purging = true;
for (var i in queues) {
var q = queues[i];
delete queues[i];
purging = false;
_autoPurge();
finished: false,
nodes: []
n.onreadystatechange = function() {
n.onreadystatechange = null;
n.onload = function() {
n.onerror = function(e) {
abort: function(o) {
q.aborted = true;
* ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
* "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"], {
* ["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
* "http://yui.yahooapis.com/2.3.1/build/logger/assets/skins/sam/logger.css"], {
* insertBefore: 'custom-styles' // nodes will be inserted before the specified node
* 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"
* 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>
// http://yui.yahooapis.com/combo?2.5.2/build/yahoo/yahoo-min.js&2.5.2/build/dom/dom-min.js&2.5.2/build/event/event-min.js&2.5.2/build/autocomplete/autocomplete-min.js"
CSS_AFTER = [CSSRESET, CSSFONTS, CSSGRIDS, 'cssreset-context', 'cssfonts-context', 'cssgrids-context'],
META = {
modules: {
dom: {
submodules: {
selector: {
node: {
submodules: {
anim: {
submodules: {
attribute: {
base: {
compat: {
cookie: { },
dd:{
submodules: {
dump: { },
event: {
get: {
io: {
json: {
submodules: {
loader: {
oop: {
queue: { },
substitute: {
yui: {
var _cssmeta = function() {
Y.Loader = function(o) {
this._internalCallback = null;
this._useYahooListener = false;
this.onSuccess = null;
this.onFailure = null;
this.onProgress = null;
this.onTimeout = null;
this.context = Y;
this.data = null;
this.insertBefore = null;
this.charset = null;
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
* @default http://yui.yahooapis.com/combo?
this.ignoreRegistered = false;
this.ignore = null;
this.force = null;
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.filter = null;
this.required = {};
this.moduleInfo = {};
for (var i in defaults) {
this._internal = true;
this._internal = false;
this.rollups = null;
this.loadOptional = false;
this.sorted = [];
this.loaded = {};
this.attaching = null;
this.dirty = true;
this.inserted = {};
this.skipped = {};
this._config(o);
FILTERS: {
RAW: {
DEBUG: {
_config: function(o) {
var val = o[i];
if (o.hasOwnProperty(i)) {
for (var j in val) {
this[i] = val;
var f = this.filter;
if (L.isString(f)) {
f = f.toUpperCase();
this.filterName = f;
* <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) {
for (var i in subs) {
var s = subs[i];
this.addModule(s, i);
this.dirty = true;
this.dirty = true;
if (!mod) {
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]);
if (m[ckey]) {
return m[ckey];
add(s[i]);
m[SUPER] = o;
return m[ckey];
calculate: function(o) {
if (o || this.dirty) {
this._config(o);
this._setup();
this._explode();
if (this.allowRollup) {
this._rollup();
this._reduce();
this._sort();
this.dirty = false;
_setup: function() {
if (!this.ignoreRegistered) {
if (this.ignore) {
if (l.hasOwnProperty(j)) {
if (this.force) {
if (this.force[i] in l) {
delete l[this.force[i]];
this.loaded = l;
_explode: function() {
if (r.hasOwnProperty(i)) {
if (req) {
_rollup: function() {
for (i in info) {
m = this.getModule(i);
if (m && m.rollup) {
rollups[i] = m;
var rolled = false;
for (i in rollups) {
if (!r[i] && !this.loaded[i]) {
if (!m.rollup) {
if (this.loaded[s[j]]) {
roll = false;
if (roll) {
if (roll) {
rolled = true;
this.getRequires(m);
if (!rolled) {
_reduce: function() {
var i, j, s, m, r=this.required;
if (i in this.loaded) {
m = this.getModule(i);
s = m && m.supersedes;
_attach: function() {
if (this.attaching) {
this._pushEvents();
_onSuccess: function() {
this._attach();
for (var i in this.skipped) {
delete this.inserted[i];
this.skipped = {};
var f = this.onSuccess;
success: true
this._attach();
var f = this.onFailure;
success: false
_onTimeout: function() {
this._attach();
var f = this.onTimeout;
success: false
_sort: function() {
me = this;
if (ss) {
if (requires(a, s[k])) {
moved = true;
if (moved) {
if (!moved) {
this.sorted = s;
this.calculate(o);
if (!type) {
var self = this;
this._internalCallback = function() {
this._loading = true;
this._combineComplete = false;
this.loadNext();
if (!this._loading) {
this._combining = [];
s=this.sorted;
m = this.getModule(s[i]);
var callback=function(o) {
this._combineComplete = true;
this.inserted[c[i]] = true;
this._combineComplete = true;
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];
onsuccess=function(o) {
self=this;
data: s[i],
this._loading = null;
if (this._internalCallback) {
var f = this._internalCallback;
this._internalCallback = null;
f.call(this);
this._onSuccess();
* In IE, the onAvailable/onDOMReady events need help when Event is
_pushEvents: function() {
if (Y.Event) {
f = this.filter;
var useFilter = true;
var self = this,
useFilter = false;
useFilter = false;
if (useFilter) {
var C = Y.config;
if (C.core) {