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