yui.js revision bc05981e4a74b0d3280120fc184dc8a2b6e5e9a1
2521N/Aare store in Y.config. See <a href="config.html">Config</a> for the list of supported
5403N/A handleLoad = function() {
2892N/A YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, [ 'loader-base', 'loader-rollup', 'loader-yui3' ]));
3998N/A if (s.hasOwnProperty(i)) {
2892N/A applyConfig: function(o) {
5403N/A this.applyConfig(o);
2521N/A core: ['get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3'],
5403N/A // 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
2521N/A // so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
2521N/A // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
2892N/A // "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js"
2521N/A useBrowserConsole: true,
2892N/A //extras = Y.config.core || ['get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3'];
2892N/A@param fn {Function} entry point into the module that is used to bind module to the YUI instance.
3998N/A@param details.requires {Array} features that must be present before this module can be attached.
if (use) {
use: function() {
name,
provisioned = true;
callback = null;
provisioned = false;
if (provisioned) {
if (Y._loading) {
* Notify handler from Loader for attachment/load errors
* @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`
} else if (callback) {
YArray = Y.Array,
missing = [],
ret = true,
if (aliases) {
names = a;
if (!skip) {
success: true,
ret = true,
Y._loading = false;
if (data) {
missing = [];
if (redo) {
redo = false;
Y._loading = false;
if (data) {
if (ret) {
if (ret) {
handleLoader();
if (len) {
Y._loading = true;
Y._loading = true;
handleBoot = function() {
Y._loading = false;
if (ret) {
handleLoader();
namespace: function() {
for (; i < a.length; i++) {
arg = a[i];
var Y = this, ret;
var uid;
if (!uid) {
if (!readOnly) {
uid = null;
return uid;
destroy: function() {
if (Y.Event) {
delete Y.Env;
delete Y.config;
if (hasWin) {
handleLoad();
* The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`
* 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"
* fullpath: 'http://myserver.mydomain.com/mymod1/mymod1.js'
* fullpath: 'http://myserver.mydomain.com/mymod2/mymod2.js'
* base: 'http://yui.yahooapis.com/2.8.0r4/build/',
* comboBase: 'http://yui.yahooapis.com/combo?',
* path: "yahoo-dom-event/yahoo-dom-event.js"
* path: "animation/animation.js",
* @default loader/loader-min.js
TYPES = {
SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
TRIMREGEX = /^\s+|\s+$/g,
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) {
return s.trimLeft();
return s.trimRight();
L.isValue = function(o) {
var t = L.type(o);
return isFinite(o);
L.type = function(o) {
L.sub = function(s, o) {
return new Date().getTime();
} catch (ex) {
result = [];
return result;
return [thing];
Y.Array = YArray;
var hash = {},
results = [],
return results;
if (i in array) {
var hash = {},
i, len;
if (i in keys) {
return hash;
} catch (ex) {}
return result;
function Queue() {
this._init();
_init: function() {
this._q = [];
next: function() {
last: function() {
add: function() {
size: function() {
return function (arg) {
String(arg);
Y.merge = function () {
result = {};
for (; i < len; ++i) {
return result;
return receiver || Y;
if (mode) {
return receiver;
if (whitelist) {
if (Y.Object._hasEnumBug) {
return receiver;
return function (obj) {
* - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
var keys = [],
if (hasEnumBug) {
return keys;
values = [];
for (; i < len; ++i) {
return values;
} catch (ex) {
var key;
var key;
return UNDEFINED;
p = Y.Array(path),
l = p.length;
p = Y.Array(path),
ref = o;
return UNDEFINED;
var numberify = function(s) {
mobile: null,
ios: null,
secure: false,
os: null,
if (ua) {
o.ios = m;
if (!subUA) {
"anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
"autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
"dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
"datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
"dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
"editor": ["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
"event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside"],
L = Y.Lang,
ALL = true,
ONLOAD_SUPPORTED = {
queues = {},
_clearTimeout = function(q) {
if (timer) {
q.timer = null;
d = w.document,
if (custAttrs) {
for (i in attr) {
purge: function() {
q.finished = true;
if (onEnd) {
_clearTimeout(q);
if (onFailure) {
_clearTimeout(q);
if (q.aborted) {
if (onSuccess) {
* @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned.
q.nodes = [];
if (onProgress) {
o = _returnData(q);
if (onTimeout) {
if (sync) {
_clearTimeout(q);
if (!q.finished) {
if (q.aborted) {
} else if (sync) {
n.onreadystatechange = function() {
n.onreadystatechange = null;
n.onload = function() {
n.onerror = function(e) {
if (insertBefore) {
if (sibling) {
node,
url;
}, timeout);
if (q.async) {
_autoPurge = function() {
if (purging) {
purging = true;
for (i in queues) {
q = queues[i];
delete queues[i];
purging = false;
_autoPurge();
q.finished = false;
q.nodes = [];
Y.Get = {
abort : function(o) {
q.aborted = true;
* <dd>callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same
* payload as onSuccess, with the addition of a <code>url</code> property, which identifies the file which was loaded. Currently only useful for non Webkit/Gecko browsers,
* into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible).
* This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.</dd>
* Y.Get.css("http://localhost/css/menu.css");
* ["http://localhost/css/menu.css",
var feature_tests = {};
* @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3
* @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance
result = [];
if (cat_o) {
if (!feature) {
if (ua) {
return result;
/* This file is auto-generated by src/loader/scripts/meta_join.py */
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
ret = true;
return ret;
ret = false;
test: function() {
test: function() {
return ret;
return ret;
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
var SPLIT_REGEX = /[, ]/;
return availableLanguages[i];
if (result) {
return result;
* console implementations. This module is a `core` YUI module, <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>.
var INSTANCE = Y,
Y = INSTANCE,
c = Y.config,
if (c.debug) {
if (src) {
if (!bail) {
if (c.useBrowserConsole) {
console[f](m);
* Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>.
var NO_ARGS = [];
var cancelled = false,
wrapper = function() {
if (!cancelled) {
cancel: function() {
cancelled = true;
if (this.interval) {
groups: {},
patterns: {} },
ext: false,
combine: true,
combine: true,
ext: false,
patterns: {
yui2Update();
var NOT_FOUND = {},
NO_REQUIREMENTS = [],
YObject = Y.Object,
YArray = Y.Array,
L = Y.Lang,
if (!nomin) {
return path;
* 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).
* 'replaceStr': "-debug.js"
* for a given component, this overrides the filter config. _Note:_ This does not work on combo urls, use the filter property instead.</li>
Y.Loader = function(o) {
self = this;
// self.jsAttributes = null;
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
* @default http://yui.yahooapis.com/combo?
* 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).
* 'replaceStr': "-debug.js"
if (cache) {
FILTER_DEFS: {
RAW: {
DEBUG: {
_inspectPage: function() {
if (v.details) {
var m = this.moduleInfo[k],
delete m.expanded;
m._inspected = true;
if (!m || !other) {
_config: function(o) {
if (o.hasOwnProperty(i)) {
val = o[i];
for (j in val) {
groupName = j;
if (L.isString(f)) {
f = f.toUpperCase();
if (mod) {
if (mod) {
nmod = {
return name;
self = this;
if (o.patterns) {
if (mods) {
}, self);
if (!o || !o.name) {
if (!o.type) {
if (!smod) {
if (subs) {
for (i in subs) {
s = subs[i];
if (s.supersedes) {
o.skinnable = true;
i, name);
i, name);
if (!smod) {
if (!smod) {
if (this.allowRollup) {
if (plugins) {
for (i in plugins) {
if (o.skinnable) {
if (o.condition) {
trigger = t[i];
if (o.supersedes) {
if (o.after) {
if (o.configFn) {
if (ret === false) {
this.dirty = true;
this._explodeRollups();
* Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
_explodeRollups: function() {
var self = this, m,
if (m && m.use) {
if (m && m.use) {
filterRequires: function(r) {
var c = [], i, mod, o, m;
if (m && m.use) {
c.push(r[i]);
if (!mod) {
return NO_REQUIREMENTS;
d, k, m1,
r, old_mod,
hash;
hash = {};
intl = true;
if (!hash[r[i]]) {
d.push(r[i]);
hash[r[i]] = true;
m = this.getModule(r[i]);
if (!hash[r[i]]) {
d.push(r[i]);
hash[r[i]] = true;
m = this.getModule(r[i]);
if (o && this.loadOptional) {
if (!hash[o[i]]) {
d.push(o[i]);
hash[o[i]] = true;
m = info[o[i]];
if (cond) {
//Set the module to not parsed since we have conditionals and this could change the dependency tree.
if (go) {
skinpar = n;
if (intl) {
if (packName) {
return NOT_FOUND;
if (m && !m.provides) {
s = m.supersedes;
o[name] = true;
m.provides = o;
return m.provides;
this._config(o);
if (!this._init) {
this._setup();
this._explode();
if (this.allowRollup) {
this._rollup();
this._explodeRollups();
this._reduce();
this._sort();
* @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
if (!existing) {
intl: true,
langPack: true,
if (lang) {
_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._init = true;
_explode: function() {
self = this;
if (expound) {
if (!mname) {
if (!p.test) {
found = p;
if (found) {
if (p.action) {
m.temp = true;
_rollup: function() { },
_reduce: function(r) {
r = r || this.required;
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
s = m && m.supersedes;
if (onEnd) {
this._continue();
_onSuccess: function() {
if (fn) {
_onProgress: function(e) {
var self = this;
_onFailure: function(o) {
success: false
_onTimeout: function() {
var f = this.onTimeout;
success: false
_sort: function() {
done = {},
l = s.length;
moved = false;
doneKey = a + s[k];
moved = true;
if (moved) {
if (!moved) {
this.sorted = s;
if (source) {
if (!skipcalc) {
this.calculate(o);
if (type) {
modules = {};
comp++;
comp++;
comp++;
var complete = function(d) {
actions++;
this._loading = true;
complete();
autopurge: false,
async: true,
onProgress: function(e) {
autopurge: false,
async: true,
onProgress: function(e) {
_continue: function() {
this._continue();
var f = this.filter,
hasFilter = true;
if (hasFilter) {
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
self = this,
if (calc) {
comboSources = {};
if (groupName) {
m.combine = false;
m.combine = true;
for (j in comboSources) {
url = j;
if (len) {
m = mods[i];
for (j in resCombos) {
base = j;
if (len) {
resCombos = null;
return resolved;
this.rollups = {};
for (i in info) {
m = this.getModule(i);
if (m && m.rollup) {
this.rollups[i] = m;
rolled = false;
for (i in this.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) {
/* This file is auto-generated by src/loader/scripts/meta_join.py */
ret = false;
test: function() {
test: function() {
return ret;
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
return ret;
ret = true;
return ret;