3
Copyright 2011 Yahoo! Inc. All rights reserved.
4
Licensed under the BSD License.
5
http://yuilibrary.com/license/
8
* The YUI module contains the components required for building the YUI seed
9
* file. This includes the script loading mechanism, a simple queue, and
10
* the core utilities for the library.
15
if (typeof YUI != 'undefined') {
20
The YUI global namespace object. If YUI is already defined, the
21
existing YUI object will not be overwritten so that defined
22
namespaces are preserved. It is the constructor for the object
23
the end user interacts with. As indicated below, each instance
24
has full custom event support, but only if the event system
25
is available. This is a self-instantiable factory function. You
26
can invoke it directly like this:
28
YUI().use('*', function(Y) {
32
But it also works like this:
40
@param o* {Object} 0..n optional configuration objects. these values
41
are store in Y.config. See <a href="config.html">Config</a> for the list of supported
46
var YUI = function() {
51
instanceOf = function(o, type) {
52
return (o && o.hasOwnProperty && (o instanceof type));
54
gconf = (typeof YUI_config !== 'undefined') && YUI_config;
56
if (!(instanceOf(Y, YUI))) {
59
// set up the core environment
63
YUI.GlobalConfig is a master configuration that might span
64
multiple contexts in a non-browser environment. It is applied
65
first to all instances in all contexts.
66
@property GlobalConfig
77
YUI().use('node', function(Y) {
78
//debug files used here
83
}).use('node', function(Y) {
88
if (YUI.GlobalConfig) {
89
Y.applyConfig(YUI.GlobalConfig);
93
YUI_config is a page-level config. It is applied to all
94
instances created on the page. This is applied after
95
YUI.GlobalConfig, and before the instance level configuration
103
//Single global var to include before YUI seed file
108
YUI().use('node', function(Y) {
109
//debug files used here
114
}).use('node', function(Y) {
115
//min files used here
119
Y.applyConfig(gconf);
122
// bind the specified additional modules for this instance
129
// Each instance can accept one or more configuration objects.
130
// These are applied after YUI.GlobalConfig and YUI_Config,
131
// overriding values set in those config files if there is a '
132
// matching property.
134
Y.applyConfig(args[i]);
140
Y.instanceOf = instanceOf;
150
BASE = 'http://yui.yahooapis.com/',
151
DOC_LABEL = 'yui3-js-enabled',
152
NOOP = function() {},
153
SLICE = Array.prototype.slice,
154
APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo
155
'io.xdrResponse': 1, // can call. this should
156
'SWF.eventHandler': 1 }, // be done at build time
157
hasWin = (typeof window != 'undefined'),
158
win = (hasWin) ? window : null,
159
doc = (hasWin) ? win.document : null,
160
docEl = doc && doc.documentElement,
161
docClass = docEl && docEl.className,
163
time = new Date().getTime(),
164
add = function(el, type, fn, capture) {
165
if (el && el.addEventListener) {
166
el.addEventListener(type, fn, capture);
167
} else if (el && el.attachEvent) {
168
el.attachEvent('on' + type, fn);
171
remove = function(el, type, fn, capture) {
172
if (el && el.removeEventListener) {
173
// this can throw an uncaught exception in FF
175
el.removeEventListener(type, fn, capture);
177
} else if (el && el.detachEvent) {
178
el.detachEvent('on' + type, fn);
181
handleLoad = function() {
182
YUI.Env.windowLoaded = true;
183
YUI.Env.DOMReady = true;
185
remove(window, 'load', handleLoad);
188
getLoader = function(Y, o) {
189
var loader = Y.Env._loader;
191
//loader._config(Y.config);
192
loader.ignoreRegistered = false;
195
loader.required = [];
196
loader.loadType = null;
198
loader = new Y.Loader(Y.config);
199
Y.Env._loader = loader;
201
YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, [ 'loader-base', 'loader-rollup', 'loader-yui3' ]));
206
clobber = function(r, s) {
208
if (s.hasOwnProperty(i)) {
214
ALREADY_DONE = { success: true };
216
// Stamp the documentElement (HTML) with a class of "yui-loaded" to
217
// enable styles that need to key off of JS being enabled.
218
if (docEl && docClass.indexOf(DOC_LABEL) == -1) {
222
docClass += DOC_LABEL;
223
docEl.className = docClass;
226
if (VERSION.indexOf('@') > -1) {
227
VERSION = '3.3.0'; // dev time hack for cdn test
232
* Applies a new configuration object to the YUI instance config.
233
* This will merge new group/module definitions, and will also
234
* update the loader cache if necessary. Updating Y.config directly
235
* will not update the cache.
236
* @method applyConfig
237
* @param {Object} o the configuration object.
240
applyConfig: function(o) {
247
config = this.config,
248
mods = config.modules,
249
groups = config.groups,
251
loader = this.Env._loader;
254
if (o.hasOwnProperty(name)) {
256
if (mods && name == 'modules') {
258
} else if (groups && name == 'groups') {
259
clobber(groups, attr);
260
} else if (rls && name == 'rls') {
262
} else if (name == 'win') {
263
config[name] = attr.contentWindow || attr;
264
config.doc = config[name].document;
265
} else if (name == '_yuid') {
278
* Old way to apply a config to the instance (calls `applyConfig` under the hood)
281
* @param {Object} o The config to apply
283
_config: function(o) {
288
* Initialize this YUI instance
300
* The version number of the YUI instance.
308
core: ['get','intl-base'],
309
mods: {}, // flat module map
310
versions: {}, // version module map
312
cdn: BASE + VERSION + '/build/',
313
// bootstrapped: false,
324
// I'll start at the \b(simpleyui).
325
// 1. Look in the test string for "simpleyui" or "yui" or
326
// "yui-base" or "yui-rls" or "yui-foobar" that comes after a word break. That is, it
327
// can't match "foyui" or "i_heart_simpleyui". This can be anywhere in the string.
328
// 2. After #1 must come a forward slash followed by the string matched in #1, so
329
// "yui-base/yui-base" or "simpleyui/simpleyui" or "yui-pants/yui-pants".
330
// 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
331
// so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
332
// 4. This is followed by ".js", so "yui/yui.js", "simpleyui/simpleyui-min.js"
333
// 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
334
// then capture the junk between the LAST "&" and the string in 1-4. So
335
// "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-rls/yui-rls.js"
336
// will capture "3.3.0/build/"
340
// (?:[^&]*&) followed by 0..n characters followed by an &
341
// * in fact, find as many sets of characters followed by a & as you can
342
// ([^&]*) capture the stuff after the last & in \1
343
// )? but it's ok if all this ?junk&more_junk stuff isn't even there
344
// \b(simpleyui| after a word break find either the string "simpleyui" or
345
// yui(?:-\w+)? the string "yui" optionally followed by a -, then more characters
346
// ) and store the simpleyui or yui-* string in \2
347
// \/\2 then comes a / followed by the simpleyui or yui-* string in \2
348
// (?:-(min|debug))? optionally followed by "-min" or "-debug"
349
// .js and ending in ".js"
350
_BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,
351
parseBasePath: function(src, pattern) {
352
var match = src.match(pattern),
356
path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));
358
// this is to set up the path to the loader. The file
359
// filter for loader should match the yui include.
362
// extract correct path for mixed combo urls
363
// http://yuilibrary.com/projects/yui3/ticket/2528423
365
path += '?' + match[1];
374
getBase: G_ENV && G_ENV.getBase ||
376
var nodes = (doc && doc.getElementsByTagName('script')) || [],
377
path = Env.cdn, parsed,
380
for (i = 0, len = nodes.length; i < len; ++i) {
383
parsed = Y.Env.parseBasePath(src, pattern);
385
filter = parsed.filter;
400
Env._loaded[VERSION] = {};
402
if (G_ENV && Y !== YUI) {
403
Env._yidx = ++G_ENV._yidx;
404
Env._guidp = ('yui_' + VERSION + '_' +
405
Env._yidx + '_' + time).replace(/\./g, '_');
406
} else if (YUI._YUI) {
408
G_ENV = YUI._YUI.Env;
409
Env._yidx += G_ENV._yidx;
410
Env._uidx += G_ENV._uidx;
412
for (prop in G_ENV) {
413
if (!(prop in Env)) {
414
Env[prop] = G_ENV[prop];
428
// configuration defaults
429
Y.config = Y.config || {
433
useBrowserConsole: true,
442
if (YUI.Env.rls_disabled) {
443
Y.config.use_rls = false;
446
Y.config.lang = Y.config.lang || 'en-US';
448
Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);
450
if (!filter || (!('mindebug').indexOf(filter))) {
453
filter = (filter) ? '-' + filter : filter;
454
Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';
459
* Finishes the instance setup. Attaches whatever modules were defined
460
* when the yui modules was registered.
464
_setup: function(o) {
468
//extras = Y.config.core || ['get','intl-base'];
469
extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..
471
for (i = 0; i < extras.length; i++) {
472
if (mods[extras[i]]) {
473
core.push(extras[i]);
477
Y._attach(['yui-base']);
487
* Executes a method on a YUI instance with
488
* the specified id if the specified method is whitelisted.
490
* @param id {String} the YUI instance id.
491
* @param method {String} the name of the method to exectute.
493
* @param args {Array} the arguments to apply to the method.
494
* @return {Object} the return value from the applied method or null.
496
applyTo: function(id, method, args) {
497
if (!(method in APPLY_TO_AUTH)) {
498
this.log(method + ': applyTo not allowed', 'warn', 'yui');
502
var instance = instances[id], nest, m, i;
504
nest = method.split('.');
506
for (i = 0; i < nest.length; i = i + 1) {
509
this.log('applyTo not found: ' + method, 'warn', 'yui');
512
return m.apply(instance, args);
519
Registers a module with the YUI global. The easiest way to create a
520
first-class YUI module is to use the YUI component build tool.
522
http://yuilibrary.com/projects/builder
524
The build system will produce the `YUI.add` wrapper for you module, along
525
with any configuration info required for the module.
527
@param name {String} module name.
528
@param fn {Function} entry point into the module that is used to bind module to the YUI instance.
529
@param {YUI} fn.Y The YUI instance this module is executed in.
530
@param {String} fn.name The name of the module
531
@param version {String} version string.
532
@param details {Object} optional config data:
533
@param details.requires {Array} features that must be present before this module can be attached.
534
@param details.optional {Array} optional features that should be present if loadOptional
535
is defined. Note: modules are not often loaded this way in YUI 3,
536
but this field is still useful to inform the user that certain
537
features in the component will require additional dependencies.
538
@param details.use {Array} features that are included within this module which need to
539
be attached automatically when this module is attached. This
540
supports the YUI 3 rollup system -- a module with submodules
541
defined will need to have the submodules listed in the 'use'
542
config. The YUI component build tool does this for you.
543
@return {YUI} the YUI instance.
546
YUI.add('davglass', function(Y, name) {
547
Y.davglass = function() {
548
alert('Dav was here!');
550
}, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });
553
add: function(name, fn, version, details) {
554
details = details || {};
563
i, versions = env.versions;
565
env.mods[name] = mod;
566
versions[version] = versions[version] || {};
567
versions[version][name] = mod;
569
for (i in instances) {
570
if (instances.hasOwnProperty(i)) {
571
loader = instances[i].Env._loader;
573
if (!loader.moduleInfo[name]) {
574
loader.addModule(details, name);
584
* Executes the function associated with each required
585
* module, binding the module to the YUI instance.
586
* @param {Array} r The array of modules to attach
587
* @param {Boolean} [moot=false] Don't throw a warning if the module is not attached
591
_attach: function(r, moot) {
592
var i, name, mod, details, req, use, after,
594
aliases = YUI.Env.aliases,
596
loader = Y.Env._loader,
597
done = Y.Env._attached,
598
len = r.length, loader,
601
//Check for conditional modules (in a second+ instance) and add their requirements
602
//TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass
603
for (i = 0; i < len; i++) {
607
if (loader && loader.conditions[name]) {
608
Y.Object.each(loader.conditions[name], function(def) {
609
var go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));
619
for (i = 0; i < len; i++) {
624
if (aliases && aliases[name]) {
625
Y._attach(aliases[name]);
629
if (loader && loader.moduleInfo[name]) {
630
mod = loader.moduleInfo[name];
635
//if (!loader || !loader.moduleInfo[name]) {
636
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
638
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
639
Y.Env._missed.push(name);
640
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
641
Y.message('NOT loaded: ' + name, 'warn', 'yui');
646
//Don't like this, but in case a mod was asked for once, then we fetch it
647
//We need to remove it from the missed list ^davglass
648
for (j = 0; j < Y.Env._missed.length; j++) {
649
if (Y.Env._missed[j] === name) {
650
Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
651
Y.Env._missed.splice(j, 1);
654
details = mod.details;
655
req = details.requires;
657
after = details.after;
660
for (j = 0; j < req.length; j++) {
662
if (!Y._attach(req)) {
671
for (j = 0; j < after.length; j++) {
672
if (!done[after[j]]) {
673
if (!Y._attach(after, true)) {
685
Y.error('Attach error: ' + name, e, name);
691
for (j = 0; j < use.length; j++) {
693
if (!Y._attach(use)) {
711
* Attaches one or more modules to the YUI instance. When this
712
* is executed, the requirements are analyzed, and one of
713
* several things can happen:
715
* * All requirements are available on the page -- The modules
716
* are attached to the instance. If supplied, the use callback
717
* is executed synchronously.
719
* * Modules are missing, the Get utility is not available OR
720
* the 'bootstrap' config is false -- A warning is issued about
721
* the missing modules and all available modules are attached.
723
* * Modules are missing, the Loader is not available but the Get
724
* utility is and boostrap is not false -- The loader is bootstrapped
725
* before doing the following....
727
* * Modules are missing and the Loader is available -- The loader
728
* expands the dependency tree and fetches missing modules. When
729
* the loader is finshed the callback supplied to use is executed
733
* @param modules* {String} 1-n modules to bind (uses arguments array).
734
* @param *callback {Function} callback function executed when
735
* the instance has the required functionality. If included, it
736
* must be the last parameter.
739
* // loads and attaches dd and its dependencies
740
* YUI().use('dd', function(Y) {});
742
* // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)
743
* YUI().use(['dd', 'node'], function(Y) {});
745
* // attaches all modules that are available on the page
746
* YUI().use('*', function(Y) {});
748
* // intrinsic YUI gallery support (since 3.1.0)
749
* YUI().use('gallery-yql', function(Y) {});
751
* // intrinsic YUI 2in3 support (since 3.1.0)
752
* YUI().use('yui2-datatable', function(Y) {});
754
* @return {YUI} the YUI instance.
757
var args = SLICE.call(arguments, 0),
758
callback = args[args.length - 1],
765
// The last argument supplied to use can be a load complete callback
766
if (Y.Lang.isFunction(callback)) {
771
if (Y.Lang.isArray(args[0])) {
775
if (Y.config.cacheUse) {
776
while ((name = args[i++])) {
777
if (!Env._attached[name]) {
786
Y._notify(callback, ALREADY_DONE, args);
792
Y._useQueue = Y._useQueue || new Y.Queue();
793
Y._useQueue.add([args, callback]);
795
Y._use(args, function(Y, response) {
796
Y._notify(callback, response, args);
803
* Notify handler from Loader for attachment/load errors
805
* @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`
806
* @param response {Object} The response returned from Loader
807
* @param args {Array} The aruments passed from Loader
810
_notify: function(callback, response, args) {
811
if (!response.success && this.config.loadErrorFn) {
812
this.config.loadErrorFn.call(this, this, callback, response, args);
813
} else if (callback) {
815
callback(this, response);
817
this.error('use callback error', e, args);
823
* This private method is called from the `use` method queue. To ensure that only one set of loading
824
* logic is performed at a time.
827
* @param args* {String} 1-n modules to bind (uses arguments array).
828
* @param *callback {Function} callback function executed when
829
* the instance has the required functionality. If included, it
830
* must be the last parameter.
832
_use: function(args, callback) {
835
this._attach(['yui-base']);
838
var len, loader, handleBoot, handleRLS,
844
queue = G_ENV._loaderQueue,
848
boot = config.bootstrap,
852
fetchCSS = config.fetchCSS,
853
process = function(names, skip) {
859
YArray.each(names, function(name) {
861
// add this module to full list of things to attach
866
// only attach a module once
871
var m = mods[name], req, use;
875
req = m.details.requires;
878
// CSS files don't register themselves, see if it has
880
if (!G_ENV._loaded[VERSION][name]) {
883
used[name] = true; // probably css
887
// make sure requirements are attached
888
if (req && req.length) {
892
// make sure we grab the submodule dependencies too
893
if (use && use.length) {
899
handleLoader = function(fromLoader) {
900
var response = fromLoader || {
906
data = response.data;
912
origMissing = missing;
916
redo = missing.length;
918
if (missing.sort().join() ==
919
origMissing.sort().join()) {
927
Y._use(args, function() {
928
if (Y._attach(data)) {
929
Y._notify(callback, response, data);
934
ret = Y._attach(data);
937
Y._notify(callback, response, args);
941
if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
942
Y._use.apply(Y, Y._useQueue.next());
948
// YUI().use('*'); // bind everything available
949
if (firstArg === '*') {
950
ret = Y._attach(Y.Object.keys(mods));
958
// use loader to expand dependencies and sort the
959
// requirements if it is available.
960
if (boot && Y.Loader && args.length) {
961
loader = getLoader(Y);
962
loader.require(args);
963
loader.ignoreRegistered = true;
964
loader.calculate(null, (fetchCSS) ? null : 'js');
965
args = loader.sorted;
968
// process each requirement and any additional requirements
969
// the module metadata specifies
972
len = missing.length;
975
missing = Y.Object.keys(YArray.hash(missing));
976
len = missing.length;
981
if (boot && len && Y.Loader) {
983
loader = getLoader(Y);
984
loader.onEnd = handleLoader;
987
loader.ignoreRegistered = false;
988
loader.require(args);
989
loader.insert(null, (fetchCSS) ? null : 'js');
990
// loader.partial(missing, (fetchCSS) ? null : 'js');
992
} else if (len && Y.config.use_rls && !YUI.Env.rls_enabled) {
994
G_ENV._rls_queue = G_ENV._rls_queue || new Y.Queue();
996
// server side loader service
997
handleRLS = function(instance, argz) {
999
var rls_end = function(o) {
1001
instance.rls_advance();
1003
rls_url = instance._rls(argz);
1006
instance.rls_oncomplete(function(o) {
1009
instance.Get.script(rls_url, {
1011
timeout: instance.config.rls_timeout,
1012
onFailure: instance.rls_handleFailure,
1013
onTimeout: instance.rls_handleTimeout
1023
G_ENV._rls_queue.add(function() {
1024
G_ENV._rls_in_progress = true;
1025
Y.rls_callback = callback;
1026
Y.rls_locals(Y, args, handleRLS);
1029
if (!G_ENV._rls_in_progress && G_ENV._rls_queue.size()) {
1030
G_ENV._rls_queue.next()();
1033
} else if (boot && len && Y.Get && !Env.bootstrapped) {
1037
handleBoot = function() {
1039
queue.running = false;
1040
Env.bootstrapped = true;
1041
G_ENV._bootstrapping = false;
1042
if (Y._attach(['loader'])) {
1043
Y._use(args, callback);
1047
if (G_ENV._bootstrapping) {
1048
queue.add(handleBoot);
1050
G_ENV._bootstrapping = true;
1051
Y.Get.script(config.base + config.loaderPath, {
1057
ret = Y._attach(args);
1068
Adds a namespace object onto the YUI global if called statically.
1070
// creates YUI.your.namespace.here as nested objects
1071
YUI.namespace("your.namespace.here");
1073
If called as a method on a YUI <em>instance</em>, it creates the
1074
namespace on the instance.
1076
// creates Y.property.package
1077
Y.namespace("property.package");
1079
Dots in the input string cause `namespace` to create nested objects for
1080
each token. If any part of the requested namespace already exists, the
1081
current object will be left in place. This allows multiple calls to
1082
`namespace` to preserve existing namespaced properties.
1084
If the first token in the namespace string is "YAHOO", the token is
1087
Be careful with namespace tokens. Reserved words may work in some browsers
1088
and not others. For instance, the following will fail in some browsers
1089
because the supported version of JavaScript reserves the word "long":
1091
Y.namespace("really.long.nested.namespace");
1094
@param {String} namespace* namespaces to create.
1095
@return {Object} A reference to the last namespace object created.
1097
namespace: function() {
1098
var a = arguments, o = this, i = 0, j, d, arg;
1099
for (; i < a.length; i++) {
1100
// d = ('' + a[i]).split('.');
1102
if (arg.indexOf(PERIOD)) {
1103
d = arg.split(PERIOD);
1104
for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
1105
o[d[j]] = o[d[j]] || {};
1109
o[arg] = o[arg] || {};
1115
// this is replaced if the log module is included
1118
// this is replaced if the dump module is included
1119
dump: function (o) { return ''+o; },
1122
* Report an error. The reporting mechanism is controled by
1123
* the `throwFail` configuration attribute. If throwFail is
1124
* not specified, the message is written to the Logger, otherwise
1125
* a JS error is thrown
1127
* @param msg {String} the error message.
1128
* @param e {Error|String} Optional JS error that was caught, or an error string.
1129
* @param data Optional additional info
1130
* and `throwFail` is specified, this error will be re-thrown.
1131
* @return {YUI} this YUI instance.
1133
error: function(msg, e, data) {
1137
if (Y.config.errorFn) {
1138
ret = Y.config.errorFn.apply(Y, arguments);
1141
if (Y.config.throwFail && !ret) {
1142
throw (e || new Error(msg));
1144
Y.message(msg, 'error'); // don't scrub this one
1151
* Generate an id that is unique among all YUI instances
1153
* @param pre {String} optional guid prefix.
1154
* @return {String} the guid.
1156
guid: function(pre) {
1157
var id = this.Env._guidp + '_' + (++this.Env._uidx);
1158
return (pre) ? (pre + id) : id;
1162
* Returns a `guid` associated with an object. If the object
1163
* does not have one, a new one is created unless `readOnly`
1166
* @param o {Object} The object to stamp.
1167
* @param readOnly {Boolean} if `true`, a valid guid will only
1168
* be returned if the object has one assigned to it.
1169
* @return {String} The object's guid or null.
1171
stamp: function(o, readOnly) {
1177
// IE generates its own unique ID for dom nodes
1178
// The uniqueID property of a document node returns a new ID
1179
if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
1182
uid = (typeof o === 'string') ? o : o._yuid;
1199
* Destroys the YUI instance
1203
destroy: function() {
1208
delete instances[Y.id];
1214
* instanceof check for objects that works around
1215
* memory leak in IE when the item tested is
1217
* @method instanceOf
1224
YUI.prototype = proto;
1226
// inheritance utilities are not available yet
1227
for (prop in proto) {
1228
if (proto.hasOwnProperty(prop)) {
1229
YUI[prop] = proto[prop];
1233
// set up the environment
1237
// add a window load event at load time so we can capture
1238
// the case where it fires before dynamic loading is
1240
add(window, 'load', handleLoad);
1246
YUI.Env.remove = remove;
1249
// Support the CommonJS method for exporting our single global
1250
if (typeof exports == 'object') {
1258
* The config object contains all of the configuration options for
1259
* the `YUI` instance. This object is supplied by the implementer
1260
* when instantiating a `YUI` instance. Some properties have default
1261
* values if they are not supplied by the implementer. This should
1262
* not be updated directly because some values are cached. Use
1263
* `applyConfig()` to update the config object on a YUI instance that
1264
* has already been configured.
1271
* Allows the YUI seed file to fetch the loader component and library
1272
* metadata to dynamically load additional dependencies.
1274
* @property bootstrap
1280
* Log to the browser console if debug is on and the browser has a
1281
* supported console.
1283
* @property useBrowserConsole
1289
* A hash of log sources that should be logged. If specified, only
1290
* log messages from these sources will be logged.
1292
* @property logInclude
1297
* A hash of log sources that should be not be logged. If specified,
1298
* all sources are logged if not on this list.
1300
* @property logExclude
1305
* Set to true if the yui seed file was dynamically loaded in
1306
* order to bootstrap components relying on the window load event
1307
* and the `domready` custom event.
1309
* @property injected
1315
* If `throwFail` is set, `Y.error` will generate or re-throw a JS Error.
1316
* Otherwise the failure is logged.
1318
* @property throwFail
1324
* The window/frame that this instance should operate in.
1328
* @default the window hosting YUI
1332
* The document associated with the 'win' configuration.
1336
* @default the document hosting YUI
1340
* A list of modules that defines the YUI core (overrides the default).
1347
* A list of languages in order of preference. This list is matched against
1348
* the list of available languages in modules that the YUI instance uses to
1349
* determine the best possible localization of language sensitive modules.
1350
* Languages are represented using BCP 47 language tags, such as "en-GB" for
1351
* English as used in the United Kingdom, or "zh-Hans-CN" for simplified
1352
* Chinese as used in China. The list can be provided as a comma-separated
1353
* list or as an array.
1356
* @type string|string[]
1360
* The default date format
1361
* @property dateFormat
1363
* @deprecated use configuration in `DataType.Date.format()` instead.
1367
* The default locale
1370
* @deprecated use `config.lang` instead.
1374
* The default interval when polling in milliseconds.
1375
* @property pollInterval
1381
* The number of dynamic nodes to insert by default before
1382
* automatically removing them. This applies to script nodes
1383
* because removing the node will not make the evaluated script
1384
* unavailable. Dynamic CSS is not auto purged, because removing
1385
* a linked style sheet will also remove the style definitions.
1386
* @property purgethreshold
1392
* The default interval when polling in milliseconds.
1393
* @property windowResizeDelay
1399
* Base directory for dynamic loading
1405
* The secure base dir (not implemented)
1406
* For dynamic loading.
1407
* @property secureBase
1412
* The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`
1413
* For dynamic loading.
1414
* @property comboBase
1419
* The root path to prepend to module path for the combo service.
1420
* Ex: 3.0.0b1/build/
1421
* For dynamic loading.
1427
* A filter to apply to result urls. This filter will modify the default
1428
* path for all modules. The default path for the YUI library is the
1429
* minified version of the files (e.g., event-min.js). The filter property
1430
* can be a predefined filter or a custom filter. The valid predefined
1434
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
1435
* This option will automatically include the Logger widget</dd>
1437
* <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
1439
* You can also define a custom filter, which must be an object literal
1440
* containing a search expression and a replace string:
1443
* 'searchExp': "-min\\.js",
1444
* 'replaceStr': "-debug.js"
1447
* For dynamic loading.
1450
* @type string|object
1454
* The `skin` config let's you configure application level skin
1455
* customizations. It contains the following attributes which
1456
* can be specified to override the defaults:
1458
* // The default skin, which is automatically applied if not
1459
* // overriden by a component-specific skin definition.
1460
* // Change this in to apply a different skin globally
1461
* defaultSkin: 'sam',
1463
* // This is combined with the loader base property to get
1464
* // the default root directory for a skin.
1465
* base: 'assets/skins/',
1467
* // Any component-specific overrides can be specified here,
1468
* // making it possible to load different skins for different
1469
* // components. It is possible to load more than one skin
1470
* // for a given component as well.
1472
* slider: ['capsule', 'round']
1475
* For dynamic loading.
1481
* Hash of per-component filter specification. If specified for a given
1482
* component, this overrides the filter config.
1484
* For dynamic loading.
1490
* Use the YUI combo service to reduce the number of http connections
1491
* required to load your dependencies. Turning this off will
1492
* disable combo handling for YUI and all module groups configured
1493
* with a combo service.
1495
* For dynamic loading.
1499
* @default true if 'base' is not supplied, false if it is.
1503
* A list of modules that should never be dynamically loaded
1510
* A list of modules that should always be loaded when required, even if already
1511
* present on the page.
1518
* Node or id for a node that should be used as the insertion point for new
1519
* nodes. For dynamic loading.
1521
* @property insertBefore
1526
* Object literal containing attributes to add to dynamically loaded script
1528
* @property jsAttributes
1533
* Object literal containing attributes to add to dynamically loaded link
1535
* @property cssAttributes
1540
* Number of milliseconds before a timeout occurs when dynamically
1541
* loading nodes. If not set, there is no timeout.
1547
* Callback for the 'CSSComplete' event. When dynamically loading YUI
1548
* components with CSS, this property fires when the CSS is finished
1549
* loading but script loading is still ongoing. This provides an
1550
* opportunity to enhance the presentation of a loading page a little
1551
* bit before the entire loading process is done.
1558
* A hash of module definitions to add to the list of YUI components.
1559
* These components can then be dynamically loaded side by side with
1560
* YUI via the `use()` method. This is a hash, the key is the module
1561
* name, and the value is an object literal specifying the metdata
1562
* for the module. See `Loader.addModule` for the supported module
1563
* metadata fields. Also see groups, which provides a way to
1564
* configure the base and combo spec for a set of modules.
1568
* requires: ['node'],
1569
* fullpath: 'http://myserver.mydomain.com/mymod1/mymod1.js'
1572
* requires: ['mymod1'],
1573
* fullpath: 'http://myserver.mydomain.com/mymod2/mymod2.js'
1582
* A hash of module group definitions. It for each group you
1583
* can specify a list of modules and the base path and
1584
* combo spec to use when dynamically loading the modules.
1588
* // specify whether or not this group has a combo service
1591
* // the base path for non-combo paths
1592
* base: 'http://yui.yahooapis.com/2.8.0r4/build/',
1594
* // the path to the combo service
1595
* comboBase: 'http://yui.yahooapis.com/combo?',
1597
* // a fragment to prepend to the path attribute when
1598
* // when building combo urls
1599
* root: '2.8.0r4/build/',
1601
* // the module definitions
1604
* path: "yahoo-dom-event/yahoo-dom-event.js"
1607
* path: "animation/animation.js",
1608
* requires: ['yui2_yde']
1619
* The loader 'path' attribute to the loader itself. This is combined
1620
* with the 'base' attribute to dynamically load the loader component
1621
* when boostrapping with the get utility alone.
1623
* @property loaderPath
1625
* @default loader/loader-min.js
1629
* Specifies whether or not YUI().use(...) will attempt to load CSS
1630
* resources at all. Any truthy value will cause CSS dependencies
1631
* to load when fetching script. The special value 'force' will
1632
* cause CSS dependencies to be loaded even if no script is needed.
1634
* @property fetchCSS
1635
* @type boolean|string
1640
* The default gallery version to build gallery module urls
1647
* The default YUI 2 version to build yui2 module urls. This is for
1648
* intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'
1649
* config for pulling different revisions of the wrapped YUI 2
1658
* The 2in3 project is a deployment of the various versions of YUI 2
1659
* deployed as first-class YUI 3 modules. Eventually, the wrapper
1660
* for the modules will change (but the underlying YUI 2 code will
1661
* be the same), and you can select a particular version of
1662
* the wrapper modules via this config.
1670
* Alternative console log function for use in environments without
1671
* a supported native console. The function is executed in the
1672
* YUI instance context.
1679
* A callback to execute when Y.error is called. It receives the
1680
* error message and an javascript error object if Y.error was
1681
* executed because a javascript error was caught. The function
1682
* is executed in the YUI instance context.
1690
* A callback to execute when the loader fails to load one or
1691
* more resource. This could be because of a script load
1692
* failure. It can also fail if a javascript module fails
1693
* to register itself, but only when the 'requireRegistration'
1694
* is true. If this function is defined, the use() callback will
1695
* only be called when the loader succeeds, otherwise it always
1696
* executes unless there was a javascript error when attaching
1700
* @property loadErrorFn
1705
* When set to true, the YUI loader will expect that all modules
1706
* it is responsible for loading will be first-class YUI modules
1707
* that register themselves with the YUI global. If this is
1708
* set to true, loader will fail if the module registration fails
1709
* to happen after the script is loaded.
1712
* @property requireRegistration
1718
* Cache serviced use() requests.
1720
* @property cacheUse
1723
* @deprecated no longer used
1727
* The parameter defaults for the remote loader service. **Requires the rls seed file.** The properties that are supported:
1729
* * `m`: comma separated list of module requirements. This
1730
* must be the param name even for custom implemetations.
1731
* * `v`: the version of YUI to load. Defaults to the version
1732
* of YUI that is being used.
1733
* * `gv`: the version of the gallery to load (see the gallery config)
1734
* * `env`: comma separated list of modules already on the page.
1735
* this must be the param name even for custom implemetations.
1736
* * `lang`: the languages supported on the page (see the lang config)
1737
* * `'2in3v'`: the version of the 2in3 wrapper to use (see the 2in3 config).
1738
* * `'2v'`: the version of yui2 to use in the yui 2in3 wrappers
1739
* * `filt`: a filter def to apply to the urls (see the filter config).
1740
* * `filts`: a list of custom filters to apply per module
1741
* * `tests`: this is a map of conditional module test function id keys
1742
* with the values of 1 if the test passes, 0 if not. This must be
1743
* the name of the querystring param in custom templates.
1751
* The base path to the remote loader service. **Requires the rls seed file.**
1754
* @property rls_base
1759
* The template to use for building the querystring portion
1760
* of the remote loader service url. The default is determined
1761
* by the rls config -- each property that has a value will be
1762
* represented. **Requires the rls seed file.**
1765
* @property rls_tmpl
1768
* m={m}&v={v}&env={env}&lang={lang}&filt={filt}&tests={tests}
1773
* Configure the instance to use a remote loader service instead of
1774
* the client loader. **Requires the rls seed file.**
1780
YUI.add('yui-base', function(Y) {
1785
* @submodule yui-base
1788
* The YUI module contains the components required for building the YUI
1789
* seed file. This includes the script loading mechanism, a simple queue,
1790
* and the core utilities for the library.
1792
* @submodule yui-base
1796
* Provides core language utilites and extensions used throughout YUI.
1802
var L = Y.Lang || (Y.Lang = {}),
1804
STRING_PROTO = String.prototype,
1805
TOSTRING = Object.prototype.toString,
1808
'undefined' : 'undefined',
1809
'number' : 'number',
1810
'boolean' : 'boolean',
1811
'string' : 'string',
1812
'[object Function]': 'function',
1813
'[object RegExp]' : 'regexp',
1814
'[object Array]' : 'array',
1815
'[object Date]' : 'date',
1816
'[object Error]' : 'error'
1819
SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
1820
TRIMREGEX = /^\s+|\s+$/g,
1822
// If either MooTools or Prototype is on the page, then there's a chance that we
1823
// can't trust "native" language features to actually be native. When this is
1824
// the case, we take the safe route and fall back to our own non-native
1827
unsafeNatives = win && !!(win.MooTools || win.Prototype);
1830
* Determines whether or not the provided item is an array.
1832
* Returns `false` for array-like collections such as the function `arguments`
1833
* collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
1834
* test for an array-like collection.
1837
* @param o The object to test.
1838
* @return {boolean} true if o is an array.
1841
L.isArray = (!unsafeNatives && Array.isArray) || function (o) {
1842
return L.type(o) === 'array';
1846
* Determines whether or not the provided item is a boolean.
1849
* @param o The object to test.
1850
* @return {boolean} true if o is a boolean.
1852
L.isBoolean = function(o) {
1853
return typeof o === 'boolean';
1858
* Determines whether or not the provided item is a function.
1859
* Note: Internet Explorer thinks certain functions are objects:
1863
* var obj = document.createElement("object");
1864
* Y.Lang.isFunction(obj.getAttribute) // reports false in IE
1866
* var input = document.createElement("input"); // append to body
1867
* Y.Lang.isFunction(input.focus) // reports false in IE
1871
* You will have to implement additional tests if these functions
1875
* @method isFunction
1877
* @param o The object to test.
1878
* @return {boolean} true if o is a function.
1880
L.isFunction = function(o) {
1881
return L.type(o) === 'function';
1885
* Determines whether or not the supplied item is a date instance.
1888
* @param o The object to test.
1889
* @return {boolean} true if o is a date.
1891
L.isDate = function(o) {
1892
return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
1896
* Determines whether or not the provided item is null.
1899
* @param o The object to test.
1900
* @return {boolean} true if o is null.
1902
L.isNull = function(o) {
1907
* Determines whether or not the provided item is a legal number.
1910
* @param o The object to test.
1911
* @return {boolean} true if o is a number.
1913
L.isNumber = function(o) {
1914
return typeof o === 'number' && isFinite(o);
1918
* Determines whether or not the provided item is of type object
1919
* or function. Note that arrays are also objects, so
1920
* <code>Y.Lang.isObject([]) === true</code>.
1923
* @param o The object to test.
1924
* @param failfn {boolean} fail if the input is a function.
1925
* @return {boolean} true if o is an object.
1926
* @see isPlainObject
1928
L.isObject = function(o, failfn) {
1930
return (o && (t === 'object' ||
1931
(!failfn && (t === 'function' || L.isFunction(o))))) || false;
1935
* Determines whether or not the provided item is a string.
1938
* @param o The object to test.
1939
* @return {boolean} true if o is a string.
1941
L.isString = function(o) {
1942
return typeof o === 'string';
1946
* Determines whether or not the provided item is undefined.
1947
* @method isUndefined
1949
* @param o The object to test.
1950
* @return {boolean} true if o is undefined.
1952
L.isUndefined = function(o) {
1953
return typeof o === 'undefined';
1957
* Returns a string without any leading or trailing whitespace. If
1958
* the input is not a string, the input will be returned untouched.
1961
* @param s {string} the string to trim.
1962
* @return {string} the trimmed string.
1964
L.trim = STRING_PROTO.trim ? function(s) {
1965
return s && s.trim ? s.trim() : s;
1968
return s.replace(TRIMREGEX, '');
1975
* Returns a string without any leading whitespace.
1978
* @param s {string} the string to trim.
1979
* @return {string} the trimmed string.
1981
L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
1982
return s.trimLeft();
1984
return s.replace(/^\s+/, '');
1988
* Returns a string without any trailing whitespace.
1991
* @param s {string} the string to trim.
1992
* @return {string} the trimmed string.
1994
L.trimRight = STRING_PROTO.trimRight ? function (s) {
1995
return s.trimRight();
1997
return s.replace(/\s+$/, '');
2001
* A convenience method for detecting a legitimate non-null value.
2002
* Returns false for null/undefined/NaN, true for other values,
2003
* including 0/false/''
2006
* @param o The item to test.
2007
* @return {boolean} true if it is not null/undefined/NaN || false.
2009
L.isValue = function(o) {
2016
case 'null': // fallthru
2027
* Returns a string representing the type of the item passed in.
2036
* <code>typeof HTMLElementCollection</code> returns function in Safari, but
2037
* <code>Y.type()</code> reports object, which could be a good thing --
2038
* but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.
2043
* @param o the item to test.
2044
* @return {string} the detected type.
2047
L.type = function(o) {
2048
return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
2052
* Lightweight version of <code>Y.substitute</code>. Uses the same template
2053
* structure as <code>Y.substitute</code>, but doesn't support recursion,
2054
* auto-object coersion, or formats.
2056
* @param {string} s String to be modified.
2057
* @param {object} o Object containing replacement values.
2058
* @return {string} the substitute result.
2062
L.sub = function(s, o) {
2063
return s.replace ? s.replace(SUBREGEX, function (match, key) {
2064
return L.isUndefined(o[key]) ? match : o[key];
2069
* Returns the current time in milliseconds.
2072
* @return {Number} Current time in milliseconds.
2076
L.now = Date.now || function () {
2077
return new Date().getTime();
2085
Native = Array.prototype,
2087
hasOwn = Object.prototype.hasOwnProperty;
2090
Provides utility methods for working with arrays. Additional array helpers can
2091
be found in the `collection` and `array-extras` modules.
2093
`Y.Array(thing)` returns a native array created from _thing_. Depending on
2094
_thing_'s type, one of the following will happen:
2096
* Arrays are returned unmodified unless a non-zero _startIndex_ is
2098
* Array-like collections (see `Array.test()`) are converted to arrays.
2099
* For everything else, a new array is created with _thing_ as the sole
2102
Note: elements that are also collections, such as `<form>` and `<select>`
2103
elements, are not automatically converted to arrays. To force a conversion,
2104
pass `true` as the value of the _force_ parameter.
2108
@param {Any} thing The thing to arrayify.
2109
@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like
2110
collection, a subset of items starting at the specified index will be
2112
@param {Boolean} [force=false] If `true`, _thing_ will be treated as an
2113
array-like collection no matter what.
2114
@return {Array} A native array created from _thing_, according to the rules
2117
function YArray(thing, startIndex, force) {
2120
startIndex || (startIndex = 0);
2122
if (force || YArray.test(thing)) {
2123
// IE throws when trying to slice HTMLElement collections.
2125
return Native.slice.call(thing, startIndex);
2129
for (len = thing.length; startIndex < len; ++startIndex) {
2130
result.push(thing[startIndex]);
2143
Dedupes an array of strings, returning an array that's guaranteed to contain
2144
only one copy of a given string.
2146
This method differs from `Array.unique()` in that it's optimized for use only
2147
with strings, whereas `unique` may be used with other types (but is slower).
2148
Using `dedupe()` with non-string values may result in unexpected behavior.
2151
@param {String[]} array Array of strings to dedupe.
2152
@return {Array} Deduped copy of _array_.
2156
YArray.dedupe = function (array) {
2161
for (i = 0, len = array.length; i < len; ++i) {
2164
if (!hasOwn.call(hash, item)) {
2174
Executes the supplied function on each item in the array. This method wraps
2175
the native ES5 `Array.forEach()` method if available.
2178
@param {Array} array Array to iterate.
2179
@param {Function} fn Function to execute on each item in the array. The function
2180
will receive the following arguments:
2181
@param {Any} fn.item Current array item.
2182
@param {Number} fn.index Current array index.
2183
@param {Array} fn.array Array being iterated.
2184
@param {Object} [thisObj] `this` object to use when calling _fn_.
2185
@return {YUI} The YUI instance.
2188
YArray.each = YArray.forEach = Native.forEach ? function (array, fn, thisObj) {
2189
Native.forEach.call(array || [], fn, thisObj || Y);
2191
} : function (array, fn, thisObj) {
2192
for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
2194
fn.call(thisObj || Y, array[i], i, array);
2209
Returns an object using the first array as keys and the second as values. If
2210
the second array is not provided, or if it doesn't contain the same number of
2211
values as the first array, then `true` will be used in place of the missing
2216
Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
2217
// => {a: 'foo', b: 'bar', c: true}
2220
@param {String[]} keys Array of strings to use as keys.
2221
@param {Array} [values] Array to use as values.
2222
@return {Object} Hash using the first array as keys and the second as values.
2225
YArray.hash = function (keys, values) {
2227
vlen = (values && values.length) || 0,
2230
for (i = 0, len = keys.length; i < len; ++i) {
2232
hash[keys[i]] = vlen > i && i in values ? values[i] : true;
2240
Returns the index of the first item in the array that's equal (using a strict
2241
equality check) to the specified _value_, or `-1` if the value isn't found.
2243
This method wraps the native ES5 `Array.indexOf()` method if available.
2246
@param {Array} array Array to search.
2247
@param {Any} value Value to search for.
2248
@return {Number} Index of the item strictly equal to _value_, or `-1` if not
2252
YArray.indexOf = Native.indexOf ? function (array, value) {
2253
// TODO: support fromIndex
2254
return Native.indexOf.call(array, value);
2255
} : function (array, value) {
2256
for (var i = 0, len = array.length; i < len; ++i) {
2257
if (i in array && array[i] === value) {
2266
Numeric sort convenience function.
2268
The native `Array.prototype.sort()` function converts values to strings and
2269
sorts them in lexicographic order, which is unsuitable for sorting numeric
2270
values. Provide `Array.numericSort` as a custom sort function when you want
2271
to sort values in numeric order.
2275
[42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
2276
// => [4, 8, 15, 16, 23, 42]
2279
@param {Number} a First value to compare.
2280
@param {Number} b Second value to compare.
2281
@return {Number} Difference between _a_ and _b_.
2284
YArray.numericSort = function (a, b) {
2289
Executes the supplied function on each item in the array. Returning a truthy
2290
value from the function will stop the processing of remaining items.
2293
@param {Array} array Array to iterate over.
2294
@param {Function} fn Function to execute on each item. The function will receive
2295
the following arguments:
2296
@param {Any} fn.value Current array item.
2297
@param {Number} fn.index Current array index.
2298
@param {Array} fn.array Array being iterated over.
2299
@param {Object} [thisObj] `this` object to use when calling _fn_.
2300
@return {Boolean} `true` if the function returns a truthy value on any of the
2301
items in the array; `false` otherwise.
2304
YArray.some = Native.some ? function (array, fn, thisObj) {
2305
return Native.some.call(array, fn, thisObj);
2306
} : function (array, fn, thisObj) {
2307
for (var i = 0, len = array.length; i < len; ++i) {
2308
if (i in array && fn.call(thisObj, array[i], i, array)) {
2317
Evaluates _obj_ to determine if it's an array, an array-like collection, or
2318
something else. This is useful when working with the function `arguments`
2319
collection and `HTMLElement` collections.
2321
Note: This implementation doesn't consider elements that are also
2322
collections, such as `<form>` and `<select>`, to be array-like.
2325
@param {Object} obj Object to test.
2326
@return {Number} A number indicating the results of the test:
2328
* 0: Neither an array nor an array-like collection.
2330
* 2: Array-like collection.
2334
YArray.test = function (obj) {
2337
if (Lang.isArray(obj)) {
2339
} else if (Lang.isObject(obj)) {
2341
// indexed, but no tagName (element) or alert (window),
2342
// or functions without apply/call (Safari
2343
// HTMLElementCollection bug).
2344
if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {
2353
* The YUI module contains the components required for building the YUI
2354
* seed file. This includes the script loading mechanism, a simple queue,
2355
* and the core utilities for the library.
2357
* @submodule yui-base
2361
* A simple FIFO queue. Items are added to the Queue with add(1..n items) and
2362
* removed using next().
2366
* @param {MIXED} item* 0..n items to seed the queue.
2370
this.add.apply(this, arguments);
2375
* Initialize the queue
2382
* The collection of enqueued items
2392
* Get the next item in the queue. FIFO support
2395
* @return {MIXED} the next item in the queue.
2398
return this._q.shift();
2402
* Get the last in the queue. LIFO support.
2405
* @return {MIXED} the last item in the queue.
2408
return this._q.pop();
2412
* Add 0..n items to the end of the queue.
2415
* @param {MIXED} item* 0..n items.
2416
* @return {object} this queue.
2419
this._q.push.apply(this._q, arguments);
2425
* Returns the current number of queued items.
2428
* @return {Number} The size.
2431
return this._q.length;
2437
YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();
2440
The YUI module contains the components required for building the YUI seed file.
2441
This includes the script loading mechanism, a simple queue, and the core
2442
utilities for the library.
2448
var CACHED_DELIMITER = '__',
2450
hasOwn = Object.prototype.hasOwnProperty,
2451
isObject = Y.Lang.isObject;
2454
Returns a wrapper for a function which caches the return value of that function,
2455
keyed off of the combined string representation of the argument values provided
2456
when the wrapper is called.
2458
Calling this function again with the same arguments will return the cached value
2459
rather than executing the wrapped function.
2461
Note that since the cache is keyed off of the string representation of arguments
2462
passed to the wrapper function, arguments that aren't strings and don't provide
2463
a meaningful `toString()` method may result in unexpected caching behavior. For
2464
example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
2465
string `[object Object]` when used as a cache key.
2468
@param {Function} source The function to memoize.
2469
@param {Object} [cache={}] Object in which to store cached values. You may seed
2470
this object with pre-existing cached values if desired.
2471
@param {any} [refetch] If supplied, this value is compared with the cached value
2472
using a `==` comparison. If the values are equal, the wrapped function is
2473
executed again even though a cached value exists.
2474
@return {Function} Wrapped function.
2477
Y.cached = function (source, cache, refetch) {
2478
cache || (cache = {});
2480
return function (arg) {
2481
var key = arguments.length > 1 ?
2482
Array.prototype.join.call(arguments, CACHED_DELIMITER) :
2485
if (!(key in cache) || (refetch && cache[key] == refetch)) {
2486
cache[key] = source.apply(source, arguments);
2494
Returns a new object containing all of the properties of all the supplied
2495
objects. The properties from later objects will overwrite those in earlier
2498
Passing in a single object will create a shallow copy of it. For a deep copy,
2502
@param {Object} objects* One or more objects to merge.
2503
@return {Object} A new merged object.
2505
Y.merge = function () {
2506
var args = arguments,
2511
for (; i < len; ++i) {
2512
Y.mix(result, args[i], true);
2519
Mixes _supplier_'s properties into _receiver_.
2521
Properties on _receiver_ or _receiver_'s prototype will not be overwritten or
2522
shadowed unless the _overwrite_ parameter is `true`, and will not be merged
2523
unless the _merge_ parameter is `true`.
2525
In the default mode (0), only properties the supplier owns are copied (prototype
2526
properties are not copied). The following copying modes are available:
2528
* `0`: _Default_. Object to object.
2529
* `1`: Prototype to prototype.
2530
* `2`: Prototype to prototype and object to object.
2531
* `3`: Prototype to object.
2532
* `4`: Object to prototype.
2535
@param {Function|Object} receiver The object or function to receive the mixed
2537
@param {Function|Object} supplier The object or function supplying the
2538
properties to be mixed.
2539
@param {Boolean} [overwrite=false] If `true`, properties that already exist
2540
on the receiver will be overwritten with properties from the supplier.
2541
@param {String[]} [whitelist] An array of property names to copy. If
2542
specified, only the whitelisted properties will be copied, and all others
2544
@param {Number} [mode=0] Mix mode to use. See above for available modes.
2545
@param {Boolean} [merge=false] If `true`, objects and arrays that already
2546
exist on the receiver will have the corresponding object/array from the
2547
supplier merged into them, rather than being skipped or overwritten. When
2548
both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
2549
@return {Function|Object|YUI} The receiver, or the YUI instance if the
2550
specified receiver is falsy.
2552
Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
2553
var alwaysOverwrite, exists, from, i, key, len, to;
2555
// If no supplier is given, we return the receiver. If no receiver is given,
2556
// we return Y. Returning Y doesn't make much sense to me, but it's
2557
// grandfathered in for backcompat reasons.
2558
if (!receiver || !supplier) {
2559
return receiver || Y;
2563
// In mode 2 (prototype to prototype and object to object), we recurse
2564
// once to do the proto to proto mix. The object to object mix will be
2565
// handled later on.
2567
Y.mix(receiver.prototype, supplier.prototype, overwrite,
2568
whitelist, 0, merge);
2571
// Depending on which mode is specified, we may be copying from or to
2572
// the prototypes of the supplier and receiver.
2573
from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
2574
to = mode === 1 || mode === 4 ? receiver.prototype : receiver;
2576
// If either the supplier or receiver doesn't actually have a
2577
// prototype property, then we could end up with an undefined `from`
2578
// or `to`. If that happens, we abort and return the receiver.
2587
// If `overwrite` is truthy and `merge` is falsy, then we can skip a
2588
// property existence check on each iteration and save some time.
2589
alwaysOverwrite = overwrite && !merge;
2592
for (i = 0, len = whitelist.length; i < len; ++i) {
2595
// We call `Object.prototype.hasOwnProperty` instead of calling
2596
// `hasOwnProperty` on the object itself, since the object's
2597
// `hasOwnProperty` method may have been overridden or removed.
2598
// Also, some native objects don't implement a `hasOwnProperty`
2600
if (!hasOwn.call(from, key)) {
2604
// The `key in to` check here is (sadly) intentional for backwards
2605
// compatibility reasons. It prevents undesired shadowing of
2606
// prototype members on `to`.
2607
exists = alwaysOverwrite ? false : key in to;
2609
if (merge && exists && isObject(to[key], true)
2610
&& isObject(from[key], true)) {
2611
// If we're in merge mode, and the key is present on both
2612
// objects, and the value on both objects is either an object or
2613
// an array (but not a function), then we recurse to merge the
2614
// `from` value into the `to` value instead of overwriting it.
2616
// Note: It's intentional that the whitelist isn't passed to the
2617
// recursive call here. This is legacy behavior that lots of
2618
// code still depends on.
2619
Y.mix(to[key], from[key], overwrite, null, 0, merge);
2620
} else if (overwrite || !exists) {
2621
// We're not in merge mode, so we'll only copy the `from` value
2622
// to the `to` value if we're in overwrite mode or if the
2623
// current key doesn't exist on the `to` object.
2624
to[key] = from[key];
2629
// The code duplication here is for runtime performance reasons.
2630
// Combining whitelist and non-whitelist operations into a single
2631
// loop or breaking the shared logic out into a function both result
2632
// in worse performance, and Y.mix is critical enough that the byte
2633
// tradeoff is worth it.
2634
if (!hasOwn.call(from, key)) {
2638
// The `key in to` check here is (sadly) intentional for backwards
2639
// compatibility reasons. It prevents undesired shadowing of
2640
// prototype members on `to`.
2641
exists = alwaysOverwrite ? false : key in to;
2643
if (merge && exists && isObject(to[key], true)
2644
&& isObject(from[key], true)) {
2645
Y.mix(to[key], from[key], overwrite, null, 0, merge);
2646
} else if (overwrite || !exists) {
2647
to[key] = from[key];
2651
// If this is an IE browser with the JScript enumeration bug, force
2652
// enumeration of the buggy properties by making a recursive call with
2653
// the buggy properties as the whitelist.
2654
if (Y.Object._hasEnumBug) {
2655
Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
2662
* The YUI module contains the components required for building the YUI
2663
* seed file. This includes the script loading mechanism, a simple queue,
2664
* and the core utilities for the library.
2666
* @submodule yui-base
2670
* Adds utilities to the YUI instance for working with objects.
2675
var hasOwn = Object.prototype.hasOwnProperty,
2677
// If either MooTools or Prototype is on the page, then there's a chance that we
2678
// can't trust "native" language features to actually be native. When this is
2679
// the case, we take the safe route and fall back to our own non-native
2682
unsafeNatives = win && !!(win.MooTools || win.Prototype),
2684
UNDEFINED, // <-- Note the comma. We're still declaring vars.
2687
* Returns a new object that uses _obj_ as its prototype. This method wraps the
2688
* native ES5 `Object.create()` method if available, but doesn't currently
2689
* pass through `Object.create()`'s second argument (properties) in order to
2690
* ensure compatibility with older browsers.
2693
* @param {Object} obj Prototype object.
2694
* @return {Object} New object using _obj_ as its prototype.
2697
O = Y.Object = (!unsafeNatives && Object.create) ? function (obj) {
2698
// We currently wrap the native Object.create instead of simply aliasing it
2699
// to ensure consistency with our fallback shim, which currently doesn't
2700
// support Object.create()'s second argument (properties). Once we have a
2701
// safe fallback for the properties arg, we can stop wrapping
2703
return Object.create(obj);
2705
// Reusable constructor function for the Object.create() shim.
2709
return function (obj) {
2716
* Property names that IE doesn't enumerate in for..in loops, even when they
2717
* should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
2718
* manually enumerate these properties.
2720
* @property _forceEnum
2725
forceEnum = O._forceEnum = [
2728
'propertyIsEnumerable',
2735
* `true` if this browser has the JScript enumeration bug that prevents
2736
* enumeration of the properties named in the `_forceEnum` array, `false`
2740
* - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
2741
* - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
2743
* @property _hasEnumBug
2748
hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
2751
* `true` if this browser incorrectly considers the `prototype` property of
2752
* functions to be enumerable. Currently known to affect Opera 11.50.
2754
* @property _hasProtoEnumBug
2759
hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
2762
* Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
2763
* exists only on _obj_'s prototype. This is essentially a safer version of
2764
* `obj.hasOwnProperty()`.
2767
* @param {Object} obj Object to test.
2768
* @param {String} key Property name to look for.
2769
* @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2772
owns = O.owns = function (obj, key) {
2773
return !!obj && hasOwn.call(obj, key);
2774
}; // <-- End of var declarations.
2777
* Alias for `owns()`.
2780
* @param {Object} obj Object to test.
2781
* @param {String} key Property name to look for.
2782
* @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2788
* Returns an array containing the object's enumerable keys. Does not include
2789
* prototype keys or non-enumerable keys.
2791
* Note that keys are returned in enumeration order (that is, in the same order
2792
* that they would be enumerated by a `for-in` loop), which may not be the same
2793
* as the order in which they were defined.
2795
* This method is an alias for the native ES5 `Object.keys()` method if
2800
* Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
2801
* // => ['a', 'b', 'c']
2804
* @param {Object} obj An object.
2805
* @return {String[]} Array of keys.
2808
O.keys = (!unsafeNatives && Object.keys) || function (obj) {
2809
if (!Y.Lang.isObject(obj)) {
2810
throw new TypeError('Object.keys called on a non-object');
2816
if (hasProtoEnumBug && typeof obj === 'function') {
2818
if (owns(obj, key) && key !== 'prototype') {
2824
if (owns(obj, key)) {
2831
for (i = 0, len = forceEnum.length; i < len; ++i) {
2834
if (owns(obj, key)) {
2844
* Returns an array containing the values of the object's enumerable keys.
2846
* Note that values are returned in enumeration order (that is, in the same
2847
* order that they would be enumerated by a `for-in` loop), which may not be the
2848
* same as the order in which they were defined.
2852
* Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
2853
* // => ['foo', 'bar', 'baz']
2856
* @param {Object} obj An object.
2857
* @return {Array} Array of values.
2860
O.values = function (obj) {
2861
var keys = O.keys(obj),
2866
for (; i < len; ++i) {
2867
values.push(obj[keys[i]]);
2874
* Returns the number of enumerable keys owned by an object.
2877
* @param {Object} obj An object.
2878
* @return {Number} The object's size.
2881
O.size = function (obj) {
2883
return O.keys(obj).length;
2885
return 0; // Legacy behavior for non-objects.
2890
* Returns `true` if the object owns an enumerable property with the specified
2894
* @param {Object} obj An object.
2895
* @param {any} value The value to search for.
2896
* @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
2899
O.hasValue = function (obj, value) {
2900
return Y.Array.indexOf(O.values(obj), value) > -1;
2904
* Executes a function on each enumerable property in _obj_. The function
2905
* receives the value, the key, and the object itself as parameters (in that
2908
* By default, only properties owned by _obj_ are enumerated. To include
2909
* prototype properties, set the _proto_ parameter to `true`.
2912
* @param {Object} obj Object to enumerate.
2913
* @param {Function} fn Function to execute on each enumerable property.
2914
* @param {mixed} fn.value Value of the current property.
2915
* @param {String} fn.key Key of the current property.
2916
* @param {Object} fn.obj Object being enumerated.
2917
* @param {Object} [thisObj] `this` object to use when calling _fn_.
2918
* @param {Boolean} [proto=false] Include prototype properties.
2919
* @return {YUI} the YUI instance.
2923
O.each = function (obj, fn, thisObj, proto) {
2927
if (proto || owns(obj, key)) {
2928
fn.call(thisObj || Y, obj[key], key, obj);
2936
* Executes a function on each enumerable property in _obj_, but halts if the
2937
* function returns a truthy value. The function receives the value, the key,
2938
* and the object itself as paramters (in that order).
2940
* By default, only properties owned by _obj_ are enumerated. To include
2941
* prototype properties, set the _proto_ parameter to `true`.
2944
* @param {Object} obj Object to enumerate.
2945
* @param {Function} fn Function to execute on each enumerable property.
2946
* @param {mixed} fn.value Value of the current property.
2947
* @param {String} fn.key Key of the current property.
2948
* @param {Object} fn.obj Object being enumerated.
2949
* @param {Object} [thisObj] `this` object to use when calling _fn_.
2950
* @param {Boolean} [proto=false] Include prototype properties.
2951
* @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
2952
* `false` otherwise.
2955
O.some = function (obj, fn, thisObj, proto) {
2959
if (proto || owns(obj, key)) {
2960
if (fn.call(thisObj || Y, obj[key], key, obj)) {
2970
* Retrieves the sub value at the provided path,
2971
* from the value object provided.
2975
* @param o The object from which to extract the property value.
2976
* @param path {Array} A path array, specifying the object traversal path
2977
* from which to obtain the sub value.
2978
* @return {Any} The value stored in the path, undefined if not found,
2979
* undefined if the source is not an object. Returns the source object
2980
* if an empty path is provided.
2982
O.getValue = function(o, path) {
2983
if (!Y.Lang.isObject(o)) {
2991
for (i = 0; o !== UNDEFINED && i < l; i++) {
2999
* Sets the sub-attribute value at the provided path on the
3000
* value object. Returns the modified value object, or
3001
* undefined if the path is invalid.
3005
* @param o The object on which to set the sub value.
3006
* @param path {Array} A path array, specifying the object traversal path
3007
* at which to set the sub value.
3008
* @param val {Any} The new value for the sub-attribute.
3009
* @return {Object} The modified object, with the new sub value set, or
3010
* undefined, if the path was invalid.
3012
O.setValue = function(o, path, val) {
3015
leafIdx = p.length - 1,
3019
for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
3023
if (ref !== UNDEFINED) {
3034
* Returns `true` if the object has no enumerable properties of its own.
3037
* @param {Object} obj An object.
3038
* @return {Boolean} `true` if the object is empty.
3042
O.isEmpty = function (obj) {
3043
return !O.keys(obj).length;
3046
* The YUI module contains the components required for building the YUI seed
3047
* file. This includes the script loading mechanism, a simple queue, and the
3048
* core utilities for the library.
3050
* @submodule yui-base
3054
* YUI user agent detection.
3055
* Do not fork for a browser if it can be avoided. Use feature detection when
3056
* you can. Use the user agent as a last resort. For all fields listed
3057
* as @type float, UA stores a version number for the browser engine,
3058
* 0 otherwise. This value may or may not map to the version number of
3059
* the browser using the engine. The value is presented as a float so
3060
* that it can easily be used for boolean evaluation as well as for
3061
* looking for a particular range of versions. Because of this,
3062
* some of the granularity of the version info may be lost. The fields that
3063
* are @type string default to null. The API docs list the values that
3064
* these fields can have.
3070
* Static method on `YUI.Env` for parsing a UA string. Called at instantiation
3071
* to populate `Y.UA`.
3075
* @param {String} [subUA=navigator.userAgent] UA string to parse
3076
* @returns {Object} The Y.UA object
3078
YUI.Env.parseUA = function(subUA) {
3080
var numberify = function(s) {
3082
return parseFloat(s.replace(/\./g, function() {
3083
return (c++ == 1) ? '' : '.';
3089
nav = win && win.navigator,
3094
* Internet Explorer version number or 0. Example: 6
3102
* Opera version number or 0. Example: 9.2
3110
* Gecko engine revision number. Will evaluate to 1 if Gecko
3111
* is detected but the revision could not be found. Other browsers
3112
* will be 0. Example: 1.8
3114
* Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7
3115
* Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
3116
* Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
3117
* Firefox 3.0 <-- 1.9
3118
* Firefox 3.5 <-- 1.91
3127
* AppleWebKit version. KHTML browsers that are not WebKit browsers
3128
* will evaluate to 1, other browsers 0. Example: 418.9
3130
* Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
3131
* latest available for Mac OSX 10.3.
3132
* Safari 2.0.2: 416 <-- hasOwnProperty introduced
3133
* Safari 2.0.4: 418 <-- preventDefault fixed
3134
* Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
3135
* different versions of webkit
3136
* Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been
3137
* updated, but not updated
3138
* to the latest patch.
3139
* Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native
3140
* SVG and many major issues fixed).
3141
* Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic
3142
* update from 2.x via the 10.4.11 OS patch.
3143
* Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event.
3144
* yahoo.com user agent hack removed.
3146
* http://en.wikipedia.org/wiki/Safari_version_history
3154
* Safari will be detected as webkit, but this property will also
3155
* be populated with the Safari version number
3163
* Chrome will be detected as webkit, but this property will also
3164
* be populated with the Chrome version number
3172
* The mobile property will be set to a string containing any relevant
3173
* user agent information when a modern mobile browser is detected.
3174
* Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
3175
* devices with the WebKit-based browser, and Opera Mini.
3184
* Adobe AIR version number or 0. Only populated if webkit is detected.
3191
* Detects Apple iPad's OS version
3198
* Detects Apple iPhone's OS version
3205
* Detects Apples iPod's OS version
3212
* General truthy check for iPad, iPhone or iPod
3220
* Detects Googles Android OS version
3227
* Detects Palms WebOS version
3235
* Google Caja version number or 0.
3239
caja: nav && nav.cajaVersion,
3242
* Set to true if the page appears to be in SSL
3250
* The operating system. Currently only detecting windows or macintosh
3260
ua = subUA || nav && nav.userAgent,
3262
loc = win && win.location,
3264
href = loc && loc.href,
3269
* The User Agent string that was parsed
3270
* @property userAgent
3277
o.secure = href && (href.toLowerCase().indexOf('https') === 0);
3281
if ((/windows|win32/i).test(ua)) {
3283
} else if ((/macintosh/i).test(ua)) {
3285
} else if ((/rhino/i).test(ua)) {
3289
// Modern KHTML browsers should qualify as Safari X-Grade
3290
if ((/KHTML/).test(ua)) {
3293
// Modern WebKit browsers are at least X-Grade
3294
m = ua.match(/AppleWebKit\/([^\s]*)/);
3296
o.webkit = numberify(m[1]);
3297
o.safari = o.webkit;
3299
// Mobile browser check
3300
if (/ Mobile\//.test(ua)) {
3301
o.mobile = 'Apple'; // iPhone or iPod Touch
3303
m = ua.match(/OS ([^\s]*)/);
3305
m = numberify(m[1].replace('_', '.'));
3308
o.ipad = o.ipod = o.iphone = 0;
3310
m = ua.match(/iPad|iPod|iPhone/);
3312
o[m[0].toLowerCase()] = o.ios;
3315
m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
3317
// Nokia N-series, webOS, ex: NokiaN95
3320
if (/webOS/.test(ua)) {
3322
m = ua.match(/webOS\/([^\s]*);/);
3324
o.webos = numberify(m[1]);
3327
if (/ Android/.test(ua)) {
3328
if (/Mobile/.test(ua)) {
3329
o.mobile = 'Android';
3331
m = ua.match(/Android ([^\s]*);/);
3333
o.android = numberify(m[1]);
3339
m = ua.match(/Chrome\/([^\s]*)/);
3341
o.chrome = numberify(m[1]); // Chrome
3342
o.safari = 0; //Reset safari back to 0
3344
m = ua.match(/AdobeAIR\/([^\s]*)/);
3346
o.air = m[0]; // Adobe AIR 1.0 or better
3351
if (!o.webkit) { // not webkit
3352
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
3353
m = ua.match(/Opera[\s\/]([^\s]*)/);
3355
o.opera = numberify(m[1]);
3356
m = ua.match(/Version\/([^\s]*)/);
3358
o.opera = numberify(m[1]); // opera 10+
3361
m = ua.match(/Opera Mini[^;]*/);
3364
o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
3366
} else { // not opera or webkit
3367
m = ua.match(/MSIE\s([^;]*)/);
3369
o.ie = numberify(m[1]);
3370
} else { // not opera, webkit, or ie
3371
m = ua.match(/Gecko\/([^\s]*)/);
3373
o.gecko = 1; // Gecko detected, look for revision
3374
m = ua.match(/rv:([^\s\)]*)/);
3376
o.gecko = numberify(m[1]);
3384
//It was a parsed UA, do not assign the global value.
3393
Y.UA = YUI.Env.UA || YUI.Env.parseUA();
3395
"anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
3396
"app": ["controller","model","model-list","view"],
3397
"attribute": ["attribute-base","attribute-complex"],
3398
"autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
3399
"base": ["base-base","base-pluginhost","base-build"],
3400
"cache": ["cache-base","cache-offline","cache-plugin"],
3401
"collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
3402
"dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
3403
"datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
3404
"datatable": ["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"],
3405
"datatype": ["datatype-number","datatype-date","datatype-xml"],
3406
"datatype-date": ["datatype-date-parse","datatype-date-format"],
3407
"datatype-number": ["datatype-number-parse","datatype-number-format"],
3408
"datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
3409
"dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
3410
"dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
3411
"editor": ["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
3412
"event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside"],
3413
"event-custom": ["event-custom-base","event-custom-complex"],
3414
"event-gestures": ["event-flick","event-move"],
3415
"highlight": ["highlight-base","highlight-accentfold"],
3416
"history": ["history-base","history-hash","history-hash-ie","history-html5"],
3417
"io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
3418
"json": ["json-parse","json-stringify"],
3419
"loader": ["loader-base","loader-rollup","loader-yui3"],
3420
"node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
3421
"pluginhost": ["pluginhost-base","pluginhost-config"],
3422
"querystring": ["querystring-parse","querystring-stringify"],
3423
"recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
3424
"resize": ["resize-base","resize-proxy","resize-constrain"],
3425
"slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
3426
"text": ["text-accentfold","text-wordbreak"],
3427
"widget": ["widget-base","widget-htmlparser","widget-uievents","widget-skin"]