~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/build/yui/yui-debug.js

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
YUI 3.4.1 (build 4118)
3
 
Copyright 2011 Yahoo! Inc. All rights reserved.
4
 
Licensed under the BSD License.
5
 
http://yuilibrary.com/license/
6
 
*/
7
 
/**
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.
11
 
 * @module yui
12
 
 * @submodule yui-base
13
 
 */
14
 
 
15
 
if (typeof YUI != 'undefined') {
16
 
    YUI._YUI = YUI;
17
 
}
18
 
 
19
 
/**
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:
27
 
 
28
 
     YUI().use('*', function(Y) {
29
 
         // ready
30
 
     });
31
 
 
32
 
But it also works like this:
33
 
 
34
 
     var Y = YUI();
35
 
 
36
 
@class YUI
37
 
@constructor
38
 
@global
39
 
@uses EventTarget
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
42
 
properties.
43
 
*/
44
 
    /*global YUI*/
45
 
    /*global YUI_config*/
46
 
    var YUI = function() {
47
 
        var i = 0,
48
 
            Y = this,
49
 
            args = arguments,
50
 
            l = args.length,
51
 
            instanceOf = function(o, type) {
52
 
                return (o && o.hasOwnProperty && (o instanceof type));
53
 
            },
54
 
            gconf = (typeof YUI_config !== 'undefined') && YUI_config;
55
 
 
56
 
        if (!(instanceOf(Y, YUI))) {
57
 
            Y = new YUI();
58
 
        } else {
59
 
            // set up the core environment
60
 
            Y._init();
61
 
 
62
 
            /**
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
67
 
                @type {Object}
68
 
                @global
69
 
                @static
70
 
                @example
71
 
 
72
 
                    
73
 
                    YUI.GlobalConfig = {
74
 
                        filter: 'debug'
75
 
                    };
76
 
 
77
 
                    YUI().use('node', function(Y) {
78
 
                        //debug files used here
79
 
                    });
80
 
 
81
 
                    YUI({
82
 
                        filter: 'min'
83
 
                    }).use('node', function(Y) {
84
 
                        //min files used here
85
 
                    });
86
 
 
87
 
            */
88
 
            if (YUI.GlobalConfig) {
89
 
                Y.applyConfig(YUI.GlobalConfig);
90
 
            }
91
 
            
92
 
            /**
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
96
 
                objects.
97
 
                @global
98
 
                @property YUI_config
99
 
                @type {Object}
100
 
                @example
101
 
 
102
 
                    
103
 
                    //Single global var to include before YUI seed file
104
 
                    YUI_config = {
105
 
                        filter: 'debug'
106
 
                    };
107
 
                    
108
 
                    YUI().use('node', function(Y) {
109
 
                        //debug files used here
110
 
                    });
111
 
 
112
 
                    YUI({
113
 
                        filter: 'min'
114
 
                    }).use('node', function(Y) {
115
 
                        //min files used here
116
 
                    });
117
 
            */
118
 
            if (gconf) {
119
 
                Y.applyConfig(gconf);
120
 
            }
121
 
 
122
 
            // bind the specified additional modules for this instance
123
 
            if (!l) {
124
 
                Y._setup();
125
 
            }
126
 
        }
127
 
 
128
 
        if (l) {
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.
133
 
            for (; i < l; i++) {
134
 
                Y.applyConfig(args[i]);
135
 
            }
136
 
 
137
 
            Y._setup();
138
 
        }
139
 
 
140
 
        Y.instanceOf = instanceOf;
141
 
 
142
 
        return Y;
143
 
    };
144
 
 
145
 
(function() {
146
 
 
147
 
    var proto, prop,
148
 
        VERSION = '3.4.1',
149
 
        PERIOD = '.',
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,
162
 
        instances = {},
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);
169
 
            }
170
 
        },
171
 
        remove = function(el, type, fn, capture) {
172
 
            if (el && el.removeEventListener) {
173
 
                // this can throw an uncaught exception in FF
174
 
                try {
175
 
                    el.removeEventListener(type, fn, capture);
176
 
                } catch (ex) {}
177
 
            } else if (el && el.detachEvent) {
178
 
                el.detachEvent('on' + type, fn);
179
 
            }
180
 
        },
181
 
        handleLoad = function() {
182
 
            YUI.Env.windowLoaded = true;
183
 
            YUI.Env.DOMReady = true;
184
 
            if (hasWin) {
185
 
                remove(window, 'load', handleLoad);
186
 
            }
187
 
        },
188
 
        getLoader = function(Y, o) {
189
 
            var loader = Y.Env._loader;
190
 
            if (loader) {
191
 
                //loader._config(Y.config);
192
 
                loader.ignoreRegistered = false;
193
 
                loader.onEnd = null;
194
 
                loader.data = null;
195
 
                loader.required = [];
196
 
                loader.loadType = null;
197
 
            } else {
198
 
                loader = new Y.Loader(Y.config);
199
 
                Y.Env._loader = loader;
200
 
            }
201
 
            YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, [ 'loader-base', 'loader-rollup', 'loader-yui3' ]));
202
 
 
203
 
            return loader;
204
 
        },
205
 
 
206
 
        clobber = function(r, s) {
207
 
            for (var i in s) {
208
 
                if (s.hasOwnProperty(i)) {
209
 
                    r[i] = s[i];
210
 
                }
211
 
            }
212
 
        },
213
 
 
214
 
        ALREADY_DONE = { success: true };
215
 
 
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) {
219
 
    if (docClass) {
220
 
        docClass += ' ';
221
 
    }
222
 
    docClass += DOC_LABEL;
223
 
    docEl.className = docClass;
224
 
}
225
 
 
226
 
if (VERSION.indexOf('@') > -1) {
227
 
    VERSION = '3.3.0'; // dev time hack for cdn test
228
 
}
229
 
 
230
 
proto = {
231
 
    /**
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.
238
 
     * @since 3.2.0
239
 
     */
240
 
    applyConfig: function(o) {
241
 
 
242
 
        o = o || NOOP;
243
 
 
244
 
        var attr,
245
 
            name,
246
 
            // detail,
247
 
            config = this.config,
248
 
            mods = config.modules,
249
 
            groups = config.groups,
250
 
            rls = config.rls,
251
 
            loader = this.Env._loader;
252
 
 
253
 
        for (name in o) {
254
 
            if (o.hasOwnProperty(name)) {
255
 
                attr = o[name];
256
 
                if (mods && name == 'modules') {
257
 
                    clobber(mods, attr);
258
 
                } else if (groups && name == 'groups') {
259
 
                    clobber(groups, attr);
260
 
                } else if (rls && name == 'rls') {
261
 
                    clobber(rls, attr);
262
 
                } else if (name == 'win') {
263
 
                    config[name] = attr.contentWindow || attr;
264
 
                    config.doc = config[name].document;
265
 
                } else if (name == '_yuid') {
266
 
                    // preserve the guid
267
 
                } else {
268
 
                    config[name] = attr;
269
 
                }
270
 
            }
271
 
        }
272
 
 
273
 
        if (loader) {
274
 
            loader._config(o);
275
 
        }
276
 
    },
277
 
    /**
278
 
    * Old way to apply a config to the instance (calls `applyConfig` under the hood)
279
 
    * @private
280
 
    * @method _config
281
 
    * @param {Object} o The config to apply
282
 
    */
283
 
    _config: function(o) {
284
 
        this.applyConfig(o);
285
 
    },
286
 
 
287
 
    /**
288
 
     * Initialize this YUI instance
289
 
     * @private
290
 
     * @method _init
291
 
     */
292
 
    _init: function() {
293
 
        var filter,
294
 
            Y = this,
295
 
            G_ENV = YUI.Env,
296
 
            Env = Y.Env,
297
 
            prop;
298
 
 
299
 
        /**
300
 
         * The version number of the YUI instance.
301
 
         * @property version
302
 
         * @type string
303
 
         */
304
 
        Y.version = VERSION;
305
 
 
306
 
        if (!Env) {
307
 
            Y.Env = {
308
 
                core: ['get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3'],
309
 
                mods: {}, // flat module map
310
 
                versions: {}, // version module map
311
 
                base: BASE,
312
 
                cdn: BASE + VERSION + '/build/',
313
 
                // bootstrapped: false,
314
 
                _idx: 0,
315
 
                _used: {},
316
 
                _attached: {},
317
 
                _missed: [],
318
 
                _yidx: 0,
319
 
                _uidx: 0,
320
 
                _guidp: 'y',
321
 
                _loaded: {},
322
 
                // serviced: {},
323
 
                // Regex in English:
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/"
337
 
                //
338
 
                // Regex Exploded:
339
 
                // (?:\?             Find a ?
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),
353
 
                        path, filter;
354
 
 
355
 
                    if (match) {
356
 
                        path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));
357
 
 
358
 
                        // this is to set up the path to the loader.  The file
359
 
                        // filter for loader should match the yui include.
360
 
                        filter = match[3];
361
 
 
362
 
                        // extract correct path for mixed combo urls
363
 
                        // http://yuilibrary.com/projects/yui3/ticket/2528423
364
 
                        if (match[1]) {
365
 
                            path += '?' + match[1];
366
 
                        }
367
 
                        path = {
368
 
                            filter: filter,
369
 
                            path: path
370
 
                        }
371
 
                    }
372
 
                    return path;
373
 
                },
374
 
                getBase: G_ENV && G_ENV.getBase ||
375
 
                        function(pattern) {
376
 
                            var nodes = (doc && doc.getElementsByTagName('script')) || [],
377
 
                                path = Env.cdn, parsed,
378
 
                                i, len, src;
379
 
 
380
 
                            for (i = 0, len = nodes.length; i < len; ++i) {
381
 
                                src = nodes[i].src;
382
 
                                if (src) {
383
 
                                    parsed = Y.Env.parseBasePath(src, pattern);
384
 
                                    if (parsed) {
385
 
                                        filter = parsed.filter;
386
 
                                        path = parsed.path;
387
 
                                        break;
388
 
                                    }
389
 
                                }
390
 
                            }
391
 
 
392
 
                            // use CDN default
393
 
                            return path;
394
 
                        }
395
 
 
396
 
            };
397
 
 
398
 
            Env = Y.Env;
399
 
 
400
 
            Env._loaded[VERSION] = {};
401
 
 
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) {
407
 
 
408
 
                G_ENV = YUI._YUI.Env;
409
 
                Env._yidx += G_ENV._yidx;
410
 
                Env._uidx += G_ENV._uidx;
411
 
 
412
 
                for (prop in G_ENV) {
413
 
                    if (!(prop in Env)) {
414
 
                        Env[prop] = G_ENV[prop];
415
 
                    }
416
 
                }
417
 
 
418
 
                delete YUI._YUI;
419
 
            }
420
 
 
421
 
            Y.id = Y.stamp(Y);
422
 
            instances[Y.id] = Y;
423
 
 
424
 
        }
425
 
 
426
 
        Y.constructor = YUI;
427
 
 
428
 
        // configuration defaults
429
 
        Y.config = Y.config || {
430
 
            win: win,
431
 
            doc: doc,
432
 
            debug: true,
433
 
            useBrowserConsole: true,
434
 
            throwFail: true,
435
 
            bootstrap: true,
436
 
            cacheUse: true,
437
 
            fetchCSS: true,
438
 
            use_rls: false,
439
 
            rls_timeout: 2000
440
 
        };
441
 
 
442
 
        if (YUI.Env.rls_disabled) {
443
 
            Y.config.use_rls = false;
444
 
        }
445
 
 
446
 
        Y.config.lang = Y.config.lang || 'en-US';
447
 
 
448
 
        Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);
449
 
        
450
 
        if (!filter || (!('mindebug').indexOf(filter))) {
451
 
            filter = 'min';
452
 
        }
453
 
        filter = (filter) ? '-' + filter : filter;
454
 
        Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';
455
 
 
456
 
    },
457
 
 
458
 
    /**
459
 
     * Finishes the instance setup. Attaches whatever modules were defined
460
 
     * when the yui modules was registered.
461
 
     * @method _setup
462
 
     * @private
463
 
     */
464
 
    _setup: function(o) {
465
 
        var i, Y = this,
466
 
            core = [],
467
 
            mods = YUI.Env.mods,
468
 
            //extras = Y.config.core || ['get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3'];
469
 
            extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..
470
 
 
471
 
        for (i = 0; i < extras.length; i++) {
472
 
            if (mods[extras[i]]) {
473
 
                core.push(extras[i]);
474
 
            }
475
 
        }
476
 
 
477
 
        Y._attach(['yui-base']);
478
 
        Y._attach(core);
479
 
 
480
 
        if (Y.Loader) {
481
 
            getLoader(Y);
482
 
        }
483
 
 
484
 
        // Y.log(Y.id + ' initialized', 'info', 'yui');
485
 
    },
486
 
 
487
 
    /**
488
 
     * Executes a method on a YUI instance with
489
 
     * the specified id if the specified method is whitelisted.
490
 
     * @method applyTo
491
 
     * @param id {String} the YUI instance id.
492
 
     * @param method {String} the name of the method to exectute.
493
 
     * Ex: 'Object.keys'.
494
 
     * @param args {Array} the arguments to apply to the method.
495
 
     * @return {Object} the return value from the applied method or null.
496
 
     */
497
 
    applyTo: function(id, method, args) {
498
 
        if (!(method in APPLY_TO_AUTH)) {
499
 
            this.log(method + ': applyTo not allowed', 'warn', 'yui');
500
 
            return null;
501
 
        }
502
 
 
503
 
        var instance = instances[id], nest, m, i;
504
 
        if (instance) {
505
 
            nest = method.split('.');
506
 
            m = instance;
507
 
            for (i = 0; i < nest.length; i = i + 1) {
508
 
                m = m[nest[i]];
509
 
                if (!m) {
510
 
                    this.log('applyTo not found: ' + method, 'warn', 'yui');
511
 
                }
512
 
            }
513
 
            return m.apply(instance, args);
514
 
        }
515
 
 
516
 
        return null;
517
 
    },
518
 
 
519
 
/**
520
 
Registers a module with the YUI global.  The easiest way to create a
521
 
first-class YUI module is to use the YUI component build tool.
522
 
 
523
 
http://yuilibrary.com/projects/builder
524
 
 
525
 
The build system will produce the `YUI.add` wrapper for you module, along
526
 
with any configuration info required for the module.
527
 
@method add
528
 
@param name {String} module name.
529
 
@param fn {Function} entry point into the module that is used to bind module to the YUI instance.
530
 
@param {YUI} fn.Y The YUI instance this module is executed in.
531
 
@param {String} fn.name The name of the module
532
 
@param version {String} version string.
533
 
@param details {Object} optional config data:
534
 
@param details.requires {Array} features that must be present before this module can be attached.
535
 
@param details.optional {Array} optional features that should be present if loadOptional
536
 
 is defined.  Note: modules are not often loaded this way in YUI 3,
537
 
 but this field is still useful to inform the user that certain
538
 
 features in the component will require additional dependencies.
539
 
@param details.use {Array} features that are included within this module which need to
540
 
 be attached automatically when this module is attached.  This
541
 
 supports the YUI 3 rollup system -- a module with submodules
542
 
 defined will need to have the submodules listed in the 'use'
543
 
 config.  The YUI component build tool does this for you.
544
 
@return {YUI} the YUI instance.
545
 
@example
546
 
 
547
 
    YUI.add('davglass', function(Y, name) {
548
 
        Y.davglass = function() {
549
 
            alert('Dav was here!');
550
 
        };
551
 
    }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });
552
 
 
553
 
*/
554
 
    add: function(name, fn, version, details) {
555
 
        details = details || {};
556
 
        var env = YUI.Env,
557
 
            mod = {
558
 
                name: name,
559
 
                fn: fn,
560
 
                version: version,
561
 
                details: details
562
 
            },
563
 
            loader,
564
 
            i, versions = env.versions;
565
 
 
566
 
        env.mods[name] = mod;
567
 
        versions[version] = versions[version] || {};
568
 
        versions[version][name] = mod;
569
 
 
570
 
        for (i in instances) {
571
 
            if (instances.hasOwnProperty(i)) {
572
 
                loader = instances[i].Env._loader;
573
 
                if (loader) {
574
 
                    if (!loader.moduleInfo[name]) {
575
 
                        loader.addModule(details, name);
576
 
                    }
577
 
                }
578
 
            }
579
 
        }
580
 
 
581
 
        return this;
582
 
    },
583
 
 
584
 
    /**
585
 
     * Executes the function associated with each required
586
 
     * module, binding the module to the YUI instance.
587
 
     * @param {Array} r The array of modules to attach
588
 
     * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached
589
 
     * @method _attach
590
 
     * @private
591
 
     */
592
 
    _attach: function(r, moot) {
593
 
        var i, name, mod, details, req, use, after,
594
 
            mods = YUI.Env.mods,
595
 
            aliases = YUI.Env.aliases,
596
 
            Y = this, j,
597
 
            loader = Y.Env._loader,
598
 
            done = Y.Env._attached,
599
 
            len = r.length, loader,
600
 
            c = [];
601
 
 
602
 
        //Check for conditional modules (in a second+ instance) and add their requirements
603
 
        //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass
604
 
        for (i = 0; i < len; i++) {
605
 
            name = r[i];
606
 
            mod = mods[name];
607
 
            c.push(name);
608
 
            if (loader && loader.conditions[name]) {
609
 
                Y.Object.each(loader.conditions[name], function(def) {
610
 
                    var go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));
611
 
                    if (go) {
612
 
                        c.push(def.name);
613
 
                    }
614
 
                });
615
 
            }
616
 
        }
617
 
        r = c;
618
 
        len = r.length;
619
 
 
620
 
        for (i = 0; i < len; i++) {
621
 
            if (!done[r[i]]) {
622
 
                name = r[i];
623
 
                mod = mods[name];
624
 
 
625
 
                if (aliases && aliases[name]) {
626
 
                    Y._attach(aliases[name]);
627
 
                    continue;
628
 
                }
629
 
                if (!mod) {
630
 
                    if (loader && loader.moduleInfo[name]) {
631
 
                        mod = loader.moduleInfo[name];
632
 
                        moot = true;
633
 
                    }
634
 
 
635
 
                    // Y.log('no js def for: ' + name, 'info', 'yui');
636
 
 
637
 
                    //if (!loader || !loader.moduleInfo[name]) {
638
 
                    //if ((!loader || !loader.moduleInfo[name]) && !moot) {
639
 
                    if (!moot) {
640
 
                        if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
641
 
                            Y.Env._missed.push(name);
642
 
                            Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
643
 
                            Y.message('NOT loaded: ' + name, 'warn', 'yui');
644
 
                        }
645
 
                    }
646
 
                } else {
647
 
                    done[name] = true;
648
 
                    //Don't like this, but in case a mod was asked for once, then we fetch it
649
 
                    //We need to remove it from the missed list ^davglass
650
 
                    for (j = 0; j < Y.Env._missed.length; j++) {
651
 
                        if (Y.Env._missed[j] === name) {
652
 
                            Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
653
 
                            Y.Env._missed.splice(j, 1);
654
 
                        }
655
 
                    }
656
 
                    details = mod.details;
657
 
                    req = details.requires;
658
 
                    use = details.use;
659
 
                    after = details.after;
660
 
 
661
 
                    if (req) {
662
 
                        for (j = 0; j < req.length; j++) {
663
 
                            if (!done[req[j]]) {
664
 
                                if (!Y._attach(req)) {
665
 
                                    return false;
666
 
                                }
667
 
                                break;
668
 
                            }
669
 
                        }
670
 
                    }
671
 
 
672
 
                    if (after) {
673
 
                        for (j = 0; j < after.length; j++) {
674
 
                            if (!done[after[j]]) {
675
 
                                if (!Y._attach(after, true)) {
676
 
                                    return false;
677
 
                                }
678
 
                                break;
679
 
                            }
680
 
                        }
681
 
                    }
682
 
 
683
 
                    if (mod.fn) {
684
 
                        try {
685
 
                            mod.fn(Y, name);
686
 
                        } catch (e) {
687
 
                            Y.error('Attach error: ' + name, e, name);
688
 
                            return false;
689
 
                        }
690
 
                    }
691
 
 
692
 
                    if (use) {
693
 
                        for (j = 0; j < use.length; j++) {
694
 
                            if (!done[use[j]]) {
695
 
                                if (!Y._attach(use)) {
696
 
                                    return false;
697
 
                                }
698
 
                                break;
699
 
                            }
700
 
                        }
701
 
                    }
702
 
 
703
 
 
704
 
 
705
 
                }
706
 
            }
707
 
        }
708
 
 
709
 
        return true;
710
 
    },
711
 
 
712
 
    /**
713
 
     * Attaches one or more modules to the YUI instance.  When this
714
 
     * is executed, the requirements are analyzed, and one of
715
 
     * several things can happen:
716
 
     *
717
 
     *  * All requirements are available on the page --  The modules
718
 
     *   are attached to the instance.  If supplied, the use callback
719
 
     *   is executed synchronously.
720
 
     *
721
 
     *  * Modules are missing, the Get utility is not available OR
722
 
     *   the 'bootstrap' config is false -- A warning is issued about
723
 
     *   the missing modules and all available modules are attached.
724
 
     *
725
 
     *  * Modules are missing, the Loader is not available but the Get
726
 
     *   utility is and boostrap is not false -- The loader is bootstrapped
727
 
     *   before doing the following....
728
 
     *
729
 
     *  * Modules are missing and the Loader is available -- The loader
730
 
     *   expands the dependency tree and fetches missing modules.  When
731
 
     *   the loader is finshed the callback supplied to use is executed
732
 
     *   asynchronously.
733
 
     *
734
 
     * @method use
735
 
     * @param modules* {String} 1-n modules to bind (uses arguments array).
736
 
     * @param *callback {Function} callback function executed when
737
 
     * the instance has the required functionality.  If included, it
738
 
     * must be the last parameter.
739
 
     *
740
 
     * @example
741
 
     *      // loads and attaches dd and its dependencies
742
 
     *      YUI().use('dd', function(Y) {});
743
 
     *
744
 
     *      // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)
745
 
     *      YUI().use(['dd', 'node'], function(Y) {});
746
 
     *
747
 
     *      // attaches all modules that are available on the page
748
 
     *      YUI().use('*', function(Y) {});
749
 
     *
750
 
     *      // intrinsic YUI gallery support (since 3.1.0)
751
 
     *      YUI().use('gallery-yql', function(Y) {});
752
 
     *
753
 
     *      // intrinsic YUI 2in3 support (since 3.1.0)
754
 
     *      YUI().use('yui2-datatable', function(Y) {});
755
 
     *
756
 
     * @return {YUI} the YUI instance.
757
 
     */
758
 
    use: function() {
759
 
        var args = SLICE.call(arguments, 0),
760
 
            callback = args[args.length - 1],
761
 
            Y = this,
762
 
            i = 0,
763
 
            name,
764
 
            Env = Y.Env,
765
 
            provisioned = true;
766
 
 
767
 
        // The last argument supplied to use can be a load complete callback
768
 
        if (Y.Lang.isFunction(callback)) {
769
 
            args.pop();
770
 
        } else {
771
 
            callback = null;
772
 
        }
773
 
        if (Y.Lang.isArray(args[0])) {
774
 
            args = args[0];
775
 
        }
776
 
 
777
 
        if (Y.config.cacheUse) {
778
 
            while ((name = args[i++])) {
779
 
                if (!Env._attached[name]) {
780
 
                    provisioned = false;
781
 
                    break;
782
 
                }
783
 
            }
784
 
 
785
 
            if (provisioned) {
786
 
                if (args.length) {
787
 
                    Y.log('already provisioned: ' + args, 'info', 'yui');
788
 
                }
789
 
                Y._notify(callback, ALREADY_DONE, args);
790
 
                return Y;
791
 
            }
792
 
        }
793
 
 
794
 
        if (Y._loading) {
795
 
            Y._useQueue = Y._useQueue || new Y.Queue();
796
 
            Y._useQueue.add([args, callback]);
797
 
        } else {
798
 
            Y._use(args, function(Y, response) {
799
 
                Y._notify(callback, response, args);
800
 
            });
801
 
        }
802
 
 
803
 
        return Y;
804
 
    },
805
 
    /**
806
 
    * Notify handler from Loader for attachment/load errors
807
 
    * @method _notify
808
 
    * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`
809
 
    * @param response {Object} The response returned from Loader
810
 
    * @param args {Array} The aruments passed from Loader
811
 
    * @private
812
 
    */
813
 
    _notify: function(callback, response, args) {
814
 
        if (!response.success && this.config.loadErrorFn) {
815
 
            this.config.loadErrorFn.call(this, this, callback, response, args);
816
 
        } else if (callback) {
817
 
            try {
818
 
                callback(this, response);
819
 
            } catch (e) {
820
 
                this.error('use callback error', e, args);
821
 
            }
822
 
        }
823
 
    },
824
 
    
825
 
    /**
826
 
    * This private method is called from the `use` method queue. To ensure that only one set of loading
827
 
    * logic is performed at a time.
828
 
    * @method _use
829
 
    * @private
830
 
    * @param args* {String} 1-n modules to bind (uses arguments array).
831
 
    * @param *callback {Function} callback function executed when
832
 
    * the instance has the required functionality.  If included, it
833
 
    * must be the last parameter.
834
 
    */
835
 
    _use: function(args, callback) {
836
 
 
837
 
        if (!this.Array) {
838
 
            this._attach(['yui-base']);
839
 
        }
840
 
 
841
 
        var len, loader, handleBoot, handleRLS,
842
 
            Y = this,
843
 
            G_ENV = YUI.Env,
844
 
            mods = G_ENV.mods,
845
 
            Env = Y.Env,
846
 
            used = Env._used,
847
 
            queue = G_ENV._loaderQueue,
848
 
            firstArg = args[0],
849
 
            YArray = Y.Array,
850
 
            config = Y.config,
851
 
            boot = config.bootstrap,
852
 
            missing = [],
853
 
            r = [],
854
 
            ret = true,
855
 
            fetchCSS = config.fetchCSS,
856
 
            process = function(names, skip) {
857
 
 
858
 
                if (!names.length) {
859
 
                    return;
860
 
                }
861
 
 
862
 
                YArray.each(names, function(name) {
863
 
 
864
 
                    // add this module to full list of things to attach
865
 
                    if (!skip) {
866
 
                        r.push(name);
867
 
                    }
868
 
 
869
 
                    // only attach a module once
870
 
                    if (used[name]) {
871
 
                        return;
872
 
                    }
873
 
 
874
 
                    var m = mods[name], req, use;
875
 
 
876
 
                    if (m) {
877
 
                        used[name] = true;
878
 
                        req = m.details.requires;
879
 
                        use = m.details.use;
880
 
                    } else {
881
 
                        // CSS files don't register themselves, see if it has
882
 
                        // been loaded
883
 
                        if (!G_ENV._loaded[VERSION][name]) {
884
 
                            missing.push(name);
885
 
                        } else {
886
 
                            used[name] = true; // probably css
887
 
                        }
888
 
                    }
889
 
 
890
 
                    // make sure requirements are attached
891
 
                    if (req && req.length) {
892
 
                        process(req);
893
 
                    }
894
 
 
895
 
                    // make sure we grab the submodule dependencies too
896
 
                    if (use && use.length) {
897
 
                        process(use, 1);
898
 
                    }
899
 
                });
900
 
            },
901
 
 
902
 
            handleLoader = function(fromLoader) {
903
 
                var response = fromLoader || {
904
 
                        success: true,
905
 
                        msg: 'not dynamic'
906
 
                    },
907
 
                    redo, origMissing,
908
 
                    ret = true,
909
 
                    data = response.data;
910
 
 
911
 
 
912
 
                Y._loading = false;
913
 
 
914
 
                if (data) {
915
 
                    origMissing = missing;
916
 
                    missing = [];
917
 
                    r = [];
918
 
                    process(data);
919
 
                    redo = missing.length;
920
 
                    if (redo) {
921
 
                        if (missing.sort().join() ==
922
 
                                origMissing.sort().join()) {
923
 
                            redo = false;
924
 
                        }
925
 
                    }
926
 
                }
927
 
 
928
 
                if (redo && data) {
929
 
                    Y._loading = false;
930
 
                    Y._use(args, function() {
931
 
                        Y.log('Nested use callback: ' + data, 'info', 'yui');
932
 
                        if (Y._attach(data)) {
933
 
                            Y._notify(callback, response, data);
934
 
                        }
935
 
                    });
936
 
                } else {
937
 
                    if (data) {
938
 
                        // Y.log('attaching from loader: ' + data, 'info', 'yui');
939
 
                        ret = Y._attach(data);
940
 
                    }
941
 
                    if (ret) {
942
 
                        Y._notify(callback, response, args);
943
 
                    }
944
 
                }
945
 
 
946
 
                if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
947
 
                    Y._use.apply(Y, Y._useQueue.next());
948
 
                }
949
 
 
950
 
            };
951
 
 
952
 
// Y.log(Y.id + ': use called: ' + a + ' :: ' + callback, 'info', 'yui');
953
 
 
954
 
        // YUI().use('*'); // bind everything available
955
 
        if (firstArg === '*') {
956
 
            ret = Y._attach(Y.Object.keys(mods));
957
 
            if (ret) {
958
 
                handleLoader();
959
 
            }
960
 
            return Y;
961
 
        }
962
 
 
963
 
        // Y.log('before loader requirements: ' + args, 'info', 'yui');
964
 
 
965
 
        // use loader to expand dependencies and sort the
966
 
        // requirements if it is available.
967
 
        if (boot && Y.Loader && args.length) {
968
 
            loader = getLoader(Y);
969
 
            loader.require(args);
970
 
            loader.ignoreRegistered = true;
971
 
            loader.calculate(null, (fetchCSS) ? null : 'js');
972
 
            args = loader.sorted;
973
 
        }
974
 
 
975
 
        // process each requirement and any additional requirements
976
 
        // the module metadata specifies
977
 
        process(args);
978
 
 
979
 
        len = missing.length;
980
 
 
981
 
        if (len) {
982
 
            missing = Y.Object.keys(YArray.hash(missing));
983
 
            len = missing.length;
984
 
Y.log('Modules missing: ' + missing + ', ' + missing.length, 'info', 'yui');
985
 
        }
986
 
 
987
 
 
988
 
        // dynamic load
989
 
        if (boot && len && Y.Loader) {
990
 
// Y.log('Using loader to fetch missing deps: ' + missing, 'info', 'yui');
991
 
            Y.log('Using Loader', 'info', 'yui');
992
 
            Y._loading = true;
993
 
            loader = getLoader(Y);
994
 
            loader.onEnd = handleLoader;
995
 
            loader.context = Y;
996
 
            loader.data = args;
997
 
            loader.ignoreRegistered = false;
998
 
            loader.require(args);
999
 
            loader.insert(null, (fetchCSS) ? null : 'js');
1000
 
            // loader.partial(missing, (fetchCSS) ? null : 'js');
1001
 
 
1002
 
        } else if (len && Y.config.use_rls && !YUI.Env.rls_enabled) {
1003
 
 
1004
 
            G_ENV._rls_queue = G_ENV._rls_queue || new Y.Queue();
1005
 
 
1006
 
            // server side loader service
1007
 
            handleRLS = function(instance, argz) {
1008
 
 
1009
 
                var rls_end = function(o) {
1010
 
                    handleLoader(o);
1011
 
                    instance.rls_advance();
1012
 
                },
1013
 
                rls_url = instance._rls(argz);
1014
 
 
1015
 
                if (rls_url) {
1016
 
                    Y.log('Fetching RLS url', 'info', 'rls');
1017
 
                    instance.rls_oncomplete(function(o) {
1018
 
                        rls_end(o);
1019
 
                    });
1020
 
                    instance.Get.script(rls_url, {
1021
 
                        data: argz,
1022
 
                        timeout: instance.config.rls_timeout,
1023
 
                        onFailure: instance.rls_handleFailure,
1024
 
                        onTimeout: instance.rls_handleTimeout
1025
 
                    });
1026
 
                } else {
1027
 
                    rls_end({
1028
 
                        success: true,
1029
 
                        data: argz
1030
 
                    });
1031
 
                }
1032
 
            };
1033
 
 
1034
 
            G_ENV._rls_queue.add(function() {
1035
 
                Y.log('executing queued rls request', 'info', 'rls');
1036
 
                G_ENV._rls_in_progress = true;
1037
 
                Y.rls_callback = callback;
1038
 
                Y.rls_locals(Y, args, handleRLS);
1039
 
            });
1040
 
 
1041
 
            if (!G_ENV._rls_in_progress && G_ENV._rls_queue.size()) {
1042
 
                G_ENV._rls_queue.next()();
1043
 
            }
1044
 
 
1045
 
        } else if (boot && len && Y.Get && !Env.bootstrapped) {
1046
 
 
1047
 
            Y._loading = true;
1048
 
 
1049
 
            handleBoot = function() {
1050
 
                Y._loading = false;
1051
 
                queue.running = false;
1052
 
                Env.bootstrapped = true;
1053
 
                G_ENV._bootstrapping = false;
1054
 
                if (Y._attach(['loader'])) {
1055
 
                    Y._use(args, callback);
1056
 
                }
1057
 
            };
1058
 
 
1059
 
            if (G_ENV._bootstrapping) {
1060
 
Y.log('Waiting for loader', 'info', 'yui');
1061
 
                queue.add(handleBoot);
1062
 
            } else {
1063
 
                G_ENV._bootstrapping = true;
1064
 
Y.log('Fetching loader: ' + config.base + config.loaderPath, 'info', 'yui');
1065
 
                Y.Get.script(config.base + config.loaderPath, {
1066
 
                    onEnd: handleBoot
1067
 
                });
1068
 
            }
1069
 
 
1070
 
        } else {
1071
 
            Y.log('Attaching available dependencies: ' + args, 'info', 'yui');
1072
 
            ret = Y._attach(args);
1073
 
            if (ret) {
1074
 
                handleLoader();
1075
 
            }
1076
 
        }
1077
 
 
1078
 
        return Y;
1079
 
    },
1080
 
 
1081
 
 
1082
 
    /**
1083
 
    Adds a namespace object onto the YUI global if called statically.
1084
 
 
1085
 
        // creates YUI.your.namespace.here as nested objects
1086
 
        YUI.namespace("your.namespace.here");
1087
 
 
1088
 
    If called as a method on a YUI <em>instance</em>, it creates the
1089
 
    namespace on the instance.
1090
 
 
1091
 
         // creates Y.property.package
1092
 
         Y.namespace("property.package");
1093
 
    
1094
 
    Dots in the input string cause `namespace` to create nested objects for
1095
 
    each token. If any part of the requested namespace already exists, the
1096
 
    current object will be left in place.  This allows multiple calls to
1097
 
    `namespace` to preserve existing namespaced properties.
1098
 
    
1099
 
    If the first token in the namespace string is "YAHOO", the token is
1100
 
    discarded.
1101
 
 
1102
 
    Be careful with namespace tokens. Reserved words may work in some browsers
1103
 
    and not others. For instance, the following will fail in some browsers
1104
 
    because the supported version of JavaScript reserves the word "long":
1105
 
    
1106
 
         Y.namespace("really.long.nested.namespace");
1107
 
    
1108
 
    @method namespace
1109
 
    @param  {String} namespace* namespaces to create.
1110
 
    @return {Object}  A reference to the last namespace object created.
1111
 
    **/
1112
 
    namespace: function() {
1113
 
        var a = arguments, o = this, i = 0, j, d, arg;
1114
 
        for (; i < a.length; i++) {
1115
 
            // d = ('' + a[i]).split('.');
1116
 
            arg = a[i];
1117
 
            if (arg.indexOf(PERIOD)) {
1118
 
                d = arg.split(PERIOD);
1119
 
                for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
1120
 
                    o[d[j]] = o[d[j]] || {};
1121
 
                    o = o[d[j]];
1122
 
                }
1123
 
            } else {
1124
 
                o[arg] = o[arg] || {};
1125
 
            }
1126
 
        }
1127
 
        return o;
1128
 
    },
1129
 
 
1130
 
    // this is replaced if the log module is included
1131
 
    log: NOOP,
1132
 
    message: NOOP,
1133
 
    // this is replaced if the dump module is included
1134
 
    dump: function (o) { return ''+o; },
1135
 
 
1136
 
    /**
1137
 
     * Report an error.  The reporting mechanism is controled by
1138
 
     * the `throwFail` configuration attribute.  If throwFail is
1139
 
     * not specified, the message is written to the Logger, otherwise
1140
 
     * a JS error is thrown
1141
 
     * @method error
1142
 
     * @param msg {String} the error message.
1143
 
     * @param e {Error|String} Optional JS error that was caught, or an error string.
1144
 
     * @param data Optional additional info
1145
 
     * and `throwFail` is specified, this error will be re-thrown.
1146
 
     * @return {YUI} this YUI instance.
1147
 
     */
1148
 
    error: function(msg, e, data) {
1149
 
 
1150
 
        var Y = this, ret;
1151
 
 
1152
 
        if (Y.config.errorFn) {
1153
 
            ret = Y.config.errorFn.apply(Y, arguments);
1154
 
        }
1155
 
 
1156
 
        if (Y.config.throwFail && !ret) {
1157
 
            throw (e || new Error(msg));
1158
 
        } else {
1159
 
            Y.message(msg, 'error'); // don't scrub this one
1160
 
        }
1161
 
 
1162
 
        return Y;
1163
 
    },
1164
 
 
1165
 
    /**
1166
 
     * Generate an id that is unique among all YUI instances
1167
 
     * @method guid
1168
 
     * @param pre {String} optional guid prefix.
1169
 
     * @return {String} the guid.
1170
 
     */
1171
 
    guid: function(pre) {
1172
 
        var id = this.Env._guidp + '_' + (++this.Env._uidx);
1173
 
        return (pre) ? (pre + id) : id;
1174
 
    },
1175
 
 
1176
 
    /**
1177
 
     * Returns a `guid` associated with an object.  If the object
1178
 
     * does not have one, a new one is created unless `readOnly`
1179
 
     * is specified.
1180
 
     * @method stamp
1181
 
     * @param o {Object} The object to stamp.
1182
 
     * @param readOnly {Boolean} if `true`, a valid guid will only
1183
 
     * be returned if the object has one assigned to it.
1184
 
     * @return {String} The object's guid or null.
1185
 
     */
1186
 
    stamp: function(o, readOnly) {
1187
 
        var uid;
1188
 
        if (!o) {
1189
 
            return o;
1190
 
        }
1191
 
 
1192
 
        // IE generates its own unique ID for dom nodes
1193
 
        // The uniqueID property of a document node returns a new ID
1194
 
        if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
1195
 
            uid = o.uniqueID;
1196
 
        } else {
1197
 
            uid = (typeof o === 'string') ? o : o._yuid;
1198
 
        }
1199
 
 
1200
 
        if (!uid) {
1201
 
            uid = this.guid();
1202
 
            if (!readOnly) {
1203
 
                try {
1204
 
                    o._yuid = uid;
1205
 
                } catch (e) {
1206
 
                    uid = null;
1207
 
                }
1208
 
            }
1209
 
        }
1210
 
        return uid;
1211
 
    },
1212
 
 
1213
 
    /**
1214
 
     * Destroys the YUI instance
1215
 
     * @method destroy
1216
 
     * @since 3.3.0
1217
 
     */
1218
 
    destroy: function() {
1219
 
        var Y = this;
1220
 
        if (Y.Event) {
1221
 
            Y.Event._unload();
1222
 
        }
1223
 
        delete instances[Y.id];
1224
 
        delete Y.Env;
1225
 
        delete Y.config;
1226
 
    }
1227
 
 
1228
 
    /**
1229
 
     * instanceof check for objects that works around
1230
 
     * memory leak in IE when the item tested is
1231
 
     * window/document
1232
 
     * @method instanceOf
1233
 
     * @since 3.3.0
1234
 
     */
1235
 
};
1236
 
 
1237
 
 
1238
 
 
1239
 
    YUI.prototype = proto;
1240
 
 
1241
 
    // inheritance utilities are not available yet
1242
 
    for (prop in proto) {
1243
 
        if (proto.hasOwnProperty(prop)) {
1244
 
            YUI[prop] = proto[prop];
1245
 
        }
1246
 
    }
1247
 
 
1248
 
    // set up the environment
1249
 
    YUI._init();
1250
 
 
1251
 
    if (hasWin) {
1252
 
        // add a window load event at load time so we can capture
1253
 
        // the case where it fires before dynamic loading is
1254
 
        // complete.
1255
 
        add(window, 'load', handleLoad);
1256
 
    } else {
1257
 
        handleLoad();
1258
 
    }
1259
 
 
1260
 
    YUI.Env.add = add;
1261
 
    YUI.Env.remove = remove;
1262
 
 
1263
 
    /*global exports*/
1264
 
    // Support the CommonJS method for exporting our single global
1265
 
    if (typeof exports == 'object') {
1266
 
        exports.YUI = YUI;
1267
 
    }
1268
 
 
1269
 
}());
1270
 
 
1271
 
 
1272
 
/**
1273
 
 * The config object contains all of the configuration options for
1274
 
 * the `YUI` instance.  This object is supplied by the implementer
1275
 
 * when instantiating a `YUI` instance.  Some properties have default
1276
 
 * values if they are not supplied by the implementer.  This should
1277
 
 * not be updated directly because some values are cached.  Use
1278
 
 * `applyConfig()` to update the config object on a YUI instance that
1279
 
 * has already been configured.
1280
 
 *
1281
 
 * @class config
1282
 
 * @static
1283
 
 */
1284
 
 
1285
 
/**
1286
 
 * Allows the YUI seed file to fetch the loader component and library
1287
 
 * metadata to dynamically load additional dependencies.
1288
 
 *
1289
 
 * @property bootstrap
1290
 
 * @type boolean
1291
 
 * @default true
1292
 
 */
1293
 
 
1294
 
/**
1295
 
 * Log to the browser console if debug is on and the browser has a
1296
 
 * supported console.
1297
 
 *
1298
 
 * @property useBrowserConsole
1299
 
 * @type boolean
1300
 
 * @default true
1301
 
 */
1302
 
 
1303
 
/**
1304
 
 * A hash of log sources that should be logged.  If specified, only
1305
 
 * log messages from these sources will be logged.
1306
 
 *
1307
 
 * @property logInclude
1308
 
 * @type object
1309
 
 */
1310
 
 
1311
 
/**
1312
 
 * A hash of log sources that should be not be logged.  If specified,
1313
 
 * all sources are logged if not on this list.
1314
 
 *
1315
 
 * @property logExclude
1316
 
 * @type object
1317
 
 */
1318
 
 
1319
 
/**
1320
 
 * Set to true if the yui seed file was dynamically loaded in
1321
 
 * order to bootstrap components relying on the window load event
1322
 
 * and the `domready` custom event.
1323
 
 *
1324
 
 * @property injected
1325
 
 * @type boolean
1326
 
 * @default false
1327
 
 */
1328
 
 
1329
 
/**
1330
 
 * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error.
1331
 
 * Otherwise the failure is logged.
1332
 
 *
1333
 
 * @property throwFail
1334
 
 * @type boolean
1335
 
 * @default true
1336
 
 */
1337
 
 
1338
 
/**
1339
 
 * The window/frame that this instance should operate in.
1340
 
 *
1341
 
 * @property win
1342
 
 * @type Window
1343
 
 * @default the window hosting YUI
1344
 
 */
1345
 
 
1346
 
/**
1347
 
 * The document associated with the 'win' configuration.
1348
 
 *
1349
 
 * @property doc
1350
 
 * @type Document
1351
 
 * @default the document hosting YUI
1352
 
 */
1353
 
 
1354
 
/**
1355
 
 * A list of modules that defines the YUI core (overrides the default).
1356
 
 *
1357
 
 * @property core
1358
 
 * @type string[]
1359
 
 */
1360
 
 
1361
 
/**
1362
 
 * A list of languages in order of preference. This list is matched against
1363
 
 * the list of available languages in modules that the YUI instance uses to
1364
 
 * determine the best possible localization of language sensitive modules.
1365
 
 * Languages are represented using BCP 47 language tags, such as "en-GB" for
1366
 
 * English as used in the United Kingdom, or "zh-Hans-CN" for simplified
1367
 
 * Chinese as used in China. The list can be provided as a comma-separated
1368
 
 * list or as an array.
1369
 
 *
1370
 
 * @property lang
1371
 
 * @type string|string[]
1372
 
 */
1373
 
 
1374
 
/**
1375
 
 * The default date format
1376
 
 * @property dateFormat
1377
 
 * @type string
1378
 
 * @deprecated use configuration in `DataType.Date.format()` instead.
1379
 
 */
1380
 
 
1381
 
/**
1382
 
 * The default locale
1383
 
 * @property locale
1384
 
 * @type string
1385
 
 * @deprecated use `config.lang` instead.
1386
 
 */
1387
 
 
1388
 
/**
1389
 
 * The default interval when polling in milliseconds.
1390
 
 * @property pollInterval
1391
 
 * @type int
1392
 
 * @default 20
1393
 
 */
1394
 
 
1395
 
/**
1396
 
 * The number of dynamic nodes to insert by default before
1397
 
 * automatically removing them.  This applies to script nodes
1398
 
 * because removing the node will not make the evaluated script
1399
 
 * unavailable.  Dynamic CSS is not auto purged, because removing
1400
 
 * a linked style sheet will also remove the style definitions.
1401
 
 * @property purgethreshold
1402
 
 * @type int
1403
 
 * @default 20
1404
 
 */
1405
 
 
1406
 
/**
1407
 
 * The default interval when polling in milliseconds.
1408
 
 * @property windowResizeDelay
1409
 
 * @type int
1410
 
 * @default 40
1411
 
 */
1412
 
 
1413
 
/**
1414
 
 * Base directory for dynamic loading
1415
 
 * @property base
1416
 
 * @type string
1417
 
 */
1418
 
 
1419
 
/*
1420
 
 * The secure base dir (not implemented)
1421
 
 * For dynamic loading.
1422
 
 * @property secureBase
1423
 
 * @type string
1424
 
 */
1425
 
 
1426
 
/**
1427
 
 * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`
1428
 
 * For dynamic loading.
1429
 
 * @property comboBase
1430
 
 * @type string
1431
 
 */
1432
 
 
1433
 
/**
1434
 
 * The root path to prepend to module path for the combo service.
1435
 
 * Ex: 3.0.0b1/build/
1436
 
 * For dynamic loading.
1437
 
 * @property root
1438
 
 * @type string
1439
 
 */
1440
 
 
1441
 
/**
1442
 
 * A filter to apply to result urls.  This filter will modify the default
1443
 
 * path for all modules.  The default path for the YUI library is the
1444
 
 * minified version of the files (e.g., event-min.js).  The filter property
1445
 
 * can be a predefined filter or a custom filter.  The valid predefined
1446
 
 * filters are:
1447
 
 * <dl>
1448
 
 *  <dt>DEBUG</dt>
1449
 
 *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
1450
 
 *      This option will automatically include the Logger widget</dd>
1451
 
 *  <dt>RAW</dt>
1452
 
 *  <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
1453
 
 * </dl>
1454
 
 * You can also define a custom filter, which must be an object literal
1455
 
 * containing a search expression and a replace string:
1456
 
 * 
1457
 
 *      myFilter: {
1458
 
 *          'searchExp': "-min\\.js",
1459
 
 *          'replaceStr': "-debug.js"
1460
 
 *      }
1461
 
 *
1462
 
 * For dynamic loading.
1463
 
 *
1464
 
 * @property filter
1465
 
 * @type string|object
1466
 
 */
1467
 
 
1468
 
/**
1469
 
 * The `skin` config let's you configure application level skin
1470
 
 * customizations.  It contains the following attributes which
1471
 
 * can be specified to override the defaults:
1472
 
 *
1473
 
 *      // The default skin, which is automatically applied if not
1474
 
 *      // overriden by a component-specific skin definition.
1475
 
 *      // Change this in to apply a different skin globally
1476
 
 *      defaultSkin: 'sam',
1477
 
 *
1478
 
 *      // This is combined with the loader base property to get
1479
 
 *      // the default root directory for a skin.
1480
 
 *      base: 'assets/skins/',
1481
 
 *
1482
 
 *      // Any component-specific overrides can be specified here,
1483
 
 *      // making it possible to load different skins for different
1484
 
 *      // components.  It is possible to load more than one skin
1485
 
 *      // for a given component as well.
1486
 
 *      overrides: {
1487
 
 *          slider: ['capsule', 'round']
1488
 
 *      }
1489
 
 *
1490
 
 * For dynamic loading.
1491
 
 *
1492
 
 *  @property skin
1493
 
 */
1494
 
 
1495
 
/**
1496
 
 * Hash of per-component filter specification.  If specified for a given
1497
 
 * component, this overrides the filter config.
1498
 
 *
1499
 
 * For dynamic loading.
1500
 
 *
1501
 
 * @property filters
1502
 
 */
1503
 
 
1504
 
/**
1505
 
 * Use the YUI combo service to reduce the number of http connections
1506
 
 * required to load your dependencies.  Turning this off will
1507
 
 * disable combo handling for YUI and all module groups configured
1508
 
 * with a combo service.
1509
 
 *
1510
 
 * For dynamic loading.
1511
 
 *
1512
 
 * @property combine
1513
 
 * @type boolean
1514
 
 * @default true if 'base' is not supplied, false if it is.
1515
 
 */
1516
 
 
1517
 
/**
1518
 
 * A list of modules that should never be dynamically loaded
1519
 
 *
1520
 
 * @property ignore
1521
 
 * @type string[]
1522
 
 */
1523
 
 
1524
 
/**
1525
 
 * A list of modules that should always be loaded when required, even if already
1526
 
 * present on the page.
1527
 
 *
1528
 
 * @property force
1529
 
 * @type string[]
1530
 
 */
1531
 
 
1532
 
/**
1533
 
 * Node or id for a node that should be used as the insertion point for new
1534
 
 * nodes.  For dynamic loading.
1535
 
 *
1536
 
 * @property insertBefore
1537
 
 * @type string
1538
 
 */
1539
 
 
1540
 
/**
1541
 
 * Object literal containing attributes to add to dynamically loaded script
1542
 
 * nodes.
1543
 
 * @property jsAttributes
1544
 
 * @type string
1545
 
 */
1546
 
 
1547
 
/**
1548
 
 * Object literal containing attributes to add to dynamically loaded link
1549
 
 * nodes.
1550
 
 * @property cssAttributes
1551
 
 * @type string
1552
 
 */
1553
 
 
1554
 
/**
1555
 
 * Number of milliseconds before a timeout occurs when dynamically
1556
 
 * loading nodes. If not set, there is no timeout.
1557
 
 * @property timeout
1558
 
 * @type int
1559
 
 */
1560
 
 
1561
 
/**
1562
 
 * Callback for the 'CSSComplete' event.  When dynamically loading YUI
1563
 
 * components with CSS, this property fires when the CSS is finished
1564
 
 * loading but script loading is still ongoing.  This provides an
1565
 
 * opportunity to enhance the presentation of a loading page a little
1566
 
 * bit before the entire loading process is done.
1567
 
 *
1568
 
 * @property onCSS
1569
 
 * @type function
1570
 
 */
1571
 
 
1572
 
/**
1573
 
 * A hash of module definitions to add to the list of YUI components.
1574
 
 * These components can then be dynamically loaded side by side with
1575
 
 * YUI via the `use()` method. This is a hash, the key is the module
1576
 
 * name, and the value is an object literal specifying the metdata
1577
 
 * for the module.  See `Loader.addModule` for the supported module
1578
 
 * metadata fields.  Also see groups, which provides a way to
1579
 
 * configure the base and combo spec for a set of modules.
1580
 
 * 
1581
 
 *      modules: {
1582
 
 *          mymod1: {
1583
 
 *              requires: ['node'],
1584
 
 *              fullpath: 'http://myserver.mydomain.com/mymod1/mymod1.js'
1585
 
 *          },
1586
 
 *          mymod2: {
1587
 
 *              requires: ['mymod1'],
1588
 
 *              fullpath: 'http://myserver.mydomain.com/mymod2/mymod2.js'
1589
 
 *          }
1590
 
 *      }
1591
 
 *
1592
 
 * @property modules
1593
 
 * @type object
1594
 
 */
1595
 
 
1596
 
/**
1597
 
 * A hash of module group definitions.  It for each group you
1598
 
 * can specify a list of modules and the base path and
1599
 
 * combo spec to use when dynamically loading the modules.
1600
 
 * 
1601
 
 *      groups: {
1602
 
 *          yui2: {
1603
 
 *              // specify whether or not this group has a combo service
1604
 
 *              combine: true,
1605
 
 * 
1606
 
 *              // the base path for non-combo paths
1607
 
 *              base: 'http://yui.yahooapis.com/2.8.0r4/build/',
1608
 
 * 
1609
 
 *              // the path to the combo service
1610
 
 *              comboBase: 'http://yui.yahooapis.com/combo?',
1611
 
 * 
1612
 
 *              // a fragment to prepend to the path attribute when
1613
 
 *              // when building combo urls
1614
 
 *              root: '2.8.0r4/build/',
1615
 
 * 
1616
 
 *              // the module definitions
1617
 
 *              modules:  {
1618
 
 *                  yui2_yde: {
1619
 
 *                      path: "yahoo-dom-event/yahoo-dom-event.js"
1620
 
 *                  },
1621
 
 *                  yui2_anim: {
1622
 
 *                      path: "animation/animation.js",
1623
 
 *                      requires: ['yui2_yde']
1624
 
 *                  }
1625
 
 *              }
1626
 
 *          }
1627
 
 *      }
1628
 
 * 
1629
 
 * @property groups
1630
 
 * @type object
1631
 
 */
1632
 
 
1633
 
/**
1634
 
 * The loader 'path' attribute to the loader itself.  This is combined
1635
 
 * with the 'base' attribute to dynamically load the loader component
1636
 
 * when boostrapping with the get utility alone.
1637
 
 *
1638
 
 * @property loaderPath
1639
 
 * @type string
1640
 
 * @default loader/loader-min.js
1641
 
 */
1642
 
 
1643
 
/**
1644
 
 * Specifies whether or not YUI().use(...) will attempt to load CSS
1645
 
 * resources at all.  Any truthy value will cause CSS dependencies
1646
 
 * to load when fetching script.  The special value 'force' will
1647
 
 * cause CSS dependencies to be loaded even if no script is needed.
1648
 
 *
1649
 
 * @property fetchCSS
1650
 
 * @type boolean|string
1651
 
 * @default true
1652
 
 */
1653
 
 
1654
 
/**
1655
 
 * The default gallery version to build gallery module urls
1656
 
 * @property gallery
1657
 
 * @type string
1658
 
 * @since 3.1.0
1659
 
 */
1660
 
 
1661
 
/**
1662
 
 * The default YUI 2 version to build yui2 module urls.  This is for
1663
 
 * intrinsic YUI 2 support via the 2in3 project.  Also see the '2in3'
1664
 
 * config for pulling different revisions of the wrapped YUI 2
1665
 
 * modules.
1666
 
 * @since 3.1.0
1667
 
 * @property yui2
1668
 
 * @type string
1669
 
 * @default 2.8.1
1670
 
 */
1671
 
 
1672
 
/**
1673
 
 * The 2in3 project is a deployment of the various versions of YUI 2
1674
 
 * deployed as first-class YUI 3 modules.  Eventually, the wrapper
1675
 
 * for the modules will change (but the underlying YUI 2 code will
1676
 
 * be the same), and you can select a particular version of
1677
 
 * the wrapper modules via this config.
1678
 
 * @since 3.1.0
1679
 
 * @property 2in3
1680
 
 * @type string
1681
 
 * @default 1
1682
 
 */
1683
 
 
1684
 
/**
1685
 
 * Alternative console log function for use in environments without
1686
 
 * a supported native console.  The function is executed in the
1687
 
 * YUI instance context.
1688
 
 * @since 3.1.0
1689
 
 * @property logFn
1690
 
 * @type Function
1691
 
 */
1692
 
 
1693
 
/**
1694
 
 * A callback to execute when Y.error is called.  It receives the
1695
 
 * error message and an javascript error object if Y.error was
1696
 
 * executed because a javascript error was caught.  The function
1697
 
 * is executed in the YUI instance context.
1698
 
 *
1699
 
 * @since 3.2.0
1700
 
 * @property errorFn
1701
 
 * @type Function
1702
 
 */
1703
 
 
1704
 
/**
1705
 
 * A callback to execute when the loader fails to load one or
1706
 
 * more resource.  This could be because of a script load
1707
 
 * failure.  It can also fail if a javascript module fails
1708
 
 * to register itself, but only when the 'requireRegistration'
1709
 
 * is true.  If this function is defined, the use() callback will
1710
 
 * only be called when the loader succeeds, otherwise it always
1711
 
 * executes unless there was a javascript error when attaching
1712
 
 * a module.
1713
 
 *
1714
 
 * @since 3.3.0
1715
 
 * @property loadErrorFn
1716
 
 * @type Function
1717
 
 */
1718
 
 
1719
 
/**
1720
 
 * When set to true, the YUI loader will expect that all modules
1721
 
 * it is responsible for loading will be first-class YUI modules
1722
 
 * that register themselves with the YUI global.  If this is
1723
 
 * set to true, loader will fail if the module registration fails
1724
 
 * to happen after the script is loaded.
1725
 
 *
1726
 
 * @since 3.3.0
1727
 
 * @property requireRegistration
1728
 
 * @type boolean
1729
 
 * @default false
1730
 
 */
1731
 
 
1732
 
/**
1733
 
 * Cache serviced use() requests.
1734
 
 * @since 3.3.0
1735
 
 * @property cacheUse
1736
 
 * @type boolean
1737
 
 * @default true
1738
 
 * @deprecated no longer used
1739
 
 */
1740
 
 
1741
 
/**
1742
 
 * The parameter defaults for the remote loader service. **Requires the rls seed file.** The properties that are supported:
1743
 
 * 
1744
 
 *  * `m`: comma separated list of module requirements.  This
1745
 
 *    must be the param name even for custom implemetations.
1746
 
 *  * `v`: the version of YUI to load.  Defaults to the version
1747
 
 *    of YUI that is being used.
1748
 
 *  * `gv`: the version of the gallery to load (see the gallery config)
1749
 
 *  * `env`: comma separated list of modules already on the page.
1750
 
 *      this must be the param name even for custom implemetations.
1751
 
 *  * `lang`: the languages supported on the page (see the lang config)
1752
 
 *  * `'2in3v'`:  the version of the 2in3 wrapper to use (see the 2in3 config).
1753
 
 *  * `'2v'`: the version of yui2 to use in the yui 2in3 wrappers
1754
 
 *  * `filt`: a filter def to apply to the urls (see the filter config).
1755
 
 *  * `filts`: a list of custom filters to apply per module
1756
 
 *  * `tests`: this is a map of conditional module test function id keys
1757
 
 * with the values of 1 if the test passes, 0 if not.  This must be
1758
 
 * the name of the querystring param in custom templates.
1759
 
 *
1760
 
 * @since 3.2.0
1761
 
 * @property rls
1762
 
 * @type {Object}
1763
 
 */
1764
 
 
1765
 
/**
1766
 
 * The base path to the remote loader service. **Requires the rls seed file.**
1767
 
 *
1768
 
 * @since 3.2.0
1769
 
 * @property rls_base
1770
 
 * @type {String}
1771
 
 */
1772
 
 
1773
 
/**
1774
 
 * The template to use for building the querystring portion
1775
 
 * of the remote loader service url.  The default is determined
1776
 
 * by the rls config -- each property that has a value will be
1777
 
 * represented. **Requires the rls seed file.**
1778
 
 * 
1779
 
 * @since 3.2.0
1780
 
 * @property rls_tmpl
1781
 
 * @type {String}
1782
 
 * @example
1783
 
 *      m={m}&v={v}&env={env}&lang={lang}&filt={filt}&tests={tests}
1784
 
 *
1785
 
 */
1786
 
 
1787
 
/**
1788
 
 * Configure the instance to use a remote loader service instead of
1789
 
 * the client loader. **Requires the rls seed file.**
1790
 
 *
1791
 
 * @since 3.2.0
1792
 
 * @property use_rls
1793
 
 * @type {Boolean}
1794
 
 */
1795
 
YUI.add('yui-base', function(Y) {
1796
 
 
1797
 
/*
1798
 
 * YUI stub
1799
 
 * @module yui
1800
 
 * @submodule yui-base
1801
 
 */
1802
 
/**
1803
 
 * The YUI module contains the components required for building the YUI
1804
 
 * seed file.  This includes the script loading mechanism, a simple queue,
1805
 
 * and the core utilities for the library.
1806
 
 * @module yui
1807
 
 * @submodule yui-base
1808
 
 */
1809
 
 
1810
 
/**
1811
 
 * Provides core language utilites and extensions used throughout YUI.
1812
 
 *
1813
 
 * @class Lang
1814
 
 * @static
1815
 
 */
1816
 
 
1817
 
var L = Y.Lang || (Y.Lang = {}),
1818
 
 
1819
 
STRING_PROTO = String.prototype,
1820
 
TOSTRING     = Object.prototype.toString,
1821
 
 
1822
 
TYPES = {
1823
 
    'undefined'        : 'undefined',
1824
 
    'number'           : 'number',
1825
 
    'boolean'          : 'boolean',
1826
 
    'string'           : 'string',
1827
 
    '[object Function]': 'function',
1828
 
    '[object RegExp]'  : 'regexp',
1829
 
    '[object Array]'   : 'array',
1830
 
    '[object Date]'    : 'date',
1831
 
    '[object Error]'   : 'error'
1832
 
},
1833
 
 
1834
 
SUBREGEX  = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
1835
 
TRIMREGEX = /^\s+|\s+$/g,
1836
 
 
1837
 
// If either MooTools or Prototype is on the page, then there's a chance that we
1838
 
// can't trust "native" language features to actually be native. When this is
1839
 
// the case, we take the safe route and fall back to our own non-native
1840
 
// implementation.
1841
 
win           = Y.config.win,
1842
 
unsafeNatives = win && !!(win.MooTools || win.Prototype);
1843
 
 
1844
 
/**
1845
 
 * Determines whether or not the provided item is an array.
1846
 
 *
1847
 
 * Returns `false` for array-like collections such as the function `arguments`
1848
 
 * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
1849
 
 * test for an array-like collection.
1850
 
 *
1851
 
 * @method isArray
1852
 
 * @param o The object to test.
1853
 
 * @return {boolean} true if o is an array.
1854
 
 * @static
1855
 
 */
1856
 
L.isArray = (!unsafeNatives && Array.isArray) || function (o) {
1857
 
    return L.type(o) === 'array';
1858
 
};
1859
 
 
1860
 
/**
1861
 
 * Determines whether or not the provided item is a boolean.
1862
 
 * @method isBoolean
1863
 
 * @static
1864
 
 * @param o The object to test.
1865
 
 * @return {boolean} true if o is a boolean.
1866
 
 */
1867
 
L.isBoolean = function(o) {
1868
 
    return typeof o === 'boolean';
1869
 
};
1870
 
 
1871
 
/**
1872
 
 * <p>
1873
 
 * Determines whether or not the provided item is a function.
1874
 
 * Note: Internet Explorer thinks certain functions are objects:
1875
 
 * </p>
1876
 
 *
1877
 
 * <pre>
1878
 
 * var obj = document.createElement("object");
1879
 
 * Y.Lang.isFunction(obj.getAttribute) // reports false in IE
1880
 
 * &nbsp;
1881
 
 * var input = document.createElement("input"); // append to body
1882
 
 * Y.Lang.isFunction(input.focus) // reports false in IE
1883
 
 * </pre>
1884
 
 *
1885
 
 * <p>
1886
 
 * You will have to implement additional tests if these functions
1887
 
 * matter to you.
1888
 
 * </p>
1889
 
 *
1890
 
 * @method isFunction
1891
 
 * @static
1892
 
 * @param o The object to test.
1893
 
 * @return {boolean} true if o is a function.
1894
 
 */
1895
 
L.isFunction = function(o) {
1896
 
    return L.type(o) === 'function';
1897
 
};
1898
 
 
1899
 
/**
1900
 
 * Determines whether or not the supplied item is a date instance.
1901
 
 * @method isDate
1902
 
 * @static
1903
 
 * @param o The object to test.
1904
 
 * @return {boolean} true if o is a date.
1905
 
 */
1906
 
L.isDate = function(o) {
1907
 
    return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
1908
 
};
1909
 
 
1910
 
/**
1911
 
 * Determines whether or not the provided item is null.
1912
 
 * @method isNull
1913
 
 * @static
1914
 
 * @param o The object to test.
1915
 
 * @return {boolean} true if o is null.
1916
 
 */
1917
 
L.isNull = function(o) {
1918
 
    return o === null;
1919
 
};
1920
 
 
1921
 
/**
1922
 
 * Determines whether or not the provided item is a legal number.
1923
 
 * @method isNumber
1924
 
 * @static
1925
 
 * @param o The object to test.
1926
 
 * @return {boolean} true if o is a number.
1927
 
 */
1928
 
L.isNumber = function(o) {
1929
 
    return typeof o === 'number' && isFinite(o);
1930
 
};
1931
 
 
1932
 
/**
1933
 
 * Determines whether or not the provided item is of type object
1934
 
 * or function. Note that arrays are also objects, so
1935
 
 * <code>Y.Lang.isObject([]) === true</code>.
1936
 
 * @method isObject
1937
 
 * @static
1938
 
 * @param o The object to test.
1939
 
 * @param failfn {boolean} fail if the input is a function.
1940
 
 * @return {boolean} true if o is an object.
1941
 
 * @see isPlainObject
1942
 
 */
1943
 
L.isObject = function(o, failfn) {
1944
 
    var t = typeof o;
1945
 
    return (o && (t === 'object' ||
1946
 
        (!failfn && (t === 'function' || L.isFunction(o))))) || false;
1947
 
};
1948
 
 
1949
 
/**
1950
 
 * Determines whether or not the provided item is a string.
1951
 
 * @method isString
1952
 
 * @static
1953
 
 * @param o The object to test.
1954
 
 * @return {boolean} true if o is a string.
1955
 
 */
1956
 
L.isString = function(o) {
1957
 
    return typeof o === 'string';
1958
 
};
1959
 
 
1960
 
/**
1961
 
 * Determines whether or not the provided item is undefined.
1962
 
 * @method isUndefined
1963
 
 * @static
1964
 
 * @param o The object to test.
1965
 
 * @return {boolean} true if o is undefined.
1966
 
 */
1967
 
L.isUndefined = function(o) {
1968
 
    return typeof o === 'undefined';
1969
 
};
1970
 
 
1971
 
/**
1972
 
 * Returns a string without any leading or trailing whitespace.  If
1973
 
 * the input is not a string, the input will be returned untouched.
1974
 
 * @method trim
1975
 
 * @static
1976
 
 * @param s {string} the string to trim.
1977
 
 * @return {string} the trimmed string.
1978
 
 */
1979
 
L.trim = STRING_PROTO.trim ? function(s) {
1980
 
    return s && s.trim ? s.trim() : s;
1981
 
} : function (s) {
1982
 
    try {
1983
 
        return s.replace(TRIMREGEX, '');
1984
 
    } catch (e) {
1985
 
        return s;
1986
 
    }
1987
 
};
1988
 
 
1989
 
/**
1990
 
 * Returns a string without any leading whitespace.
1991
 
 * @method trimLeft
1992
 
 * @static
1993
 
 * @param s {string} the string to trim.
1994
 
 * @return {string} the trimmed string.
1995
 
 */
1996
 
L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
1997
 
    return s.trimLeft();
1998
 
} : function (s) {
1999
 
    return s.replace(/^\s+/, '');
2000
 
};
2001
 
 
2002
 
/**
2003
 
 * Returns a string without any trailing whitespace.
2004
 
 * @method trimRight
2005
 
 * @static
2006
 
 * @param s {string} the string to trim.
2007
 
 * @return {string} the trimmed string.
2008
 
 */
2009
 
L.trimRight = STRING_PROTO.trimRight ? function (s) {
2010
 
    return s.trimRight();
2011
 
} : function (s) {
2012
 
    return s.replace(/\s+$/, '');
2013
 
};
2014
 
 
2015
 
/**
2016
 
 * A convenience method for detecting a legitimate non-null value.
2017
 
 * Returns false for null/undefined/NaN, true for other values,
2018
 
 * including 0/false/''
2019
 
 * @method isValue
2020
 
 * @static
2021
 
 * @param o The item to test.
2022
 
 * @return {boolean} true if it is not null/undefined/NaN || false.
2023
 
 */
2024
 
L.isValue = function(o) {
2025
 
    var t = L.type(o);
2026
 
 
2027
 
    switch (t) {
2028
 
        case 'number':
2029
 
            return isFinite(o);
2030
 
 
2031
 
        case 'null': // fallthru
2032
 
        case 'undefined':
2033
 
            return false;
2034
 
 
2035
 
        default:
2036
 
            return !!t;
2037
 
    }
2038
 
};
2039
 
 
2040
 
/**
2041
 
 * <p>
2042
 
 * Returns a string representing the type of the item passed in.
2043
 
 * </p>
2044
 
 *
2045
 
 * <p>
2046
 
 * Known issues:
2047
 
 * </p>
2048
 
 *
2049
 
 * <ul>
2050
 
 *   <li>
2051
 
 *     <code>typeof HTMLElementCollection</code> returns function in Safari, but
2052
 
 *     <code>Y.type()</code> reports object, which could be a good thing --
2053
 
 *     but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.
2054
 
 *   </li>
2055
 
 * </ul>
2056
 
 *
2057
 
 * @method type
2058
 
 * @param o the item to test.
2059
 
 * @return {string} the detected type.
2060
 
 * @static
2061
 
 */
2062
 
L.type = function(o) {
2063
 
    return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
2064
 
};
2065
 
 
2066
 
/**
2067
 
 * Lightweight version of <code>Y.substitute</code>. Uses the same template
2068
 
 * structure as <code>Y.substitute</code>, but doesn't support recursion,
2069
 
 * auto-object coersion, or formats.
2070
 
 * @method sub
2071
 
 * @param {string} s String to be modified.
2072
 
 * @param {object} o Object containing replacement values.
2073
 
 * @return {string} the substitute result.
2074
 
 * @static
2075
 
 * @since 3.2.0
2076
 
 */
2077
 
L.sub = function(s, o) {
2078
 
    return s.replace ? s.replace(SUBREGEX, function (match, key) {
2079
 
        return L.isUndefined(o[key]) ? match : o[key];
2080
 
    }) : s;
2081
 
};
2082
 
 
2083
 
/**
2084
 
 * Returns the current time in milliseconds.
2085
 
 *
2086
 
 * @method now
2087
 
 * @return {Number} Current time in milliseconds.
2088
 
 * @static
2089
 
 * @since 3.3.0
2090
 
 */
2091
 
L.now = Date.now || function () {
2092
 
    return new Date().getTime();
2093
 
};
2094
 
/**
2095
 
@module yui
2096
 
@submodule yui-base
2097
 
*/
2098
 
 
2099
 
var Lang   = Y.Lang,
2100
 
    Native = Array.prototype,
2101
 
 
2102
 
    hasOwn = Object.prototype.hasOwnProperty;
2103
 
 
2104
 
/**
2105
 
Provides utility methods for working with arrays. Additional array helpers can
2106
 
be found in the `collection` and `array-extras` modules.
2107
 
 
2108
 
`Y.Array(thing)` returns a native array created from _thing_. Depending on
2109
 
_thing_'s type, one of the following will happen:
2110
 
 
2111
 
  * Arrays are returned unmodified unless a non-zero _startIndex_ is
2112
 
    specified.
2113
 
  * Array-like collections (see `Array.test()`) are converted to arrays.
2114
 
  * For everything else, a new array is created with _thing_ as the sole
2115
 
    item.
2116
 
 
2117
 
Note: elements that are also collections, such as `<form>` and `<select>`
2118
 
elements, are not automatically converted to arrays. To force a conversion,
2119
 
pass `true` as the value of the _force_ parameter.
2120
 
 
2121
 
@class Array
2122
 
@constructor
2123
 
@param {Any} thing The thing to arrayify.
2124
 
@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like
2125
 
  collection, a subset of items starting at the specified index will be
2126
 
  returned.
2127
 
@param {Boolean} [force=false] If `true`, _thing_ will be treated as an
2128
 
  array-like collection no matter what.
2129
 
@return {Array} A native array created from _thing_, according to the rules
2130
 
  described above.
2131
 
**/
2132
 
function YArray(thing, startIndex, force) {
2133
 
    var len, result;
2134
 
 
2135
 
    startIndex || (startIndex = 0);
2136
 
 
2137
 
    if (force || YArray.test(thing)) {
2138
 
        // IE throws when trying to slice HTMLElement collections.
2139
 
        try {
2140
 
            return Native.slice.call(thing, startIndex);
2141
 
        } catch (ex) {
2142
 
            result = [];
2143
 
 
2144
 
            for (len = thing.length; startIndex < len; ++startIndex) {
2145
 
                result.push(thing[startIndex]);
2146
 
            }
2147
 
 
2148
 
            return result;
2149
 
        }
2150
 
    }
2151
 
 
2152
 
    return [thing];
2153
 
}
2154
 
 
2155
 
Y.Array = YArray;
2156
 
 
2157
 
/**
2158
 
Dedupes an array of strings, returning an array that's guaranteed to contain
2159
 
only one copy of a given string.
2160
 
 
2161
 
This method differs from `Array.unique()` in that it's optimized for use only
2162
 
with strings, whereas `unique` may be used with other types (but is slower).
2163
 
Using `dedupe()` with non-string values may result in unexpected behavior.
2164
 
 
2165
 
@method dedupe
2166
 
@param {String[]} array Array of strings to dedupe.
2167
 
@return {Array} Deduped copy of _array_.
2168
 
@static
2169
 
@since 3.4.0
2170
 
**/
2171
 
YArray.dedupe = function (array) {
2172
 
    var hash    = {},
2173
 
        results = [],
2174
 
        i, item, len;
2175
 
 
2176
 
    for (i = 0, len = array.length; i < len; ++i) {
2177
 
        item = array[i];
2178
 
 
2179
 
        if (!hasOwn.call(hash, item)) {
2180
 
            hash[item] = 1;
2181
 
            results.push(item);
2182
 
        }
2183
 
    }
2184
 
 
2185
 
    return results;
2186
 
};
2187
 
 
2188
 
/**
2189
 
Executes the supplied function on each item in the array. This method wraps
2190
 
the native ES5 `Array.forEach()` method if available.
2191
 
 
2192
 
@method each
2193
 
@param {Array} array Array to iterate.
2194
 
@param {Function} fn Function to execute on each item in the array. The function
2195
 
  will receive the following arguments:
2196
 
    @param {Any} fn.item Current array item.
2197
 
    @param {Number} fn.index Current array index.
2198
 
    @param {Array} fn.array Array being iterated.
2199
 
@param {Object} [thisObj] `this` object to use when calling _fn_.
2200
 
@return {YUI} The YUI instance.
2201
 
@static
2202
 
**/
2203
 
YArray.each = YArray.forEach = Native.forEach ? function (array, fn, thisObj) {
2204
 
    Native.forEach.call(array || [], fn, thisObj || Y);
2205
 
    return Y;
2206
 
} : function (array, fn, thisObj) {
2207
 
    for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
2208
 
        if (i in array) {
2209
 
            fn.call(thisObj || Y, array[i], i, array);
2210
 
        }
2211
 
    }
2212
 
 
2213
 
    return Y;
2214
 
};
2215
 
 
2216
 
/**
2217
 
Alias for `each()`.
2218
 
 
2219
 
@method forEach
2220
 
@static
2221
 
**/
2222
 
 
2223
 
/**
2224
 
Returns an object using the first array as keys and the second as values. If
2225
 
the second array is not provided, or if it doesn't contain the same number of
2226
 
values as the first array, then `true` will be used in place of the missing
2227
 
values.
2228
 
 
2229
 
@example
2230
 
 
2231
 
    Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
2232
 
    // => {a: 'foo', b: 'bar', c: true}
2233
 
 
2234
 
@method hash
2235
 
@param {String[]} keys Array of strings to use as keys.
2236
 
@param {Array} [values] Array to use as values.
2237
 
@return {Object} Hash using the first array as keys and the second as values.
2238
 
@static
2239
 
**/
2240
 
YArray.hash = function (keys, values) {
2241
 
    var hash = {},
2242
 
        vlen = (values && values.length) || 0,
2243
 
        i, len;
2244
 
 
2245
 
    for (i = 0, len = keys.length; i < len; ++i) {
2246
 
        if (i in keys) {
2247
 
            hash[keys[i]] = vlen > i && i in values ? values[i] : true;
2248
 
        }
2249
 
    }
2250
 
 
2251
 
    return hash;
2252
 
};
2253
 
 
2254
 
/**
2255
 
Returns the index of the first item in the array that's equal (using a strict
2256
 
equality check) to the specified _value_, or `-1` if the value isn't found.
2257
 
 
2258
 
This method wraps the native ES5 `Array.indexOf()` method if available.
2259
 
 
2260
 
@method indexOf
2261
 
@param {Array} array Array to search.
2262
 
@param {Any} value Value to search for.
2263
 
@return {Number} Index of the item strictly equal to _value_, or `-1` if not
2264
 
  found.
2265
 
@static
2266
 
**/
2267
 
YArray.indexOf = Native.indexOf ? function (array, value) {
2268
 
    // TODO: support fromIndex
2269
 
    return Native.indexOf.call(array, value);
2270
 
} : function (array, value) {
2271
 
    for (var i = 0, len = array.length; i < len; ++i) {
2272
 
        if (i in array && array[i] === value) {
2273
 
            return i;
2274
 
        }
2275
 
    }
2276
 
 
2277
 
    return -1;
2278
 
};
2279
 
 
2280
 
/**
2281
 
Numeric sort convenience function.
2282
 
 
2283
 
The native `Array.prototype.sort()` function converts values to strings and
2284
 
sorts them in lexicographic order, which is unsuitable for sorting numeric
2285
 
values. Provide `Array.numericSort` as a custom sort function when you want
2286
 
to sort values in numeric order.
2287
 
 
2288
 
@example
2289
 
 
2290
 
    [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
2291
 
    // => [4, 8, 15, 16, 23, 42]
2292
 
 
2293
 
@method numericSort
2294
 
@param {Number} a First value to compare.
2295
 
@param {Number} b Second value to compare.
2296
 
@return {Number} Difference between _a_ and _b_.
2297
 
@static
2298
 
**/
2299
 
YArray.numericSort = function (a, b) {
2300
 
    return a - b;
2301
 
};
2302
 
 
2303
 
/**
2304
 
Executes the supplied function on each item in the array. Returning a truthy
2305
 
value from the function will stop the processing of remaining items.
2306
 
 
2307
 
@method some
2308
 
@param {Array} array Array to iterate over.
2309
 
@param {Function} fn Function to execute on each item. The function will receive
2310
 
  the following arguments:
2311
 
    @param {Any} fn.value Current array item.
2312
 
    @param {Number} fn.index Current array index.
2313
 
    @param {Array} fn.array Array being iterated over.
2314
 
@param {Object} [thisObj] `this` object to use when calling _fn_.
2315
 
@return {Boolean} `true` if the function returns a truthy value on any of the
2316
 
  items in the array; `false` otherwise.
2317
 
@static
2318
 
**/
2319
 
YArray.some = Native.some ? function (array, fn, thisObj) {
2320
 
    return Native.some.call(array, fn, thisObj);
2321
 
} : function (array, fn, thisObj) {
2322
 
    for (var i = 0, len = array.length; i < len; ++i) {
2323
 
        if (i in array && fn.call(thisObj, array[i], i, array)) {
2324
 
            return true;
2325
 
        }
2326
 
    }
2327
 
 
2328
 
    return false;
2329
 
};
2330
 
 
2331
 
/**
2332
 
Evaluates _obj_ to determine if it's an array, an array-like collection, or
2333
 
something else. This is useful when working with the function `arguments`
2334
 
collection and `HTMLElement` collections.
2335
 
 
2336
 
Note: This implementation doesn't consider elements that are also
2337
 
collections, such as `<form>` and `<select>`, to be array-like.
2338
 
 
2339
 
@method test
2340
 
@param {Object} obj Object to test.
2341
 
@return {Number} A number indicating the results of the test:
2342
 
 
2343
 
  * 0: Neither an array nor an array-like collection.
2344
 
  * 1: Real array.
2345
 
  * 2: Array-like collection.
2346
 
 
2347
 
@static
2348
 
**/
2349
 
YArray.test = function (obj) {
2350
 
    var result = 0;
2351
 
 
2352
 
    if (Lang.isArray(obj)) {
2353
 
        result = 1;
2354
 
    } else if (Lang.isObject(obj)) {
2355
 
        try {
2356
 
            // indexed, but no tagName (element) or alert (window),
2357
 
            // or functions without apply/call (Safari
2358
 
            // HTMLElementCollection bug).
2359
 
            if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {
2360
 
                result = 2;
2361
 
            }
2362
 
        } catch (ex) {}
2363
 
    }
2364
 
 
2365
 
    return result;
2366
 
};
2367
 
/**
2368
 
 * The YUI module contains the components required for building the YUI
2369
 
 * seed file.  This includes the script loading mechanism, a simple queue,
2370
 
 * and the core utilities for the library.
2371
 
 * @module yui
2372
 
 * @submodule yui-base
2373
 
 */
2374
 
 
2375
 
/**
2376
 
 * A simple FIFO queue.  Items are added to the Queue with add(1..n items) and
2377
 
 * removed using next().
2378
 
 *
2379
 
 * @class Queue
2380
 
 * @constructor
2381
 
 * @param {MIXED} item* 0..n items to seed the queue.
2382
 
 */
2383
 
function Queue() {
2384
 
    this._init();
2385
 
    this.add.apply(this, arguments);
2386
 
}
2387
 
 
2388
 
Queue.prototype = {
2389
 
    /**
2390
 
     * Initialize the queue
2391
 
     *
2392
 
     * @method _init
2393
 
     * @protected
2394
 
     */
2395
 
    _init: function() {
2396
 
        /**
2397
 
         * The collection of enqueued items
2398
 
         *
2399
 
         * @property _q
2400
 
         * @type Array
2401
 
         * @protected
2402
 
         */
2403
 
        this._q = [];
2404
 
    },
2405
 
 
2406
 
    /**
2407
 
     * Get the next item in the queue. FIFO support
2408
 
     *
2409
 
     * @method next
2410
 
     * @return {MIXED} the next item in the queue.
2411
 
     */
2412
 
    next: function() {
2413
 
        return this._q.shift();
2414
 
    },
2415
 
 
2416
 
    /**
2417
 
     * Get the last in the queue. LIFO support.
2418
 
     *
2419
 
     * @method last
2420
 
     * @return {MIXED} the last item in the queue.
2421
 
     */
2422
 
    last: function() {
2423
 
        return this._q.pop();
2424
 
    },
2425
 
 
2426
 
    /**
2427
 
     * Add 0..n items to the end of the queue.
2428
 
     *
2429
 
     * @method add
2430
 
     * @param {MIXED} item* 0..n items.
2431
 
     * @return {object} this queue.
2432
 
     */
2433
 
    add: function() {
2434
 
        this._q.push.apply(this._q, arguments);
2435
 
 
2436
 
        return this;
2437
 
    },
2438
 
 
2439
 
    /**
2440
 
     * Returns the current number of queued items.
2441
 
     *
2442
 
     * @method size
2443
 
     * @return {Number} The size.
2444
 
     */
2445
 
    size: function() {
2446
 
        return this._q.length;
2447
 
    }
2448
 
};
2449
 
 
2450
 
Y.Queue = Queue;
2451
 
 
2452
 
YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();
2453
 
 
2454
 
/**
2455
 
The YUI module contains the components required for building the YUI seed file.
2456
 
This includes the script loading mechanism, a simple queue, and the core
2457
 
utilities for the library.
2458
 
 
2459
 
@module yui
2460
 
@submodule yui-base
2461
 
**/
2462
 
 
2463
 
var CACHED_DELIMITER = '__',
2464
 
 
2465
 
    hasOwn   = Object.prototype.hasOwnProperty,
2466
 
    isObject = Y.Lang.isObject;
2467
 
 
2468
 
/**
2469
 
Returns a wrapper for a function which caches the return value of that function,
2470
 
keyed off of the combined string representation of the argument values provided
2471
 
when the wrapper is called.
2472
 
 
2473
 
Calling this function again with the same arguments will return the cached value
2474
 
rather than executing the wrapped function.
2475
 
 
2476
 
Note that since the cache is keyed off of the string representation of arguments
2477
 
passed to the wrapper function, arguments that aren't strings and don't provide
2478
 
a meaningful `toString()` method may result in unexpected caching behavior. For
2479
 
example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
2480
 
string `[object Object]` when used as a cache key.
2481
 
 
2482
 
@method cached
2483
 
@param {Function} source The function to memoize.
2484
 
@param {Object} [cache={}] Object in which to store cached values. You may seed
2485
 
  this object with pre-existing cached values if desired.
2486
 
@param {any} [refetch] If supplied, this value is compared with the cached value
2487
 
  using a `==` comparison. If the values are equal, the wrapped function is
2488
 
  executed again even though a cached value exists.
2489
 
@return {Function} Wrapped function.
2490
 
@for YUI
2491
 
**/
2492
 
Y.cached = function (source, cache, refetch) {
2493
 
    cache || (cache = {});
2494
 
 
2495
 
    return function (arg) {
2496
 
        var key = arguments.length > 1 ?
2497
 
                Array.prototype.join.call(arguments, CACHED_DELIMITER) :
2498
 
                String(arg);
2499
 
 
2500
 
        if (!(key in cache) || (refetch && cache[key] == refetch)) {
2501
 
            cache[key] = source.apply(source, arguments);
2502
 
        }
2503
 
 
2504
 
        return cache[key];
2505
 
    };
2506
 
};
2507
 
 
2508
 
/**
2509
 
Returns a new object containing all of the properties of all the supplied
2510
 
objects. The properties from later objects will overwrite those in earlier
2511
 
objects.
2512
 
 
2513
 
Passing in a single object will create a shallow copy of it. For a deep copy,
2514
 
use `clone()`.
2515
 
 
2516
 
@method merge
2517
 
@param {Object} objects* One or more objects to merge.
2518
 
@return {Object} A new merged object.
2519
 
**/
2520
 
Y.merge = function () {
2521
 
    var args   = arguments,
2522
 
        i      = 0,
2523
 
        len    = args.length,
2524
 
        result = {};
2525
 
 
2526
 
    for (; i < len; ++i) {
2527
 
        Y.mix(result, args[i], true);
2528
 
    }
2529
 
 
2530
 
    return result;
2531
 
};
2532
 
 
2533
 
/**
2534
 
Mixes _supplier_'s properties into _receiver_.
2535
 
 
2536
 
Properties on _receiver_ or _receiver_'s prototype will not be overwritten or
2537
 
shadowed unless the _overwrite_ parameter is `true`, and will not be merged
2538
 
unless the _merge_ parameter is `true`.
2539
 
 
2540
 
In the default mode (0), only properties the supplier owns are copied (prototype
2541
 
properties are not copied). The following copying modes are available:
2542
 
 
2543
 
  * `0`: _Default_. Object to object.
2544
 
  * `1`: Prototype to prototype.
2545
 
  * `2`: Prototype to prototype and object to object.
2546
 
  * `3`: Prototype to object.
2547
 
  * `4`: Object to prototype.
2548
 
 
2549
 
@method mix
2550
 
@param {Function|Object} receiver The object or function to receive the mixed
2551
 
  properties.
2552
 
@param {Function|Object} supplier The object or function supplying the
2553
 
  properties to be mixed.
2554
 
@param {Boolean} [overwrite=false] If `true`, properties that already exist
2555
 
  on the receiver will be overwritten with properties from the supplier.
2556
 
@param {String[]} [whitelist] An array of property names to copy. If
2557
 
  specified, only the whitelisted properties will be copied, and all others
2558
 
  will be ignored.
2559
 
@param {Number} [mode=0] Mix mode to use. See above for available modes.
2560
 
@param {Boolean} [merge=false] If `true`, objects and arrays that already
2561
 
  exist on the receiver will have the corresponding object/array from the
2562
 
  supplier merged into them, rather than being skipped or overwritten. When
2563
 
  both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
2564
 
@return {Function|Object|YUI} The receiver, or the YUI instance if the
2565
 
  specified receiver is falsy.
2566
 
**/
2567
 
Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
2568
 
    var alwaysOverwrite, exists, from, i, key, len, to;
2569
 
 
2570
 
    // If no supplier is given, we return the receiver. If no receiver is given,
2571
 
    // we return Y. Returning Y doesn't make much sense to me, but it's
2572
 
    // grandfathered in for backcompat reasons.
2573
 
    if (!receiver || !supplier) {
2574
 
        return receiver || Y;
2575
 
    }
2576
 
 
2577
 
    if (mode) {
2578
 
        // In mode 2 (prototype to prototype and object to object), we recurse
2579
 
        // once to do the proto to proto mix. The object to object mix will be
2580
 
        // handled later on.
2581
 
        if (mode === 2) {
2582
 
            Y.mix(receiver.prototype, supplier.prototype, overwrite,
2583
 
                    whitelist, 0, merge);
2584
 
        }
2585
 
 
2586
 
        // Depending on which mode is specified, we may be copying from or to
2587
 
        // the prototypes of the supplier and receiver.
2588
 
        from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
2589
 
        to   = mode === 1 || mode === 4 ? receiver.prototype : receiver;
2590
 
 
2591
 
        // If either the supplier or receiver doesn't actually have a
2592
 
        // prototype property, then we could end up with an undefined `from`
2593
 
        // or `to`. If that happens, we abort and return the receiver.
2594
 
        if (!from || !to) {
2595
 
            return receiver;
2596
 
        }
2597
 
    } else {
2598
 
        from = supplier;
2599
 
        to   = receiver;
2600
 
    }
2601
 
 
2602
 
    // If `overwrite` is truthy and `merge` is falsy, then we can skip a
2603
 
    // property existence check on each iteration and save some time.
2604
 
    alwaysOverwrite = overwrite && !merge;
2605
 
 
2606
 
    if (whitelist) {
2607
 
        for (i = 0, len = whitelist.length; i < len; ++i) {
2608
 
            key = whitelist[i];
2609
 
 
2610
 
            // We call `Object.prototype.hasOwnProperty` instead of calling
2611
 
            // `hasOwnProperty` on the object itself, since the object's
2612
 
            // `hasOwnProperty` method may have been overridden or removed.
2613
 
            // Also, some native objects don't implement a `hasOwnProperty`
2614
 
            // method.
2615
 
            if (!hasOwn.call(from, key)) {
2616
 
                continue;
2617
 
            }
2618
 
 
2619
 
            // The `key in to` check here is (sadly) intentional for backwards
2620
 
            // compatibility reasons. It prevents undesired shadowing of
2621
 
            // prototype members on `to`.
2622
 
            exists = alwaysOverwrite ? false : key in to;
2623
 
 
2624
 
            if (merge && exists && isObject(to[key], true)
2625
 
                    && isObject(from[key], true)) {
2626
 
                // If we're in merge mode, and the key is present on both
2627
 
                // objects, and the value on both objects is either an object or
2628
 
                // an array (but not a function), then we recurse to merge the
2629
 
                // `from` value into the `to` value instead of overwriting it.
2630
 
                //
2631
 
                // Note: It's intentional that the whitelist isn't passed to the
2632
 
                // recursive call here. This is legacy behavior that lots of
2633
 
                // code still depends on.
2634
 
                Y.mix(to[key], from[key], overwrite, null, 0, merge);
2635
 
            } else if (overwrite || !exists) {
2636
 
                // We're not in merge mode, so we'll only copy the `from` value
2637
 
                // to the `to` value if we're in overwrite mode or if the
2638
 
                // current key doesn't exist on the `to` object.
2639
 
                to[key] = from[key];
2640
 
            }
2641
 
        }
2642
 
    } else {
2643
 
        for (key in from) {
2644
 
            // The code duplication here is for runtime performance reasons.
2645
 
            // Combining whitelist and non-whitelist operations into a single
2646
 
            // loop or breaking the shared logic out into a function both result
2647
 
            // in worse performance, and Y.mix is critical enough that the byte
2648
 
            // tradeoff is worth it.
2649
 
            if (!hasOwn.call(from, key)) {
2650
 
                continue;
2651
 
            }
2652
 
 
2653
 
            // The `key in to` check here is (sadly) intentional for backwards
2654
 
            // compatibility reasons. It prevents undesired shadowing of
2655
 
            // prototype members on `to`.
2656
 
            exists = alwaysOverwrite ? false : key in to;
2657
 
 
2658
 
            if (merge && exists && isObject(to[key], true)
2659
 
                    && isObject(from[key], true)) {
2660
 
                Y.mix(to[key], from[key], overwrite, null, 0, merge);
2661
 
            } else if (overwrite || !exists) {
2662
 
                to[key] = from[key];
2663
 
            }
2664
 
        }
2665
 
 
2666
 
        // If this is an IE browser with the JScript enumeration bug, force
2667
 
        // enumeration of the buggy properties by making a recursive call with
2668
 
        // the buggy properties as the whitelist.
2669
 
        if (Y.Object._hasEnumBug) {
2670
 
            Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
2671
 
        }
2672
 
    }
2673
 
 
2674
 
    return receiver;
2675
 
};
2676
 
/**
2677
 
 * The YUI module contains the components required for building the YUI
2678
 
 * seed file.  This includes the script loading mechanism, a simple queue,
2679
 
 * and the core utilities for the library.
2680
 
 * @module yui
2681
 
 * @submodule yui-base
2682
 
 */
2683
 
 
2684
 
/**
2685
 
 * Adds utilities to the YUI instance for working with objects.
2686
 
 *
2687
 
 * @class Object
2688
 
 */
2689
 
 
2690
 
var hasOwn = Object.prototype.hasOwnProperty,
2691
 
 
2692
 
// If either MooTools or Prototype is on the page, then there's a chance that we
2693
 
// can't trust "native" language features to actually be native. When this is
2694
 
// the case, we take the safe route and fall back to our own non-native
2695
 
// implementations.
2696
 
win           = Y.config.win,
2697
 
unsafeNatives = win && !!(win.MooTools || win.Prototype),
2698
 
 
2699
 
UNDEFINED, // <-- Note the comma. We're still declaring vars.
2700
 
 
2701
 
/**
2702
 
 * Returns a new object that uses _obj_ as its prototype. This method wraps the
2703
 
 * native ES5 `Object.create()` method if available, but doesn't currently
2704
 
 * pass through `Object.create()`'s second argument (properties) in order to
2705
 
 * ensure compatibility with older browsers.
2706
 
 *
2707
 
 * @method ()
2708
 
 * @param {Object} obj Prototype object.
2709
 
 * @return {Object} New object using _obj_ as its prototype.
2710
 
 * @static
2711
 
 */
2712
 
O = Y.Object = (!unsafeNatives && Object.create) ? function (obj) {
2713
 
    // We currently wrap the native Object.create instead of simply aliasing it
2714
 
    // to ensure consistency with our fallback shim, which currently doesn't
2715
 
    // support Object.create()'s second argument (properties). Once we have a
2716
 
    // safe fallback for the properties arg, we can stop wrapping
2717
 
    // Object.create().
2718
 
    return Object.create(obj);
2719
 
} : (function () {
2720
 
    // Reusable constructor function for the Object.create() shim.
2721
 
    function F() {}
2722
 
 
2723
 
    // The actual shim.
2724
 
    return function (obj) {
2725
 
        F.prototype = obj;
2726
 
        return new F();
2727
 
    };
2728
 
}()),
2729
 
 
2730
 
/**
2731
 
 * Property names that IE doesn't enumerate in for..in loops, even when they
2732
 
 * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
2733
 
 * manually enumerate these properties.
2734
 
 *
2735
 
 * @property _forceEnum
2736
 
 * @type String[]
2737
 
 * @protected
2738
 
 * @static
2739
 
 */
2740
 
forceEnum = O._forceEnum = [
2741
 
    'hasOwnProperty',
2742
 
    'isPrototypeOf',
2743
 
    'propertyIsEnumerable',
2744
 
    'toString',
2745
 
    'toLocaleString',
2746
 
    'valueOf'
2747
 
],
2748
 
 
2749
 
/**
2750
 
 * `true` if this browser has the JScript enumeration bug that prevents
2751
 
 * enumeration of the properties named in the `_forceEnum` array, `false`
2752
 
 * otherwise.
2753
 
 *
2754
 
 * See:
2755
 
 *   - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
2756
 
 *   - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
2757
 
 *
2758
 
 * @property _hasEnumBug
2759
 
 * @type Boolean
2760
 
 * @protected
2761
 
 * @static
2762
 
 */
2763
 
hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
2764
 
 
2765
 
/**
2766
 
 * `true` if this browser incorrectly considers the `prototype` property of
2767
 
 * functions to be enumerable. Currently known to affect Opera 11.50.
2768
 
 *
2769
 
 * @property _hasProtoEnumBug
2770
 
 * @type Boolean
2771
 
 * @protected
2772
 
 * @static
2773
 
 */
2774
 
hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
2775
 
 
2776
 
/**
2777
 
 * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
2778
 
 * exists only on _obj_'s prototype. This is essentially a safer version of
2779
 
 * `obj.hasOwnProperty()`.
2780
 
 *
2781
 
 * @method owns
2782
 
 * @param {Object} obj Object to test.
2783
 
 * @param {String} key Property name to look for.
2784
 
 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2785
 
 * @static
2786
 
 */
2787
 
owns = O.owns = function (obj, key) {
2788
 
    return !!obj && hasOwn.call(obj, key);
2789
 
}; // <-- End of var declarations.
2790
 
 
2791
 
/**
2792
 
 * Alias for `owns()`.
2793
 
 *
2794
 
 * @method hasKey
2795
 
 * @param {Object} obj Object to test.
2796
 
 * @param {String} key Property name to look for.
2797
 
 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2798
 
 * @static
2799
 
 */
2800
 
O.hasKey = owns;
2801
 
 
2802
 
/**
2803
 
 * Returns an array containing the object's enumerable keys. Does not include
2804
 
 * prototype keys or non-enumerable keys.
2805
 
 *
2806
 
 * Note that keys are returned in enumeration order (that is, in the same order
2807
 
 * that they would be enumerated by a `for-in` loop), which may not be the same
2808
 
 * as the order in which they were defined.
2809
 
 *
2810
 
 * This method is an alias for the native ES5 `Object.keys()` method if
2811
 
 * available.
2812
 
 *
2813
 
 * @example
2814
 
 *
2815
 
 *     Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
2816
 
 *     // => ['a', 'b', 'c']
2817
 
 *
2818
 
 * @method keys
2819
 
 * @param {Object} obj An object.
2820
 
 * @return {String[]} Array of keys.
2821
 
 * @static
2822
 
 */
2823
 
O.keys = (!unsafeNatives && Object.keys) || function (obj) {
2824
 
    if (!Y.Lang.isObject(obj)) {
2825
 
        throw new TypeError('Object.keys called on a non-object');
2826
 
    }
2827
 
 
2828
 
    var keys = [],
2829
 
        i, key, len;
2830
 
 
2831
 
    if (hasProtoEnumBug && typeof obj === 'function') {
2832
 
        for (key in obj) {
2833
 
            if (owns(obj, key) && key !== 'prototype') {
2834
 
                keys.push(key);
2835
 
            }
2836
 
        }
2837
 
    } else {
2838
 
        for (key in obj) {
2839
 
            if (owns(obj, key)) {
2840
 
                keys.push(key);
2841
 
            }
2842
 
        }
2843
 
    }
2844
 
 
2845
 
    if (hasEnumBug) {
2846
 
        for (i = 0, len = forceEnum.length; i < len; ++i) {
2847
 
            key = forceEnum[i];
2848
 
 
2849
 
            if (owns(obj, key)) {
2850
 
                keys.push(key);
2851
 
            }
2852
 
        }
2853
 
    }
2854
 
 
2855
 
    return keys;
2856
 
};
2857
 
 
2858
 
/**
2859
 
 * Returns an array containing the values of the object's enumerable keys.
2860
 
 *
2861
 
 * Note that values are returned in enumeration order (that is, in the same
2862
 
 * order that they would be enumerated by a `for-in` loop), which may not be the
2863
 
 * same as the order in which they were defined.
2864
 
 *
2865
 
 * @example
2866
 
 *
2867
 
 *     Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
2868
 
 *     // => ['foo', 'bar', 'baz']
2869
 
 *
2870
 
 * @method values
2871
 
 * @param {Object} obj An object.
2872
 
 * @return {Array} Array of values.
2873
 
 * @static
2874
 
 */
2875
 
O.values = function (obj) {
2876
 
    var keys   = O.keys(obj),
2877
 
        i      = 0,
2878
 
        len    = keys.length,
2879
 
        values = [];
2880
 
 
2881
 
    for (; i < len; ++i) {
2882
 
        values.push(obj[keys[i]]);
2883
 
    }
2884
 
 
2885
 
    return values;
2886
 
};
2887
 
 
2888
 
/**
2889
 
 * Returns the number of enumerable keys owned by an object.
2890
 
 *
2891
 
 * @method size
2892
 
 * @param {Object} obj An object.
2893
 
 * @return {Number} The object's size.
2894
 
 * @static
2895
 
 */
2896
 
O.size = function (obj) {
2897
 
    try {
2898
 
        return O.keys(obj).length;
2899
 
    } catch (ex) {
2900
 
        return 0; // Legacy behavior for non-objects.
2901
 
    }
2902
 
};
2903
 
 
2904
 
/**
2905
 
 * Returns `true` if the object owns an enumerable property with the specified
2906
 
 * value.
2907
 
 *
2908
 
 * @method hasValue
2909
 
 * @param {Object} obj An object.
2910
 
 * @param {any} value The value to search for.
2911
 
 * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
2912
 
 * @static
2913
 
 */
2914
 
O.hasValue = function (obj, value) {
2915
 
    return Y.Array.indexOf(O.values(obj), value) > -1;
2916
 
};
2917
 
 
2918
 
/**
2919
 
 * Executes a function on each enumerable property in _obj_. The function
2920
 
 * receives the value, the key, and the object itself as parameters (in that
2921
 
 * order).
2922
 
 *
2923
 
 * By default, only properties owned by _obj_ are enumerated. To include
2924
 
 * prototype properties, set the _proto_ parameter to `true`.
2925
 
 *
2926
 
 * @method each
2927
 
 * @param {Object} obj Object to enumerate.
2928
 
 * @param {Function} fn Function to execute on each enumerable property.
2929
 
 *   @param {mixed} fn.value Value of the current property.
2930
 
 *   @param {String} fn.key Key of the current property.
2931
 
 *   @param {Object} fn.obj Object being enumerated.
2932
 
 * @param {Object} [thisObj] `this` object to use when calling _fn_.
2933
 
 * @param {Boolean} [proto=false] Include prototype properties.
2934
 
 * @return {YUI} the YUI instance.
2935
 
 * @chainable
2936
 
 * @static
2937
 
 */
2938
 
O.each = function (obj, fn, thisObj, proto) {
2939
 
    var key;
2940
 
 
2941
 
    for (key in obj) {
2942
 
        if (proto || owns(obj, key)) {
2943
 
            fn.call(thisObj || Y, obj[key], key, obj);
2944
 
        }
2945
 
    }
2946
 
 
2947
 
    return Y;
2948
 
};
2949
 
 
2950
 
/**
2951
 
 * Executes a function on each enumerable property in _obj_, but halts if the
2952
 
 * function returns a truthy value. The function receives the value, the key,
2953
 
 * and the object itself as paramters (in that order).
2954
 
 *
2955
 
 * By default, only properties owned by _obj_ are enumerated. To include
2956
 
 * prototype properties, set the _proto_ parameter to `true`.
2957
 
 *
2958
 
 * @method some
2959
 
 * @param {Object} obj Object to enumerate.
2960
 
 * @param {Function} fn Function to execute on each enumerable property.
2961
 
 *   @param {mixed} fn.value Value of the current property.
2962
 
 *   @param {String} fn.key Key of the current property.
2963
 
 *   @param {Object} fn.obj Object being enumerated.
2964
 
 * @param {Object} [thisObj] `this` object to use when calling _fn_.
2965
 
 * @param {Boolean} [proto=false] Include prototype properties.
2966
 
 * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
2967
 
 *   `false` otherwise.
2968
 
 * @static
2969
 
 */
2970
 
O.some = function (obj, fn, thisObj, proto) {
2971
 
    var key;
2972
 
 
2973
 
    for (key in obj) {
2974
 
        if (proto || owns(obj, key)) {
2975
 
            if (fn.call(thisObj || Y, obj[key], key, obj)) {
2976
 
                return true;
2977
 
            }
2978
 
        }
2979
 
    }
2980
 
 
2981
 
    return false;
2982
 
};
2983
 
 
2984
 
/**
2985
 
 * Retrieves the sub value at the provided path,
2986
 
 * from the value object provided.
2987
 
 *
2988
 
 * @method getValue
2989
 
 * @static
2990
 
 * @param o The object from which to extract the property value.
2991
 
 * @param path {Array} A path array, specifying the object traversal path
2992
 
 * from which to obtain the sub value.
2993
 
 * @return {Any} The value stored in the path, undefined if not found,
2994
 
 * undefined if the source is not an object.  Returns the source object
2995
 
 * if an empty path is provided.
2996
 
 */
2997
 
O.getValue = function(o, path) {
2998
 
    if (!Y.Lang.isObject(o)) {
2999
 
        return UNDEFINED;
3000
 
    }
3001
 
 
3002
 
    var i,
3003
 
        p = Y.Array(path),
3004
 
        l = p.length;
3005
 
 
3006
 
    for (i = 0; o !== UNDEFINED && i < l; i++) {
3007
 
        o = o[p[i]];
3008
 
    }
3009
 
 
3010
 
    return o;
3011
 
};
3012
 
 
3013
 
/**
3014
 
 * Sets the sub-attribute value at the provided path on the
3015
 
 * value object.  Returns the modified value object, or
3016
 
 * undefined if the path is invalid.
3017
 
 *
3018
 
 * @method setValue
3019
 
 * @static
3020
 
 * @param o             The object on which to set the sub value.
3021
 
 * @param path {Array}  A path array, specifying the object traversal path
3022
 
 *                      at which to set the sub value.
3023
 
 * @param val {Any}     The new value for the sub-attribute.
3024
 
 * @return {Object}     The modified object, with the new sub value set, or
3025
 
 *                      undefined, if the path was invalid.
3026
 
 */
3027
 
O.setValue = function(o, path, val) {
3028
 
    var i,
3029
 
        p = Y.Array(path),
3030
 
        leafIdx = p.length - 1,
3031
 
        ref = o;
3032
 
 
3033
 
    if (leafIdx >= 0) {
3034
 
        for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
3035
 
            ref = ref[p[i]];
3036
 
        }
3037
 
 
3038
 
        if (ref !== UNDEFINED) {
3039
 
            ref[p[i]] = val;
3040
 
        } else {
3041
 
            return UNDEFINED;
3042
 
        }
3043
 
    }
3044
 
 
3045
 
    return o;
3046
 
};
3047
 
 
3048
 
/**
3049
 
 * Returns `true` if the object has no enumerable properties of its own.
3050
 
 *
3051
 
 * @method isEmpty
3052
 
 * @param {Object} obj An object.
3053
 
 * @return {Boolean} `true` if the object is empty.
3054
 
 * @static
3055
 
 * @since 3.2.0
3056
 
 */
3057
 
O.isEmpty = function (obj) {
3058
 
    return !O.keys(obj).length;
3059
 
};
3060
 
/**
3061
 
 * The YUI module contains the components required for building the YUI seed
3062
 
 * file.  This includes the script loading mechanism, a simple queue, and the
3063
 
 * core utilities for the library.
3064
 
 * @module yui
3065
 
 * @submodule yui-base
3066
 
 */
3067
 
 
3068
 
/**
3069
 
 * YUI user agent detection.
3070
 
 * Do not fork for a browser if it can be avoided.  Use feature detection when
3071
 
 * you can.  Use the user agent as a last resort.  For all fields listed
3072
 
 * as @type float, UA stores a version number for the browser engine,
3073
 
 * 0 otherwise.  This value may or may not map to the version number of
3074
 
 * the browser using the engine.  The value is presented as a float so
3075
 
 * that it can easily be used for boolean evaluation as well as for
3076
 
 * looking for a particular range of versions.  Because of this,
3077
 
 * some of the granularity of the version info may be lost.  The fields that
3078
 
 * are @type string default to null.  The API docs list the values that
3079
 
 * these fields can have.
3080
 
 * @class UA
3081
 
 * @static
3082
 
 */
3083
 
 
3084
 
/**
3085
 
* Static method on `YUI.Env` for parsing a UA string.  Called at instantiation
3086
 
* to populate `Y.UA`.
3087
 
*
3088
 
* @static
3089
 
* @method parseUA
3090
 
* @param {String} [subUA=navigator.userAgent] UA string to parse
3091
 
* @returns {Object} The Y.UA object
3092
 
*/
3093
 
YUI.Env.parseUA = function(subUA) {
3094
 
 
3095
 
    var numberify = function(s) {
3096
 
            var c = 0;
3097
 
            return parseFloat(s.replace(/\./g, function() {
3098
 
                return (c++ == 1) ? '' : '.';
3099
 
            }));
3100
 
        },
3101
 
 
3102
 
        win = Y.config.win,
3103
 
 
3104
 
        nav = win && win.navigator,
3105
 
 
3106
 
        o = {
3107
 
 
3108
 
        /**
3109
 
         * Internet Explorer version number or 0.  Example: 6
3110
 
         * @property ie
3111
 
         * @type float
3112
 
         * @static
3113
 
         */
3114
 
        ie: 0,
3115
 
 
3116
 
        /**
3117
 
         * Opera version number or 0.  Example: 9.2
3118
 
         * @property opera
3119
 
         * @type float
3120
 
         * @static
3121
 
         */
3122
 
        opera: 0,
3123
 
 
3124
 
        /**
3125
 
         * Gecko engine revision number.  Will evaluate to 1 if Gecko
3126
 
         * is detected but the revision could not be found. Other browsers
3127
 
         * will be 0.  Example: 1.8
3128
 
         * <pre>
3129
 
         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
3130
 
         * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
3131
 
         * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
3132
 
         * Firefox 3.0   <-- 1.9
3133
 
         * Firefox 3.5   <-- 1.91
3134
 
         * </pre>
3135
 
         * @property gecko
3136
 
         * @type float
3137
 
         * @static
3138
 
         */
3139
 
        gecko: 0,
3140
 
 
3141
 
        /**
3142
 
         * AppleWebKit version.  KHTML browsers that are not WebKit browsers
3143
 
         * will evaluate to 1, other browsers 0.  Example: 418.9
3144
 
         * <pre>
3145
 
         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
3146
 
         *                                   latest available for Mac OSX 10.3.
3147
 
         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
3148
 
         * Safari 2.0.4:         418     <-- preventDefault fixed
3149
 
         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
3150
 
         *                                   different versions of webkit
3151
 
         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
3152
 
         *                                   updated, but not updated
3153
 
         *                                   to the latest patch.
3154
 
         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native
3155
 
         * SVG and many major issues fixed).
3156
 
         * Safari 3.0.4 (523.12) 523.12  <-- First Tiger release - automatic
3157
 
         * update from 2.x via the 10.4.11 OS patch.
3158
 
         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
3159
 
         *                                   yahoo.com user agent hack removed.
3160
 
         * </pre>
3161
 
         * http://en.wikipedia.org/wiki/Safari_version_history
3162
 
         * @property webkit
3163
 
         * @type float
3164
 
         * @static
3165
 
         */
3166
 
        webkit: 0,
3167
 
 
3168
 
        /**
3169
 
         * Safari will be detected as webkit, but this property will also
3170
 
         * be populated with the Safari version number
3171
 
         * @property safari
3172
 
         * @type float
3173
 
         * @static
3174
 
         */
3175
 
        safari: 0,
3176
 
 
3177
 
        /**
3178
 
         * Chrome will be detected as webkit, but this property will also
3179
 
         * be populated with the Chrome version number
3180
 
         * @property chrome
3181
 
         * @type float
3182
 
         * @static
3183
 
         */
3184
 
        chrome: 0,
3185
 
 
3186
 
        /**
3187
 
         * The mobile property will be set to a string containing any relevant
3188
 
         * user agent information when a modern mobile browser is detected.
3189
 
         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
3190
 
         * devices with the WebKit-based browser, and Opera Mini.
3191
 
         * @property mobile
3192
 
         * @type string
3193
 
         * @default null
3194
 
         * @static
3195
 
         */
3196
 
        mobile: null,
3197
 
 
3198
 
        /**
3199
 
         * Adobe AIR version number or 0.  Only populated if webkit is detected.
3200
 
         * Example: 1.0
3201
 
         * @property air
3202
 
         * @type float
3203
 
         */
3204
 
        air: 0,
3205
 
        /**
3206
 
         * Detects Apple iPad's OS version
3207
 
         * @property ipad
3208
 
         * @type float
3209
 
         * @static
3210
 
         */
3211
 
        ipad: 0,
3212
 
        /**
3213
 
         * Detects Apple iPhone's OS version
3214
 
         * @property iphone
3215
 
         * @type float
3216
 
         * @static
3217
 
         */
3218
 
        iphone: 0,
3219
 
        /**
3220
 
         * Detects Apples iPod's OS version
3221
 
         * @property ipod
3222
 
         * @type float
3223
 
         * @static
3224
 
         */
3225
 
        ipod: 0,
3226
 
        /**
3227
 
         * General truthy check for iPad, iPhone or iPod
3228
 
         * @property ios
3229
 
         * @type float
3230
 
         * @default null
3231
 
         * @static
3232
 
         */
3233
 
        ios: null,
3234
 
        /**
3235
 
         * Detects Googles Android OS version
3236
 
         * @property android
3237
 
         * @type float
3238
 
         * @static
3239
 
         */
3240
 
        android: 0,
3241
 
        /**
3242
 
         * Detects Palms WebOS version
3243
 
         * @property webos
3244
 
         * @type float
3245
 
         * @static
3246
 
         */
3247
 
        webos: 0,
3248
 
 
3249
 
        /**
3250
 
         * Google Caja version number or 0.
3251
 
         * @property caja
3252
 
         * @type float
3253
 
         */
3254
 
        caja: nav && nav.cajaVersion,
3255
 
 
3256
 
        /**
3257
 
         * Set to true if the page appears to be in SSL
3258
 
         * @property secure
3259
 
         * @type boolean
3260
 
         * @static
3261
 
         */
3262
 
        secure: false,
3263
 
 
3264
 
        /**
3265
 
         * The operating system.  Currently only detecting windows or macintosh
3266
 
         * @property os
3267
 
         * @type string
3268
 
         * @default null
3269
 
         * @static
3270
 
         */
3271
 
        os: null
3272
 
 
3273
 
    },
3274
 
 
3275
 
    ua = subUA || nav && nav.userAgent,
3276
 
 
3277
 
    loc = win && win.location,
3278
 
 
3279
 
    href = loc && loc.href,
3280
 
 
3281
 
    m;
3282
 
 
3283
 
    /**
3284
 
    * The User Agent string that was parsed
3285
 
    * @property userAgent
3286
 
    * @type String
3287
 
    * @static
3288
 
    */
3289
 
    o.userAgent = ua;
3290
 
 
3291
 
 
3292
 
    o.secure = href && (href.toLowerCase().indexOf('https') === 0);
3293
 
 
3294
 
    if (ua) {
3295
 
 
3296
 
        if ((/windows|win32/i).test(ua)) {
3297
 
            o.os = 'windows';
3298
 
        } else if ((/macintosh/i).test(ua)) {
3299
 
            o.os = 'macintosh';
3300
 
        } else if ((/rhino/i).test(ua)) {
3301
 
            o.os = 'rhino';
3302
 
        }
3303
 
 
3304
 
        // Modern KHTML browsers should qualify as Safari X-Grade
3305
 
        if ((/KHTML/).test(ua)) {
3306
 
            o.webkit = 1;
3307
 
        }
3308
 
        // Modern WebKit browsers are at least X-Grade
3309
 
        m = ua.match(/AppleWebKit\/([^\s]*)/);
3310
 
        if (m && m[1]) {
3311
 
            o.webkit = numberify(m[1]);
3312
 
            o.safari = o.webkit;
3313
 
 
3314
 
            // Mobile browser check
3315
 
            if (/ Mobile\//.test(ua)) {
3316
 
                o.mobile = 'Apple'; // iPhone or iPod Touch
3317
 
 
3318
 
                m = ua.match(/OS ([^\s]*)/);
3319
 
                if (m && m[1]) {
3320
 
                    m = numberify(m[1].replace('_', '.'));
3321
 
                }
3322
 
                o.ios = m;
3323
 
                o.ipad = o.ipod = o.iphone = 0;
3324
 
 
3325
 
                m = ua.match(/iPad|iPod|iPhone/);
3326
 
                if (m && m[0]) {
3327
 
                    o[m[0].toLowerCase()] = o.ios;
3328
 
                }
3329
 
            } else {
3330
 
                m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
3331
 
                if (m) {
3332
 
                    // Nokia N-series, webOS, ex: NokiaN95
3333
 
                    o.mobile = m[0];
3334
 
                }
3335
 
                if (/webOS/.test(ua)) {
3336
 
                    o.mobile = 'WebOS';
3337
 
                    m = ua.match(/webOS\/([^\s]*);/);
3338
 
                    if (m && m[1]) {
3339
 
                        o.webos = numberify(m[1]);
3340
 
                    }
3341
 
                }
3342
 
                if (/ Android/.test(ua)) {
3343
 
                    if (/Mobile/.test(ua)) {
3344
 
                        o.mobile = 'Android';
3345
 
                    }
3346
 
                    m = ua.match(/Android ([^\s]*);/);
3347
 
                    if (m && m[1]) {
3348
 
                        o.android = numberify(m[1]);
3349
 
                    }
3350
 
 
3351
 
                }
3352
 
            }
3353
 
 
3354
 
            m = ua.match(/Chrome\/([^\s]*)/);
3355
 
            if (m && m[1]) {
3356
 
                o.chrome = numberify(m[1]); // Chrome
3357
 
                o.safari = 0; //Reset safari back to 0
3358
 
            } else {
3359
 
                m = ua.match(/AdobeAIR\/([^\s]*)/);
3360
 
                if (m) {
3361
 
                    o.air = m[0]; // Adobe AIR 1.0 or better
3362
 
                }
3363
 
            }
3364
 
        }
3365
 
 
3366
 
        if (!o.webkit) { // not webkit
3367
 
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
3368
 
            m = ua.match(/Opera[\s\/]([^\s]*)/);
3369
 
            if (m && m[1]) {
3370
 
                o.opera = numberify(m[1]);
3371
 
                m = ua.match(/Version\/([^\s]*)/);
3372
 
                if (m && m[1]) {
3373
 
                    o.opera = numberify(m[1]); // opera 10+
3374
 
                }
3375
 
 
3376
 
                m = ua.match(/Opera Mini[^;]*/);
3377
 
 
3378
 
                if (m) {
3379
 
                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
3380
 
                }
3381
 
            } else { // not opera or webkit
3382
 
                m = ua.match(/MSIE\s([^;]*)/);
3383
 
                if (m && m[1]) {
3384
 
                    o.ie = numberify(m[1]);
3385
 
                } else { // not opera, webkit, or ie
3386
 
                    m = ua.match(/Gecko\/([^\s]*)/);
3387
 
                    if (m) {
3388
 
                        o.gecko = 1; // Gecko detected, look for revision
3389
 
                        m = ua.match(/rv:([^\s\)]*)/);
3390
 
                        if (m && m[1]) {
3391
 
                            o.gecko = numberify(m[1]);
3392
 
                        }
3393
 
                    }
3394
 
                }
3395
 
            }
3396
 
        }
3397
 
    }
3398
 
 
3399
 
    //It was a parsed UA, do not assign the global value.
3400
 
    if (!subUA) {
3401
 
        YUI.Env.UA = o;
3402
 
    }
3403
 
 
3404
 
    return o;
3405
 
};
3406
 
 
3407
 
 
3408
 
Y.UA = YUI.Env.UA || YUI.Env.parseUA();
3409
 
YUI.Env.aliases = {
3410
 
    "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
3411
 
    "app": ["controller","model","model-list","view"],
3412
 
    "attribute": ["attribute-base","attribute-complex"],
3413
 
    "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
3414
 
    "base": ["base-base","base-pluginhost","base-build"],
3415
 
    "cache": ["cache-base","cache-offline","cache-plugin"],
3416
 
    "collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
3417
 
    "dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
3418
 
    "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
3419
 
    "datatable": ["datatable-base","datatable-datasource","datatable-sort","datatable-scroll"],
3420
 
    "datatype": ["datatype-number","datatype-date","datatype-xml"],
3421
 
    "datatype-date": ["datatype-date-parse","datatype-date-format"],
3422
 
    "datatype-number": ["datatype-number-parse","datatype-number-format"],
3423
 
    "datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
3424
 
    "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
3425
 
    "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
3426
 
    "editor": ["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
3427
 
    "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside"],
3428
 
    "event-custom": ["event-custom-base","event-custom-complex"],
3429
 
    "event-gestures": ["event-flick","event-move"],
3430
 
    "highlight": ["highlight-base","highlight-accentfold"],
3431
 
    "history": ["history-base","history-hash","history-hash-ie","history-html5"],
3432
 
    "io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
3433
 
    "json": ["json-parse","json-stringify"],
3434
 
    "loader": ["loader-base","loader-rollup","loader-yui3"],
3435
 
    "node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
3436
 
    "pluginhost": ["pluginhost-base","pluginhost-config"],
3437
 
    "querystring": ["querystring-parse","querystring-stringify"],
3438
 
    "recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
3439
 
    "resize": ["resize-base","resize-proxy","resize-constrain"],
3440
 
    "slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
3441
 
    "text": ["text-accentfold","text-wordbreak"],
3442
 
    "widget": ["widget-base","widget-htmlparser","widget-uievents","widget-skin"]
3443
 
};
3444
 
 
3445
 
 
3446
 
}, '3.4.1' );
3447
 
YUI.add('get', function(Y) {
3448
 
 
3449
 
/**
3450
 
 * Provides a mechanism to fetch remote resources and
3451
 
 * insert them into a document.
3452
 
 * @module yui
3453
 
 * @submodule get
3454
 
 */
3455
 
 
3456
 
/**
3457
 
 * Fetches and inserts one or more script or link nodes into the document
3458
 
 * @class Get
3459
 
 * @static
3460
 
 */
3461
 
 
3462
 
var ua = Y.UA,
3463
 
    L = Y.Lang,
3464
 
    TYPE_JS = 'text/javascript',
3465
 
    TYPE_CSS = 'text/css',
3466
 
    STYLESHEET = 'stylesheet',
3467
 
    SCRIPT = 'script',
3468
 
    AUTOPURGE = 'autopurge',
3469
 
    UTF8 = 'utf-8',
3470
 
    LINK = 'link',
3471
 
    ASYNC = 'async',
3472
 
    ALL = true,
3473
 
 
3474
 
    // FireFox does not support the onload event for link nodes, so
3475
 
    // there is no way to make the css requests synchronous. This means
3476
 
    // that the css rules in multiple files could be applied out of order
3477
 
    // in this browser if a later request returns before an earlier one.
3478
 
 
3479
 
    // Safari too.
3480
 
 
3481
 
    ONLOAD_SUPPORTED = {
3482
 
        script: ALL,
3483
 
        css: !(ua.webkit || ua.gecko)
3484
 
    },
3485
 
 
3486
 
    /**
3487
 
     * hash of queues to manage multiple requests
3488
 
     * @property queues
3489
 
     * @private
3490
 
     */
3491
 
    queues = {},
3492
 
 
3493
 
    /**
3494
 
     * queue index used to generate transaction ids
3495
 
     * @property qidx
3496
 
     * @type int
3497
 
     * @private
3498
 
     */
3499
 
    qidx = 0,
3500
 
 
3501
 
    /**
3502
 
     * interal property used to prevent multiple simultaneous purge
3503
 
     * processes
3504
 
     * @property purging
3505
 
     * @type boolean
3506
 
     * @private
3507
 
     */
3508
 
    purging,
3509
 
 
3510
 
    /**
3511
 
     * Clear timeout state 
3512
 
     * 
3513
 
     * @method _clearTimeout
3514
 
     * @param {Object} q Queue data
3515
 
     * @private
3516
 
     */
3517
 
    _clearTimeout = function(q) {
3518
 
        var timer = q.timer;
3519
 
        if (timer) {
3520
 
            clearTimeout(timer);
3521
 
            q.timer = null;
3522
 
        }
3523
 
    },
3524
 
 
3525
 
    /**
3526
 
     * Generates an HTML element, this is not appended to a document
3527
 
     * @method _node
3528
 
     * @param {string} type the type of element.
3529
 
     * @param {Object} attr the fixed set of attribute for the type.
3530
 
     * @param {Object} custAttrs optional Any custom attributes provided by the user.
3531
 
     * @param {Window} win optional window to create the element in.
3532
 
     * @return {HTMLElement} the generated node.
3533
 
     * @private
3534
 
     */
3535
 
    _node = function(type, attr, custAttrs, win) {
3536
 
        var w = win || Y.config.win,
3537
 
            d = w.document,
3538
 
            n = d.createElement(type),
3539
 
            i;
3540
 
 
3541
 
        if (custAttrs) {
3542
 
            Y.mix(attr, custAttrs);
3543
 
        }
3544
 
 
3545
 
        for (i in attr) {
3546
 
            if (attr[i] && attr.hasOwnProperty(i)) {
3547
 
                n.setAttribute(i, attr[i]);
3548
 
            }
3549
 
        }
3550
 
 
3551
 
        return n;
3552
 
    },
3553
 
 
3554
 
    /**
3555
 
     * Generates a link node
3556
 
     * @method _linkNode
3557
 
     * @param {string} url the url for the css file.
3558
 
     * @param {Window} win optional window to create the node in.
3559
 
     * @param {object} attributes optional attributes collection to apply to the
3560
 
     * new node.
3561
 
     * @return {HTMLElement} the generated node.
3562
 
     * @private
3563
 
     */
3564
 
    _linkNode = function(url, win, attributes) {
3565
 
        return _node(LINK, {
3566
 
                        id: Y.guid(),
3567
 
                        type: TYPE_CSS,
3568
 
                        rel: STYLESHEET,
3569
 
                        href: url
3570
 
                    }, attributes, win);
3571
 
    },
3572
 
 
3573
 
    /**
3574
 
     * Generates a script node
3575
 
     * @method _scriptNode
3576
 
     * @param {string} url the url for the script file.
3577
 
     * @param {Window} win optional window to create the node in.
3578
 
     * @param {object} attributes optional attributes collection to apply to the
3579
 
     * new node.
3580
 
     * @return {HTMLElement} the generated node.
3581
 
     * @private
3582
 
     */
3583
 
    _scriptNode = function(url, win, attributes) {
3584
 
        return _node(SCRIPT, {
3585
 
                        id: Y.guid(),
3586
 
                        type: TYPE_JS,
3587
 
                        src: url
3588
 
                    }, attributes, win);
3589
 
    },
3590
 
 
3591
 
    /**
3592
 
     * Returns the data payload for callback functions.
3593
 
     * @method _returnData
3594
 
     * @param {object} q the queue.
3595
 
     * @param {string} msg the result message.
3596
 
     * @param {string} result the status message from the request.
3597
 
     * @return {object} the state data from the request.
3598
 
     * @private
3599
 
     */
3600
 
    _returnData = function(q, msg, result) {
3601
 
        return {
3602
 
            tId: q.tId,
3603
 
            win: q.win,
3604
 
            data: q.data,
3605
 
            nodes: q.nodes,
3606
 
            msg: msg,
3607
 
            statusText: result,
3608
 
 
3609
 
            purge: function() {
3610
 
                _purge(this.tId);
3611
 
            }
3612
 
        };
3613
 
    },
3614
 
 
3615
 
    /**
3616
 
     * The transaction is finished
3617
 
     * @method _end
3618
 
     * @param {string} id the id of the request.
3619
 
     * @param {string} msg the result message.
3620
 
     * @param {string} result the status message from the request.
3621
 
     * @private
3622
 
     */
3623
 
    _end = function(id, msg, result) {
3624
 
        var q = queues[id],
3625
 
            onEnd = q && q.onEnd;
3626
 
 
3627
 
        q.finished = true;
3628
 
 
3629
 
        if (onEnd) {
3630
 
            onEnd.call(q.context, _returnData(q, msg, result));
3631
 
        }
3632
 
    },
3633
 
 
3634
 
    /**
3635
 
     * The request failed, execute fail handler with whatever
3636
 
     * was accomplished.  There isn't a failure case at the
3637
 
     * moment unless you count aborted transactions
3638
 
     * @method _fail
3639
 
     * @param {string} id the id of the request
3640
 
     * @private
3641
 
     */
3642
 
    _fail = function(id, msg) {
3643
 
        Y.log('get failure: ' + msg, 'warn', 'get');
3644
 
 
3645
 
        var q = queues[id],
3646
 
            onFailure = q.onFailure;
3647
 
 
3648
 
        _clearTimeout(q);
3649
 
 
3650
 
        if (onFailure) {
3651
 
            onFailure.call(q.context, _returnData(q, msg));
3652
 
        }
3653
 
 
3654
 
        _end(id, msg, 'failure');
3655
 
    },
3656
 
 
3657
 
 
3658
 
    /**
3659
 
     * Abort the transaction
3660
 
     * 
3661
 
     * @method _abort
3662
 
     * @param {Object} id
3663
 
     * @private
3664
 
     */
3665
 
    _abort = function(id) {
3666
 
        _fail(id, 'transaction ' + id + ' was aborted');
3667
 
    },
3668
 
 
3669
 
    /**
3670
 
     * The request is complete, so executing the requester's callback
3671
 
     * @method _complete
3672
 
     * @param {string} id the id of the request.
3673
 
     * @private
3674
 
     */
3675
 
    _complete = function(id) {
3676
 
        Y.log("Finishing transaction " + id, "info", "get");
3677
 
 
3678
 
        var q = queues[id],
3679
 
            onSuccess = q.onSuccess;
3680
 
 
3681
 
        _clearTimeout(q);
3682
 
 
3683
 
        if (q.aborted) {
3684
 
            _abort(id);
3685
 
        } else {
3686
 
 
3687
 
            if (onSuccess) {
3688
 
                onSuccess.call(q.context, _returnData(q));
3689
 
            }
3690
 
 
3691
 
            // 3.3.0 had undefined msg for this path.
3692
 
            _end(id, undefined, 'OK');
3693
 
        }
3694
 
    },
3695
 
 
3696
 
    /**
3697
 
     * Get node reference, from string
3698
 
     * 
3699
 
     * @method _getNodeRef
3700
 
     * @param {String|HTMLElement} nId The node id to find. If an HTMLElement is passed in, it will be returned.
3701
 
     * @param {String} tId Queue id, used to determine document for queue
3702
 
     * @private
3703
 
     */
3704
 
    _getNodeRef = function(nId, tId) {
3705
 
        var q = queues[tId],
3706
 
            n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId;
3707
 
        if (!n) {
3708
 
            _fail(tId, 'target node not found: ' + nId);
3709
 
        }
3710
 
 
3711
 
        return n;
3712
 
    },
3713
 
 
3714
 
    /**
3715
 
     * Removes the nodes for the specified queue
3716
 
     * @method _purge
3717
 
     * @param {string} tId the transaction id.
3718
 
     * @private
3719
 
     */
3720
 
    _purge = function(tId) {
3721
 
        var nodes, doc, parent, sibling, node, attr, insertBefore,
3722
 
            i, l,
3723
 
            q = queues[tId];
3724
 
 
3725
 
        if (q) {
3726
 
            nodes = q.nodes;
3727
 
            l = nodes.length;
3728
 
 
3729
 
            // TODO: Why is node.parentNode undefined? Which forces us to do this...
3730
 
            /*
3731
 
            doc = q.win.document;
3732
 
            parent = doc.getElementsByTagName('head')[0];
3733
 
            insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0];
3734
 
 
3735
 
            if (insertBefore) {
3736
 
                sibling = _getNodeRef(insertBefore, tId);
3737
 
                if (sibling) {
3738
 
                    parent = sibling.parentNode;
3739
 
                }
3740
 
            }
3741
 
            */
3742
 
 
3743
 
            for (i = 0; i < l; i++) {
3744
 
                node = nodes[i];
3745
 
                parent = node.parentNode;
3746
 
 
3747
 
                if (node.clearAttributes) {
3748
 
                    node.clearAttributes();
3749
 
                } else {
3750
 
                    // This destroys parentNode ref, so we hold onto it above first.
3751
 
                    for (attr in node) {
3752
 
                        if (node.hasOwnProperty(attr)) {
3753
 
                            delete node[attr];
3754
 
                        }
3755
 
                    }
3756
 
                }
3757
 
 
3758
 
                parent.removeChild(node);
3759
 
            }
3760
 
        }
3761
 
 
3762
 
        q.nodes = [];
3763
 
    },
3764
 
 
3765
 
    /**
3766
 
     * Progress callback
3767
 
     * 
3768
 
     * @method _progress
3769
 
     * @param {string} id The id of the request.
3770
 
     * @param {string} The url which just completed.
3771
 
     * @private
3772
 
     */
3773
 
    _progress = function(id, url) {
3774
 
        var q = queues[id],
3775
 
            onProgress = q.onProgress,
3776
 
            o;
3777
 
 
3778
 
        if (onProgress) {
3779
 
            o = _returnData(q);
3780
 
            o.url = url;
3781
 
            onProgress.call(q.context, o);
3782
 
        }
3783
 
    },
3784
 
 
3785
 
    /**
3786
 
     * Timeout detected
3787
 
     * @method _timeout
3788
 
     * @param {string} id the id of the request.
3789
 
     * @private
3790
 
     */
3791
 
    _timeout = function(id) {
3792
 
        Y.log('Timeout ' + id, 'info', 'get');
3793
 
 
3794
 
        var q = queues[id],
3795
 
            onTimeout = q.onTimeout;
3796
 
 
3797
 
        if (onTimeout) {
3798
 
            onTimeout.call(q.context, _returnData(q));
3799
 
        }
3800
 
 
3801
 
        _end(id, 'timeout', 'timeout');
3802
 
    },
3803
 
 
3804
 
    /**
3805
 
     * onload callback
3806
 
     * @method _loaded
3807
 
     * @param {string} id the id of the request.
3808
 
     * @return {string} the result.
3809
 
     * @private
3810
 
     */
3811
 
    _loaded = function(id, url) {
3812
 
 
3813
 
        var q = queues[id],
3814
 
            sync = (q && !q.async);
3815
 
 
3816
 
        if (!q) {
3817
 
            return;
3818
 
        }
3819
 
 
3820
 
        if (sync) {
3821
 
            _clearTimeout(q);
3822
 
        }
3823
 
 
3824
 
        _progress(id, url);
3825
 
 
3826
 
        // TODO: Cleaning up flow to have a consistent end point
3827
 
 
3828
 
        // !q.finished check is for the async case,
3829
 
        // where scripts may still be loading when we've 
3830
 
        // already aborted. Ideally there should be a single path
3831
 
        // for this.
3832
 
 
3833
 
        if (!q.finished) { 
3834
 
            if (q.aborted) {
3835
 
                _abort(id);
3836
 
            } else {
3837
 
                if ((--q.remaining) === 0) {
3838
 
                    _complete(id);
3839
 
                } else if (sync) {
3840
 
                    _next(id);
3841
 
                }
3842
 
            }
3843
 
        }
3844
 
    },
3845
 
 
3846
 
    /**
3847
 
     * Detects when a node has been loaded.  In the case of
3848
 
     * script nodes, this does not guarantee that contained
3849
 
     * script is ready to use.
3850
 
     * @method _trackLoad
3851
 
     * @param {string} type the type of node to track.
3852
 
     * @param {HTMLElement} n the node to track.
3853
 
     * @param {string} id the id of the request.
3854
 
     * @param {string} url the url that is being loaded.
3855
 
     * @private
3856
 
     */
3857
 
    _trackLoad = function(type, n, id, url) {
3858
 
 
3859
 
        // TODO: Can we massage this to use ONLOAD_SUPPORTED[type]?
3860
 
 
3861
 
        // IE supports the readystatechange event for script and css nodes
3862
 
        // Opera only for script nodes.  Opera support onload for script
3863
 
        // nodes, but this doesn't fire when there is a load failure.
3864
 
        // The onreadystatechange appears to be a better way to respond
3865
 
        // to both success and failure.
3866
 
 
3867
 
        if (ua.ie) {
3868
 
 
3869
 
            n.onreadystatechange = function() {
3870
 
                var rs = this.readyState;
3871
 
                if ('loaded' === rs || 'complete' === rs) {
3872
 
                    // Y.log(id + " onreadstatechange " + url, "info", "get");
3873
 
                    n.onreadystatechange = null;
3874
 
                    _loaded(id, url);
3875
 
                }
3876
 
            };
3877
 
 
3878
 
        } else if (ua.webkit) {
3879
 
 
3880
 
            // webkit prior to 3.x is no longer supported
3881
 
            if (type === SCRIPT) {
3882
 
                // Safari 3.x supports the load event for script nodes (DOM2)
3883
 
                n.addEventListener('load', function() {
3884
 
                    _loaded(id, url);
3885
 
                }, false);
3886
 
            }
3887
 
 
3888
 
        } else {
3889
 
 
3890
 
            // FireFox and Opera support onload (but not DOM2 in FF) handlers for
3891
 
            // script nodes. Opera, but not FF, supports the onload event for link nodes.
3892
 
 
3893
 
            n.onload = function() {
3894
 
                // Y.log(id + " onload " + url, "info", "get");
3895
 
                _loaded(id, url);
3896
 
            };
3897
 
 
3898
 
            n.onerror = function(e) {
3899
 
                _fail(id, e + ': ' + url);
3900
 
            };
3901
 
        }
3902
 
    },
3903
 
 
3904
 
    _insertInDoc = function(node, id, win) {
3905
 
 
3906
 
        // Add it to the head or insert it before 'insertBefore'.  
3907
 
        // Work around IE bug if there is a base tag.
3908
 
        var q = queues[id],
3909
 
            doc = win.document,
3910
 
            insertBefore = q.insertBefore || doc.getElementsByTagName('base')[0],
3911
 
            sibling;
3912
 
 
3913
 
        if (insertBefore) {
3914
 
            sibling = _getNodeRef(insertBefore, id);
3915
 
            if (sibling) {
3916
 
                Y.log('inserting before: ' + insertBefore, 'info', 'get');
3917
 
                sibling.parentNode.insertBefore(node, sibling);
3918
 
            }
3919
 
        } else {
3920
 
            // 3.3.0 assumed head is always around.
3921
 
            doc.getElementsByTagName('head')[0].appendChild(node);
3922
 
        }
3923
 
    },
3924
 
 
3925
 
    /**
3926
 
     * Loads the next item for a given request
3927
 
     * @method _next
3928
 
     * @param {string} id the id of the request.
3929
 
     * @return {string} the result.
3930
 
     * @private
3931
 
     */
3932
 
    _next = function(id) {
3933
 
 
3934
 
        // Assigning out here for readability
3935
 
        var q = queues[id],
3936
 
            type = q.type,
3937
 
            attrs = q.attributes,
3938
 
            win = q.win,
3939
 
            timeout = q.timeout,
3940
 
            node,
3941
 
            url;
3942
 
 
3943
 
        if (q.url.length > 0) {
3944
 
 
3945
 
            url = q.url.shift();
3946
 
 
3947
 
            Y.log('attempting to load ' + url, 'info', 'get');
3948
 
 
3949
 
            // !q.timer ensures that this only happens once for async
3950
 
            if (timeout && !q.timer) {
3951
 
                q.timer = setTimeout(function() {
3952
 
                    _timeout(id);
3953
 
                }, timeout);
3954
 
            }
3955
 
 
3956
 
            if (type === SCRIPT) {
3957
 
                node = _scriptNode(url, win, attrs);
3958
 
            } else {
3959
 
                node = _linkNode(url, win, attrs);
3960
 
            }
3961
 
 
3962
 
            // add the node to the queue so we can return it in the callback 
3963
 
            q.nodes.push(node);
3964
 
 
3965
 
            _trackLoad(type, node, id, url);
3966
 
            _insertInDoc(node, id, win);
3967
 
    
3968
 
            if (!ONLOAD_SUPPORTED[type]) {
3969
 
                _loaded(id, url);
3970
 
            }
3971
 
 
3972
 
            if (q.async) {
3973
 
                // For sync, the _next call is chained in _loaded 
3974
 
                _next(id);
3975
 
            }
3976
 
        }
3977
 
    },
3978
 
 
3979
 
    /**
3980
 
     * Removes processed queues and corresponding nodes
3981
 
     * @method _autoPurge
3982
 
     * @private
3983
 
     */
3984
 
    _autoPurge = function() {
3985
 
        if (purging) {
3986
 
            return;
3987
 
        }
3988
 
        purging = true;
3989
 
 
3990
 
        var i, q;
3991
 
 
3992
 
        for (i in queues) {
3993
 
            if (queues.hasOwnProperty(i)) {
3994
 
                q = queues[i];
3995
 
                if (q.autopurge && q.finished) {
3996
 
                    _purge(q.tId);
3997
 
                    delete queues[i];
3998
 
                }
3999
 
            }
4000
 
        }
4001
 
 
4002
 
        purging = false;
4003
 
    },
4004
 
 
4005
 
    /**
4006
 
     * Saves the state for the request and begins loading
4007
 
     * the requested urls
4008
 
     * @method queue
4009
 
     * @param {string} type the type of node to insert.
4010
 
     * @param {string} url the url to load.
4011
 
     * @param {object} opts the hash of options for this request.
4012
 
     * @return {object} transaction object.
4013
 
     * @private
4014
 
     */
4015
 
    _queue = function(type, url, opts) {
4016
 
 
4017
 
        opts = opts || {};
4018
 
 
4019
 
        var id = 'q' + (qidx++),
4020
 
            thresh = opts.purgethreshold || Y.Get.PURGE_THRESH, 
4021
 
            q;
4022
 
 
4023
 
        if (qidx % thresh === 0) {
4024
 
            _autoPurge();
4025
 
        }
4026
 
 
4027
 
        // Merge to protect opts (grandfathered in).
4028
 
        q = queues[id] = Y.merge(opts);
4029
 
 
4030
 
        // Avoid mix, merge overhead. Known set of props.
4031
 
        q.tId = id;
4032
 
        q.type = type;
4033
 
        q.url = url;
4034
 
        q.finished = false;
4035
 
        q.nodes = [];
4036
 
 
4037
 
        q.win = q.win || Y.config.win;
4038
 
        q.context = q.context || q;
4039
 
        q.autopurge = (AUTOPURGE in q) ? q.autopurge : (type === SCRIPT) ? true : false;
4040
 
        q.attributes = q.attributes || {};
4041
 
        q.attributes.charset = opts.charset || q.attributes.charset || UTF8;
4042
 
 
4043
 
        if (ASYNC in q && type === SCRIPT) {
4044
 
            q.attributes.async = q.async;
4045
 
        }
4046
 
 
4047
 
        q.url = (L.isString(q.url)) ? [q.url] : q.url;
4048
 
 
4049
 
        // TODO: Do we really need to account for this developer error? 
4050
 
        // If the url is undefined, this is probably a trailing comma problem in IE.
4051
 
        if (!q.url[0]) {
4052
 
            q.url.shift();
4053
 
            Y.log('skipping empty url');
4054
 
        }
4055
 
 
4056
 
        q.remaining = q.url.length;
4057
 
 
4058
 
        _next(id);
4059
 
 
4060
 
        return {
4061
 
            tId: id
4062
 
        };
4063
 
    };
4064
 
 
4065
 
 
4066
 
Y.Get = {
4067
 
 
4068
 
    /**
4069
 
     * The number of request required before an automatic purge.
4070
 
     * Can be configured via the 'purgethreshold' config
4071
 
     * @property PURGE_THRESH
4072
 
     * @static
4073
 
     * @type int
4074
 
     * @default 20
4075
 
     * @private
4076
 
     */
4077
 
    PURGE_THRESH: 20,
4078
 
 
4079
 
    /**
4080
 
     * Abort a transaction
4081
 
     * @method abort
4082
 
     * @static
4083
 
     * @param {string|object} o Either the tId or the object returned from
4084
 
     * script() or css().
4085
 
     */
4086
 
    abort : function(o) {
4087
 
        var id = (L.isString(o)) ? o : o.tId,
4088
 
            q = queues[id];
4089
 
 
4090
 
        if (q) {
4091
 
            Y.log('Aborting ' + id, 'info', 'get');
4092
 
            q.aborted = true;
4093
 
        }
4094
 
    },
4095
 
 
4096
 
    /**
4097
 
     * Fetches and inserts one or more script nodes into the head
4098
 
     * of the current document or the document in a specified window.
4099
 
     *
4100
 
     * @method script
4101
 
     * @static
4102
 
     * @param {string|string[]} url the url or urls to the script(s).
4103
 
     * @param {object} opts Options:
4104
 
     * <dl>
4105
 
     * <dt>onSuccess</dt>
4106
 
     * <dd>
4107
 
     * callback to execute when the script(s) are finished loading
4108
 
     * The callback receives an object back with the following
4109
 
     * data:
4110
 
     * <dl>
4111
 
     * <dt>win</dt>
4112
 
     * <dd>the window the script(s) were inserted into</dd>
4113
 
     * <dt>data</dt>
4114
 
     * <dd>the data object passed in when the request was made</dd>
4115
 
     * <dt>nodes</dt>
4116
 
     * <dd>An array containing references to the nodes that were
4117
 
     * inserted</dd>
4118
 
     * <dt>purge</dt>
4119
 
     * <dd>A function that, when executed, will remove the nodes
4120
 
     * that were inserted</dd>
4121
 
     * <dt>
4122
 
     * </dl>
4123
 
     * </dd>
4124
 
     * <dt>onTimeout</dt>
4125
 
     * <dd>
4126
 
     * callback to execute when a timeout occurs.
4127
 
     * The callback receives an object back with the following
4128
 
     * data:
4129
 
     * <dl>
4130
 
     * <dt>win</dt>
4131
 
     * <dd>the window the script(s) were inserted into</dd>
4132
 
     * <dt>data</dt>
4133
 
     * <dd>the data object passed in when the request was made</dd>
4134
 
     * <dt>nodes</dt>
4135
 
     * <dd>An array containing references to the nodes that were
4136
 
     * inserted</dd>
4137
 
     * <dt>purge</dt>
4138
 
     * <dd>A function that, when executed, will remove the nodes
4139
 
     * that were inserted</dd>
4140
 
     * <dt>
4141
 
     * </dl>
4142
 
     * </dd>
4143
 
     * <dt>onEnd</dt>
4144
 
     * <dd>a function that executes when the transaction finishes,
4145
 
     * regardless of the exit path</dd>
4146
 
     * <dt>onFailure</dt>
4147
 
     * <dd>
4148
 
     * callback to execute when the script load operation fails
4149
 
     * The callback receives an object back with the following
4150
 
     * data:
4151
 
     * <dl>
4152
 
     * <dt>win</dt>
4153
 
     * <dd>the window the script(s) were inserted into</dd>
4154
 
     * <dt>data</dt>
4155
 
     * <dd>the data object passed in when the request was made</dd>
4156
 
     * <dt>nodes</dt>
4157
 
     * <dd>An array containing references to the nodes that were
4158
 
     * inserted successfully</dd>
4159
 
     * <dt>purge</dt>
4160
 
     * <dd>A function that, when executed, will remove any nodes
4161
 
     * that were inserted</dd>
4162
 
     * <dt>
4163
 
     * </dl>
4164
 
     * </dd>
4165
 
     * <dt>onProgress</dt>
4166
 
     * <dd>callback to execute when each individual file is done loading 
4167
 
     * (useful when passing in an array of js files). Receives the same
4168
 
     * payload as onSuccess, with the addition of a <code>url</code> 
4169
 
     * property, which identifies the file which was loaded.</dd>
4170
 
     * <dt>async</dt>
4171
 
     * <dd>
4172
 
     * <p>When passing in an array of JS files, setting this flag to true 
4173
 
     * will insert them into the document in parallel, as opposed to the 
4174
 
     * default behavior, which is to chain load them serially. It will also
4175
 
     * set the async attribute on the script node to true.</p> 
4176
 
     * <p>Setting async:true
4177
 
     * will lead to optimal file download performance allowing the browser to
4178
 
     * download multiple scripts in parallel, and execute them as soon as they
4179
 
     * are available.</p>  
4180
 
     * <p>Note that async:true does not guarantee execution order of the 
4181
 
     * scripts being downloaded. They are executed in whichever order they 
4182
 
     * are received.</p>
4183
 
     * </dd>
4184
 
     * <dt>context</dt>
4185
 
     * <dd>the execution context for the callbacks</dd>
4186
 
     * <dt>win</dt>
4187
 
     * <dd>a window other than the one the utility occupies</dd>
4188
 
     * <dt>autopurge</dt>
4189
 
     * <dd>
4190
 
     * setting to true will let the utilities cleanup routine purge
4191
 
     * the script once loaded
4192
 
     * </dd>
4193
 
     * <dt>purgethreshold</dt>
4194
 
     * <dd>
4195
 
     * The number of transaction before autopurge should be initiated
4196
 
     * </dd>
4197
 
     * <dt>data</dt>
4198
 
     * <dd>
4199
 
     * data that is supplied to the callback when the script(s) are
4200
 
     * loaded.
4201
 
     * </dd>
4202
 
     * <dt>insertBefore</dt>
4203
 
     * <dd>node or node id that will become the new node's nextSibling.
4204
 
     * If this is not specified, nodes will be inserted before a base
4205
 
     * tag should it exist.  Otherwise, the nodes will be appended to the
4206
 
     * end of the document head.</dd>
4207
 
     * </dl>
4208
 
     * <dt>charset</dt>
4209
 
     * <dd>Node charset, default utf-8 (deprecated, use the attributes
4210
 
     * config)</dd>
4211
 
     * <dt>attributes</dt>
4212
 
     * <dd>An object literal containing additional attributes to add to
4213
 
     * the link tags</dd>
4214
 
     * <dt>timeout</dt>
4215
 
     * <dd>Number of milliseconds to wait before aborting and firing
4216
 
     * the timeout event</dd>
4217
 
     * <pre>
4218
 
     * &nbsp; Y.Get.script(
4219
 
     * &nbsp; ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
4220
 
     * &nbsp;  "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"],
4221
 
     * &nbsp; &#123;
4222
 
     * &nbsp;   onSuccess: function(o) &#123;
4223
 
     * &nbsp;     this.log("won't cause error because Y is the context");
4224
 
     * &nbsp;     Y.log(o.data); // foo
4225
 
     * &nbsp;     Y.log(o.nodes.length === 2) // true
4226
 
     * &nbsp;     // o.purge(); // optionally remove the script nodes
4227
 
     * &nbsp;                   // immediately
4228
 
     * &nbsp;   &#125;,
4229
 
     * &nbsp;   onFailure: function(o) &#123;
4230
 
     * &nbsp;     Y.log("transaction failed");
4231
 
     * &nbsp;   &#125;,
4232
 
     * &nbsp;   onTimeout: function(o) &#123;
4233
 
     * &nbsp;     Y.log("transaction timed out");
4234
 
     * &nbsp;   &#125;,
4235
 
     * &nbsp;   data: "foo",
4236
 
     * &nbsp;   timeout: 10000, // 10 second timeout
4237
 
     * &nbsp;   context: Y, // make the YUI instance
4238
 
     * &nbsp;   // win: otherframe // target another window/frame
4239
 
     * &nbsp;   autopurge: true // allow the utility to choose when to
4240
 
     * &nbsp;                   // remove the nodes
4241
 
     * &nbsp;   purgetheshold: 1 // purge previous transaction before
4242
 
     * &nbsp;                    // next transaction
4243
 
     * &nbsp; &#125;);.
4244
 
     * </pre>
4245
 
     * @return {tId: string} an object containing info about the
4246
 
     * transaction.
4247
 
     */
4248
 
    script: function(url, opts) {
4249
 
        return _queue(SCRIPT, url, opts);
4250
 
    },
4251
 
 
4252
 
    /**
4253
 
     * Fetches and inserts one or more css link nodes into the
4254
 
     * head of the current document or the document in a specified
4255
 
     * window.
4256
 
     * @method css
4257
 
     * @static
4258
 
     * @param {string} url the url or urls to the css file(s).
4259
 
     * @param {object} opts Options:
4260
 
     * <dl>
4261
 
     * <dt>onSuccess</dt>
4262
 
     * <dd>
4263
 
     * callback to execute when the css file(s) are finished loading
4264
 
     * The callback receives an object back with the following
4265
 
     * data:
4266
 
     * <dl>win</dl>
4267
 
     * <dd>the window the link nodes(s) were inserted into</dd>
4268
 
     * <dt>data</dt>
4269
 
     * <dd>the data object passed in when the request was made</dd>
4270
 
     * <dt>nodes</dt>
4271
 
     * <dd>An array containing references to the nodes that were
4272
 
     * inserted</dd>
4273
 
     * <dt>purge</dt>
4274
 
     * <dd>A function that, when executed, will remove the nodes
4275
 
     * that were inserted</dd>
4276
 
     * <dt>
4277
 
     * </dl>
4278
 
     * </dd>
4279
 
     * <dt>onProgress</dt>
4280
 
     * <dd>callback to execute when each individual file is done loading (useful when passing in an array of css files). Receives the same
4281
 
     * 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,
4282
 
     * where onload for css is detected accurately.</dd>
4283
 
     * <dt>async</dt>
4284
 
     * <dd>When passing in an array of css files, setting this flag to true will insert them
4285
 
     * into the document in parallel, as oppposed to the default behavior, which is to chain load them (where possible). 
4286
 
     * This flag is more useful for scripts currently, since for css Get only chains if not Webkit/Gecko.</dd>
4287
 
     * <dt>context</dt>
4288
 
     * <dd>the execution context for the callbacks</dd>
4289
 
     * <dt>win</dt>
4290
 
     * <dd>a window other than the one the utility occupies</dd>
4291
 
     * <dt>data</dt>
4292
 
     * <dd>
4293
 
     * data that is supplied to the callbacks when the nodes(s) are
4294
 
     * loaded.
4295
 
     * </dd>
4296
 
     * <dt>insertBefore</dt>
4297
 
     * <dd>node or node id that will become the new node's nextSibling</dd>
4298
 
     * <dt>charset</dt>
4299
 
     * <dd>Node charset, default utf-8 (deprecated, use the attributes
4300
 
     * config)</dd>
4301
 
     * <dt>attributes</dt>
4302
 
     * <dd>An object literal containing additional attributes to add to
4303
 
     * the link tags</dd>
4304
 
     * </dl>
4305
 
     * <pre>
4306
 
     * Y.Get.css("http://localhost/css/menu.css");
4307
 
     * </pre>
4308
 
     * <pre>
4309
 
     * &nbsp; Y.Get.css(
4310
 
     * &nbsp; ["http://localhost/css/menu.css",
4311
 
     * &nbsp;  "http://localhost/css/logger.css"], &#123;
4312
 
     * &nbsp;   insertBefore: 'custom-styles' // nodes will be inserted
4313
 
     * &nbsp;                                 // before the specified node
4314
 
     * &nbsp; &#125;);.
4315
 
     * </pre>
4316
 
     * @return {tId: string} an object containing info about the
4317
 
     * transaction.
4318
 
     */
4319
 
    css: function(url, opts) {
4320
 
        return _queue('css', url, opts);
4321
 
    }
4322
 
};
4323
 
 
4324
 
 
4325
 
}, '3.4.1' ,{requires:['yui-base']});
4326
 
YUI.add('features', function(Y) {
4327
 
 
4328
 
var feature_tests = {};
4329
 
 
4330
 
/**
4331
 
Contains the core of YUI's feature test architecture.
4332
 
@module features
4333
 
*/
4334
 
 
4335
 
/**
4336
 
* Feature detection
4337
 
* @class Features
4338
 
* @static
4339
 
*/
4340
 
 
4341
 
Y.mix(Y.namespace('Features'), {
4342
 
    
4343
 
    /**
4344
 
    * Object hash of all registered feature tests
4345
 
    * @property tests
4346
 
    * @type Object
4347
 
    */
4348
 
    tests: feature_tests,
4349
 
    
4350
 
    /**
4351
 
    * Add a test to the system
4352
 
    * 
4353
 
    *   ```
4354
 
    *   Y.Features.add("load", "1", {});
4355
 
    *   ```
4356
 
    * 
4357
 
    * @method add
4358
 
    * @param {String} cat The category, right now only 'load' is supported
4359
 
    * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3
4360
 
    * @param {Object} o Object containing test properties
4361
 
    * @param {String} o.name The name of the test
4362
 
    * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance
4363
 
    * @param {String} o.trigger The module that triggers this test.
4364
 
    */
4365
 
    add: function(cat, name, o) {
4366
 
        feature_tests[cat] = feature_tests[cat] || {};
4367
 
        feature_tests[cat][name] = o;
4368
 
    },
4369
 
    /**
4370
 
    * Execute all tests of a given category and return the serialized results
4371
 
    *
4372
 
    *   ```
4373
 
    *   caps=1:1;2:1;3:0
4374
 
    *   ```
4375
 
    * @method all
4376
 
    * @param {String} cat The category to execute
4377
 
    * @param {Array} args The arguments to pass to the test function
4378
 
    * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0
4379
 
    */
4380
 
    all: function(cat, args) {
4381
 
        var cat_o = feature_tests[cat],
4382
 
            // results = {};
4383
 
            result = [];
4384
 
        if (cat_o) {
4385
 
            Y.Object.each(cat_o, function(v, k) {
4386
 
                result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));
4387
 
            });
4388
 
        }
4389
 
 
4390
 
        return (result.length) ? result.join(';') : '';
4391
 
    },
4392
 
    /**
4393
 
    * Run a sepecific test and return a Boolean response.
4394
 
    *
4395
 
    *   ```
4396
 
    *   Y.Features.test("load", "1");
4397
 
    *   ```
4398
 
    *
4399
 
    * @method test
4400
 
    * @param {String} cat The category of the test to run
4401
 
    * @param {String} name The name of the test to run
4402
 
    * @param {Array} args The arguments to pass to the test function
4403
 
    * @return {Boolean} True or false if the test passed/failed.
4404
 
    */
4405
 
    test: function(cat, name, args) {
4406
 
        args = args || [];
4407
 
        var result, ua, test,
4408
 
            cat_o = feature_tests[cat],
4409
 
            feature = cat_o && cat_o[name];
4410
 
 
4411
 
        if (!feature) {
4412
 
            Y.log('Feature test ' + cat + ', ' + name + ' not found');
4413
 
        } else {
4414
 
 
4415
 
            result = feature.result;
4416
 
 
4417
 
            if (Y.Lang.isUndefined(result)) {
4418
 
 
4419
 
                ua = feature.ua;
4420
 
                if (ua) {
4421
 
                    result = (Y.UA[ua]);
4422
 
                }
4423
 
 
4424
 
                test = feature.test;
4425
 
                if (test && ((!ua) || result)) {
4426
 
                    result = test.apply(Y, args);
4427
 
                }
4428
 
 
4429
 
                feature.result = result;
4430
 
            }
4431
 
        }
4432
 
 
4433
 
        return result;
4434
 
    }
4435
 
});
4436
 
 
4437
 
// Y.Features.add("load", "1", {});
4438
 
// Y.Features.test("load", "1");
4439
 
// caps=1:1;2:0;3:1;
4440
 
 
4441
 
/* This file is auto-generated by src/loader/scripts/meta_join.py */
4442
 
var add = Y.Features.add;
4443
 
// graphics-canvas-default
4444
 
add('load', '0', {
4445
 
    "name": "graphics-canvas-default", 
4446
 
    "test": function(Y) {
4447
 
    var DOCUMENT = Y.config.doc,
4448
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4449
 
        return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
4450
 
}, 
4451
 
    "trigger": "graphics"
4452
 
});
4453
 
// autocomplete-list-keys
4454
 
add('load', '1', {
4455
 
    "name": "autocomplete-list-keys", 
4456
 
    "test": function (Y) {
4457
 
    // Only add keyboard support to autocomplete-list if this doesn't appear to
4458
 
    // be an iOS or Android-based mobile device.
4459
 
    //
4460
 
    // There's currently no feasible way to actually detect whether a device has
4461
 
    // a hardware keyboard, so this sniff will have to do. It can easily be
4462
 
    // overridden by manually loading the autocomplete-list-keys module.
4463
 
    //
4464
 
    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
4465
 
    // doesn't fire the keyboard events used by AutoCompleteList, so there's
4466
 
    // no point loading the -keys module even when a bluetooth keyboard may be
4467
 
    // available.
4468
 
    return !(Y.UA.ios || Y.UA.android);
4469
 
}, 
4470
 
    "trigger": "autocomplete-list"
4471
 
});
4472
 
// graphics-svg
4473
 
add('load', '2', {
4474
 
    "name": "graphics-svg", 
4475
 
    "test": function(Y) {
4476
 
    var DOCUMENT = Y.config.doc;
4477
 
        return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
4478
 
}, 
4479
 
    "trigger": "graphics"
4480
 
});
4481
 
// history-hash-ie
4482
 
add('load', '3', {
4483
 
    "name": "history-hash-ie", 
4484
 
    "test": function (Y) {
4485
 
    var docMode = Y.config.doc && Y.config.doc.documentMode;
4486
 
 
4487
 
    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
4488
 
            !docMode || docMode < 8);
4489
 
}, 
4490
 
    "trigger": "history-hash"
4491
 
});
4492
 
// graphics-vml-default
4493
 
add('load', '4', {
4494
 
    "name": "graphics-vml-default", 
4495
 
    "test": function(Y) {
4496
 
    var DOCUMENT = Y.config.doc,
4497
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4498
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
4499
 
}, 
4500
 
    "trigger": "graphics"
4501
 
});
4502
 
// graphics-svg-default
4503
 
add('load', '5', {
4504
 
    "name": "graphics-svg-default", 
4505
 
    "test": function(Y) {
4506
 
    var DOCUMENT = Y.config.doc;
4507
 
        return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
4508
 
}, 
4509
 
    "trigger": "graphics"
4510
 
});
4511
 
// widget-base-ie
4512
 
add('load', '6', {
4513
 
    "name": "widget-base-ie", 
4514
 
    "trigger": "widget-base", 
4515
 
    "ua": "ie"
4516
 
});
4517
 
// transition-timer
4518
 
add('load', '7', {
4519
 
    "name": "transition-timer", 
4520
 
    "test": function (Y) {
4521
 
    var DOCUMENT = Y.config.doc,
4522
 
        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
4523
 
        ret = true;
4524
 
 
4525
 
    if (node && node.style) {
4526
 
        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
4527
 
    } 
4528
 
 
4529
 
    return ret;
4530
 
}, 
4531
 
    "trigger": "transition"
4532
 
});
4533
 
// dom-style-ie
4534
 
add('load', '8', {
4535
 
    "name": "dom-style-ie", 
4536
 
    "test": function (Y) {
4537
 
 
4538
 
    var testFeature = Y.Features.test,
4539
 
        addFeature = Y.Features.add,
4540
 
        WINDOW = Y.config.win,
4541
 
        DOCUMENT = Y.config.doc,
4542
 
        DOCUMENT_ELEMENT = 'documentElement',
4543
 
        ret = false;
4544
 
 
4545
 
    addFeature('style', 'computedStyle', {
4546
 
        test: function() {
4547
 
            return WINDOW && 'getComputedStyle' in WINDOW;
4548
 
        }
4549
 
    });
4550
 
 
4551
 
    addFeature('style', 'opacity', {
4552
 
        test: function() {
4553
 
            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
4554
 
        }
4555
 
    });
4556
 
 
4557
 
    ret =  (!testFeature('style', 'opacity') &&
4558
 
            !testFeature('style', 'computedStyle'));
4559
 
 
4560
 
    return ret;
4561
 
}, 
4562
 
    "trigger": "dom-style"
4563
 
});
4564
 
// selector-css2
4565
 
add('load', '9', {
4566
 
    "name": "selector-css2", 
4567
 
    "test": function (Y) {
4568
 
    var DOCUMENT = Y.config.doc,
4569
 
        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
4570
 
 
4571
 
    return ret;
4572
 
}, 
4573
 
    "trigger": "selector"
4574
 
});
4575
 
// event-base-ie
4576
 
add('load', '10', {
4577
 
    "name": "event-base-ie", 
4578
 
    "test": function(Y) {
4579
 
    var imp = Y.config.doc && Y.config.doc.implementation;
4580
 
    return (imp && (!imp.hasFeature('Events', '2.0')));
4581
 
}, 
4582
 
    "trigger": "node-base"
4583
 
});
4584
 
// dd-gestures
4585
 
add('load', '11', {
4586
 
    "name": "dd-gestures", 
4587
 
    "test": function(Y) {
4588
 
    return (Y.config.win && ('ontouchstart' in Y.config.win && !Y.UA.chrome));
4589
 
}, 
4590
 
    "trigger": "dd-drag"
4591
 
});
4592
 
// scrollview-base-ie
4593
 
add('load', '12', {
4594
 
    "name": "scrollview-base-ie", 
4595
 
    "trigger": "scrollview-base", 
4596
 
    "ua": "ie"
4597
 
});
4598
 
// graphics-canvas
4599
 
add('load', '13', {
4600
 
    "name": "graphics-canvas", 
4601
 
    "test": function(Y) {
4602
 
    var DOCUMENT = Y.config.doc,
4603
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4604
 
        return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
4605
 
}, 
4606
 
    "trigger": "graphics"
4607
 
});
4608
 
// graphics-vml
4609
 
add('load', '14', {
4610
 
    "name": "graphics-vml", 
4611
 
    "test": function(Y) {
4612
 
    var DOCUMENT = Y.config.doc,
4613
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4614
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
4615
 
}, 
4616
 
    "trigger": "graphics"
4617
 
});
4618
 
 
4619
 
 
4620
 
}, '3.4.1' ,{requires:['yui-base']});
4621
 
YUI.add('intl-base', function(Y) {
4622
 
 
4623
 
/**
4624
 
 * The Intl utility provides a central location for managing sets of
4625
 
 * localized resources (strings and formatting patterns).
4626
 
 *
4627
 
 * @class Intl
4628
 
 * @uses EventTarget
4629
 
 * @static
4630
 
 */
4631
 
 
4632
 
var SPLIT_REGEX = /[, ]/;
4633
 
 
4634
 
Y.mix(Y.namespace('Intl'), {
4635
 
 
4636
 
 /**
4637
 
    * Returns the language among those available that
4638
 
    * best matches the preferred language list, using the Lookup
4639
 
    * algorithm of BCP 47.
4640
 
    * If none of the available languages meets the user's preferences,
4641
 
    * then "" is returned.
4642
 
    * Extended language ranges are not supported.
4643
 
    *
4644
 
    * @method lookupBestLang
4645
 
    * @param {String[] | String} preferredLanguages The list of preferred
4646
 
    * languages in descending preference order, represented as BCP 47
4647
 
    * language tags. A string array or a comma-separated list.
4648
 
    * @param {String[]} availableLanguages The list of languages
4649
 
    * that the application supports, represented as BCP 47 language
4650
 
    * tags.
4651
 
    *
4652
 
    * @return {String} The available language that best matches the
4653
 
    * preferred language list, or "".
4654
 
    * @since 3.1.0
4655
 
    */
4656
 
    lookupBestLang: function(preferredLanguages, availableLanguages) {
4657
 
 
4658
 
        var i, language, result, index;
4659
 
 
4660
 
        // check whether the list of available languages contains language;
4661
 
        // if so return it
4662
 
        function scan(language) {
4663
 
            var i;
4664
 
            for (i = 0; i < availableLanguages.length; i += 1) {
4665
 
                if (language.toLowerCase() ===
4666
 
                            availableLanguages[i].toLowerCase()) {
4667
 
                    return availableLanguages[i];
4668
 
                }
4669
 
            }
4670
 
        }
4671
 
 
4672
 
        if (Y.Lang.isString(preferredLanguages)) {
4673
 
            preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
4674
 
        }
4675
 
 
4676
 
        for (i = 0; i < preferredLanguages.length; i += 1) {
4677
 
            language = preferredLanguages[i];
4678
 
            if (!language || language === '*') {
4679
 
                continue;
4680
 
            }
4681
 
            // check the fallback sequence for one language
4682
 
            while (language.length > 0) {
4683
 
                result = scan(language);
4684
 
                if (result) {
4685
 
                    return result;
4686
 
                } else {
4687
 
                    index = language.lastIndexOf('-');
4688
 
                    if (index >= 0) {
4689
 
                        language = language.substring(0, index);
4690
 
                        // one-character subtags get cut along with the
4691
 
                        // following subtag
4692
 
                        if (index >= 2 && language.charAt(index - 2) === '-') {
4693
 
                            language = language.substring(0, index - 2);
4694
 
                        }
4695
 
                    } else {
4696
 
                        // nothing available for this language
4697
 
                        break;
4698
 
                    }
4699
 
                }
4700
 
            }
4701
 
        }
4702
 
 
4703
 
        return '';
4704
 
    }
4705
 
});
4706
 
 
4707
 
 
4708
 
}, '3.4.1' ,{requires:['yui-base']});
4709
 
YUI.add('yui-log', function(Y) {
4710
 
 
4711
 
/**
4712
 
 * Provides console log capability and exposes a custom event for
4713
 
 * 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>.
4714
 
 *
4715
 
 * @module yui
4716
 
 * @submodule yui-log
4717
 
 */
4718
 
 
4719
 
var INSTANCE = Y,
4720
 
    LOGEVENT = 'yui:log',
4721
 
    UNDEFINED = 'undefined',
4722
 
    LEVELS = { debug: 1,
4723
 
               info: 1,
4724
 
               warn: 1,
4725
 
               error: 1 };
4726
 
 
4727
 
/**
4728
 
 * If the 'debug' config is true, a 'yui:log' event will be
4729
 
 * dispatched, which the Console widget and anything else
4730
 
 * can consume.  If the 'useBrowserConsole' config is true, it will
4731
 
 * write to the browser console if available.  YUI-specific log
4732
 
 * messages will only be present in the -debug versions of the
4733
 
 * JS files.  The build system is supposed to remove log statements
4734
 
 * from the raw and minified versions of the files.
4735
 
 *
4736
 
 * @method log
4737
 
 * @for YUI
4738
 
 * @param  {String}  msg  The message to log.
4739
 
 * @param  {String}  cat  The log category for the message.  Default
4740
 
 *                        categories are "info", "warn", "error", time".
4741
 
 *                        Custom categories can be used as well. (opt).
4742
 
 * @param  {String}  src  The source of the the message (opt).
4743
 
 * @param  {boolean} silent If true, the log event won't fire.
4744
 
 * @return {YUI}      YUI instance.
4745
 
 */
4746
 
INSTANCE.log = function(msg, cat, src, silent) {
4747
 
    var bail, excl, incl, m, f,
4748
 
        Y = INSTANCE,
4749
 
        c = Y.config,
4750
 
        publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
4751
 
    // suppress log message if the config is off or the event stack
4752
 
    // or the event call stack contains a consumer of the yui:log event
4753
 
    if (c.debug) {
4754
 
        // apply source filters
4755
 
        if (src) {
4756
 
            excl = c.logExclude;
4757
 
            incl = c.logInclude;
4758
 
            if (incl && !(src in incl)) {
4759
 
                bail = 1;
4760
 
            } else if (incl && (src in incl)) {
4761
 
                bail = !incl[src];
4762
 
            } else if (excl && (src in excl)) {
4763
 
                bail = excl[src];
4764
 
            }
4765
 
        }
4766
 
        if (!bail) {
4767
 
            if (c.useBrowserConsole) {
4768
 
                m = (src) ? src + ': ' + msg : msg;
4769
 
                if (Y.Lang.isFunction(c.logFn)) {
4770
 
                    c.logFn.call(Y, msg, cat, src);
4771
 
                } else if (typeof console != UNDEFINED && console.log) {
4772
 
                    f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
4773
 
                    console[f](m);
4774
 
                } else if (typeof opera != UNDEFINED) {
4775
 
                    opera.postError(m);
4776
 
                }
4777
 
            }
4778
 
 
4779
 
            if (publisher && !silent) {
4780
 
 
4781
 
                if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {
4782
 
                    publisher.publish(LOGEVENT, {
4783
 
                        broadcast: 2
4784
 
                    });
4785
 
                }
4786
 
 
4787
 
                publisher.fire(LOGEVENT, {
4788
 
                    msg: msg,
4789
 
                    cat: cat,
4790
 
                    src: src
4791
 
                });
4792
 
            }
4793
 
        }
4794
 
    }
4795
 
 
4796
 
    return Y;
4797
 
};
4798
 
 
4799
 
/**
4800
 
 * Write a system message.  This message will be preserved in the
4801
 
 * minified and raw versions of the YUI files, unlike log statements.
4802
 
 * @method message
4803
 
 * @for YUI
4804
 
 * @param  {String}  msg  The message to log.
4805
 
 * @param  {String}  cat  The log category for the message.  Default
4806
 
 *                        categories are "info", "warn", "error", time".
4807
 
 *                        Custom categories can be used as well. (opt).
4808
 
 * @param  {String}  src  The source of the the message (opt).
4809
 
 * @param  {boolean} silent If true, the log event won't fire.
4810
 
 * @return {YUI}      YUI instance.
4811
 
 */
4812
 
INSTANCE.message = function() {
4813
 
    return INSTANCE.log.apply(INSTANCE, arguments);
4814
 
};
4815
 
 
4816
 
 
4817
 
}, '3.4.1' ,{requires:['yui-base']});
4818
 
YUI.add('yui-later', function(Y) {
4819
 
 
4820
 
/**
4821
 
 * 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>.
4822
 
 *
4823
 
 * @module yui
4824
 
 * @submodule yui-later
4825
 
 */
4826
 
 
4827
 
var NO_ARGS = [];
4828
 
 
4829
 
/**
4830
 
 * Executes the supplied function in the context of the supplied
4831
 
 * object 'when' milliseconds later.  Executes the function a
4832
 
 * single time unless periodic is set to true.
4833
 
 * @for YUI
4834
 
 * @method later
4835
 
 * @param when {int} the number of milliseconds to wait until the fn
4836
 
 * is executed.
4837
 
 * @param o the context object.
4838
 
 * @param fn {Function|String} the function to execute or the name of
4839
 
 * the method in the 'o' object to execute.
4840
 
 * @param data [Array] data that is provided to the function.  This
4841
 
 * accepts either a single item or an array.  If an array is provided,
4842
 
 * the function is executed with one parameter for each array item.
4843
 
 * If you need to pass a single array parameter, it needs to be wrapped
4844
 
 * in an array [myarray].
4845
 
 *
4846
 
 * Note: native methods in IE may not have the call and apply methods.
4847
 
 * In this case, it will work, but you are limited to four arguments.
4848
 
 *
4849
 
 * @param periodic {boolean} if true, executes continuously at supplied
4850
 
 * interval until canceled.
4851
 
 * @return {object} a timer object. Call the cancel() method on this
4852
 
 * object to stop the timer.
4853
 
 */
4854
 
Y.later = function(when, o, fn, data, periodic) {
4855
 
    when = when || 0;
4856
 
    data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
4857
 
    o = o || Y.config.win || Y;
4858
 
 
4859
 
    var cancelled = false,
4860
 
        method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
4861
 
        wrapper = function() {
4862
 
            // IE 8- may execute a setInterval callback one last time
4863
 
            // after clearInterval was called, so in order to preserve
4864
 
            // the cancel() === no more runny-run, we have to jump through
4865
 
            // an extra hoop.
4866
 
            if (!cancelled) {
4867
 
                if (!method.apply) {
4868
 
                    method(data[0], data[1], data[2], data[3]);
4869
 
                } else {
4870
 
                    method.apply(o, data || NO_ARGS);
4871
 
                }
4872
 
            }
4873
 
        },
4874
 
        id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
4875
 
 
4876
 
    return {
4877
 
        id: id,
4878
 
        interval: periodic,
4879
 
        cancel: function() {
4880
 
            cancelled = true;
4881
 
            if (this.interval) {
4882
 
                clearInterval(id);
4883
 
            } else {
4884
 
                clearTimeout(id);
4885
 
            }
4886
 
        }
4887
 
    };
4888
 
};
4889
 
 
4890
 
Y.Lang.later = Y.later;
4891
 
 
4892
 
 
4893
 
 
4894
 
}, '3.4.1' ,{requires:['yui-base']});
4895
 
YUI.add('loader-base', function(Y) {
4896
 
 
4897
 
/**
4898
 
 * The YUI loader core
4899
 
 * @module loader
4900
 
 * @submodule loader-base
4901
 
 */
4902
 
 
4903
 
if (!YUI.Env[Y.version]) {
4904
 
 
4905
 
    (function() {
4906
 
        var VERSION = Y.version,
4907
 
            BUILD = '/build/',
4908
 
            ROOT = VERSION + BUILD,
4909
 
            CDN_BASE = Y.Env.base,
4910
 
            GALLERY_VERSION = 'gallery-2011.09.14-20-40',
4911
 
            TNT = '2in3',
4912
 
            TNT_VERSION = '4',
4913
 
            YUI2_VERSION = '2.9.0',
4914
 
            COMBO_BASE = CDN_BASE + 'combo?',
4915
 
            META = { version: VERSION,
4916
 
                              root: ROOT,
4917
 
                              base: Y.Env.base,
4918
 
                              comboBase: COMBO_BASE,
4919
 
                              skin: { defaultSkin: 'sam',
4920
 
                                           base: 'assets/skins/',
4921
 
                                           path: 'skin.css',
4922
 
                                           after: ['cssreset',
4923
 
                                                          'cssfonts',
4924
 
                                                          'cssgrids',
4925
 
                                                          'cssbase',
4926
 
                                                          'cssreset-context',
4927
 
                                                          'cssfonts-context']},
4928
 
                              groups: {},
4929
 
                              patterns: {} },
4930
 
            groups = META.groups,
4931
 
            yui2Update = function(tnt, yui2) {
4932
 
                                  var root = TNT + '.' +
4933
 
                                            (tnt || TNT_VERSION) + '/' +
4934
 
                                            (yui2 || YUI2_VERSION) + BUILD;
4935
 
                                  groups.yui2.base = CDN_BASE + root;
4936
 
                                  groups.yui2.root = root;
4937
 
                              },
4938
 
            galleryUpdate = function(tag) {
4939
 
                                  var root = (tag || GALLERY_VERSION) + BUILD;
4940
 
                                  groups.gallery.base = CDN_BASE + root;
4941
 
                                  groups.gallery.root = root;
4942
 
                              };
4943
 
 
4944
 
        groups[VERSION] = {};
4945
 
 
4946
 
        groups.gallery = {
4947
 
            ext: false,
4948
 
            combine: true,
4949
 
            comboBase: COMBO_BASE,
4950
 
            update: galleryUpdate,
4951
 
            patterns: { 'gallery-': { },
4952
 
                        'lang/gallery-': {},
4953
 
                        'gallerycss-': { type: 'css' } }
4954
 
        };
4955
 
 
4956
 
        groups.yui2 = {
4957
 
            combine: true,
4958
 
            ext: false,
4959
 
            comboBase: COMBO_BASE,
4960
 
            update: yui2Update,
4961
 
            patterns: {
4962
 
                'yui2-': {
4963
 
                    configFn: function(me) {
4964
 
                        if (/-skin|reset|fonts|grids|base/.test(me.name)) {
4965
 
                            me.type = 'css';
4966
 
                            me.path = me.path.replace(/\.js/, '.css');
4967
 
                            // this makes skins in builds earlier than
4968
 
                            // 2.6.0 work as long as combine is false
4969
 
                            me.path = me.path.replace(/\/yui2-skin/,
4970
 
                                             '/assets/skins/sam/yui2-skin');
4971
 
                        }
4972
 
                    }
4973
 
                }
4974
 
            }
4975
 
        };
4976
 
 
4977
 
        galleryUpdate();
4978
 
        yui2Update();
4979
 
 
4980
 
        YUI.Env[VERSION] = META;
4981
 
    }());
4982
 
}
4983
 
 
4984
 
 
4985
 
/**
4986
 
 * Loader dynamically loads script and css files.  It includes the dependency
4987
 
 * info for the version of the library in use, and will automatically pull in
4988
 
 * dependencies for the modules requested.  It supports rollup files and will
4989
 
 * automatically use these when appropriate in order to minimize the number of
4990
 
 * http connections required to load all of the dependencies.  It can load the
4991
 
 * files from the Yahoo! CDN, and it can utilize the combo service provided on
4992
 
 * this network to reduce the number of http connections required to download
4993
 
 * YUI files.
4994
 
 *
4995
 
 * @module loader
4996
 
 * @main loader
4997
 
 * @submodule loader-base
4998
 
 */
4999
 
 
5000
 
var NOT_FOUND = {},
5001
 
    NO_REQUIREMENTS = [],
5002
 
    MAX_URL_LENGTH = 2048,
5003
 
    GLOBAL_ENV = YUI.Env,
5004
 
    GLOBAL_LOADED = GLOBAL_ENV._loaded,
5005
 
    CSS = 'css',
5006
 
    JS = 'js',
5007
 
    INTL = 'intl',
5008
 
    VERSION = Y.version,
5009
 
    ROOT_LANG = '',
5010
 
    YObject = Y.Object,
5011
 
    oeach = YObject.each,
5012
 
    YArray = Y.Array,
5013
 
    _queue = GLOBAL_ENV._loaderQueue,
5014
 
    META = GLOBAL_ENV[VERSION],
5015
 
    SKIN_PREFIX = 'skin-',
5016
 
    L = Y.Lang,
5017
 
    ON_PAGE = GLOBAL_ENV.mods,
5018
 
    modulekey,
5019
 
    cache,
5020
 
    _path = function(dir, file, type, nomin) {
5021
 
                        var path = dir + '/' + file;
5022
 
                        if (!nomin) {
5023
 
                            path += '-min';
5024
 
                        }
5025
 
                        path += '.' + (type || CSS);
5026
 
 
5027
 
                        return path;
5028
 
                    };
5029
 
 
5030
 
if (YUI.Env.aliases) {
5031
 
    YUI.Env.aliases = {}; //Don't need aliases if Loader is present
5032
 
}
5033
 
 
5034
 
/**
5035
 
 * The component metadata is stored in Y.Env.meta.
5036
 
 * Part of the loader module.
5037
 
 * @property meta
5038
 
 * @for YUI
5039
 
 */
5040
 
Y.Env.meta = META;
5041
 
 
5042
 
/**
5043
 
 * Loader dynamically loads script and css files.  It includes the dependency
5044
 
 * info for the version of the library in use, and will automatically pull in
5045
 
 * dependencies for the modules requested.  It supports rollup files and will
5046
 
 * automatically use these when appropriate in order to minimize the number of
5047
 
 * http connections required to load all of the dependencies.  It can load the
5048
 
 * files from the Yahoo! CDN, and it can utilize the combo service provided on
5049
 
 * this network to reduce the number of http connections required to download
5050
 
 * YUI files.
5051
 
 *
5052
 
 * While the loader can be instantiated by the end user, it normally is not.
5053
 
 * @see YUI.use for the normal use case.  The use function automatically will
5054
 
 * pull in missing dependencies.
5055
 
 *
5056
 
 * @constructor
5057
 
 * @class Loader
5058
 
 * @param {object} o an optional set of configuration options.  Valid options:
5059
 
 * <ul>
5060
 
 *  <li>base:
5061
 
 *  The base dir</li>
5062
 
 *  <li>comboBase:
5063
 
 *  The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
5064
 
 *  <li>root:
5065
 
 *  The root path to prepend to module names for the combo service.
5066
 
 *  Ex: 2.5.2/build/</li>
5067
 
 *  <li>filter:.
5068
 
 *
5069
 
 * A filter to apply to result urls.  This filter will modify the default
5070
 
 * path for all modules.  The default path for the YUI library is the
5071
 
 * minified version of the files (e.g., event-min.js).  The filter property
5072
 
 * can be a predefined filter or a custom filter.  The valid predefined
5073
 
 * filters are:
5074
 
 * <dl>
5075
 
 *  <dt>DEBUG</dt>
5076
 
 *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
5077
 
 *      This option will automatically include the Logger widget</dd>
5078
 
 *  <dt>RAW</dt>
5079
 
 *  <dd>Selects the non-minified version of the library (e.g., event.js).
5080
 
 *  </dd>
5081
 
 * </dl>
5082
 
 * You can also define a custom filter, which must be an object literal
5083
 
 * containing a search expression and a replace string:
5084
 
 * <pre>
5085
 
 *  myFilter: &#123;
5086
 
 *      'searchExp': "-min\\.js",
5087
 
 *      'replaceStr': "-debug.js"
5088
 
 *  &#125;
5089
 
 * </pre>
5090
 
 *
5091
 
 *  </li>
5092
 
 *  <li>filters: per-component filter specification.  If specified
5093
 
 *  for a given component, this overrides the filter config. _Note:_ This does not work on combo urls, use the filter property instead.</li>
5094
 
 *  <li>combine:
5095
 
 *  Use the YUI combo service to reduce the number of http connections
5096
 
 *  required to load your dependencies</li>
5097
 
 *  <li>ignore:
5098
 
 *  A list of modules that should never be dynamically loaded</li>
5099
 
 *  <li>force:
5100
 
 *  A list of modules that should always be loaded when required, even if
5101
 
 *  already present on the page</li>
5102
 
 *  <li>insertBefore:
5103
 
 *  Node or id for a node that should be used as the insertion point for
5104
 
 *  new nodes</li>
5105
 
 *  <li>charset:
5106
 
 *  charset for dynamic nodes (deprecated, use jsAttributes or cssAttributes)
5107
 
 *  </li>
5108
 
 *  <li>jsAttributes: object literal containing attributes to add to script
5109
 
 *  nodes</li>
5110
 
 *  <li>cssAttributes: object literal containing attributes to add to link
5111
 
 *  nodes</li>
5112
 
 *  <li>timeout:
5113
 
 *  The number of milliseconds before a timeout occurs when dynamically
5114
 
 *  loading nodes.  If not set, there is no timeout</li>
5115
 
 *  <li>context:
5116
 
 *  execution context for all callbacks</li>
5117
 
 *  <li>onSuccess:
5118
 
 *  callback for the 'success' event</li>
5119
 
 *  <li>onFailure: callback for the 'failure' event</li>
5120
 
 *  <li>onCSS: callback for the 'CSSComplete' event.  When loading YUI
5121
 
 *  components with CSS the CSS is loaded first, then the script.  This
5122
 
 *  provides a moment you can tie into to improve
5123
 
 *  the presentation of the page while the script is loading.</li>
5124
 
 *  <li>onTimeout:
5125
 
 *  callback for the 'timeout' event</li>
5126
 
 *  <li>onProgress:
5127
 
 *  callback executed each time a script or css file is loaded</li>
5128
 
 *  <li>modules:
5129
 
 *  A list of module definitions.  See Loader.addModule for the supported
5130
 
 *  module metadata</li>
5131
 
 *  <li>groups:
5132
 
 *  A list of group definitions.  Each group can contain specific definitions
5133
 
 *  for base, comboBase, combine, and accepts a list of modules.  See above
5134
 
 *  for the description of these properties.</li>
5135
 
 *  <li>2in3: the version of the YUI 2 in 3 wrapper to use.  The intrinsic
5136
 
 *  support for YUI 2 modules in YUI 3 relies on versions of the YUI 2
5137
 
 *  components inside YUI 3 module wrappers.  These wrappers
5138
 
 *  change over time to accomodate the issues that arise from running YUI 2
5139
 
 *  in a YUI 3 sandbox.</li>
5140
 
 *  <li>yui2: when using the 2in3 project, you can select the version of
5141
 
 *  YUI 2 to use.  Valid values *  are 2.2.2, 2.3.1, 2.4.1, 2.5.2, 2.6.0,
5142
 
 *  2.7.0, 2.8.0, and 2.8.1 [default] -- plus all versions of YUI 2
5143
 
 *  going forward.</li>
5144
 
 * </ul>
5145
 
 */
5146
 
Y.Loader = function(o) {
5147
 
 
5148
 
    var defaults = META.modules,
5149
 
        self = this;
5150
 
 
5151
 
    modulekey = META.md5;
5152
 
 
5153
 
    /**
5154
 
     * Internal callback to handle multiple internal insert() calls
5155
 
     * so that css is inserted prior to js
5156
 
     * @property _internalCallback
5157
 
     * @private
5158
 
     */
5159
 
    // self._internalCallback = null;
5160
 
 
5161
 
    /**
5162
 
     * Callback that will be executed when the loader is finished
5163
 
     * with an insert
5164
 
     * @method onSuccess
5165
 
     * @type function
5166
 
     */
5167
 
    // self.onSuccess = null;
5168
 
 
5169
 
    /**
5170
 
     * Callback that will be executed if there is a failure
5171
 
     * @method onFailure
5172
 
     * @type function
5173
 
     */
5174
 
    // self.onFailure = null;
5175
 
 
5176
 
    /**
5177
 
     * Callback for the 'CSSComplete' event.  When loading YUI components
5178
 
     * with CSS the CSS is loaded first, then the script.  This provides
5179
 
     * a moment you can tie into to improve the presentation of the page
5180
 
     * while the script is loading.
5181
 
     * @method onCSS
5182
 
     * @type function
5183
 
     */
5184
 
    // self.onCSS = null;
5185
 
 
5186
 
    /**
5187
 
     * Callback executed each time a script or css file is loaded
5188
 
     * @method onProgress
5189
 
     * @type function
5190
 
     */
5191
 
    // self.onProgress = null;
5192
 
 
5193
 
    /**
5194
 
     * Callback that will be executed if a timeout occurs
5195
 
     * @method onTimeout
5196
 
     * @type function
5197
 
     */
5198
 
    // self.onTimeout = null;
5199
 
 
5200
 
    /**
5201
 
     * The execution context for all callbacks
5202
 
     * @property context
5203
 
     * @default {YUI} the YUI instance
5204
 
     */
5205
 
    self.context = Y;
5206
 
 
5207
 
    /**
5208
 
     * Data that is passed to all callbacks
5209
 
     * @property data
5210
 
     */
5211
 
    // self.data = null;
5212
 
 
5213
 
    /**
5214
 
     * Node reference or id where new nodes should be inserted before
5215
 
     * @property insertBefore
5216
 
     * @type string|HTMLElement
5217
 
     */
5218
 
    // self.insertBefore = null;
5219
 
 
5220
 
    /**
5221
 
     * The charset attribute for inserted nodes
5222
 
     * @property charset
5223
 
     * @type string
5224
 
     * @deprecated , use cssAttributes or jsAttributes.
5225
 
     */
5226
 
    // self.charset = null;
5227
 
 
5228
 
    /**
5229
 
     * An object literal containing attributes to add to link nodes
5230
 
     * @property cssAttributes
5231
 
     * @type object
5232
 
     */
5233
 
    // self.cssAttributes = null;
5234
 
 
5235
 
    /**
5236
 
     * An object literal containing attributes to add to script nodes
5237
 
     * @property jsAttributes
5238
 
     * @type object
5239
 
     */
5240
 
    // self.jsAttributes = null;
5241
 
 
5242
 
    /**
5243
 
     * The base directory.
5244
 
     * @property base
5245
 
     * @type string
5246
 
     * @default http://yui.yahooapis.com/[YUI VERSION]/build/
5247
 
     */
5248
 
    self.base = Y.Env.meta.base + Y.Env.meta.root;
5249
 
 
5250
 
    /**
5251
 
     * Base path for the combo service
5252
 
     * @property comboBase
5253
 
     * @type string
5254
 
     * @default http://yui.yahooapis.com/combo?
5255
 
     */
5256
 
    self.comboBase = Y.Env.meta.comboBase;
5257
 
 
5258
 
    /*
5259
 
     * Base path for language packs.
5260
 
     */
5261
 
    // self.langBase = Y.Env.meta.langBase;
5262
 
    // self.lang = "";
5263
 
 
5264
 
    /**
5265
 
     * If configured, the loader will attempt to use the combo
5266
 
     * service for YUI resources and configured external resources.
5267
 
     * @property combine
5268
 
     * @type boolean
5269
 
     * @default true if a base dir isn't in the config
5270
 
     */
5271
 
    self.combine = o.base &&
5272
 
        (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
5273
 
    
5274
 
    /**
5275
 
    * The default seperator to use between files in a combo URL
5276
 
    * @property comboSep
5277
 
    * @type {String}
5278
 
    * @default Ampersand
5279
 
    */
5280
 
    self.comboSep = '&';
5281
 
    /**
5282
 
     * Max url length for combo urls.  The default is 2048. This is the URL
5283
 
     * limit for the Yahoo! hosted combo servers.  If consuming
5284
 
     * a different combo service that has a different URL limit
5285
 
     * it is possible to override this default by supplying
5286
 
     * the maxURLLength config option.  The config option will
5287
 
     * only take effect if lower than the default.
5288
 
     *
5289
 
     * @property maxURLLength
5290
 
     * @type int
5291
 
     */
5292
 
    self.maxURLLength = MAX_URL_LENGTH;
5293
 
 
5294
 
    /**
5295
 
     * Ignore modules registered on the YUI global
5296
 
     * @property ignoreRegistered
5297
 
     * @default false
5298
 
     */
5299
 
    // self.ignoreRegistered = false;
5300
 
 
5301
 
    /**
5302
 
     * Root path to prepend to module path for the combo
5303
 
     * service
5304
 
     * @property root
5305
 
     * @type string
5306
 
     * @default [YUI VERSION]/build/
5307
 
     */
5308
 
    self.root = Y.Env.meta.root;
5309
 
 
5310
 
    /**
5311
 
     * Timeout value in milliseconds.  If set, self value will be used by
5312
 
     * the get utility.  the timeout event will fire if
5313
 
     * a timeout occurs.
5314
 
     * @property timeout
5315
 
     * @type int
5316
 
     */
5317
 
    self.timeout = 0;
5318
 
 
5319
 
    /**
5320
 
     * A list of modules that should not be loaded, even if
5321
 
     * they turn up in the dependency tree
5322
 
     * @property ignore
5323
 
     * @type string[]
5324
 
     */
5325
 
    // self.ignore = null;
5326
 
 
5327
 
    /**
5328
 
     * A list of modules that should always be loaded, even
5329
 
     * if they have already been inserted into the page.
5330
 
     * @property force
5331
 
     * @type string[]
5332
 
     */
5333
 
    // self.force = null;
5334
 
 
5335
 
    self.forceMap = {};
5336
 
 
5337
 
    /**
5338
 
     * Should we allow rollups
5339
 
     * @property allowRollup
5340
 
     * @type boolean
5341
 
     * @default false
5342
 
     */
5343
 
    self.allowRollup = false;
5344
 
 
5345
 
    /**
5346
 
     * A filter to apply to result urls.  This filter will modify the default
5347
 
     * path for all modules.  The default path for the YUI library is the
5348
 
     * minified version of the files (e.g., event-min.js).  The filter property
5349
 
     * can be a predefined filter or a custom filter.  The valid predefined
5350
 
     * filters are:
5351
 
     * <dl>
5352
 
     *  <dt>DEBUG</dt>
5353
 
     *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
5354
 
     *      This option will automatically include the Logger widget</dd>
5355
 
     *  <dt>RAW</dt>
5356
 
     *  <dd>Selects the non-minified version of the library (e.g., event.js).
5357
 
     *  </dd>
5358
 
     * </dl>
5359
 
     * You can also define a custom filter, which must be an object literal
5360
 
     * containing a search expression and a replace string:
5361
 
     * <pre>
5362
 
     *  myFilter: &#123;
5363
 
     *      'searchExp': "-min\\.js",
5364
 
     *      'replaceStr': "-debug.js"
5365
 
     *  &#125;
5366
 
     * </pre>
5367
 
     * @property filter
5368
 
     * @type string| {searchExp: string, replaceStr: string}
5369
 
     */
5370
 
    // self.filter = null;
5371
 
 
5372
 
    /**
5373
 
     * per-component filter specification.  If specified for a given
5374
 
     * component, this overrides the filter config.
5375
 
     * @property filters
5376
 
     * @type object
5377
 
     */
5378
 
    self.filters = {};
5379
 
 
5380
 
    /**
5381
 
     * The list of requested modules
5382
 
     * @property required
5383
 
     * @type {string: boolean}
5384
 
     */
5385
 
    self.required = {};
5386
 
 
5387
 
    /**
5388
 
     * If a module name is predefined when requested, it is checked againsts
5389
 
     * the patterns provided in this property.  If there is a match, the
5390
 
     * module is added with the default configuration.
5391
 
     *
5392
 
     * At the moment only supporting module prefixes, but anticipate
5393
 
     * supporting at least regular expressions.
5394
 
     * @property patterns
5395
 
     * @type Object
5396
 
     */
5397
 
    // self.patterns = Y.merge(Y.Env.meta.patterns);
5398
 
    self.patterns = {};
5399
 
 
5400
 
    /**
5401
 
     * The library metadata
5402
 
     * @property moduleInfo
5403
 
     */
5404
 
    // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
5405
 
    self.moduleInfo = {};
5406
 
 
5407
 
    self.groups = Y.merge(Y.Env.meta.groups);
5408
 
 
5409
 
    /**
5410
 
     * Provides the information used to skin the skinnable components.
5411
 
     * The following skin definition would result in 'skin1' and 'skin2'
5412
 
     * being loaded for calendar (if calendar was requested), and
5413
 
     * 'sam' for all other skinnable components:
5414
 
     *
5415
 
     *   <code>
5416
 
     *   skin: {
5417
 
     *
5418
 
     *      // The default skin, which is automatically applied if not
5419
 
     *      // overriden by a component-specific skin definition.
5420
 
     *      // Change this in to apply a different skin globally
5421
 
     *      defaultSkin: 'sam',
5422
 
     *
5423
 
     *      // This is combined with the loader base property to get
5424
 
     *      // the default root directory for a skin. ex:
5425
 
     *      // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
5426
 
     *      base: 'assets/skins/',
5427
 
     *
5428
 
     *      // Any component-specific overrides can be specified here,
5429
 
     *      // making it possible to load different skins for different
5430
 
     *      // components.  It is possible to load more than one skin
5431
 
     *      // for a given component as well.
5432
 
     *      overrides: {
5433
 
     *          calendar: ['skin1', 'skin2']
5434
 
     *      }
5435
 
     *   }
5436
 
     *   </code>
5437
 
     *   @property skin
5438
 
     */
5439
 
    self.skin = Y.merge(Y.Env.meta.skin);
5440
 
 
5441
 
    /*
5442
 
     * Map of conditional modules
5443
 
     * @since 3.2.0
5444
 
     */
5445
 
    self.conditions = {};
5446
 
 
5447
 
    // map of modules with a hash of modules that meet the requirement
5448
 
    // self.provides = {};
5449
 
 
5450
 
    self.config = o;
5451
 
    self._internal = true;
5452
 
 
5453
 
 
5454
 
    cache = GLOBAL_ENV._renderedMods;
5455
 
 
5456
 
    if (cache) {
5457
 
        oeach(cache, function modCache(v, k) {
5458
 
            //self.moduleInfo[k] = Y.merge(v);
5459
 
            self.moduleInfo[k] = v;
5460
 
        });
5461
 
 
5462
 
        cache = GLOBAL_ENV._conditions;
5463
 
 
5464
 
        oeach(cache, function condCache(v, k) {
5465
 
            //self.conditions[k] = Y.merge(v);
5466
 
            self.conditions[k] = v;
5467
 
        });
5468
 
 
5469
 
    } else {
5470
 
        oeach(defaults, self.addModule, self);
5471
 
    }
5472
 
 
5473
 
    if (!GLOBAL_ENV._renderedMods) {
5474
 
        //GLOBAL_ENV._renderedMods = Y.merge(self.moduleInfo);
5475
 
        //GLOBAL_ENV._conditions = Y.merge(self.conditions);
5476
 
        GLOBAL_ENV._renderedMods = self.moduleInfo;
5477
 
        GLOBAL_ENV._conditions = self.conditions;
5478
 
    }
5479
 
 
5480
 
    self._inspectPage();
5481
 
 
5482
 
    self._internal = false;
5483
 
 
5484
 
    self._config(o);
5485
 
 
5486
 
    self.testresults = null;
5487
 
 
5488
 
    if (Y.config.tests) {
5489
 
        self.testresults = Y.config.tests;
5490
 
    }
5491
 
 
5492
 
    /**
5493
 
     * List of rollup files found in the library metadata
5494
 
     * @property rollups
5495
 
     */
5496
 
    // self.rollups = null;
5497
 
 
5498
 
    /**
5499
 
     * Whether or not to load optional dependencies for
5500
 
     * the requested modules
5501
 
     * @property loadOptional
5502
 
     * @type boolean
5503
 
     * @default false
5504
 
     */
5505
 
    // self.loadOptional = false;
5506
 
 
5507
 
    /**
5508
 
     * All of the derived dependencies in sorted order, which
5509
 
     * will be populated when either calculate() or insert()
5510
 
     * is called
5511
 
     * @property sorted
5512
 
     * @type string[]
5513
 
     */
5514
 
    self.sorted = [];
5515
 
 
5516
 
    /**
5517
 
     * Set when beginning to compute the dependency tree.
5518
 
     * Composed of what YUI reports to be loaded combined
5519
 
     * with what has been loaded by any instance on the page
5520
 
     * with the version number specified in the metadata.
5521
 
     * @property loaded
5522
 
     * @type {string: boolean}
5523
 
     */
5524
 
    self.loaded = GLOBAL_LOADED[VERSION];
5525
 
 
5526
 
    /*
5527
 
     * A list of modules to attach to the YUI instance when complete.
5528
 
     * If not supplied, the sorted list of dependencies are applied.
5529
 
     * @property attaching
5530
 
     */
5531
 
    // self.attaching = null;
5532
 
 
5533
 
    /**
5534
 
     * Flag to indicate the dependency tree needs to be recomputed
5535
 
     * if insert is called again.
5536
 
     * @property dirty
5537
 
     * @type boolean
5538
 
     * @default true
5539
 
     */
5540
 
    self.dirty = true;
5541
 
 
5542
 
    /**
5543
 
     * List of modules inserted by the utility
5544
 
     * @property inserted
5545
 
     * @type {string: boolean}
5546
 
     */
5547
 
    self.inserted = {};
5548
 
 
5549
 
    /**
5550
 
     * List of skipped modules during insert() because the module
5551
 
     * was not defined
5552
 
     * @property skipped
5553
 
     */
5554
 
    self.skipped = {};
5555
 
 
5556
 
    // Y.on('yui:load', self.loadNext, self);
5557
 
 
5558
 
    self.tested = {};
5559
 
 
5560
 
    /*
5561
 
     * Cached sorted calculate results
5562
 
     * @property results
5563
 
     * @since 3.2.0
5564
 
     */
5565
 
    //self.results = {};
5566
 
 
5567
 
};
5568
 
 
5569
 
Y.Loader.prototype = {
5570
 
 
5571
 
    FILTER_DEFS: {
5572
 
        RAW: {
5573
 
            'searchExp': '-min\\.js',
5574
 
            'replaceStr': '.js'
5575
 
        },
5576
 
        DEBUG: {
5577
 
            'searchExp': '-min\\.js',
5578
 
            'replaceStr': '-debug.js'
5579
 
        }
5580
 
    },
5581
 
    /*
5582
 
    * Check the pages meta-data and cache the result.
5583
 
    * @method _inspectPage
5584
 
    * @private
5585
 
    */
5586
 
    _inspectPage: function() {
5587
 
        oeach(ON_PAGE, function(v, k) {
5588
 
           if (v.details) {
5589
 
               var m = this.moduleInfo[k],
5590
 
                   req = v.details.requires,
5591
 
                   mr = m && m.requires;
5592
 
               if (m) {
5593
 
                   if (!m._inspected && req && mr.length != req.length) {
5594
 
                       // console.log('deleting ' + m.name);
5595
 
                       // m.requres = YObject.keys(Y.merge(YArray.hash(req), YArray.hash(mr)));
5596
 
                       delete m.expanded;
5597
 
                       // delete m.expanded_map;
5598
 
                   }
5599
 
               } else {
5600
 
                   m = this.addModule(v.details, k);
5601
 
               }
5602
 
               m._inspected = true;
5603
 
           }
5604
 
       }, this);
5605
 
    },
5606
 
    /*
5607
 
    * returns true if b is not loaded, and is required directly or by means of modules it supersedes.
5608
 
    * @private
5609
 
    * @method _requires
5610
 
    * @param {String} mod1 The first module to compare
5611
 
    * @param {String} mod2 The second module to compare
5612
 
    */
5613
 
   _requires: function(mod1, mod2) {
5614
 
 
5615
 
        var i, rm, after_map, s,
5616
 
            info = this.moduleInfo,
5617
 
            m = info[mod1],
5618
 
            other = info[mod2];
5619
 
 
5620
 
        if (!m || !other) {
5621
 
            return false;
5622
 
        }
5623
 
 
5624
 
        rm = m.expanded_map;
5625
 
        after_map = m.after_map;
5626
 
 
5627
 
        // check if this module should be sorted after the other
5628
 
        // do this first to short circut circular deps
5629
 
        if (after_map && (mod2 in after_map)) {
5630
 
            return true;
5631
 
        }
5632
 
 
5633
 
        after_map = other.after_map;
5634
 
 
5635
 
        // and vis-versa
5636
 
        if (after_map && (mod1 in after_map)) {
5637
 
            return false;
5638
 
        }
5639
 
 
5640
 
        // check if this module requires one the other supersedes
5641
 
        s = info[mod2] && info[mod2].supersedes;
5642
 
        if (s) {
5643
 
            for (i = 0; i < s.length; i++) {
5644
 
                if (this._requires(mod1, s[i])) {
5645
 
                    return true;
5646
 
                }
5647
 
            }
5648
 
        }
5649
 
 
5650
 
        s = info[mod1] && info[mod1].supersedes;
5651
 
        if (s) {
5652
 
            for (i = 0; i < s.length; i++) {
5653
 
                if (this._requires(mod2, s[i])) {
5654
 
                    return false;
5655
 
                }
5656
 
            }
5657
 
        }
5658
 
 
5659
 
        // check if this module requires the other directly
5660
 
        // if (r && YArray.indexOf(r, mod2) > -1) {
5661
 
        if (rm && (mod2 in rm)) {
5662
 
            return true;
5663
 
        }
5664
 
 
5665
 
        // external css files should be sorted below yui css
5666
 
        if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
5667
 
            return true;
5668
 
        }
5669
 
 
5670
 
        return false;
5671
 
    },
5672
 
    /**
5673
 
    * Apply a new config to the Loader instance
5674
 
    * @method _config
5675
 
    * @param {Object} o The new configuration
5676
 
    */
5677
 
    _config: function(o) {
5678
 
        var i, j, val, f, group, groupName, self = this;
5679
 
        // apply config values
5680
 
        if (o) {
5681
 
            for (i in o) {
5682
 
                if (o.hasOwnProperty(i)) {
5683
 
                    val = o[i];
5684
 
                    if (i == 'require') {
5685
 
                        self.require(val);
5686
 
                    } else if (i == 'skin') {
5687
 
                        Y.mix(self.skin, o[i], true);
5688
 
                    } else if (i == 'groups') {
5689
 
                        for (j in val) {
5690
 
                            if (val.hasOwnProperty(j)) {
5691
 
                                // Y.log('group: ' + j);
5692
 
                                groupName = j;
5693
 
                                group = val[j];
5694
 
                                self.addGroup(group, groupName);
5695
 
                            }
5696
 
                        }
5697
 
 
5698
 
                    } else if (i == 'modules') {
5699
 
                        // add a hash of module definitions
5700
 
                        oeach(val, self.addModule, self);
5701
 
                    } else if (i == 'gallery') {
5702
 
                        this.groups.gallery.update(val);
5703
 
                    } else if (i == 'yui2' || i == '2in3') {
5704
 
                        this.groups.yui2.update(o['2in3'], o.yui2);
5705
 
                    } else if (i == 'maxURLLength') {
5706
 
                        self[i] = Math.min(MAX_URL_LENGTH, val);
5707
 
                    } else {
5708
 
                        self[i] = val;
5709
 
                    }
5710
 
                }
5711
 
            }
5712
 
        }
5713
 
 
5714
 
        // fix filter
5715
 
        f = self.filter;
5716
 
 
5717
 
        if (L.isString(f)) {
5718
 
            f = f.toUpperCase();
5719
 
            self.filterName = f;
5720
 
            self.filter = self.FILTER_DEFS[f];
5721
 
            if (f == 'DEBUG') {
5722
 
                self.require('yui-log', 'dump');
5723
 
            }
5724
 
        }
5725
 
 
5726
 
        if (self.lang) {
5727
 
            self.require('intl-base', 'intl');
5728
 
        }
5729
 
 
5730
 
    },
5731
 
 
5732
 
    /**
5733
 
     * Returns the skin module name for the specified skin name.  If a
5734
 
     * module name is supplied, the returned skin module name is
5735
 
     * specific to the module passed in.
5736
 
     * @method formatSkin
5737
 
     * @param {string} skin the name of the skin.
5738
 
     * @param {string} mod optional: the name of a module to skin.
5739
 
     * @return {string} the full skin module name.
5740
 
     */
5741
 
    formatSkin: function(skin, mod) {
5742
 
        var s = SKIN_PREFIX + skin;
5743
 
        if (mod) {
5744
 
            s = s + '-' + mod;
5745
 
        }
5746
 
 
5747
 
        return s;
5748
 
    },
5749
 
 
5750
 
    /**
5751
 
     * Adds the skin def to the module info
5752
 
     * @method _addSkin
5753
 
     * @param {string} skin the name of the skin.
5754
 
     * @param {string} mod the name of the module.
5755
 
     * @param {string} parent parent module if this is a skin of a
5756
 
     * submodule or plugin.
5757
 
     * @return {string} the module name for the skin.
5758
 
     * @private
5759
 
     */
5760
 
    _addSkin: function(skin, mod, parent) {
5761
 
        var mdef, pkg, name, nmod,
5762
 
            info = this.moduleInfo,
5763
 
            sinf = this.skin,
5764
 
            ext = info[mod] && info[mod].ext;
5765
 
 
5766
 
        // Add a module definition for the module-specific skin css
5767
 
        if (mod) {
5768
 
            name = this.formatSkin(skin, mod);
5769
 
            if (!info[name]) {
5770
 
                mdef = info[mod];
5771
 
                pkg = mdef.pkg || mod;
5772
 
                nmod = {
5773
 
                    name: name,
5774
 
                    group: mdef.group,
5775
 
                    type: 'css',
5776
 
                    after: sinf.after,
5777
 
                    path: (parent || pkg) + '/' + sinf.base + skin +
5778
 
                          '/' + mod + '.css',
5779
 
                    ext: ext
5780
 
                };
5781
 
                if (mdef.base) {
5782
 
                    nmod.base = mdef.base;
5783
 
                }
5784
 
                if (mdef.configFn) {
5785
 
                    nmod.configFn = mdef.configFn;
5786
 
                }
5787
 
                this.addModule(nmod, name);
5788
 
 
5789
 
                Y.log('adding skin ' + name + ', ' + parent + ', ' + pkg + ', ' + info[name].path);
5790
 
            }
5791
 
        }
5792
 
 
5793
 
        return name;
5794
 
    },
5795
 
 
5796
 
    /**
5797
 
     * Add a new module group
5798
 
     * <dl>
5799
 
     *   <dt>name:</dt>      <dd>required, the group name</dd>
5800
 
     *   <dt>base:</dt>      <dd>The base dir for this module group</dd>
5801
 
     *   <dt>root:</dt>      <dd>The root path to add to each combo
5802
 
     *   resource path</dd>
5803
 
     *   <dt>combine:</dt>   <dd>combo handle</dd>
5804
 
     *   <dt>comboBase:</dt> <dd>combo service base path</dd>
5805
 
     *   <dt>modules:</dt>   <dd>the group of modules</dd>
5806
 
     * </dl>
5807
 
     * @method addGroup
5808
 
     * @param {object} o An object containing the module data.
5809
 
     * @param {string} name the group name.
5810
 
     */
5811
 
    addGroup: function(o, name) {
5812
 
        var mods = o.modules,
5813
 
            self = this;
5814
 
        name = name || o.name;
5815
 
        o.name = name;
5816
 
        self.groups[name] = o;
5817
 
 
5818
 
        if (o.patterns) {
5819
 
            oeach(o.patterns, function(v, k) {
5820
 
                v.group = name;
5821
 
                self.patterns[k] = v;
5822
 
            });
5823
 
        }
5824
 
 
5825
 
        if (mods) {
5826
 
            oeach(mods, function(v, k) {
5827
 
                v.group = name;
5828
 
                self.addModule(v, k);
5829
 
            }, self);
5830
 
        }
5831
 
    },
5832
 
 
5833
 
    /**
5834
 
     * Add a new module to the component metadata.
5835
 
     * <dl>
5836
 
     *     <dt>name:</dt>       <dd>required, the component name</dd>
5837
 
     *     <dt>type:</dt>       <dd>required, the component type (js or css)
5838
 
     *     </dd>
5839
 
     *     <dt>path:</dt>       <dd>required, the path to the script from
5840
 
     *     "base"</dd>
5841
 
     *     <dt>requires:</dt>   <dd>array of modules required by this
5842
 
     *     component</dd>
5843
 
     *     <dt>optional:</dt>   <dd>array of optional modules for this
5844
 
     *     component</dd>
5845
 
     *     <dt>supersedes:</dt> <dd>array of the modules this component
5846
 
     *     replaces</dd>
5847
 
     *     <dt>after:</dt>      <dd>array of modules the components which, if
5848
 
     *     present, should be sorted above this one</dd>
5849
 
     *     <dt>after_map:</dt>  <dd>faster alternative to 'after' -- supply
5850
 
     *     a hash instead of an array</dd>
5851
 
     *     <dt>rollup:</dt>     <dd>the number of superseded modules required
5852
 
     *     for automatic rollup</dd>
5853
 
     *     <dt>fullpath:</dt>   <dd>If fullpath is specified, this is used
5854
 
     *     instead of the configured base + path</dd>
5855
 
     *     <dt>skinnable:</dt>  <dd>flag to determine if skin assets should
5856
 
     *     automatically be pulled in</dd>
5857
 
     *     <dt>submodules:</dt> <dd>a hash of submodules</dd>
5858
 
     *     <dt>group:</dt>      <dd>The group the module belongs to -- this
5859
 
     *     is set automatically when it is added as part of a group
5860
 
     *     configuration.</dd>
5861
 
     *     <dt>lang:</dt>
5862
 
     *       <dd>array of BCP 47 language tags of languages for which this
5863
 
     *           module has localized resource bundles,
5864
 
     *           e.g., ["en-GB","zh-Hans-CN"]</dd>
5865
 
     *     <dt>condition:</dt>
5866
 
     *       <dd>Specifies that the module should be loaded automatically if
5867
 
     *           a condition is met.  This is an object with up to three fields:
5868
 
     *           [trigger] - the name of a module that can trigger the auto-load
5869
 
     *           [test] - a function that returns true when the module is to be
5870
 
     *           loaded.
5871
 
     *           [when] - specifies the load order of the conditional module
5872
 
     *           with regard to the position of the trigger module.
5873
 
     *           This should be one of three values: 'before', 'after', or
5874
 
     *           'instead'.  The default is 'after'.
5875
 
     *       </dd>
5876
 
     *     <dt>testresults:</dt><dd>a hash of test results from Y.Features.all()</dd>
5877
 
     * </dl>
5878
 
     * @method addModule
5879
 
     * @param {object} o An object containing the module data.
5880
 
     * @param {string} name the module name (optional), required if not
5881
 
     * in the module data.
5882
 
     * @return {object} the module definition or null if
5883
 
     * the object passed in did not provide all required attributes.
5884
 
     */
5885
 
    addModule: function(o, name) {
5886
 
        name = name || o.name;
5887
 
        
5888
 
        //Only merge this data if the temp flag is set
5889
 
        //from an earlier pass from a pattern or else
5890
 
        //an override module (YUI_config) can not be used to
5891
 
        //replace a default module.
5892
 
        if (this.moduleInfo[name] && this.moduleInfo[name].temp) {
5893
 
            //This catches temp modules loaded via a pattern
5894
 
            // The module will be added twice, once from the pattern and
5895
 
            // Once from the actual add call, this ensures that properties
5896
 
            // that were added to the module the first time around (group: gallery)
5897
 
            // are also added the second time around too.
5898
 
            o = Y.merge(this.moduleInfo[name], o);
5899
 
        }
5900
 
 
5901
 
        o.name = name;
5902
 
 
5903
 
        if (!o || !o.name) {
5904
 
            return null;
5905
 
        }
5906
 
 
5907
 
        if (!o.type) {
5908
 
            o.type = JS;
5909
 
        }
5910
 
 
5911
 
        if (!o.path && !o.fullpath) {
5912
 
            o.path = _path(name, name, o.type);
5913
 
        }
5914
 
        o.supersedes = o.supersedes || o.use;
5915
 
 
5916
 
        o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
5917
 
        o.requires = this.filterRequires(o.requires) || [];
5918
 
 
5919
 
        // Handle submodule logic
5920
 
        var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,
5921
 
            j, langs, packName, supName, flatSup, flatLang, lang, ret,
5922
 
            overrides, skinname, when,
5923
 
            conditions = this.conditions, trigger;
5924
 
            // , existing = this.moduleInfo[name], newr;
5925
 
 
5926
 
        this.moduleInfo[name] = o;
5927
 
 
5928
 
        if (!o.langPack && o.lang) {
5929
 
            langs = YArray(o.lang);
5930
 
            for (j = 0; j < langs.length; j++) {
5931
 
                lang = langs[j];
5932
 
                packName = this.getLangPackName(lang, name);
5933
 
                smod = this.moduleInfo[packName];
5934
 
                if (!smod) {
5935
 
                    smod = this._addLangPack(lang, o, packName);
5936
 
                }
5937
 
            }
5938
 
        }
5939
 
 
5940
 
        if (subs) {
5941
 
            sup = o.supersedes || [];
5942
 
            l = 0;
5943
 
 
5944
 
            for (i in subs) {
5945
 
                if (subs.hasOwnProperty(i)) {
5946
 
                    s = subs[i];
5947
 
 
5948
 
                    s.path = s.path || _path(name, i, o.type);
5949
 
                    s.pkg = name;
5950
 
                    s.group = o.group;
5951
 
 
5952
 
                    if (s.supersedes) {
5953
 
                        sup = sup.concat(s.supersedes);
5954
 
                    }
5955
 
 
5956
 
                    smod = this.addModule(s, i);
5957
 
                    sup.push(i);
5958
 
 
5959
 
                    if (smod.skinnable) {
5960
 
                        o.skinnable = true;
5961
 
                        overrides = this.skin.overrides;
5962
 
                        if (overrides && overrides[i]) {
5963
 
                            for (j = 0; j < overrides[i].length; j++) {
5964
 
                                skinname = this._addSkin(overrides[i][j],
5965
 
                                         i, name);
5966
 
                                sup.push(skinname);
5967
 
                            }
5968
 
                        }
5969
 
                        skinname = this._addSkin(this.skin.defaultSkin,
5970
 
                                        i, name);
5971
 
                        sup.push(skinname);
5972
 
                    }
5973
 
 
5974
 
                    // looks like we are expected to work out the metadata
5975
 
                    // for the parent module language packs from what is
5976
 
                    // specified in the child modules.
5977
 
                    if (s.lang && s.lang.length) {
5978
 
 
5979
 
                        langs = YArray(s.lang);
5980
 
                        for (j = 0; j < langs.length; j++) {
5981
 
                            lang = langs[j];
5982
 
                            packName = this.getLangPackName(lang, name);
5983
 
                            supName = this.getLangPackName(lang, i);
5984
 
                            smod = this.moduleInfo[packName];
5985
 
 
5986
 
                            if (!smod) {
5987
 
                                smod = this._addLangPack(lang, o, packName);
5988
 
                            }
5989
 
 
5990
 
                            flatSup = flatSup || YArray.hash(smod.supersedes);
5991
 
 
5992
 
                            if (!(supName in flatSup)) {
5993
 
                                smod.supersedes.push(supName);
5994
 
                            }
5995
 
 
5996
 
                            o.lang = o.lang || [];
5997
 
 
5998
 
                            flatLang = flatLang || YArray.hash(o.lang);
5999
 
 
6000
 
                            if (!(lang in flatLang)) {
6001
 
                                o.lang.push(lang);
6002
 
                            }
6003
 
 
6004
 
// Y.log('pack ' + packName + ' should supersede ' + supName);
6005
 
// Add rollup file, need to add to supersedes list too
6006
 
 
6007
 
                            // default packages
6008
 
                            packName = this.getLangPackName(ROOT_LANG, name);
6009
 
                            supName = this.getLangPackName(ROOT_LANG, i);
6010
 
 
6011
 
                            smod = this.moduleInfo[packName];
6012
 
 
6013
 
                            if (!smod) {
6014
 
                                smod = this._addLangPack(lang, o, packName);
6015
 
                            }
6016
 
 
6017
 
                            if (!(supName in flatSup)) {
6018
 
                                smod.supersedes.push(supName);
6019
 
                            }
6020
 
 
6021
 
// Y.log('pack ' + packName + ' should supersede ' + supName);
6022
 
// Add rollup file, need to add to supersedes list too
6023
 
 
6024
 
                        }
6025
 
                    }
6026
 
 
6027
 
                    l++;
6028
 
                }
6029
 
            }
6030
 
            //o.supersedes = YObject.keys(YArray.hash(sup));
6031
 
            o.supersedes = YArray.dedupe(sup);
6032
 
            if (this.allowRollup) {
6033
 
                o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
6034
 
            }
6035
 
        }
6036
 
 
6037
 
        plugins = o.plugins;
6038
 
        if (plugins) {
6039
 
            for (i in plugins) {
6040
 
                if (plugins.hasOwnProperty(i)) {
6041
 
                    plug = plugins[i];
6042
 
                    plug.pkg = name;
6043
 
                    plug.path = plug.path || _path(name, i, o.type);
6044
 
                    plug.requires = plug.requires || [];
6045
 
                    plug.group = o.group;
6046
 
                    this.addModule(plug, i);
6047
 
                    if (o.skinnable) {
6048
 
                        this._addSkin(this.skin.defaultSkin, i, name);
6049
 
                    }
6050
 
 
6051
 
                }
6052
 
            }
6053
 
        }
6054
 
 
6055
 
        if (o.condition) {
6056
 
            t = o.condition.trigger;
6057
 
            if (YUI.Env.aliases[t]) {
6058
 
                t = YUI.Env.aliases[t];
6059
 
            }
6060
 
            if (!Y.Lang.isArray(t)) {
6061
 
                t = [t];
6062
 
            }
6063
 
 
6064
 
            for (i = 0; i < t.length; i++) {
6065
 
                trigger = t[i];
6066
 
                when = o.condition.when;
6067
 
                conditions[trigger] = conditions[trigger] || {};
6068
 
                conditions[trigger][name] = o.condition;
6069
 
                // the 'when' attribute can be 'before', 'after', or 'instead'
6070
 
                // the default is after.
6071
 
                if (when && when != 'after') {
6072
 
                    if (when == 'instead') { // replace the trigger
6073
 
                        o.supersedes = o.supersedes || [];
6074
 
                        o.supersedes.push(trigger);
6075
 
                    } else { // before the trigger
6076
 
                        // the trigger requires the conditional mod,
6077
 
                        // so it should appear before the conditional
6078
 
                        // mod if we do not intersede.
6079
 
                    }
6080
 
                } else { // after the trigger
6081
 
                    o.after = o.after || [];
6082
 
                    o.after.push(trigger);
6083
 
                }
6084
 
            }
6085
 
        }
6086
 
 
6087
 
        if (o.after) {
6088
 
            o.after_map = YArray.hash(o.after);
6089
 
        }
6090
 
 
6091
 
        // this.dirty = true;
6092
 
 
6093
 
        if (o.configFn) {
6094
 
            ret = o.configFn(o);
6095
 
            if (ret === false) {
6096
 
                delete this.moduleInfo[name];
6097
 
                o = null;
6098
 
            }
6099
 
        }
6100
 
 
6101
 
        return o;
6102
 
    },
6103
 
 
6104
 
    /**
6105
 
     * Add a requirement for one or more module
6106
 
     * @method require
6107
 
     * @param {string[] | string*} what the modules to load.
6108
 
     */
6109
 
    require: function(what) {
6110
 
        var a = (typeof what === 'string') ? YArray(arguments) : what;
6111
 
        this.dirty = true;
6112
 
        this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
6113
 
 
6114
 
        this._explodeRollups();
6115
 
    },
6116
 
    /**
6117
 
    * Grab all the items that were asked for, check to see if the Loader
6118
 
    * meta-data contains a "use" array. If it doesm remove the asked item and replace it with 
6119
 
    * the content of the "use".
6120
 
    * This will make asking for: "dd"
6121
 
    * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
6122
 
    * @private
6123
 
    * @method _explodeRollups
6124
 
    */
6125
 
    _explodeRollups: function() {
6126
 
        var self = this, m,
6127
 
        r = self.required;
6128
 
        if (!self.allowRollup) {
6129
 
            oeach(r, function(v, name) {
6130
 
                m = self.getModule(name);
6131
 
                if (m && m.use) {
6132
 
                    //delete r[name];
6133
 
                    YArray.each(m.use, function(v) {
6134
 
                        m = self.getModule(v);
6135
 
                        if (m && m.use) {
6136
 
                            //delete r[v];
6137
 
                            YArray.each(m.use, function(v) {
6138
 
                                r[v] = true;
6139
 
                            });
6140
 
                        } else {
6141
 
                            r[v] = true;
6142
 
                        }
6143
 
                    });
6144
 
                }
6145
 
            });
6146
 
            self.required = r;
6147
 
        }
6148
 
 
6149
 
    },
6150
 
    /**
6151
 
    * Explodes the required array to remove aliases and replace them with real modules
6152
 
    * @method filterRequires
6153
 
    * @param {Array} r The original requires array
6154
 
    * @return {Array} The new array of exploded requirements
6155
 
    */
6156
 
    filterRequires: function(r) {
6157
 
        if (r) {
6158
 
            if (!Y.Lang.isArray(r)) {
6159
 
                r = [r];
6160
 
            }
6161
 
            r = Y.Array(r);
6162
 
            var c = [], i, mod, o, m;
6163
 
 
6164
 
            for (i = 0; i < r.length; i++) {
6165
 
                mod = this.getModule(r[i]);
6166
 
                if (mod && mod.use) {
6167
 
                    for (o = 0; o < mod.use.length; o++) {
6168
 
                        //Must walk the other modules in case a module is a rollup of rollups (datatype)
6169
 
                        m = this.getModule(mod.use[o]);
6170
 
                        if (m && m.use) {
6171
 
                            c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
6172
 
                        } else {
6173
 
                            c.push(mod.use[o]);
6174
 
                        }
6175
 
                    }
6176
 
                } else {
6177
 
                    c.push(r[i]);
6178
 
                }
6179
 
            }
6180
 
            r = c;
6181
 
        }
6182
 
        return r;
6183
 
    },
6184
 
    /**
6185
 
     * Returns an object containing properties for all modules required
6186
 
     * in order to load the requested module
6187
 
     * @method getRequires
6188
 
     * @param {object}  mod The module definition from moduleInfo.
6189
 
     * @return {array} the expanded requirement list.
6190
 
     */
6191
 
    getRequires: function(mod) {
6192
 
 
6193
 
        if (!mod || mod._parsed) {
6194
 
            // Y.log('returning no reqs for ' + mod.name);
6195
 
            return NO_REQUIREMENTS;
6196
 
        }
6197
 
 
6198
 
        var i, m, j, add, packName, lang, testresults = this.testresults,
6199
 
            name = mod.name, cond, go,
6200
 
            adddef = ON_PAGE[name] && ON_PAGE[name].details,
6201
 
            d, k, m1,
6202
 
            r, old_mod,
6203
 
            o, skinmod, skindef, skinpar, skinname,
6204
 
            intl = mod.lang || mod.intl,
6205
 
            info = this.moduleInfo,
6206
 
            ftests = Y.Features && Y.Features.tests.load,
6207
 
            hash;
6208
 
 
6209
 
        // console.log(name);
6210
 
 
6211
 
        // pattern match leaves module stub that needs to be filled out
6212
 
        if (mod.temp && adddef) {
6213
 
            old_mod = mod;
6214
 
            mod = this.addModule(adddef, name);
6215
 
            mod.group = old_mod.group;
6216
 
            mod.pkg = old_mod.pkg;
6217
 
            delete mod.expanded;
6218
 
        }
6219
 
 
6220
 
        // console.log('cache: ' + mod.langCache + ' == ' + this.lang);
6221
 
 
6222
 
        // if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
6223
 
        if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
6224
 
            //Y.log('Already expanded ' + name + ', ' + mod.expanded);
6225
 
            return mod.expanded;
6226
 
        }
6227
 
        
6228
 
 
6229
 
        d = [];
6230
 
        hash = {};
6231
 
        
6232
 
        r = this.filterRequires(mod.requires);
6233
 
        if (mod.lang) {
6234
 
            //If a module has a lang attribute, auto add the intl requirement.
6235
 
            d.unshift('intl');
6236
 
            r.unshift('intl');
6237
 
            intl = true;
6238
 
        }
6239
 
        o = this.filterRequires(mod.optional);
6240
 
 
6241
 
        // Y.log("getRequires: " + name + " (dirty:" + this.dirty +
6242
 
        // ", expanded:" + mod.expanded + ")");
6243
 
 
6244
 
        mod._parsed = true;
6245
 
        mod.langCache = this.lang;
6246
 
 
6247
 
        for (i = 0; i < r.length; i++) {
6248
 
            //Y.log(name + ' requiring ' + r[i], 'info', 'loader');
6249
 
            if (!hash[r[i]]) {
6250
 
                d.push(r[i]);
6251
 
                hash[r[i]] = true;
6252
 
                m = this.getModule(r[i]);
6253
 
                if (m) {
6254
 
                    add = this.getRequires(m);
6255
 
                    intl = intl || (m.expanded_map &&
6256
 
                        (INTL in m.expanded_map));
6257
 
                    for (j = 0; j < add.length; j++) {
6258
 
                        d.push(add[j]);
6259
 
                    }
6260
 
                }
6261
 
            }
6262
 
        }
6263
 
 
6264
 
        // get the requirements from superseded modules, if any
6265
 
        r = this.filterRequires(mod.supersedes);
6266
 
        if (r) {
6267
 
            for (i = 0; i < r.length; i++) {
6268
 
                if (!hash[r[i]]) {
6269
 
                    // if this module has submodules, the requirements list is
6270
 
                    // expanded to include the submodules.  This is so we can
6271
 
                    // prevent dups when a submodule is already loaded and the
6272
 
                    // parent is requested.
6273
 
                    if (mod.submodules) {
6274
 
                        d.push(r[i]);
6275
 
                    }
6276
 
 
6277
 
                    hash[r[i]] = true;
6278
 
                    m = this.getModule(r[i]);
6279
 
 
6280
 
                    if (m) {
6281
 
                        add = this.getRequires(m);
6282
 
                        intl = intl || (m.expanded_map &&
6283
 
                            (INTL in m.expanded_map));
6284
 
                        for (j = 0; j < add.length; j++) {
6285
 
                            d.push(add[j]);
6286
 
                        }
6287
 
                    }
6288
 
                }
6289
 
            }
6290
 
        }
6291
 
 
6292
 
        if (o && this.loadOptional) {
6293
 
            for (i = 0; i < o.length; i++) {
6294
 
                if (!hash[o[i]]) {
6295
 
                    d.push(o[i]);
6296
 
                    hash[o[i]] = true;
6297
 
                    m = info[o[i]];
6298
 
                    if (m) {
6299
 
                        add = this.getRequires(m);
6300
 
                        intl = intl || (m.expanded_map &&
6301
 
                            (INTL in m.expanded_map));
6302
 
                        for (j = 0; j < add.length; j++) {
6303
 
                            d.push(add[j]);
6304
 
                        }
6305
 
                    }
6306
 
                }
6307
 
            }
6308
 
        }
6309
 
 
6310
 
        cond = this.conditions[name];
6311
 
 
6312
 
        if (cond) {
6313
 
            if (testresults && ftests) {
6314
 
                oeach(testresults, function(result, id) {
6315
 
                    var condmod = ftests[id].name;
6316
 
                    if (!hash[condmod] && ftests[id].trigger == name) {
6317
 
                        if (result && ftests[id]) {
6318
 
                            hash[condmod] = true;
6319
 
                            d.push(condmod);
6320
 
                        }
6321
 
                    }
6322
 
                });
6323
 
            } else {
6324
 
                oeach(cond, function(def, condmod) {
6325
 
                    if (!hash[condmod]) {
6326
 
                        go = def && ((def.ua && Y.UA[def.ua]) ||
6327
 
                                     (def.test && def.test(Y, r)));
6328
 
                        if (go) {
6329
 
                            hash[condmod] = true;
6330
 
                            d.push(condmod);
6331
 
                            m = this.getModule(condmod);
6332
 
                            // Y.log('conditional', m);
6333
 
                            if (m) {
6334
 
                                add = this.getRequires(m);
6335
 
                                for (j = 0; j < add.length; j++) {
6336
 
                                    d.push(add[j]);
6337
 
                                }
6338
 
                            }
6339
 
                        }
6340
 
                    }
6341
 
                }, this);
6342
 
            }
6343
 
        }
6344
 
 
6345
 
        // Create skin modules
6346
 
        if (mod.skinnable) {
6347
 
            skindef = this.skin.overrides;
6348
 
            oeach(YUI.Env.aliases, function(o, n) {
6349
 
                if (Y.Array.indexOf(o, name) > -1) {
6350
 
                    skinpar = n;
6351
 
                }
6352
 
            });
6353
 
            if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
6354
 
                skinname = name;
6355
 
                if (skindef[skinpar]) {
6356
 
                    skinname = skinpar;
6357
 
                }
6358
 
                for (i = 0; i < skindef[skinname].length; i++) {
6359
 
                    skinmod = this._addSkin(skindef[skinname][i], name);
6360
 
                    d.push(skinmod);
6361
 
                }
6362
 
            } else {
6363
 
                skinmod = this._addSkin(this.skin.defaultSkin, name);
6364
 
                d.push(skinmod);
6365
 
            }
6366
 
        }
6367
 
 
6368
 
        mod._parsed = false;
6369
 
 
6370
 
        if (intl) {
6371
 
 
6372
 
            if (mod.lang && !mod.langPack && Y.Intl) {
6373
 
                lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
6374
 
                //Y.log('Best lang: ' + lang + ', this.lang: ' + this.lang + ', mod.lang: ' + mod.lang);
6375
 
                packName = this.getLangPackName(lang, name);
6376
 
                if (packName) {
6377
 
                    d.unshift(packName);
6378
 
                }
6379
 
            }
6380
 
            d.unshift(INTL);
6381
 
        }
6382
 
 
6383
 
        mod.expanded_map = YArray.hash(d);
6384
 
 
6385
 
        mod.expanded = YObject.keys(mod.expanded_map);
6386
 
 
6387
 
        return mod.expanded;
6388
 
    },
6389
 
 
6390
 
 
6391
 
    /**
6392
 
     * Returns a hash of module names the supplied module satisfies.
6393
 
     * @method getProvides
6394
 
     * @param {string} name The name of the module.
6395
 
     * @return {object} what this module provides.
6396
 
     */
6397
 
    getProvides: function(name) {
6398
 
        var m = this.getModule(name), o, s;
6399
 
            // supmap = this.provides;
6400
 
 
6401
 
        if (!m) {
6402
 
            return NOT_FOUND;
6403
 
        }
6404
 
 
6405
 
        if (m && !m.provides) {
6406
 
            o = {};
6407
 
            s = m.supersedes;
6408
 
 
6409
 
            if (s) {
6410
 
                YArray.each(s, function(v) {
6411
 
                    Y.mix(o, this.getProvides(v));
6412
 
                }, this);
6413
 
            }
6414
 
 
6415
 
            o[name] = true;
6416
 
            m.provides = o;
6417
 
 
6418
 
        }
6419
 
 
6420
 
        return m.provides;
6421
 
    },
6422
 
 
6423
 
    /**
6424
 
     * Calculates the dependency tree, the result is stored in the sorted
6425
 
     * property.
6426
 
     * @method calculate
6427
 
     * @param {object} o optional options object.
6428
 
     * @param {string} type optional argument to prune modules.
6429
 
     */
6430
 
    calculate: function(o, type) {
6431
 
        if (o || type || this.dirty) {
6432
 
 
6433
 
            if (o) {
6434
 
                this._config(o);
6435
 
            }
6436
 
 
6437
 
            if (!this._init) {
6438
 
                this._setup();
6439
 
            }
6440
 
 
6441
 
            this._explode();
6442
 
 
6443
 
            if (this.allowRollup) {
6444
 
                this._rollup();
6445
 
            } else {
6446
 
                this._explodeRollups();
6447
 
            }
6448
 
            this._reduce();
6449
 
            this._sort();
6450
 
        }
6451
 
    },
6452
 
    /**
6453
 
    * Creates a "psuedo" package for languages provided in the lang array
6454
 
    * @method _addLangPack
6455
 
    * @param {String} lang The language to create
6456
 
    * @param {Object} m The module definition to create the language pack around
6457
 
    * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
6458
 
    * @return {Object} The module definition
6459
 
    */
6460
 
    _addLangPack: function(lang, m, packName) {
6461
 
        var name = m.name,
6462
 
            packPath,
6463
 
            existing = this.moduleInfo[packName];
6464
 
 
6465
 
        if (!existing) {
6466
 
 
6467
 
            packPath = _path((m.pkg || name), packName, JS, true);
6468
 
 
6469
 
            this.addModule({ path: packPath,
6470
 
                             intl: true,
6471
 
                             langPack: true,
6472
 
                             ext: m.ext,
6473
 
                             group: m.group,
6474
 
                             supersedes: [] }, packName);
6475
 
 
6476
 
            if (lang) {
6477
 
                Y.Env.lang = Y.Env.lang || {};
6478
 
                Y.Env.lang[lang] = Y.Env.lang[lang] || {};
6479
 
                Y.Env.lang[lang][name] = true;
6480
 
            }
6481
 
        }
6482
 
 
6483
 
        return this.moduleInfo[packName];
6484
 
    },
6485
 
 
6486
 
    /**
6487
 
     * Investigates the current YUI configuration on the page.  By default,
6488
 
     * modules already detected will not be loaded again unless a force
6489
 
     * option is encountered.  Called by calculate()
6490
 
     * @method _setup
6491
 
     * @private
6492
 
     */
6493
 
    _setup: function() {
6494
 
        var info = this.moduleInfo, name, i, j, m, l,
6495
 
            packName;
6496
 
 
6497
 
        for (name in info) {
6498
 
            if (info.hasOwnProperty(name)) {
6499
 
                m = info[name];
6500
 
                if (m) {
6501
 
 
6502
 
                    // remove dups
6503
 
                    //m.requires = YObject.keys(YArray.hash(m.requires));
6504
 
                    m.requires = YArray.dedupe(m.requires);
6505
 
 
6506
 
                    // Create lang pack modules
6507
 
                    if (m.lang && m.lang.length) {
6508
 
                        // Setup root package if the module has lang defined,
6509
 
                        // it needs to provide a root language pack
6510
 
                        packName = this.getLangPackName(ROOT_LANG, name);
6511
 
                        this._addLangPack(null, m, packName);
6512
 
                    }
6513
 
 
6514
 
                }
6515
 
            }
6516
 
        }
6517
 
 
6518
 
 
6519
 
        //l = Y.merge(this.inserted);
6520
 
        l = {};
6521
 
 
6522
 
        // available modules
6523
 
        if (!this.ignoreRegistered) {
6524
 
            Y.mix(l, GLOBAL_ENV.mods);
6525
 
        }
6526
 
 
6527
 
        // add the ignore list to the list of loaded packages
6528
 
        if (this.ignore) {
6529
 
            Y.mix(l, YArray.hash(this.ignore));
6530
 
        }
6531
 
 
6532
 
        // expand the list to include superseded modules
6533
 
        for (j in l) {
6534
 
            if (l.hasOwnProperty(j)) {
6535
 
                Y.mix(l, this.getProvides(j));
6536
 
            }
6537
 
        }
6538
 
 
6539
 
        // remove modules on the force list from the loaded list
6540
 
        if (this.force) {
6541
 
            for (i = 0; i < this.force.length; i++) {
6542
 
                if (this.force[i] in l) {
6543
 
                    delete l[this.force[i]];
6544
 
                }
6545
 
            }
6546
 
        }
6547
 
 
6548
 
        Y.mix(this.loaded, l);
6549
 
 
6550
 
        this._init = true;
6551
 
    },
6552
 
 
6553
 
    /**
6554
 
     * Builds a module name for a language pack
6555
 
     * @method getLangPackName
6556
 
     * @param {string} lang the language code.
6557
 
     * @param {string} mname the module to build it for.
6558
 
     * @return {string} the language pack module name.
6559
 
     */
6560
 
    getLangPackName: function(lang, mname) {
6561
 
        return ('lang/' + mname + ((lang) ? '_' + lang : ''));
6562
 
    },
6563
 
    /**
6564
 
     * Inspects the required modules list looking for additional
6565
 
     * dependencies.  Expands the required list to include all
6566
 
     * required modules.  Called by calculate()
6567
 
     * @method _explode
6568
 
     * @private
6569
 
     */
6570
 
    _explode: function() {
6571
 
        var r = this.required, m, reqs, done = {},
6572
 
            self = this;
6573
 
 
6574
 
        // the setup phase is over, all modules have been created
6575
 
        self.dirty = false;
6576
 
 
6577
 
        self._explodeRollups();
6578
 
        r = self.required;
6579
 
        
6580
 
        oeach(r, function(v, name) {
6581
 
            if (!done[name]) {
6582
 
                done[name] = true;
6583
 
                m = self.getModule(name);
6584
 
                if (m) {
6585
 
                    var expound = m.expound;
6586
 
 
6587
 
                    if (expound) {
6588
 
                        r[expound] = self.getModule(expound);
6589
 
                        reqs = self.getRequires(r[expound]);
6590
 
                        Y.mix(r, YArray.hash(reqs));
6591
 
                    }
6592
 
 
6593
 
                    reqs = self.getRequires(m);
6594
 
                    Y.mix(r, YArray.hash(reqs));
6595
 
                }
6596
 
            }
6597
 
        });
6598
 
 
6599
 
        // Y.log('After explode: ' + YObject.keys(r));
6600
 
    },
6601
 
    /**
6602
 
    * Get's the loader meta data for the requested module
6603
 
    * @method getModule
6604
 
    * @param {String} mname The module name to get
6605
 
    * @return {Object} The module metadata
6606
 
    */
6607
 
    getModule: function(mname) {
6608
 
        //TODO: Remove name check - it's a quick hack to fix pattern WIP
6609
 
        if (!mname) {
6610
 
            return null;
6611
 
        }
6612
 
 
6613
 
        var p, found, pname,
6614
 
            m = this.moduleInfo[mname],
6615
 
            patterns = this.patterns;
6616
 
 
6617
 
        // check the patterns library to see if we should automatically add
6618
 
        // the module with defaults
6619
 
        if (!m) {
6620
 
           // Y.log('testing patterns ' + YObject.keys(patterns));
6621
 
            for (pname in patterns) {
6622
 
                if (patterns.hasOwnProperty(pname)) {
6623
 
                    // Y.log('testing pattern ' + i);
6624
 
                    p = patterns[pname];
6625
 
 
6626
 
                    // use the metadata supplied for the pattern
6627
 
                    // as the module definition.
6628
 
                    if (mname.indexOf(pname) > -1) {
6629
 
                        found = p;
6630
 
                        break;
6631
 
                    }
6632
 
                }
6633
 
            }
6634
 
 
6635
 
            if (found) {
6636
 
                if (p.action) {
6637
 
                    // Y.log('executing pattern action: ' + pname);
6638
 
                    p.action.call(this, mname, pname);
6639
 
                } else {
6640
 
Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
6641
 
    pname, 'info', 'loader');
6642
 
                    // ext true or false?
6643
 
                    m = this.addModule(Y.merge(found), mname);
6644
 
                    m.temp = true;
6645
 
                }
6646
 
            }
6647
 
        }
6648
 
 
6649
 
        return m;
6650
 
    },
6651
 
 
6652
 
    // impl in rollup submodule
6653
 
    _rollup: function() { },
6654
 
 
6655
 
    /**
6656
 
     * Remove superceded modules and loaded modules.  Called by
6657
 
     * calculate() after we have the mega list of all dependencies
6658
 
     * @method _reduce
6659
 
     * @return {object} the reduced dependency hash.
6660
 
     * @private
6661
 
     */
6662
 
    _reduce: function(r) {
6663
 
 
6664
 
        r = r || this.required;
6665
 
 
6666
 
        var i, j, s, m, type = this.loadType,
6667
 
        ignore = this.ignore ? YArray.hash(this.ignore) : false;
6668
 
 
6669
 
        for (i in r) {
6670
 
            if (r.hasOwnProperty(i)) {
6671
 
                m = this.getModule(i);
6672
 
                // remove if already loaded
6673
 
                if (((this.loaded[i] || ON_PAGE[i]) &&
6674
 
                        !this.forceMap[i] && !this.ignoreRegistered) ||
6675
 
                        (type && m && m.type != type)) {
6676
 
                    delete r[i];
6677
 
                }
6678
 
                if (ignore && ignore[i]) {
6679
 
                    delete r[i];
6680
 
                }
6681
 
                // remove anything this module supersedes
6682
 
                s = m && m.supersedes;
6683
 
                if (s) {
6684
 
                    for (j = 0; j < s.length; j++) {
6685
 
                        if (s[j] in r) {
6686
 
                            delete r[s[j]];
6687
 
                        }
6688
 
                    }
6689
 
                }
6690
 
            }
6691
 
        }
6692
 
 
6693
 
        return r;
6694
 
    },
6695
 
    /**
6696
 
    * Handles the queue when a module has been loaded for all cases
6697
 
    * @method _finish
6698
 
    * @private
6699
 
    * @param {String} msg The message from Loader
6700
 
    * @param {Boolean} success A boolean denoting success or failure
6701
 
    */
6702
 
    _finish: function(msg, success) {
6703
 
        Y.log('loader finishing: ' + msg + ', ' + Y.id + ', ' +
6704
 
            this.data, 'info', 'loader');
6705
 
 
6706
 
        _queue.running = false;
6707
 
 
6708
 
        var onEnd = this.onEnd;
6709
 
        if (onEnd) {
6710
 
            onEnd.call(this.context, {
6711
 
                msg: msg,
6712
 
                data: this.data,
6713
 
                success: success
6714
 
            });
6715
 
        }
6716
 
        this._continue();
6717
 
    },
6718
 
    /**
6719
 
    * The default Loader onSuccess handler, calls this.onSuccess with a payload
6720
 
    * @method _onSuccess
6721
 
    * @private
6722
 
    */
6723
 
    _onSuccess: function() {
6724
 
        var self = this, skipped = Y.merge(self.skipped), fn,
6725
 
            failed = [], rreg = self.requireRegistration,
6726
 
            success, msg;
6727
 
 
6728
 
        oeach(skipped, function(k) {
6729
 
            delete self.inserted[k];
6730
 
        });
6731
 
 
6732
 
        self.skipped = {};
6733
 
 
6734
 
        oeach(self.inserted, function(v, k) {
6735
 
            var mod = self.getModule(k);
6736
 
            if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
6737
 
                failed.push(k);
6738
 
            } else {
6739
 
                Y.mix(self.loaded, self.getProvides(k));
6740
 
            }
6741
 
        });
6742
 
 
6743
 
        fn = self.onSuccess;
6744
 
        msg = (failed.length) ? 'notregistered' : 'success';
6745
 
        success = !(failed.length);
6746
 
        if (fn) {
6747
 
            fn.call(self.context, {
6748
 
                msg: msg,
6749
 
                data: self.data,
6750
 
                success: success,
6751
 
                failed: failed,
6752
 
                skipped: skipped
6753
 
            });
6754
 
        }
6755
 
        self._finish(msg, success);
6756
 
    },
6757
 
    /**
6758
 
    * The default Loader onFailure handler, calls this.onFailure with a payload
6759
 
    * @method _onFailure
6760
 
    * @private
6761
 
    */
6762
 
    _onFailure: function(o) {
6763
 
        Y.log('load error: ' + o.msg + ', ' + Y.id, 'error', 'loader');
6764
 
        var f = this.onFailure, msg = 'failure: ' + o.msg;
6765
 
        if (f) {
6766
 
            f.call(this.context, {
6767
 
                msg: msg,
6768
 
                data: this.data,
6769
 
                success: false
6770
 
            });
6771
 
        }
6772
 
        this._finish(msg, false);
6773
 
    },
6774
 
 
6775
 
    /**
6776
 
    * The default Loader onTimeout handler, calls this.onTimeout with a payload
6777
 
    * @method _onTimeout
6778
 
    * @private
6779
 
    */
6780
 
    _onTimeout: function() {
6781
 
        Y.log('loader timeout: ' + Y.id, 'error', 'loader');
6782
 
        var f = this.onTimeout;
6783
 
        if (f) {
6784
 
            f.call(this.context, {
6785
 
                msg: 'timeout',
6786
 
                data: this.data,
6787
 
                success: false
6788
 
            });
6789
 
        }
6790
 
        this._finish('timeout', false);
6791
 
    },
6792
 
 
6793
 
    /**
6794
 
     * Sorts the dependency tree.  The last step of calculate()
6795
 
     * @method _sort
6796
 
     * @private
6797
 
     */
6798
 
    _sort: function() {
6799
 
 
6800
 
        // create an indexed list
6801
 
        var s = YObject.keys(this.required),
6802
 
            // loaded = this.loaded,
6803
 
            done = {},
6804
 
            p = 0, l, a, b, j, k, moved, doneKey;
6805
 
 
6806
 
        // keep going until we make a pass without moving anything
6807
 
        for (;;) {
6808
 
 
6809
 
            l = s.length;
6810
 
            moved = false;
6811
 
 
6812
 
            // start the loop after items that are already sorted
6813
 
            for (j = p; j < l; j++) {
6814
 
 
6815
 
                // check the next module on the list to see if its
6816
 
                // dependencies have been met
6817
 
                a = s[j];
6818
 
 
6819
 
                // check everything below current item and move if we
6820
 
                // find a requirement for the current item
6821
 
                for (k = j + 1; k < l; k++) {
6822
 
                    doneKey = a + s[k];
6823
 
 
6824
 
                    if (!done[doneKey] && this._requires(a, s[k])) {
6825
 
 
6826
 
                        // extract the dependency so we can move it up
6827
 
                        b = s.splice(k, 1);
6828
 
 
6829
 
                        // insert the dependency above the item that
6830
 
                        // requires it
6831
 
                        s.splice(j, 0, b[0]);
6832
 
 
6833
 
                        // only swap two dependencies once to short circut
6834
 
                        // circular dependencies
6835
 
                        done[doneKey] = true;
6836
 
 
6837
 
                        // keep working
6838
 
                        moved = true;
6839
 
 
6840
 
                        break;
6841
 
                    }
6842
 
                }
6843
 
 
6844
 
                // jump out of loop if we moved something
6845
 
                if (moved) {
6846
 
                    break;
6847
 
                // this item is sorted, move our pointer and keep going
6848
 
                } else {
6849
 
                    p++;
6850
 
                }
6851
 
            }
6852
 
 
6853
 
            // when we make it here and moved is false, we are
6854
 
            // finished sorting
6855
 
            if (!moved) {
6856
 
                break;
6857
 
            }
6858
 
 
6859
 
        }
6860
 
 
6861
 
        this.sorted = s;
6862
 
    },
6863
 
    /**
6864
 
    * (Unimplemented)
6865
 
    * @method partial
6866
 
    * @unimplemented
6867
 
    */
6868
 
    partial: function(partial, o, type) {
6869
 
        this.sorted = partial;
6870
 
        this.insert(o, type, true);
6871
 
    },
6872
 
    /**
6873
 
    * Handles the actual insertion of script/link tags
6874
 
    * @method _insert
6875
 
    * @param {Object} source The YUI instance the request came from
6876
 
    * @param {Object} o The metadata to include
6877
 
    * @param {String} type JS or CSS
6878
 
    * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
6879
 
    */
6880
 
    _insert: function(source, o, type, skipcalc) {
6881
 
 
6882
 
// Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
6883
 
 
6884
 
        // restore the state at the time of the request
6885
 
        if (source) {
6886
 
            this._config(source);
6887
 
        }
6888
 
 
6889
 
        // build the dependency list
6890
 
        // don't include type so we can process CSS and script in
6891
 
        // one pass when the type is not specified.
6892
 
        if (!skipcalc) {
6893
 
            this.calculate(o);
6894
 
        }
6895
 
 
6896
 
        this.loadType = type;
6897
 
 
6898
 
        if (!type) {
6899
 
 
6900
 
            var self = this;
6901
 
 
6902
 
            // Y.log("trying to load css first");
6903
 
            this._internalCallback = function() {
6904
 
 
6905
 
                var f = self.onCSS, n, p, sib;
6906
 
 
6907
 
                // IE hack for style overrides that are not being applied
6908
 
                if (this.insertBefore && Y.UA.ie) {
6909
 
                    n = Y.config.doc.getElementById(this.insertBefore);
6910
 
                    p = n.parentNode;
6911
 
                    sib = n.nextSibling;
6912
 
                    p.removeChild(n);
6913
 
                    if (sib) {
6914
 
                        p.insertBefore(n, sib);
6915
 
                    } else {
6916
 
                        p.appendChild(n);
6917
 
                    }
6918
 
                }
6919
 
 
6920
 
                if (f) {
6921
 
                    f.call(self.context, Y);
6922
 
                }
6923
 
                self._internalCallback = null;
6924
 
 
6925
 
                self._insert(null, null, JS);
6926
 
            };
6927
 
 
6928
 
            this._insert(null, null, CSS);
6929
 
 
6930
 
            return;
6931
 
        }
6932
 
 
6933
 
        // set a flag to indicate the load has started
6934
 
        this._loading = true;
6935
 
 
6936
 
        // flag to indicate we are done with the combo service
6937
 
        // and any additional files will need to be loaded
6938
 
        // individually
6939
 
        this._combineComplete = {};
6940
 
 
6941
 
        // start the load
6942
 
        this.loadNext();
6943
 
 
6944
 
    },
6945
 
    /**
6946
 
    * Once a loader operation is completely finished, process any additional queued items.
6947
 
    * @method _continue
6948
 
    * @private
6949
 
    */
6950
 
    _continue: function() {
6951
 
        if (!(_queue.running) && _queue.size() > 0) {
6952
 
            _queue.running = true;
6953
 
            _queue.next()();
6954
 
        }
6955
 
    },
6956
 
 
6957
 
    /**
6958
 
     * inserts the requested modules and their dependencies.
6959
 
     * <code>type</code> can be "js" or "css".  Both script and
6960
 
     * css are inserted if type is not provided.
6961
 
     * @method insert
6962
 
     * @param {object} o optional options object.
6963
 
     * @param {string} type the type of dependency to insert.
6964
 
     */
6965
 
    insert: function(o, type, skipsort) {
6966
 
        // Y.log('public insert() ' + (type || '') + ', ' +
6967
 
        //  Y.Object.keys(this.required), "info", "loader");
6968
 
        var self = this, copy = Y.merge(this);
6969
 
        delete copy.require;
6970
 
        delete copy.dirty;
6971
 
        _queue.add(function() {
6972
 
            self._insert(copy, o, type, skipsort);
6973
 
        });
6974
 
        this._continue();
6975
 
    },
6976
 
 
6977
 
    /**
6978
 
     * Executed every time a module is loaded, and if we are in a load
6979
 
     * cycle, we attempt to load the next script.  Public so that it
6980
 
     * is possible to call this if using a method other than
6981
 
     * Y.register to determine when scripts are fully loaded
6982
 
     * @method loadNext
6983
 
     * @param {string} mname optional the name of the module that has
6984
 
     * been loaded (which is usually why it is time to load the next
6985
 
     * one).
6986
 
     */
6987
 
    loadNext: function(mname) {
6988
 
        // It is possible that this function is executed due to something
6989
 
        // else on the page loading a YUI module.  Only react when we
6990
 
        // are actively loading something
6991
 
        if (!this._loading) {
6992
 
            return;
6993
 
        }
6994
 
 
6995
 
        var s, len, i, m, url, fn, msg, attr, group, groupName, j, frag,
6996
 
            comboSource, comboSources, mods, combining, urls, comboBase,
6997
 
            self = this,
6998
 
            type = self.loadType,
6999
 
            handleSuccess = function(o) {
7000
 
                self.loadNext(o.data);
7001
 
            },
7002
 
            handleCombo = function(o) {
7003
 
                self._combineComplete[type] = true;
7004
 
                var i, len = combining.length;
7005
 
 
7006
 
                for (i = 0; i < len; i++) {
7007
 
                    self.inserted[combining[i]] = true;
7008
 
                }
7009
 
 
7010
 
                handleSuccess(o);
7011
 
            };
7012
 
 
7013
 
        if (self.combine && (!self._combineComplete[type])) {
7014
 
 
7015
 
            combining = [];
7016
 
 
7017
 
            self._combining = combining;
7018
 
            s = self.sorted;
7019
 
            len = s.length;
7020
 
 
7021
 
            // the default combo base
7022
 
            comboBase = self.comboBase;
7023
 
 
7024
 
            url = comboBase;
7025
 
            urls = [];
7026
 
 
7027
 
            comboSources = {};
7028
 
 
7029
 
            for (i = 0; i < len; i++) {
7030
 
                comboSource = comboBase;
7031
 
                m = self.getModule(s[i]);
7032
 
                groupName = m && m.group;
7033
 
                if (groupName) {
7034
 
 
7035
 
                    group = self.groups[groupName];
7036
 
 
7037
 
                    if (!group.combine) {
7038
 
                        m.combine = false;
7039
 
                        continue;
7040
 
                    }
7041
 
                    m.combine = true;
7042
 
                    if (group.comboBase) {
7043
 
                        comboSource = group.comboBase;
7044
 
                    }
7045
 
 
7046
 
                    if ("root" in group && L.isValue(group.root)) {
7047
 
                        m.root = group.root;
7048
 
                    }
7049
 
 
7050
 
                }
7051
 
 
7052
 
                comboSources[comboSource] = comboSources[comboSource] || [];
7053
 
                comboSources[comboSource].push(m);
7054
 
            }
7055
 
 
7056
 
            for (j in comboSources) {
7057
 
                if (comboSources.hasOwnProperty(j)) {
7058
 
                    url = j;
7059
 
                    mods = comboSources[j];
7060
 
                    len = mods.length;
7061
 
 
7062
 
                    for (i = 0; i < len; i++) {
7063
 
                        // m = self.getModule(s[i]);
7064
 
                        m = mods[i];
7065
 
 
7066
 
                        // Do not try to combine non-yui JS unless combo def
7067
 
                        // is found
7068
 
                        if (m && (m.type === type) && (m.combine || !m.ext)) {
7069
 
 
7070
 
                            frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
7071
 
                            frag = self._filter(frag, m.name);
7072
 
                            if ((url !== j) && (i <= (len - 1)) &&
7073
 
                            ((frag.length + url.length) > self.maxURLLength)) {
7074
 
                                //Hack until this is rewritten to use an array and not string concat:
7075
 
                                if (url.substr(url.length - 1, 1) === self.comboSep) {
7076
 
                                    url = url.substr(0, (url.length - 1));
7077
 
                                }
7078
 
                                urls.push(self._filter(url));
7079
 
                                url = j;
7080
 
                            }
7081
 
 
7082
 
                            url += frag;
7083
 
                            if (i < (len - 1)) {
7084
 
                                url += self.comboSep;
7085
 
                            }
7086
 
 
7087
 
                            combining.push(m.name);
7088
 
                        }
7089
 
 
7090
 
                    }
7091
 
 
7092
 
                    if (combining.length && (url != j)) {
7093
 
                        //Hack until this is rewritten to use an array and not string concat:
7094
 
                        if (url.substr(url.length - 1, 1) === self.comboSep) {
7095
 
                            url = url.substr(0, (url.length - 1));
7096
 
                        }
7097
 
                        urls.push(self._filter(url));
7098
 
                    }
7099
 
                }
7100
 
            }
7101
 
 
7102
 
            if (combining.length) {
7103
 
 
7104
 
Y.log('Attempting to use combo: ' + combining, 'info', 'loader');
7105
 
 
7106
 
                // if (m.type === CSS) {
7107
 
                if (type === CSS) {
7108
 
                    fn = Y.Get.css;
7109
 
                    attr = self.cssAttributes;
7110
 
                } else {
7111
 
                    fn = Y.Get.script;
7112
 
                    attr = self.jsAttributes;
7113
 
                }
7114
 
 
7115
 
                fn(urls, {
7116
 
                    data: self._loading,
7117
 
                    onSuccess: handleCombo,
7118
 
                    onFailure: self._onFailure,
7119
 
                    onTimeout: self._onTimeout,
7120
 
                    insertBefore: self.insertBefore,
7121
 
                    charset: self.charset,
7122
 
                    attributes: attr,
7123
 
                    timeout: self.timeout,
7124
 
                    autopurge: false,
7125
 
                    context: self
7126
 
                });
7127
 
 
7128
 
                return;
7129
 
 
7130
 
            } else {
7131
 
                self._combineComplete[type] = true;
7132
 
            }
7133
 
        }
7134
 
 
7135
 
        if (mname) {
7136
 
 
7137
 
            // if the module that was just loaded isn't what we were expecting,
7138
 
            // continue to wait
7139
 
            if (mname !== self._loading) {
7140
 
                return;
7141
 
            }
7142
 
 
7143
 
// Y.log("loadNext executing, just loaded " + mname + ", " +
7144
 
// Y.id, "info", "loader");
7145
 
 
7146
 
            // The global handler that is called when each module is loaded
7147
 
            // will pass that module name to this function.  Storing this
7148
 
            // data to avoid loading the same module multiple times
7149
 
            // centralize this in the callback
7150
 
            self.inserted[mname] = true;
7151
 
            // self.loaded[mname] = true;
7152
 
 
7153
 
            // provided = self.getProvides(mname);
7154
 
            // Y.mix(self.loaded, provided);
7155
 
            // Y.mix(self.inserted, provided);
7156
 
 
7157
 
            if (self.onProgress) {
7158
 
                self.onProgress.call(self.context, {
7159
 
                        name: mname,
7160
 
                        data: self.data
7161
 
                    });
7162
 
            }
7163
 
        }
7164
 
 
7165
 
        s = self.sorted;
7166
 
        len = s.length;
7167
 
 
7168
 
        for (i = 0; i < len; i = i + 1) {
7169
 
            // this.inserted keeps track of what the loader has loaded.
7170
 
            // move on if this item is done.
7171
 
            if (s[i] in self.inserted) {
7172
 
                continue;
7173
 
            }
7174
 
 
7175
 
            // Because rollups will cause multiple load notifications
7176
 
            // from Y, loadNext may be called multiple times for
7177
 
            // the same module when loading a rollup.  We can safely
7178
 
            // skip the subsequent requests
7179
 
            if (s[i] === self._loading) {
7180
 
                Y.log('still loading ' + s[i] + ', waiting', 'info', 'loader');
7181
 
                return;
7182
 
            }
7183
 
 
7184
 
            // log("inserting " + s[i]);
7185
 
            m = self.getModule(s[i]);
7186
 
 
7187
 
            if (!m) {
7188
 
                if (!self.skipped[s[i]]) {
7189
 
                    msg = 'Undefined module ' + s[i] + ' skipped';
7190
 
                    Y.log(msg, 'warn', 'loader');
7191
 
                    // self.inserted[s[i]] = true;
7192
 
                    self.skipped[s[i]] = true;
7193
 
                }
7194
 
                continue;
7195
 
 
7196
 
            }
7197
 
 
7198
 
            group = (m.group && self.groups[m.group]) || NOT_FOUND;
7199
 
 
7200
 
            // The load type is stored to offer the possibility to load
7201
 
            // the css separately from the script.
7202
 
            if (!type || type === m.type) {
7203
 
                self._loading = s[i];
7204
 
Y.log('attempting to load ' + s[i] + ', ' + self.base, 'info', 'loader');
7205
 
 
7206
 
                if (m.type === CSS) {
7207
 
                    fn = Y.Get.css;
7208
 
                    attr = self.cssAttributes;
7209
 
                } else {
7210
 
                    fn = Y.Get.script;
7211
 
                    attr = self.jsAttributes;
7212
 
                }
7213
 
 
7214
 
                url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
7215
 
                      self._url(m.path, s[i], group.base || m.base);
7216
 
 
7217
 
                fn(url, {
7218
 
                    data: s[i],
7219
 
                    onSuccess: handleSuccess,
7220
 
                    insertBefore: self.insertBefore,
7221
 
                    charset: self.charset,
7222
 
                    attributes: attr,
7223
 
                    onFailure: self._onFailure,
7224
 
                    onTimeout: self._onTimeout,
7225
 
                    timeout: self.timeout,
7226
 
                    autopurge: false,
7227
 
                    context: self
7228
 
                });
7229
 
 
7230
 
                return;
7231
 
            }
7232
 
        }
7233
 
 
7234
 
        // we are finished
7235
 
        self._loading = null;
7236
 
 
7237
 
        fn = self._internalCallback;
7238
 
 
7239
 
        // internal callback for loading css first
7240
 
        if (fn) {
7241
 
            // Y.log('loader internal');
7242
 
            self._internalCallback = null;
7243
 
            fn.call(self);
7244
 
        } else {
7245
 
            // Y.log('loader complete');
7246
 
            self._onSuccess();
7247
 
        }
7248
 
    },
7249
 
 
7250
 
    /**
7251
 
     * Apply filter defined for this instance to a url/path
7252
 
     * @method _filter
7253
 
     * @param {string} u the string to filter.
7254
 
     * @param {string} name the name of the module, if we are processing
7255
 
     * a single module as opposed to a combined url.
7256
 
     * @return {string} the filtered string.
7257
 
     * @private
7258
 
     */
7259
 
    _filter: function(u, name) {
7260
 
        var f = this.filter,
7261
 
            hasFilter = name && (name in this.filters),
7262
 
            modFilter = hasFilter && this.filters[name],
7263
 
            groupName = this.moduleInfo[name] ? this.moduleInfo[name].group:null;               
7264
 
            if (groupName && this.groups[groupName].filter) {           
7265
 
                   modFilter = this.groups[groupName].filter;
7266
 
                   hasFilter = true;            
7267
 
             };
7268
 
 
7269
 
        if (u) {
7270
 
            if (hasFilter) {
7271
 
                f = (L.isString(modFilter)) ?
7272
 
                    this.FILTER_DEFS[modFilter.toUpperCase()] || null :
7273
 
                    modFilter;
7274
 
            }
7275
 
            if (f) {
7276
 
                u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
7277
 
            }
7278
 
        }
7279
 
 
7280
 
        return u;
7281
 
    },
7282
 
 
7283
 
    /**
7284
 
     * Generates the full url for a module
7285
 
     * @method _url
7286
 
     * @param {string} path the path fragment.
7287
 
     * @param {String} name The name of the module
7288
 
     * @pamra {String} [base=self.base] The base url to use
7289
 
     * @return {string} the full url.
7290
 
     * @private
7291
 
     */
7292
 
    _url: function(path, name, base) {
7293
 
        return this._filter((base || this.base || '') + path, name);
7294
 
    },
7295
 
    /**
7296
 
    * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
7297
 
    * @method resolve
7298
 
    * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
7299
 
    * @param {Array} [s=loader.sorted] An override for the loader.sorted array
7300
 
    * @return {Object} Object hash (js and css) of two arrays of file lists
7301
 
    * @example This method can be used as an off-line dep calculator
7302
 
    *
7303
 
    *        var Y = YUI();
7304
 
    *        var loader = new Y.Loader({
7305
 
    *            filter: 'debug',
7306
 
    *            base: '../../',
7307
 
    *            root: 'build/',
7308
 
    *            combine: true,
7309
 
    *            require: ['node', 'dd', 'console']
7310
 
    *        });
7311
 
    *        var out = loader.resolve(true);
7312
 
    *
7313
 
    */
7314
 
    resolve: function(calc, s) {
7315
 
        var self = this, i, m, url, out = { js: [], css: [] };
7316
 
 
7317
 
        if (calc) {
7318
 
            self.calculate();
7319
 
        }
7320
 
        s = s || self.sorted;
7321
 
 
7322
 
        for (i = 0; i < s.length; i++) {
7323
 
            m = self.getModule(s[i]);
7324
 
            if (m) {
7325
 
                if (self.combine) {
7326
 
                    url = self._filter((self.root + m.path), m.name, self.root);
7327
 
                } else {
7328
 
                    url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
7329
 
                }
7330
 
                out[m.type].push(url);
7331
 
            }
7332
 
        }
7333
 
        if (self.combine) {
7334
 
            out.js = [self.comboBase + out.js.join(self.comboSep)];
7335
 
            out.css = [self.comboBase + out.css.join(self.comboSep)];
7336
 
        }
7337
 
 
7338
 
        return out;
7339
 
    },
7340
 
    /**
7341
 
    * Returns an Object hash of hashes built from `loader.sorted` or from an arbitrary list of sorted modules.
7342
 
    * @method hash
7343
 
    * @private
7344
 
    * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
7345
 
    * @param {Array} [s=loader.sorted] An override for the loader.sorted array
7346
 
    * @return {Object} Object hash (js and css) of two object hashes of file lists, with the module name as the key
7347
 
    * @example This method can be used as an off-line dep calculator
7348
 
    *
7349
 
    *        var Y = YUI();
7350
 
    *        var loader = new Y.Loader({
7351
 
    *            filter: 'debug',
7352
 
    *            base: '../../',
7353
 
    *            root: 'build/',
7354
 
    *            combine: true,
7355
 
    *            require: ['node', 'dd', 'console']
7356
 
    *        });
7357
 
    *        var out = loader.hash(true);
7358
 
    *
7359
 
    */
7360
 
    hash: function(calc, s) {
7361
 
        var self = this, i, m, url, out = { js: {}, css: {} };
7362
 
 
7363
 
        if (calc) {
7364
 
            self.calculate();
7365
 
        }
7366
 
        s = s || self.sorted;
7367
 
 
7368
 
        for (i = 0; i < s.length; i++) {
7369
 
            m = self.getModule(s[i]);
7370
 
            if (m) {
7371
 
                url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
7372
 
                out[m.type][m.name] = url;
7373
 
            }
7374
 
        }
7375
 
 
7376
 
        return out;
7377
 
    }
7378
 
};
7379
 
 
7380
 
 
7381
 
 
7382
 
}, '3.4.1' ,{requires:['get']});
7383
 
YUI.add('loader-rollup', function(Y) {
7384
 
 
7385
 
/**
7386
 
 * Optional automatic rollup logic for reducing http connections
7387
 
 * when not using a combo service.
7388
 
 * @module loader
7389
 
 * @submodule rollup
7390
 
 */
7391
 
 
7392
 
/**
7393
 
 * Look for rollup packages to determine if all of the modules a
7394
 
 * rollup supersedes are required.  If so, include the rollup to
7395
 
 * help reduce the total number of connections required.  Called
7396
 
 * by calculate().  This is an optional feature, and requires the
7397
 
 * appropriate submodule to function.
7398
 
 * @method _rollup
7399
 
 * @for Loader
7400
 
 * @private
7401
 
 */
7402
 
Y.Loader.prototype._rollup = function() {
7403
 
    var i, j, m, s, r = this.required, roll,
7404
 
        info = this.moduleInfo, rolled, c, smod;
7405
 
 
7406
 
    // find and cache rollup modules
7407
 
    if (this.dirty || !this.rollups) {
7408
 
        this.rollups = {};
7409
 
        for (i in info) {
7410
 
            if (info.hasOwnProperty(i)) {
7411
 
                m = this.getModule(i);
7412
 
                // if (m && m.rollup && m.supersedes) {
7413
 
                if (m && m.rollup) {
7414
 
                    this.rollups[i] = m;
7415
 
                }
7416
 
            }
7417
 
        }
7418
 
 
7419
 
        this.forceMap = (this.force) ? Y.Array.hash(this.force) : {};
7420
 
    }
7421
 
 
7422
 
    // make as many passes as needed to pick up rollup rollups
7423
 
    for (;;) {
7424
 
        rolled = false;
7425
 
 
7426
 
        // go through the rollup candidates
7427
 
        for (i in this.rollups) {
7428
 
            if (this.rollups.hasOwnProperty(i)) {
7429
 
                // there can be only one, unless forced
7430
 
                if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
7431
 
                    m = this.getModule(i);
7432
 
                    s = m.supersedes || [];
7433
 
                    roll = false;
7434
 
 
7435
 
                    // @TODO remove continue
7436
 
                    if (!m.rollup) {
7437
 
                        continue;
7438
 
                    }
7439
 
 
7440
 
                    c = 0;
7441
 
 
7442
 
                    // check the threshold
7443
 
                    for (j = 0; j < s.length; j++) {
7444
 
                        smod = info[s[j]];
7445
 
 
7446
 
                        // if the superseded module is loaded, we can't
7447
 
                        // load the rollup unless it has been forced.
7448
 
                        if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
7449
 
                            roll = false;
7450
 
                            break;
7451
 
                        // increment the counter if this module is required.
7452
 
                        // if we are beyond the rollup threshold, we will
7453
 
                        // use the rollup module
7454
 
                        } else if (r[s[j]] && m.type == smod.type) {
7455
 
                            c++;
7456
 
                            // Y.log("adding to thresh: " + c + ", " + s[j]);
7457
 
                            roll = (c >= m.rollup);
7458
 
                            if (roll) {
7459
 
                                // Y.log("over thresh " + c + ", " + s[j]);
7460
 
                                break;
7461
 
                            }
7462
 
                        }
7463
 
                    }
7464
 
 
7465
 
                    if (roll) {
7466
 
                        // Y.log("adding rollup: " +  i);
7467
 
                        // add the rollup
7468
 
                        r[i] = true;
7469
 
                        rolled = true;
7470
 
 
7471
 
                        // expand the rollup's dependencies
7472
 
                        this.getRequires(m);
7473
 
                    }
7474
 
                }
7475
 
            }
7476
 
        }
7477
 
 
7478
 
        // if we made it here w/o rolling up something, we are done
7479
 
        if (!rolled) {
7480
 
            break;
7481
 
        }
7482
 
    }
7483
 
};
7484
 
 
7485
 
 
7486
 
}, '3.4.1' ,{requires:['loader-base']});
7487
 
YUI.add('loader-yui3', function(Y) {
7488
 
 
7489
 
/* This file is auto-generated by src/loader/scripts/meta_join.py */
7490
 
 
7491
 
/**
7492
 
 * YUI 3 module metadata
7493
 
 * @module loader
7494
 
 * @submodule yui3
7495
 
 */
7496
 
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
7497
 
    "align-plugin": {
7498
 
        "requires": [
7499
 
            "node-screen", 
7500
 
            "node-pluginhost"
7501
 
        ]
7502
 
    }, 
7503
 
    "anim": {
7504
 
        "use": [
7505
 
            "anim-base", 
7506
 
            "anim-color", 
7507
 
            "anim-curve", 
7508
 
            "anim-easing", 
7509
 
            "anim-node-plugin", 
7510
 
            "anim-scroll", 
7511
 
            "anim-xy"
7512
 
        ]
7513
 
    }, 
7514
 
    "anim-base": {
7515
 
        "requires": [
7516
 
            "base-base", 
7517
 
            "node-style"
7518
 
        ]
7519
 
    }, 
7520
 
    "anim-color": {
7521
 
        "requires": [
7522
 
            "anim-base"
7523
 
        ]
7524
 
    }, 
7525
 
    "anim-curve": {
7526
 
        "requires": [
7527
 
            "anim-xy"
7528
 
        ]
7529
 
    }, 
7530
 
    "anim-easing": {
7531
 
        "requires": [
7532
 
            "anim-base"
7533
 
        ]
7534
 
    }, 
7535
 
    "anim-node-plugin": {
7536
 
        "requires": [
7537
 
            "node-pluginhost", 
7538
 
            "anim-base"
7539
 
        ]
7540
 
    }, 
7541
 
    "anim-scroll": {
7542
 
        "requires": [
7543
 
            "anim-base"
7544
 
        ]
7545
 
    }, 
7546
 
    "anim-xy": {
7547
 
        "requires": [
7548
 
            "anim-base", 
7549
 
            "node-screen"
7550
 
        ]
7551
 
    }, 
7552
 
    "app": {
7553
 
        "use": [
7554
 
            "controller", 
7555
 
            "model", 
7556
 
            "model-list", 
7557
 
            "view"
7558
 
        ]
7559
 
    }, 
7560
 
    "array-extras": {
7561
 
        "requires": [
7562
 
            "yui-base"
7563
 
        ]
7564
 
    }, 
7565
 
    "array-invoke": {
7566
 
        "requires": [
7567
 
            "yui-base"
7568
 
        ]
7569
 
    }, 
7570
 
    "arraylist": {
7571
 
        "requires": [
7572
 
            "yui-base"
7573
 
        ]
7574
 
    }, 
7575
 
    "arraylist-add": {
7576
 
        "requires": [
7577
 
            "arraylist"
7578
 
        ]
7579
 
    }, 
7580
 
    "arraylist-filter": {
7581
 
        "requires": [
7582
 
            "arraylist"
7583
 
        ]
7584
 
    }, 
7585
 
    "arraysort": {
7586
 
        "requires": [
7587
 
            "yui-base"
7588
 
        ]
7589
 
    }, 
7590
 
    "async-queue": {
7591
 
        "requires": [
7592
 
            "event-custom"
7593
 
        ]
7594
 
    }, 
7595
 
    "attribute": {
7596
 
        "use": [
7597
 
            "attribute-base", 
7598
 
            "attribute-complex"
7599
 
        ]
7600
 
    }, 
7601
 
    "attribute-base": {
7602
 
        "requires": [
7603
 
            "event-custom"
7604
 
        ]
7605
 
    }, 
7606
 
    "attribute-complex": {
7607
 
        "requires": [
7608
 
            "attribute-base"
7609
 
        ]
7610
 
    }, 
7611
 
    "autocomplete": {
7612
 
        "use": [
7613
 
            "autocomplete-base", 
7614
 
            "autocomplete-sources", 
7615
 
            "autocomplete-list", 
7616
 
            "autocomplete-plugin"
7617
 
        ]
7618
 
    }, 
7619
 
    "autocomplete-base": {
7620
 
        "optional": [
7621
 
            "autocomplete-sources"
7622
 
        ], 
7623
 
        "requires": [
7624
 
            "array-extras", 
7625
 
            "base-build", 
7626
 
            "escape", 
7627
 
            "event-valuechange", 
7628
 
            "node-base"
7629
 
        ]
7630
 
    }, 
7631
 
    "autocomplete-filters": {
7632
 
        "requires": [
7633
 
            "array-extras", 
7634
 
            "text-wordbreak"
7635
 
        ]
7636
 
    }, 
7637
 
    "autocomplete-filters-accentfold": {
7638
 
        "requires": [
7639
 
            "array-extras", 
7640
 
            "text-accentfold", 
7641
 
            "text-wordbreak"
7642
 
        ]
7643
 
    }, 
7644
 
    "autocomplete-highlighters": {
7645
 
        "requires": [
7646
 
            "array-extras", 
7647
 
            "highlight-base"
7648
 
        ]
7649
 
    }, 
7650
 
    "autocomplete-highlighters-accentfold": {
7651
 
        "requires": [
7652
 
            "array-extras", 
7653
 
            "highlight-accentfold"
7654
 
        ]
7655
 
    }, 
7656
 
    "autocomplete-list": {
7657
 
        "after": [
7658
 
            "autocomplete-sources"
7659
 
        ], 
7660
 
        "lang": [
7661
 
            "en"
7662
 
        ], 
7663
 
        "requires": [
7664
 
            "autocomplete-base", 
7665
 
            "event-resize", 
7666
 
            "node-screen", 
7667
 
            "selector-css3", 
7668
 
            "shim-plugin", 
7669
 
            "widget", 
7670
 
            "widget-position", 
7671
 
            "widget-position-align"
7672
 
        ], 
7673
 
        "skinnable": true
7674
 
    }, 
7675
 
    "autocomplete-list-keys": {
7676
 
        "condition": {
7677
 
            "name": "autocomplete-list-keys", 
7678
 
            "test": function (Y) {
7679
 
    // Only add keyboard support to autocomplete-list if this doesn't appear to
7680
 
    // be an iOS or Android-based mobile device.
7681
 
    //
7682
 
    // There's currently no feasible way to actually detect whether a device has
7683
 
    // a hardware keyboard, so this sniff will have to do. It can easily be
7684
 
    // overridden by manually loading the autocomplete-list-keys module.
7685
 
    //
7686
 
    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
7687
 
    // doesn't fire the keyboard events used by AutoCompleteList, so there's
7688
 
    // no point loading the -keys module even when a bluetooth keyboard may be
7689
 
    // available.
7690
 
    return !(Y.UA.ios || Y.UA.android);
7691
 
}, 
7692
 
            "trigger": "autocomplete-list"
7693
 
        }, 
7694
 
        "requires": [
7695
 
            "autocomplete-list", 
7696
 
            "base-build"
7697
 
        ]
7698
 
    }, 
7699
 
    "autocomplete-plugin": {
7700
 
        "requires": [
7701
 
            "autocomplete-list", 
7702
 
            "node-pluginhost"
7703
 
        ]
7704
 
    }, 
7705
 
    "autocomplete-sources": {
7706
 
        "optional": [
7707
 
            "io-base", 
7708
 
            "json-parse", 
7709
 
            "jsonp", 
7710
 
            "yql"
7711
 
        ], 
7712
 
        "requires": [
7713
 
            "autocomplete-base"
7714
 
        ]
7715
 
    }, 
7716
 
    "base": {
7717
 
        "use": [
7718
 
            "base-base", 
7719
 
            "base-pluginhost", 
7720
 
            "base-build"
7721
 
        ]
7722
 
    }, 
7723
 
    "base-base": {
7724
 
        "after": [
7725
 
            "attribute-complex"
7726
 
        ], 
7727
 
        "requires": [
7728
 
            "attribute-base"
7729
 
        ]
7730
 
    }, 
7731
 
    "base-build": {
7732
 
        "requires": [
7733
 
            "base-base"
7734
 
        ]
7735
 
    }, 
7736
 
    "base-pluginhost": {
7737
 
        "requires": [
7738
 
            "base-base", 
7739
 
            "pluginhost"
7740
 
        ]
7741
 
    }, 
7742
 
    "cache": {
7743
 
        "use": [
7744
 
            "cache-base", 
7745
 
            "cache-offline", 
7746
 
            "cache-plugin"
7747
 
        ]
7748
 
    }, 
7749
 
    "cache-base": {
7750
 
        "requires": [
7751
 
            "base"
7752
 
        ]
7753
 
    }, 
7754
 
    "cache-offline": {
7755
 
        "requires": [
7756
 
            "cache-base", 
7757
 
            "json"
7758
 
        ]
7759
 
    }, 
7760
 
    "cache-plugin": {
7761
 
        "requires": [
7762
 
            "plugin", 
7763
 
            "cache-base"
7764
 
        ]
7765
 
    }, 
7766
 
    "calendar": {
7767
 
        "lang": [
7768
 
            "en", 
7769
 
            "ja", 
7770
 
            "ru"
7771
 
        ], 
7772
 
        "requires": [
7773
 
            "calendar-base", 
7774
 
            "calendarnavigator"
7775
 
        ], 
7776
 
        "skinnable": true
7777
 
    }, 
7778
 
    "calendar-base": {
7779
 
        "lang": [
7780
 
            "en", 
7781
 
            "ja", 
7782
 
            "ru"
7783
 
        ], 
7784
 
        "requires": [
7785
 
            "widget", 
7786
 
            "substitute", 
7787
 
            "datatype-date", 
7788
 
            "datatype-date-math", 
7789
 
            "cssgrids"
7790
 
        ], 
7791
 
        "skinnable": true
7792
 
    }, 
7793
 
    "calendarnavigator": {
7794
 
        "requires": [
7795
 
            "plugin", 
7796
 
            "classnamemanager", 
7797
 
            "datatype-date", 
7798
 
            "node", 
7799
 
            "substitute"
7800
 
        ], 
7801
 
        "skinnable": true
7802
 
    }, 
7803
 
    "charts": {
7804
 
        "requires": [
7805
 
            "dom", 
7806
 
            "datatype-number", 
7807
 
            "datatype-date", 
7808
 
            "event-custom", 
7809
 
            "event-mouseenter", 
7810
 
            "widget", 
7811
 
            "widget-position", 
7812
 
            "widget-stack", 
7813
 
            "graphics"
7814
 
        ]
7815
 
    }, 
7816
 
    "classnamemanager": {
7817
 
        "requires": [
7818
 
            "yui-base"
7819
 
        ]
7820
 
    }, 
7821
 
    "clickable-rail": {
7822
 
        "requires": [
7823
 
            "slider-base"
7824
 
        ]
7825
 
    }, 
7826
 
    "collection": {
7827
 
        "use": [
7828
 
            "array-extras", 
7829
 
            "arraylist", 
7830
 
            "arraylist-add", 
7831
 
            "arraylist-filter", 
7832
 
            "array-invoke"
7833
 
        ]
7834
 
    }, 
7835
 
    "console": {
7836
 
        "lang": [
7837
 
            "en", 
7838
 
            "es", 
7839
 
            "ja"
7840
 
        ], 
7841
 
        "requires": [
7842
 
            "yui-log", 
7843
 
            "widget", 
7844
 
            "substitute"
7845
 
        ], 
7846
 
        "skinnable": true
7847
 
    }, 
7848
 
    "console-filters": {
7849
 
        "requires": [
7850
 
            "plugin", 
7851
 
            "console"
7852
 
        ], 
7853
 
        "skinnable": true
7854
 
    }, 
7855
 
    "controller": {
7856
 
        "optional": [
7857
 
            "querystring-parse"
7858
 
        ], 
7859
 
        "requires": [
7860
 
            "array-extras", 
7861
 
            "base-build", 
7862
 
            "history"
7863
 
        ]
7864
 
    }, 
7865
 
    "cookie": {
7866
 
        "requires": [
7867
 
            "yui-base"
7868
 
        ]
7869
 
    }, 
7870
 
    "createlink-base": {
7871
 
        "requires": [
7872
 
            "editor-base"
7873
 
        ]
7874
 
    }, 
7875
 
    "cssbase": {
7876
 
        "after": [
7877
 
            "cssreset", 
7878
 
            "cssfonts", 
7879
 
            "cssgrids", 
7880
 
            "cssreset-context", 
7881
 
            "cssfonts-context", 
7882
 
            "cssgrids-context"
7883
 
        ], 
7884
 
        "type": "css"
7885
 
    }, 
7886
 
    "cssbase-context": {
7887
 
        "after": [
7888
 
            "cssreset", 
7889
 
            "cssfonts", 
7890
 
            "cssgrids", 
7891
 
            "cssreset-context", 
7892
 
            "cssfonts-context", 
7893
 
            "cssgrids-context"
7894
 
        ], 
7895
 
        "type": "css"
7896
 
    }, 
7897
 
    "cssfonts": {
7898
 
        "type": "css"
7899
 
    }, 
7900
 
    "cssfonts-context": {
7901
 
        "type": "css"
7902
 
    }, 
7903
 
    "cssgrids": {
7904
 
        "optional": [
7905
 
            "cssreset", 
7906
 
            "cssfonts"
7907
 
        ], 
7908
 
        "type": "css"
7909
 
    }, 
7910
 
    "cssreset": {
7911
 
        "type": "css"
7912
 
    }, 
7913
 
    "cssreset-context": {
7914
 
        "type": "css"
7915
 
    }, 
7916
 
    "dataschema": {
7917
 
        "use": [
7918
 
            "dataschema-base", 
7919
 
            "dataschema-json", 
7920
 
            "dataschema-xml", 
7921
 
            "dataschema-array", 
7922
 
            "dataschema-text"
7923
 
        ]
7924
 
    }, 
7925
 
    "dataschema-array": {
7926
 
        "requires": [
7927
 
            "dataschema-base"
7928
 
        ]
7929
 
    }, 
7930
 
    "dataschema-base": {
7931
 
        "requires": [
7932
 
            "base"
7933
 
        ]
7934
 
    }, 
7935
 
    "dataschema-json": {
7936
 
        "requires": [
7937
 
            "dataschema-base", 
7938
 
            "json"
7939
 
        ]
7940
 
    }, 
7941
 
    "dataschema-text": {
7942
 
        "requires": [
7943
 
            "dataschema-base"
7944
 
        ]
7945
 
    }, 
7946
 
    "dataschema-xml": {
7947
 
        "requires": [
7948
 
            "dataschema-base"
7949
 
        ]
7950
 
    }, 
7951
 
    "datasource": {
7952
 
        "use": [
7953
 
            "datasource-local", 
7954
 
            "datasource-io", 
7955
 
            "datasource-get", 
7956
 
            "datasource-function", 
7957
 
            "datasource-cache", 
7958
 
            "datasource-jsonschema", 
7959
 
            "datasource-xmlschema", 
7960
 
            "datasource-arrayschema", 
7961
 
            "datasource-textschema", 
7962
 
            "datasource-polling"
7963
 
        ]
7964
 
    }, 
7965
 
    "datasource-arrayschema": {
7966
 
        "requires": [
7967
 
            "datasource-local", 
7968
 
            "plugin", 
7969
 
            "dataschema-array"
7970
 
        ]
7971
 
    }, 
7972
 
    "datasource-cache": {
7973
 
        "requires": [
7974
 
            "datasource-local", 
7975
 
            "plugin", 
7976
 
            "cache-base"
7977
 
        ]
7978
 
    }, 
7979
 
    "datasource-function": {
7980
 
        "requires": [
7981
 
            "datasource-local"
7982
 
        ]
7983
 
    }, 
7984
 
    "datasource-get": {
7985
 
        "requires": [
7986
 
            "datasource-local", 
7987
 
            "get"
7988
 
        ]
7989
 
    }, 
7990
 
    "datasource-io": {
7991
 
        "requires": [
7992
 
            "datasource-local", 
7993
 
            "io-base"
7994
 
        ]
7995
 
    }, 
7996
 
    "datasource-jsonschema": {
7997
 
        "requires": [
7998
 
            "datasource-local", 
7999
 
            "plugin", 
8000
 
            "dataschema-json"
8001
 
        ]
8002
 
    }, 
8003
 
    "datasource-local": {
8004
 
        "requires": [
8005
 
            "base"
8006
 
        ]
8007
 
    }, 
8008
 
    "datasource-polling": {
8009
 
        "requires": [
8010
 
            "datasource-local"
8011
 
        ]
8012
 
    }, 
8013
 
    "datasource-textschema": {
8014
 
        "requires": [
8015
 
            "datasource-local", 
8016
 
            "plugin", 
8017
 
            "dataschema-text"
8018
 
        ]
8019
 
    }, 
8020
 
    "datasource-xmlschema": {
8021
 
        "requires": [
8022
 
            "datasource-local", 
8023
 
            "plugin", 
8024
 
            "dataschema-xml"
8025
 
        ]
8026
 
    }, 
8027
 
    "datatable": {
8028
 
        "use": [
8029
 
            "datatable-base", 
8030
 
            "datatable-datasource", 
8031
 
            "datatable-sort", 
8032
 
            "datatable-scroll"
8033
 
        ]
8034
 
    }, 
8035
 
    "datatable-base": {
8036
 
        "requires": [
8037
 
            "recordset-base", 
8038
 
            "widget", 
8039
 
            "substitute", 
8040
 
            "event-mouseenter"
8041
 
        ], 
8042
 
        "skinnable": true
8043
 
    }, 
8044
 
    "datatable-datasource": {
8045
 
        "requires": [
8046
 
            "datatable-base", 
8047
 
            "plugin", 
8048
 
            "datasource-local"
8049
 
        ]
8050
 
    }, 
8051
 
    "datatable-scroll": {
8052
 
        "requires": [
8053
 
            "datatable-base", 
8054
 
            "plugin"
8055
 
        ]
8056
 
    }, 
8057
 
    "datatable-sort": {
8058
 
        "lang": [
8059
 
            "en"
8060
 
        ], 
8061
 
        "requires": [
8062
 
            "datatable-base", 
8063
 
            "plugin", 
8064
 
            "recordset-sort"
8065
 
        ]
8066
 
    }, 
8067
 
    "datatype": {
8068
 
        "use": [
8069
 
            "datatype-number", 
8070
 
            "datatype-date", 
8071
 
            "datatype-xml"
8072
 
        ]
8073
 
    }, 
8074
 
    "datatype-date": {
8075
 
        "supersedes": [
8076
 
            "datatype-date-format"
8077
 
        ], 
8078
 
        "use": [
8079
 
            "datatype-date-parse", 
8080
 
            "datatype-date-format"
8081
 
        ]
8082
 
    }, 
8083
 
    "datatype-date-format": {
8084
 
        "lang": [
8085
 
            "ar", 
8086
 
            "ar-JO", 
8087
 
            "ca", 
8088
 
            "ca-ES", 
8089
 
            "da", 
8090
 
            "da-DK", 
8091
 
            "de", 
8092
 
            "de-AT", 
8093
 
            "de-DE", 
8094
 
            "el", 
8095
 
            "el-GR", 
8096
 
            "en", 
8097
 
            "en-AU", 
8098
 
            "en-CA", 
8099
 
            "en-GB", 
8100
 
            "en-IE", 
8101
 
            "en-IN", 
8102
 
            "en-JO", 
8103
 
            "en-MY", 
8104
 
            "en-NZ", 
8105
 
            "en-PH", 
8106
 
            "en-SG", 
8107
 
            "en-US", 
8108
 
            "es", 
8109
 
            "es-AR", 
8110
 
            "es-BO", 
8111
 
            "es-CL", 
8112
 
            "es-CO", 
8113
 
            "es-EC", 
8114
 
            "es-ES", 
8115
 
            "es-MX", 
8116
 
            "es-PE", 
8117
 
            "es-PY", 
8118
 
            "es-US", 
8119
 
            "es-UY", 
8120
 
            "es-VE", 
8121
 
            "fi", 
8122
 
            "fi-FI", 
8123
 
            "fr", 
8124
 
            "fr-BE", 
8125
 
            "fr-CA", 
8126
 
            "fr-FR", 
8127
 
            "hi", 
8128
 
            "hi-IN", 
8129
 
            "id", 
8130
 
            "id-ID", 
8131
 
            "it", 
8132
 
            "it-IT", 
8133
 
            "ja", 
8134
 
            "ja-JP", 
8135
 
            "ko", 
8136
 
            "ko-KR", 
8137
 
            "ms", 
8138
 
            "ms-MY", 
8139
 
            "nb", 
8140
 
            "nb-NO", 
8141
 
            "nl", 
8142
 
            "nl-BE", 
8143
 
            "nl-NL", 
8144
 
            "pl", 
8145
 
            "pl-PL", 
8146
 
            "pt", 
8147
 
            "pt-BR", 
8148
 
            "ro", 
8149
 
            "ro-RO", 
8150
 
            "ru", 
8151
 
            "ru-RU", 
8152
 
            "sv", 
8153
 
            "sv-SE", 
8154
 
            "th", 
8155
 
            "th-TH", 
8156
 
            "tr", 
8157
 
            "tr-TR", 
8158
 
            "vi", 
8159
 
            "vi-VN", 
8160
 
            "zh-Hans", 
8161
 
            "zh-Hans-CN", 
8162
 
            "zh-Hant", 
8163
 
            "zh-Hant-HK", 
8164
 
            "zh-Hant-TW"
8165
 
        ]
8166
 
    }, 
8167
 
    "datatype-date-math": {
8168
 
        "requires": [
8169
 
            "yui-base"
8170
 
        ]
8171
 
    }, 
8172
 
    "datatype-date-parse": {}, 
8173
 
    "datatype-number": {
8174
 
        "use": [
8175
 
            "datatype-number-parse", 
8176
 
            "datatype-number-format"
8177
 
        ]
8178
 
    }, 
8179
 
    "datatype-number-format": {}, 
8180
 
    "datatype-number-parse": {}, 
8181
 
    "datatype-xml": {
8182
 
        "use": [
8183
 
            "datatype-xml-parse", 
8184
 
            "datatype-xml-format"
8185
 
        ]
8186
 
    }, 
8187
 
    "datatype-xml-format": {}, 
8188
 
    "datatype-xml-parse": {}, 
8189
 
    "dd": {
8190
 
        "use": [
8191
 
            "dd-ddm-base", 
8192
 
            "dd-ddm", 
8193
 
            "dd-ddm-drop", 
8194
 
            "dd-drag", 
8195
 
            "dd-proxy", 
8196
 
            "dd-constrain", 
8197
 
            "dd-drop", 
8198
 
            "dd-scroll", 
8199
 
            "dd-delegate"
8200
 
        ]
8201
 
    }, 
8202
 
    "dd-constrain": {
8203
 
        "requires": [
8204
 
            "dd-drag"
8205
 
        ]
8206
 
    }, 
8207
 
    "dd-ddm": {
8208
 
        "requires": [
8209
 
            "dd-ddm-base", 
8210
 
            "event-resize"
8211
 
        ]
8212
 
    }, 
8213
 
    "dd-ddm-base": {
8214
 
        "requires": [
8215
 
            "node", 
8216
 
            "base", 
8217
 
            "yui-throttle", 
8218
 
            "classnamemanager"
8219
 
        ]
8220
 
    }, 
8221
 
    "dd-ddm-drop": {
8222
 
        "requires": [
8223
 
            "dd-ddm"
8224
 
        ]
8225
 
    }, 
8226
 
    "dd-delegate": {
8227
 
        "requires": [
8228
 
            "dd-drag", 
8229
 
            "dd-drop-plugin", 
8230
 
            "event-mouseenter"
8231
 
        ]
8232
 
    }, 
8233
 
    "dd-drag": {
8234
 
        "requires": [
8235
 
            "dd-ddm-base"
8236
 
        ]
8237
 
    }, 
8238
 
    "dd-drop": {
8239
 
        "requires": [
8240
 
            "dd-drag", 
8241
 
            "dd-ddm-drop"
8242
 
        ]
8243
 
    }, 
8244
 
    "dd-drop-plugin": {
8245
 
        "requires": [
8246
 
            "dd-drop"
8247
 
        ]
8248
 
    }, 
8249
 
    "dd-gestures": {
8250
 
        "condition": {
8251
 
            "name": "dd-gestures", 
8252
 
            "test": function(Y) {
8253
 
    return (Y.config.win && ('ontouchstart' in Y.config.win && !Y.UA.chrome));
8254
 
}, 
8255
 
            "trigger": "dd-drag"
8256
 
        }, 
8257
 
        "requires": [
8258
 
            "dd-drag", 
8259
 
            "event-synthetic", 
8260
 
            "event-gestures"
8261
 
        ]
8262
 
    }, 
8263
 
    "dd-plugin": {
8264
 
        "optional": [
8265
 
            "dd-constrain", 
8266
 
            "dd-proxy"
8267
 
        ], 
8268
 
        "requires": [
8269
 
            "dd-drag"
8270
 
        ]
8271
 
    }, 
8272
 
    "dd-proxy": {
8273
 
        "requires": [
8274
 
            "dd-drag"
8275
 
        ]
8276
 
    }, 
8277
 
    "dd-scroll": {
8278
 
        "requires": [
8279
 
            "dd-drag"
8280
 
        ]
8281
 
    }, 
8282
 
    "dial": {
8283
 
        "lang": [
8284
 
            "en", 
8285
 
            "es"
8286
 
        ], 
8287
 
        "requires": [
8288
 
            "widget", 
8289
 
            "dd-drag", 
8290
 
            "substitute", 
8291
 
            "event-mouseenter", 
8292
 
            "event-move", 
8293
 
            "event-key", 
8294
 
            "transition", 
8295
 
            "intl"
8296
 
        ], 
8297
 
        "skinnable": true
8298
 
    }, 
8299
 
    "dom": {
8300
 
        "use": [
8301
 
            "dom-base", 
8302
 
            "dom-screen", 
8303
 
            "dom-style", 
8304
 
            "selector-native", 
8305
 
            "selector"
8306
 
        ]
8307
 
    }, 
8308
 
    "dom-base": {
8309
 
        "requires": [
8310
 
            "dom-core"
8311
 
        ]
8312
 
    }, 
8313
 
    "dom-core": {
8314
 
        "requires": [
8315
 
            "oop", 
8316
 
            "features"
8317
 
        ]
8318
 
    }, 
8319
 
    "dom-deprecated": {
8320
 
        "requires": [
8321
 
            "dom-base"
8322
 
        ]
8323
 
    }, 
8324
 
    "dom-screen": {
8325
 
        "requires": [
8326
 
            "dom-base", 
8327
 
            "dom-style"
8328
 
        ]
8329
 
    }, 
8330
 
    "dom-style": {
8331
 
        "requires": [
8332
 
            "dom-base"
8333
 
        ]
8334
 
    }, 
8335
 
    "dom-style-ie": {
8336
 
        "condition": {
8337
 
            "name": "dom-style-ie", 
8338
 
            "test": function (Y) {
8339
 
 
8340
 
    var testFeature = Y.Features.test,
8341
 
        addFeature = Y.Features.add,
8342
 
        WINDOW = Y.config.win,
8343
 
        DOCUMENT = Y.config.doc,
8344
 
        DOCUMENT_ELEMENT = 'documentElement',
8345
 
        ret = false;
8346
 
 
8347
 
    addFeature('style', 'computedStyle', {
8348
 
        test: function() {
8349
 
            return WINDOW && 'getComputedStyle' in WINDOW;
8350
 
        }
8351
 
    });
8352
 
 
8353
 
    addFeature('style', 'opacity', {
8354
 
        test: function() {
8355
 
            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
8356
 
        }
8357
 
    });
8358
 
 
8359
 
    ret =  (!testFeature('style', 'opacity') &&
8360
 
            !testFeature('style', 'computedStyle'));
8361
 
 
8362
 
    return ret;
8363
 
}, 
8364
 
            "trigger": "dom-style"
8365
 
        }, 
8366
 
        "requires": [
8367
 
            "dom-style"
8368
 
        ]
8369
 
    }, 
8370
 
    "dump": {
8371
 
        "requires": [
8372
 
            "yui-base"
8373
 
        ]
8374
 
    }, 
8375
 
    "editor": {
8376
 
        "use": [
8377
 
            "frame", 
8378
 
            "selection", 
8379
 
            "exec-command", 
8380
 
            "editor-base", 
8381
 
            "editor-para", 
8382
 
            "editor-br", 
8383
 
            "editor-bidi", 
8384
 
            "editor-tab", 
8385
 
            "createlink-base"
8386
 
        ]
8387
 
    }, 
8388
 
    "editor-base": {
8389
 
        "requires": [
8390
 
            "base", 
8391
 
            "frame", 
8392
 
            "node", 
8393
 
            "exec-command", 
8394
 
            "selection"
8395
 
        ]
8396
 
    }, 
8397
 
    "editor-bidi": {
8398
 
        "requires": [
8399
 
            "editor-base"
8400
 
        ]
8401
 
    }, 
8402
 
    "editor-br": {
8403
 
        "requires": [
8404
 
            "editor-base"
8405
 
        ]
8406
 
    }, 
8407
 
    "editor-lists": {
8408
 
        "requires": [
8409
 
            "editor-base"
8410
 
        ]
8411
 
    }, 
8412
 
    "editor-para": {
8413
 
        "requires": [
8414
 
            "editor-base"
8415
 
        ]
8416
 
    }, 
8417
 
    "editor-tab": {
8418
 
        "requires": [
8419
 
            "editor-base"
8420
 
        ]
8421
 
    }, 
8422
 
    "escape": {
8423
 
        "requires": [
8424
 
            "yui-base"
8425
 
        ]
8426
 
    }, 
8427
 
    "event": {
8428
 
        "after": [
8429
 
            "node-base"
8430
 
        ], 
8431
 
        "use": [
8432
 
            "event-base", 
8433
 
            "event-delegate", 
8434
 
            "event-synthetic", 
8435
 
            "event-mousewheel", 
8436
 
            "event-mouseenter", 
8437
 
            "event-key", 
8438
 
            "event-focus", 
8439
 
            "event-resize", 
8440
 
            "event-hover", 
8441
 
            "event-outside"
8442
 
        ]
8443
 
    }, 
8444
 
    "event-base": {
8445
 
        "after": [
8446
 
            "node-base"
8447
 
        ], 
8448
 
        "requires": [
8449
 
            "event-custom-base"
8450
 
        ]
8451
 
    }, 
8452
 
    "event-base-ie": {
8453
 
        "after": [
8454
 
            "event-base"
8455
 
        ], 
8456
 
        "condition": {
8457
 
            "name": "event-base-ie", 
8458
 
            "test": function(Y) {
8459
 
    var imp = Y.config.doc && Y.config.doc.implementation;
8460
 
    return (imp && (!imp.hasFeature('Events', '2.0')));
8461
 
}, 
8462
 
            "trigger": "node-base"
8463
 
        }, 
8464
 
        "requires": [
8465
 
            "node-base"
8466
 
        ]
8467
 
    }, 
8468
 
    "event-custom": {
8469
 
        "use": [
8470
 
            "event-custom-base", 
8471
 
            "event-custom-complex"
8472
 
        ]
8473
 
    }, 
8474
 
    "event-custom-base": {
8475
 
        "requires": [
8476
 
            "oop"
8477
 
        ]
8478
 
    }, 
8479
 
    "event-custom-complex": {
8480
 
        "requires": [
8481
 
            "event-custom-base"
8482
 
        ]
8483
 
    }, 
8484
 
    "event-delegate": {
8485
 
        "requires": [
8486
 
            "node-base"
8487
 
        ]
8488
 
    }, 
8489
 
    "event-flick": {
8490
 
        "requires": [
8491
 
            "node-base", 
8492
 
            "event-touch", 
8493
 
            "event-synthetic"
8494
 
        ]
8495
 
    }, 
8496
 
    "event-focus": {
8497
 
        "requires": [
8498
 
            "event-synthetic"
8499
 
        ]
8500
 
    }, 
8501
 
    "event-gestures": {
8502
 
        "use": [
8503
 
            "event-flick", 
8504
 
            "event-move"
8505
 
        ]
8506
 
    }, 
8507
 
    "event-hover": {
8508
 
        "requires": [
8509
 
            "event-mouseenter"
8510
 
        ]
8511
 
    }, 
8512
 
    "event-key": {
8513
 
        "requires": [
8514
 
            "event-synthetic"
8515
 
        ]
8516
 
    }, 
8517
 
    "event-mouseenter": {
8518
 
        "requires": [
8519
 
            "event-synthetic"
8520
 
        ]
8521
 
    }, 
8522
 
    "event-mousewheel": {
8523
 
        "requires": [
8524
 
            "node-base"
8525
 
        ]
8526
 
    }, 
8527
 
    "event-move": {
8528
 
        "requires": [
8529
 
            "node-base", 
8530
 
            "event-touch", 
8531
 
            "event-synthetic"
8532
 
        ]
8533
 
    }, 
8534
 
    "event-outside": {
8535
 
        "requires": [
8536
 
            "event-synthetic"
8537
 
        ]
8538
 
    }, 
8539
 
    "event-resize": {
8540
 
        "requires": [
8541
 
            "node-base", 
8542
 
            "event-synthetic"
8543
 
        ]
8544
 
    }, 
8545
 
    "event-simulate": {
8546
 
        "requires": [
8547
 
            "event-base"
8548
 
        ]
8549
 
    }, 
8550
 
    "event-synthetic": {
8551
 
        "requires": [
8552
 
            "node-base", 
8553
 
            "event-custom-complex"
8554
 
        ]
8555
 
    }, 
8556
 
    "event-touch": {
8557
 
        "requires": [
8558
 
            "node-base"
8559
 
        ]
8560
 
    }, 
8561
 
    "event-valuechange": {
8562
 
        "requires": [
8563
 
            "event-focus", 
8564
 
            "event-synthetic"
8565
 
        ]
8566
 
    }, 
8567
 
    "exec-command": {
8568
 
        "requires": [
8569
 
            "frame"
8570
 
        ]
8571
 
    }, 
8572
 
    "features": {
8573
 
        "requires": [
8574
 
            "yui-base"
8575
 
        ]
8576
 
    }, 
8577
 
    "frame": {
8578
 
        "requires": [
8579
 
            "base", 
8580
 
            "node", 
8581
 
            "selector-css3", 
8582
 
            "substitute", 
8583
 
            "yui-throttle"
8584
 
        ]
8585
 
    }, 
8586
 
    "get": {
8587
 
        "requires": [
8588
 
            "yui-base"
8589
 
        ]
8590
 
    }, 
8591
 
    "graphics": {
8592
 
        "requires": [
8593
 
            "node", 
8594
 
            "event-custom", 
8595
 
            "pluginhost"
8596
 
        ]
8597
 
    }, 
8598
 
    "graphics-canvas": {
8599
 
        "condition": {
8600
 
            "name": "graphics-canvas", 
8601
 
            "test": function(Y) {
8602
 
    var DOCUMENT = Y.config.doc,
8603
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8604
 
        return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
8605
 
}, 
8606
 
            "trigger": "graphics"
8607
 
        }, 
8608
 
        "requires": [
8609
 
            "graphics"
8610
 
        ]
8611
 
    }, 
8612
 
    "graphics-canvas-default": {
8613
 
        "condition": {
8614
 
            "name": "graphics-canvas-default", 
8615
 
            "test": function(Y) {
8616
 
    var DOCUMENT = Y.config.doc,
8617
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8618
 
        return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (canvas && canvas.getContext && canvas.getContext("2d")));
8619
 
}, 
8620
 
            "trigger": "graphics"
8621
 
        }
8622
 
    }, 
8623
 
    "graphics-svg": {
8624
 
        "condition": {
8625
 
            "name": "graphics-svg", 
8626
 
            "test": function(Y) {
8627
 
    var DOCUMENT = Y.config.doc;
8628
 
        return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8629
 
}, 
8630
 
            "trigger": "graphics"
8631
 
        }, 
8632
 
        "requires": [
8633
 
            "graphics"
8634
 
        ]
8635
 
    }, 
8636
 
    "graphics-svg-default": {
8637
 
        "condition": {
8638
 
            "name": "graphics-svg-default", 
8639
 
            "test": function(Y) {
8640
 
    var DOCUMENT = Y.config.doc;
8641
 
        return (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8642
 
}, 
8643
 
            "trigger": "graphics"
8644
 
        }
8645
 
    }, 
8646
 
    "graphics-vml": {
8647
 
        "condition": {
8648
 
            "name": "graphics-vml", 
8649
 
            "test": function(Y) {
8650
 
    var DOCUMENT = Y.config.doc,
8651
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8652
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
8653
 
}, 
8654
 
            "trigger": "graphics"
8655
 
        }, 
8656
 
        "requires": [
8657
 
            "graphics"
8658
 
        ]
8659
 
    }, 
8660
 
    "graphics-vml-default": {
8661
 
        "condition": {
8662
 
            "name": "graphics-vml-default", 
8663
 
            "test": function(Y) {
8664
 
    var DOCUMENT = Y.config.doc,
8665
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8666
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
8667
 
}, 
8668
 
            "trigger": "graphics"
8669
 
        }
8670
 
    }, 
8671
 
    "highlight": {
8672
 
        "use": [
8673
 
            "highlight-base", 
8674
 
            "highlight-accentfold"
8675
 
        ]
8676
 
    }, 
8677
 
    "highlight-accentfold": {
8678
 
        "requires": [
8679
 
            "highlight-base", 
8680
 
            "text-accentfold"
8681
 
        ]
8682
 
    }, 
8683
 
    "highlight-base": {
8684
 
        "requires": [
8685
 
            "array-extras", 
8686
 
            "classnamemanager", 
8687
 
            "escape", 
8688
 
            "text-wordbreak"
8689
 
        ]
8690
 
    }, 
8691
 
    "history": {
8692
 
        "use": [
8693
 
            "history-base", 
8694
 
            "history-hash", 
8695
 
            "history-hash-ie", 
8696
 
            "history-html5"
8697
 
        ]
8698
 
    }, 
8699
 
    "history-base": {
8700
 
        "requires": [
8701
 
            "event-custom-complex"
8702
 
        ]
8703
 
    }, 
8704
 
    "history-hash": {
8705
 
        "after": [
8706
 
            "history-html5"
8707
 
        ], 
8708
 
        "requires": [
8709
 
            "event-synthetic", 
8710
 
            "history-base", 
8711
 
            "yui-later"
8712
 
        ]
8713
 
    }, 
8714
 
    "history-hash-ie": {
8715
 
        "condition": {
8716
 
            "name": "history-hash-ie", 
8717
 
            "test": function (Y) {
8718
 
    var docMode = Y.config.doc && Y.config.doc.documentMode;
8719
 
 
8720
 
    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
8721
 
            !docMode || docMode < 8);
8722
 
}, 
8723
 
            "trigger": "history-hash"
8724
 
        }, 
8725
 
        "requires": [
8726
 
            "history-hash", 
8727
 
            "node-base"
8728
 
        ]
8729
 
    }, 
8730
 
    "history-html5": {
8731
 
        "optional": [
8732
 
            "json"
8733
 
        ], 
8734
 
        "requires": [
8735
 
            "event-base", 
8736
 
            "history-base", 
8737
 
            "node-base"
8738
 
        ]
8739
 
    }, 
8740
 
    "imageloader": {
8741
 
        "requires": [
8742
 
            "base-base", 
8743
 
            "node-style", 
8744
 
            "node-screen"
8745
 
        ]
8746
 
    }, 
8747
 
    "intl": {
8748
 
        "requires": [
8749
 
            "intl-base", 
8750
 
            "event-custom"
8751
 
        ]
8752
 
    }, 
8753
 
    "intl-base": {
8754
 
        "requires": [
8755
 
            "yui-base"
8756
 
        ]
8757
 
    }, 
8758
 
    "io": {
8759
 
        "use": [
8760
 
            "io-base", 
8761
 
            "io-xdr", 
8762
 
            "io-form", 
8763
 
            "io-upload-iframe", 
8764
 
            "io-queue"
8765
 
        ]
8766
 
    }, 
8767
 
    "io-base": {
8768
 
        "requires": [
8769
 
            "event-custom-base", 
8770
 
            "querystring-stringify-simple"
8771
 
        ]
8772
 
    }, 
8773
 
    "io-form": {
8774
 
        "requires": [
8775
 
            "io-base", 
8776
 
            "node-base"
8777
 
        ]
8778
 
    }, 
8779
 
    "io-queue": {
8780
 
        "requires": [
8781
 
            "io-base", 
8782
 
            "queue-promote"
8783
 
        ]
8784
 
    }, 
8785
 
    "io-upload-iframe": {
8786
 
        "requires": [
8787
 
            "io-base", 
8788
 
            "node-base"
8789
 
        ]
8790
 
    }, 
8791
 
    "io-xdr": {
8792
 
        "requires": [
8793
 
            "io-base", 
8794
 
            "datatype-xml-parse"
8795
 
        ]
8796
 
    }, 
8797
 
    "json": {
8798
 
        "use": [
8799
 
            "json-parse", 
8800
 
            "json-stringify"
8801
 
        ]
8802
 
    }, 
8803
 
    "json-parse": {
8804
 
        "requires": [
8805
 
            "yui-base"
8806
 
        ]
8807
 
    }, 
8808
 
    "json-stringify": {
8809
 
        "requires": [
8810
 
            "yui-base"
8811
 
        ]
8812
 
    }, 
8813
 
    "jsonp": {
8814
 
        "requires": [
8815
 
            "get", 
8816
 
            "oop"
8817
 
        ]
8818
 
    }, 
8819
 
    "jsonp-url": {
8820
 
        "requires": [
8821
 
            "jsonp"
8822
 
        ]
8823
 
    }, 
8824
 
    "loader": {
8825
 
        "use": [
8826
 
            "loader-base", 
8827
 
            "loader-rollup", 
8828
 
            "loader-yui3"
8829
 
        ]
8830
 
    }, 
8831
 
    "loader-base": {
8832
 
        "requires": [
8833
 
            "get"
8834
 
        ]
8835
 
    }, 
8836
 
    "loader-rollup": {
8837
 
        "requires": [
8838
 
            "loader-base"
8839
 
        ]
8840
 
    }, 
8841
 
    "loader-yui3": {
8842
 
        "requires": [
8843
 
            "loader-base"
8844
 
        ]
8845
 
    }, 
8846
 
    "model": {
8847
 
        "requires": [
8848
 
            "base-build", 
8849
 
            "escape", 
8850
 
            "json-parse"
8851
 
        ]
8852
 
    }, 
8853
 
    "model-list": {
8854
 
        "requires": [
8855
 
            "array-extras", 
8856
 
            "array-invoke", 
8857
 
            "arraylist", 
8858
 
            "base-build", 
8859
 
            "escape", 
8860
 
            "json-parse", 
8861
 
            "model"
8862
 
        ]
8863
 
    }, 
8864
 
    "node": {
8865
 
        "use": [
8866
 
            "node-base", 
8867
 
            "node-event-delegate", 
8868
 
            "node-pluginhost", 
8869
 
            "node-screen", 
8870
 
            "node-style"
8871
 
        ]
8872
 
    }, 
8873
 
    "node-base": {
8874
 
        "requires": [
8875
 
            "event-base", 
8876
 
            "node-core", 
8877
 
            "dom-base"
8878
 
        ]
8879
 
    }, 
8880
 
    "node-core": {
8881
 
        "requires": [
8882
 
            "dom-core", 
8883
 
            "selector"
8884
 
        ]
8885
 
    }, 
8886
 
    "node-deprecated": {
8887
 
        "requires": [
8888
 
            "node-base"
8889
 
        ]
8890
 
    }, 
8891
 
    "node-event-delegate": {
8892
 
        "requires": [
8893
 
            "node-base", 
8894
 
            "event-delegate"
8895
 
        ]
8896
 
    }, 
8897
 
    "node-event-html5": {
8898
 
        "requires": [
8899
 
            "node-base"
8900
 
        ]
8901
 
    }, 
8902
 
    "node-event-simulate": {
8903
 
        "requires": [
8904
 
            "node-base", 
8905
 
            "event-simulate"
8906
 
        ]
8907
 
    }, 
8908
 
    "node-flick": {
8909
 
        "requires": [
8910
 
            "classnamemanager", 
8911
 
            "transition", 
8912
 
            "event-flick", 
8913
 
            "plugin"
8914
 
        ], 
8915
 
        "skinnable": true
8916
 
    }, 
8917
 
    "node-focusmanager": {
8918
 
        "requires": [
8919
 
            "attribute", 
8920
 
            "node", 
8921
 
            "plugin", 
8922
 
            "node-event-simulate", 
8923
 
            "event-key", 
8924
 
            "event-focus"
8925
 
        ]
8926
 
    }, 
8927
 
    "node-load": {
8928
 
        "requires": [
8929
 
            "node-base", 
8930
 
            "io-base"
8931
 
        ]
8932
 
    }, 
8933
 
    "node-menunav": {
8934
 
        "requires": [
8935
 
            "node", 
8936
 
            "classnamemanager", 
8937
 
            "plugin", 
8938
 
            "node-focusmanager"
8939
 
        ], 
8940
 
        "skinnable": true
8941
 
    }, 
8942
 
    "node-pluginhost": {
8943
 
        "requires": [
8944
 
            "node-base", 
8945
 
            "pluginhost"
8946
 
        ]
8947
 
    }, 
8948
 
    "node-screen": {
8949
 
        "requires": [
8950
 
            "dom-screen", 
8951
 
            "node-base"
8952
 
        ]
8953
 
    }, 
8954
 
    "node-style": {
8955
 
        "requires": [
8956
 
            "dom-style", 
8957
 
            "node-base"
8958
 
        ]
8959
 
    }, 
8960
 
    "oop": {
8961
 
        "requires": [
8962
 
            "yui-base"
8963
 
        ]
8964
 
    }, 
8965
 
    "overlay": {
8966
 
        "requires": [
8967
 
            "widget", 
8968
 
            "widget-stdmod", 
8969
 
            "widget-position", 
8970
 
            "widget-position-align", 
8971
 
            "widget-stack", 
8972
 
            "widget-position-constrain"
8973
 
        ], 
8974
 
        "skinnable": true
8975
 
    }, 
8976
 
    "panel": {
8977
 
        "requires": [
8978
 
            "widget", 
8979
 
            "widget-stdmod", 
8980
 
            "widget-position", 
8981
 
            "widget-position-align", 
8982
 
            "widget-stack", 
8983
 
            "widget-position-constrain", 
8984
 
            "widget-modality", 
8985
 
            "widget-autohide", 
8986
 
            "widget-buttons"
8987
 
        ], 
8988
 
        "skinnable": true
8989
 
    }, 
8990
 
    "plugin": {
8991
 
        "requires": [
8992
 
            "base-base"
8993
 
        ]
8994
 
    }, 
8995
 
    "pluginhost": {
8996
 
        "use": [
8997
 
            "pluginhost-base", 
8998
 
            "pluginhost-config"
8999
 
        ]
9000
 
    }, 
9001
 
    "pluginhost-base": {
9002
 
        "requires": [
9003
 
            "yui-base"
9004
 
        ]
9005
 
    }, 
9006
 
    "pluginhost-config": {
9007
 
        "requires": [
9008
 
            "pluginhost-base"
9009
 
        ]
9010
 
    }, 
9011
 
    "profiler": {
9012
 
        "requires": [
9013
 
            "yui-base"
9014
 
        ]
9015
 
    }, 
9016
 
    "querystring": {
9017
 
        "use": [
9018
 
            "querystring-parse", 
9019
 
            "querystring-stringify"
9020
 
        ]
9021
 
    }, 
9022
 
    "querystring-parse": {
9023
 
        "requires": [
9024
 
            "yui-base", 
9025
 
            "array-extras"
9026
 
        ]
9027
 
    }, 
9028
 
    "querystring-parse-simple": {
9029
 
        "requires": [
9030
 
            "yui-base"
9031
 
        ]
9032
 
    }, 
9033
 
    "querystring-stringify": {
9034
 
        "requires": [
9035
 
            "yui-base"
9036
 
        ]
9037
 
    }, 
9038
 
    "querystring-stringify-simple": {
9039
 
        "requires": [
9040
 
            "yui-base"
9041
 
        ]
9042
 
    }, 
9043
 
    "queue-promote": {
9044
 
        "requires": [
9045
 
            "yui-base"
9046
 
        ]
9047
 
    }, 
9048
 
    "range-slider": {
9049
 
        "requires": [
9050
 
            "slider-base", 
9051
 
            "slider-value-range", 
9052
 
            "clickable-rail"
9053
 
        ]
9054
 
    }, 
9055
 
    "recordset": {
9056
 
        "use": [
9057
 
            "recordset-base", 
9058
 
            "recordset-sort", 
9059
 
            "recordset-filter", 
9060
 
            "recordset-indexer"
9061
 
        ]
9062
 
    }, 
9063
 
    "recordset-base": {
9064
 
        "requires": [
9065
 
            "base", 
9066
 
            "arraylist"
9067
 
        ]
9068
 
    }, 
9069
 
    "recordset-filter": {
9070
 
        "requires": [
9071
 
            "recordset-base", 
9072
 
            "array-extras", 
9073
 
            "plugin"
9074
 
        ]
9075
 
    }, 
9076
 
    "recordset-indexer": {
9077
 
        "requires": [
9078
 
            "recordset-base", 
9079
 
            "plugin"
9080
 
        ]
9081
 
    }, 
9082
 
    "recordset-sort": {
9083
 
        "requires": [
9084
 
            "arraysort", 
9085
 
            "recordset-base", 
9086
 
            "plugin"
9087
 
        ]
9088
 
    }, 
9089
 
    "resize": {
9090
 
        "use": [
9091
 
            "resize-base", 
9092
 
            "resize-proxy", 
9093
 
            "resize-constrain"
9094
 
        ]
9095
 
    }, 
9096
 
    "resize-base": {
9097
 
        "requires": [
9098
 
            "base", 
9099
 
            "widget", 
9100
 
            "substitute", 
9101
 
            "event", 
9102
 
            "oop", 
9103
 
            "dd-drag", 
9104
 
            "dd-delegate", 
9105
 
            "dd-drop"
9106
 
        ], 
9107
 
        "skinnable": true
9108
 
    }, 
9109
 
    "resize-constrain": {
9110
 
        "requires": [
9111
 
            "plugin", 
9112
 
            "resize-base"
9113
 
        ]
9114
 
    }, 
9115
 
    "resize-plugin": {
9116
 
        "optional": [
9117
 
            "resize-constrain"
9118
 
        ], 
9119
 
        "requires": [
9120
 
            "resize-base", 
9121
 
            "plugin"
9122
 
        ]
9123
 
    }, 
9124
 
    "resize-proxy": {
9125
 
        "requires": [
9126
 
            "plugin", 
9127
 
            "resize-base"
9128
 
        ]
9129
 
    }, 
9130
 
    "rls": {
9131
 
        "requires": [
9132
 
            "get", 
9133
 
            "features"
9134
 
        ]
9135
 
    }, 
9136
 
    "scrollview": {
9137
 
        "requires": [
9138
 
            "scrollview-base", 
9139
 
            "scrollview-scrollbars"
9140
 
        ]
9141
 
    }, 
9142
 
    "scrollview-base": {
9143
 
        "requires": [
9144
 
            "widget", 
9145
 
            "event-gestures", 
9146
 
            "transition"
9147
 
        ], 
9148
 
        "skinnable": true
9149
 
    }, 
9150
 
    "scrollview-base-ie": {
9151
 
        "condition": {
9152
 
            "name": "scrollview-base-ie", 
9153
 
            "trigger": "scrollview-base", 
9154
 
            "ua": "ie"
9155
 
        }, 
9156
 
        "requires": [
9157
 
            "scrollview-base"
9158
 
        ]
9159
 
    }, 
9160
 
    "scrollview-list": {
9161
 
        "requires": [
9162
 
            "plugin", 
9163
 
            "classnamemanager"
9164
 
        ], 
9165
 
        "skinnable": true
9166
 
    }, 
9167
 
    "scrollview-paginator": {
9168
 
        "requires": [
9169
 
            "plugin"
9170
 
        ]
9171
 
    }, 
9172
 
    "scrollview-scrollbars": {
9173
 
        "requires": [
9174
 
            "classnamemanager", 
9175
 
            "transition", 
9176
 
            "plugin"
9177
 
        ], 
9178
 
        "skinnable": true
9179
 
    }, 
9180
 
    "selection": {
9181
 
        "requires": [
9182
 
            "node"
9183
 
        ]
9184
 
    }, 
9185
 
    "selector": {
9186
 
        "requires": [
9187
 
            "selector-native"
9188
 
        ]
9189
 
    }, 
9190
 
    "selector-css2": {
9191
 
        "condition": {
9192
 
            "name": "selector-css2", 
9193
 
            "test": function (Y) {
9194
 
    var DOCUMENT = Y.config.doc,
9195
 
        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
9196
 
 
9197
 
    return ret;
9198
 
}, 
9199
 
            "trigger": "selector"
9200
 
        }, 
9201
 
        "requires": [
9202
 
            "selector-native"
9203
 
        ]
9204
 
    }, 
9205
 
    "selector-css3": {
9206
 
        "requires": [
9207
 
            "selector-native", 
9208
 
            "selector-css2"
9209
 
        ]
9210
 
    }, 
9211
 
    "selector-native": {
9212
 
        "requires": [
9213
 
            "dom-base"
9214
 
        ]
9215
 
    }, 
9216
 
    "shim-plugin": {
9217
 
        "requires": [
9218
 
            "node-style", 
9219
 
            "node-pluginhost"
9220
 
        ]
9221
 
    }, 
9222
 
    "slider": {
9223
 
        "use": [
9224
 
            "slider-base", 
9225
 
            "slider-value-range", 
9226
 
            "clickable-rail", 
9227
 
            "range-slider"
9228
 
        ]
9229
 
    }, 
9230
 
    "slider-base": {
9231
 
        "requires": [
9232
 
            "widget", 
9233
 
            "dd-constrain", 
9234
 
            "substitute"
9235
 
        ], 
9236
 
        "skinnable": true
9237
 
    }, 
9238
 
    "slider-value-range": {
9239
 
        "requires": [
9240
 
            "slider-base"
9241
 
        ]
9242
 
    }, 
9243
 
    "sortable": {
9244
 
        "requires": [
9245
 
            "dd-delegate", 
9246
 
            "dd-drop-plugin", 
9247
 
            "dd-proxy"
9248
 
        ]
9249
 
    }, 
9250
 
    "sortable-scroll": {
9251
 
        "requires": [
9252
 
            "dd-scroll", 
9253
 
            "sortable"
9254
 
        ]
9255
 
    }, 
9256
 
    "stylesheet": {
9257
 
        "requires": [
9258
 
            "yui-base"
9259
 
        ]
9260
 
    }, 
9261
 
    "substitute": {
9262
 
        "optional": [
9263
 
            "dump"
9264
 
        ], 
9265
 
        "requires": [
9266
 
            "yui-base"
9267
 
        ]
9268
 
    }, 
9269
 
    "swf": {
9270
 
        "requires": [
9271
 
            "event-custom", 
9272
 
            "node", 
9273
 
            "swfdetect", 
9274
 
            "escape"
9275
 
        ]
9276
 
    }, 
9277
 
    "swfdetect": {
9278
 
        "requires": [
9279
 
            "yui-base"
9280
 
        ]
9281
 
    }, 
9282
 
    "tabview": {
9283
 
        "requires": [
9284
 
            "widget", 
9285
 
            "widget-parent", 
9286
 
            "widget-child", 
9287
 
            "tabview-base", 
9288
 
            "node-pluginhost", 
9289
 
            "node-focusmanager"
9290
 
        ], 
9291
 
        "skinnable": true
9292
 
    }, 
9293
 
    "tabview-base": {
9294
 
        "requires": [
9295
 
            "node-event-delegate", 
9296
 
            "classnamemanager", 
9297
 
            "skin-sam-tabview"
9298
 
        ]
9299
 
    }, 
9300
 
    "tabview-plugin": {
9301
 
        "requires": [
9302
 
            "tabview-base"
9303
 
        ]
9304
 
    }, 
9305
 
    "test": {
9306
 
        "requires": [
9307
 
            "event-simulate", 
9308
 
            "event-custom", 
9309
 
            "substitute", 
9310
 
            "json-stringify"
9311
 
        ], 
9312
 
        "skinnable": true
9313
 
    }, 
9314
 
    "text": {
9315
 
        "use": [
9316
 
            "text-accentfold", 
9317
 
            "text-wordbreak"
9318
 
        ]
9319
 
    }, 
9320
 
    "text-accentfold": {
9321
 
        "requires": [
9322
 
            "array-extras", 
9323
 
            "text-data-accentfold"
9324
 
        ]
9325
 
    }, 
9326
 
    "text-data-accentfold": {
9327
 
        "requires": [
9328
 
            "yui-base"
9329
 
        ]
9330
 
    }, 
9331
 
    "text-data-wordbreak": {
9332
 
        "requires": [
9333
 
            "yui-base"
9334
 
        ]
9335
 
    }, 
9336
 
    "text-wordbreak": {
9337
 
        "requires": [
9338
 
            "array-extras", 
9339
 
            "text-data-wordbreak"
9340
 
        ]
9341
 
    }, 
9342
 
    "transition": {
9343
 
        "requires": [
9344
 
            "node-style"
9345
 
        ]
9346
 
    }, 
9347
 
    "transition-timer": {
9348
 
        "condition": {
9349
 
            "name": "transition-timer", 
9350
 
            "test": function (Y) {
9351
 
    var DOCUMENT = Y.config.doc,
9352
 
        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
9353
 
        ret = true;
9354
 
 
9355
 
    if (node && node.style) {
9356
 
        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
9357
 
    } 
9358
 
 
9359
 
    return ret;
9360
 
}, 
9361
 
            "trigger": "transition"
9362
 
        }, 
9363
 
        "requires": [
9364
 
            "transition"
9365
 
        ]
9366
 
    }, 
9367
 
    "uploader": {
9368
 
        "requires": [
9369
 
            "event-custom", 
9370
 
            "node", 
9371
 
            "base", 
9372
 
            "swf"
9373
 
        ]
9374
 
    }, 
9375
 
    "view": {
9376
 
        "requires": [
9377
 
            "base-build", 
9378
 
            "node-event-delegate"
9379
 
        ]
9380
 
    }, 
9381
 
    "widget": {
9382
 
        "use": [
9383
 
            "widget-base", 
9384
 
            "widget-htmlparser", 
9385
 
            "widget-uievents", 
9386
 
            "widget-skin"
9387
 
        ]
9388
 
    }, 
9389
 
    "widget-anim": {
9390
 
        "requires": [
9391
 
            "plugin", 
9392
 
            "anim-base", 
9393
 
            "widget"
9394
 
        ]
9395
 
    }, 
9396
 
    "widget-autohide": {
9397
 
        "requires": [
9398
 
            "widget", 
9399
 
            "event-outside", 
9400
 
            "base-build", 
9401
 
            "event-key"
9402
 
        ], 
9403
 
        "skinnable": false
9404
 
    }, 
9405
 
    "widget-base": {
9406
 
        "requires": [
9407
 
            "attribute", 
9408
 
            "event-focus", 
9409
 
            "base-base", 
9410
 
            "base-pluginhost", 
9411
 
            "node-base", 
9412
 
            "node-style", 
9413
 
            "classnamemanager"
9414
 
        ], 
9415
 
        "skinnable": true
9416
 
    }, 
9417
 
    "widget-base-ie": {
9418
 
        "condition": {
9419
 
            "name": "widget-base-ie", 
9420
 
            "trigger": "widget-base", 
9421
 
            "ua": "ie"
9422
 
        }, 
9423
 
        "requires": [
9424
 
            "widget-base"
9425
 
        ]
9426
 
    }, 
9427
 
    "widget-buttons": {
9428
 
        "requires": [
9429
 
            "widget", 
9430
 
            "base-build", 
9431
 
            "widget-stdmod"
9432
 
        ], 
9433
 
        "skinnable": true
9434
 
    }, 
9435
 
    "widget-child": {
9436
 
        "requires": [
9437
 
            "base-build", 
9438
 
            "widget"
9439
 
        ]
9440
 
    }, 
9441
 
    "widget-htmlparser": {
9442
 
        "requires": [
9443
 
            "widget-base"
9444
 
        ]
9445
 
    }, 
9446
 
    "widget-locale": {
9447
 
        "requires": [
9448
 
            "widget-base"
9449
 
        ]
9450
 
    }, 
9451
 
    "widget-modality": {
9452
 
        "requires": [
9453
 
            "widget", 
9454
 
            "event-outside", 
9455
 
            "base-build"
9456
 
        ], 
9457
 
        "skinnable": false
9458
 
    }, 
9459
 
    "widget-parent": {
9460
 
        "requires": [
9461
 
            "base-build", 
9462
 
            "arraylist", 
9463
 
            "widget"
9464
 
        ]
9465
 
    }, 
9466
 
    "widget-position": {
9467
 
        "requires": [
9468
 
            "base-build", 
9469
 
            "node-screen", 
9470
 
            "widget"
9471
 
        ]
9472
 
    }, 
9473
 
    "widget-position-align": {
9474
 
        "requires": [
9475
 
            "widget-position"
9476
 
        ]
9477
 
    }, 
9478
 
    "widget-position-constrain": {
9479
 
        "requires": [
9480
 
            "widget-position"
9481
 
        ]
9482
 
    }, 
9483
 
    "widget-skin": {
9484
 
        "requires": [
9485
 
            "widget-base"
9486
 
        ]
9487
 
    }, 
9488
 
    "widget-stack": {
9489
 
        "requires": [
9490
 
            "base-build", 
9491
 
            "widget"
9492
 
        ], 
9493
 
        "skinnable": true
9494
 
    }, 
9495
 
    "widget-stdmod": {
9496
 
        "requires": [
9497
 
            "base-build", 
9498
 
            "widget"
9499
 
        ]
9500
 
    }, 
9501
 
    "widget-uievents": {
9502
 
        "requires": [
9503
 
            "widget-base", 
9504
 
            "node-event-delegate"
9505
 
        ]
9506
 
    }, 
9507
 
    "yql": {
9508
 
        "requires": [
9509
 
            "jsonp", 
9510
 
            "jsonp-url"
9511
 
        ]
9512
 
    }, 
9513
 
    "yui": {}, 
9514
 
    "yui-base": {}, 
9515
 
    "yui-later": {
9516
 
        "requires": [
9517
 
            "yui-base"
9518
 
        ]
9519
 
    }, 
9520
 
    "yui-log": {
9521
 
        "requires": [
9522
 
            "yui-base"
9523
 
        ]
9524
 
    }, 
9525
 
    "yui-rls": {}, 
9526
 
    "yui-throttle": {
9527
 
        "requires": [
9528
 
            "yui-base"
9529
 
        ]
9530
 
    }
9531
 
};
9532
 
YUI.Env[Y.version].md5 = '105ebffae27a0e3d7331f8cf5c0bb282';
9533
 
 
9534
 
 
9535
 
}, '3.4.1' ,{requires:['loader-base']});
9536
 
 
9537
 
 
9538
 
YUI.add('yui', function(Y){}, '3.4.1' ,{use:['yui-base','get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3' ]});
9539