~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/yui/yui.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.1.2
6
 
build: 56
 
5
version: 3.2.0
 
6
build: 2676
7
7
*/
8
8
/**
9
9
 * The YUI module contains the components required for building the YUI seed file.
12
12
 * @submodule yui-base
13
13
 */
14
14
 
15
 
if (typeof YUI === 'undefined') {
 
15
if (typeof YUI != 'undefined') {
 
16
    var _YUI = YUI;
 
17
}
16
18
 
17
19
/**
18
20
 * The YUI global namespace object.  If YUI is already defined, the
33
35
    /*global YUI*/
34
36
    /*global YUI_config*/
35
37
    var YUI = function() {
36
 
 
37
 
        var Y = this, a = arguments, i, l = a.length,
38
 
            globalConfig = (typeof YUI_config !== 'undefined') && YUI_config;
39
 
 
40
 
        // Allow instantiation without the new operator
 
38
        var i     = 0, 
 
39
            Y     = this, 
 
40
            args  = arguments, 
 
41
            l     = args.length, 
 
42
            gconf = (typeof YUI_config !== 'undefined') && YUI_config;
 
43
 
41
44
        if (!(Y instanceof YUI)) {
42
45
            Y = new YUI();
43
 
            for (i=0; i<l; i++) {
44
 
                Y._config(a[i]);
45
 
            }
46
 
            return Y; 
47
46
        } else {
48
47
            // set up the core environment
49
48
            Y._init();
50
 
            if (globalConfig) {
51
 
                Y._config(globalConfig);
52
 
            }
53
 
            for (i=0; i<l; i++) {
54
 
                Y._config(a[i]);
 
49
            if (gconf) {
 
50
                Y.applyConfig(gconf);
55
51
            }
56
52
            // bind the specified additional modules for this instance
 
53
            if (!l) {
 
54
                Y._setup();
 
55
            }
 
56
        }
 
57
 
 
58
        if (l) {
 
59
            for (; i<l; i++) {
 
60
                Y.applyConfig(args[i]);
 
61
            }
 
62
 
57
63
            Y._setup();
58
 
            return Y;
59
64
        }
 
65
 
 
66
        return Y;
60
67
    };
61
 
}
62
68
 
63
69
(function() {
64
 
    var p, prop,
65
 
        VERSION       = '3.1.2', 
 
70
    var proto, prop,
 
71
        VERSION       = '3.2.0', 
66
72
        BASE          = 'http://yui.yahooapis.com/',
67
73
        DOC_LABEL     = 'yui3-js-enabled',
68
74
        NOOP          = function() {},
100
106
                            if (hasWin) {
101
107
                                remove(window, 'load', handleLoad);
102
108
                            }
103
 
                        };
 
109
                        },
 
110
        getLoader = function(Y, o) {
 
111
            var loader = Y.Env._loader;
 
112
            if (loader) {
 
113
                loader.ignoreRegistered = false;
 
114
                loader.onEnd            = null;
 
115
                // loader.attaching        = null;
 
116
                loader.data             = null;
 
117
                loader.required         = [];
 
118
                loader.loadType         = null;
 
119
                // loader._inspectPage();
 
120
            } else {
 
121
                loader = new Y.Loader(Y.config);
 
122
                Y.Env._loader = loader;
 
123
            }
 
124
 
 
125
            return loader;
 
126
        },
 
127
        
 
128
        clobber = function(r, s) {
 
129
            for (var i in s) {
 
130
                if (s.hasOwnProperty(i)) {
 
131
                    r[i] = s[i];
 
132
                }
 
133
            }
 
134
        };
104
135
 
105
136
//  Stamp the documentElement (HTML) with a class of "yui-loaded" to 
106
137
//  enable styles that need to key off of JS being enabled.
113
144
}
114
145
 
115
146
if (VERSION.indexOf('@') > -1) {
116
 
    VERSION = '3.0.0'; // dev time hack for cdn test
 
147
    VERSION = '3.2.0pr1'; // dev time hack for cdn test
117
148
}
118
149
        
119
 
YUI.prototype = {
120
 
    _config: function(o) {
121
 
        o = o || {};
 
150
proto = {
 
151
    /**
 
152
     * Applies a new configuration object to the YUI instance config.
 
153
     * This will merge new group/module definitions, and will also
 
154
     * update the loader cache if necessary.  Updating Y.config directly
 
155
     * will not update the cache.
 
156
     * @method applyConfig
 
157
     * @param the configuration object
 
158
     * @since 3.2.0
 
159
     */
 
160
    applyConfig: function(o) {
 
161
 
 
162
        o = o || NOOP;
 
163
        
122
164
        var attr,
123
165
            name, 
124
 
            detail,
 
166
            // detail,
125
167
            config = this.config, 
126
168
            mods   = config.modules,
127
 
            groups = config.groups;
 
169
            groups = config.groups,
 
170
            rls    = config.rls,
 
171
            loader = this.Env._loader;
 
172
 
128
173
        for (name in o) {
129
 
            attr = o[name];
130
 
            if (mods && name == 'modules') {
131
 
                for (detail in attr) {
132
 
                    mods[detail] = attr[detail];
133
 
                }
134
 
            } else if (groups && name == 'groups') {
135
 
                for (detail in attr) {
136
 
                    groups[detail] = attr[detail];
137
 
                }
138
 
            } else if (name == 'win') {
139
 
                config[name] = attr.contentWindow || attr;
140
 
                config.doc = config[name].document;
141
 
            } else {
142
 
                config[name] = attr;
 
174
            if (o.hasOwnProperty(name)) {
 
175
                attr = o[name];
 
176
                if (mods && name == 'modules') {
 
177
                    clobber(mods, attr);
 
178
                } else if (groups && name == 'groups') {
 
179
                    clobber(groups, attr);
 
180
                } else if (rls && name == 'rls') {
 
181
                    clobber(rls, attr);
 
182
                } else if (name == 'win') {
 
183
                    config[name] = attr.contentWindow || attr;
 
184
                    config.doc = config[name].document;
 
185
                } else if (name == '_yuid') {
 
186
                    // preserve the guid
 
187
                } else {
 
188
                    config[name] = attr;
 
189
                }
143
190
            }
144
191
        }
 
192
 
 
193
        if (loader) {
 
194
            loader._config(o);
 
195
        }
 
196
    },
 
197
 
 
198
    _config: function(o) {
 
199
        this.applyConfig(o);
145
200
    },
146
201
 
147
202
    /**
150
205
     */
151
206
    _init: function() {
152
207
        var filter,
153
 
            Y     = this, 
154
 
            G_ENV = YUI.Env,
155
 
            Env   = Y.Env;
 
208
            Y       = this, 
 
209
            G_ENV   = YUI.Env,
 
210
            Env     = Y.Env,
 
211
            prop, config;
156
212
 
157
213
        Y.version = VERSION;
158
214
 
159
215
        if (!Env) {
160
216
            Y.Env = {
161
 
                mods:         {},
 
217
                mods:         {}, // flat module map
 
218
                versions:     {}, // version module map
162
219
                base:         BASE,
163
220
                cdn:          BASE + VERSION + '/build/',
164
 
                bootstrapped: false,
 
221
                // bootstrapped: false,
165
222
                _idx:         0,
166
223
                _used:        {},
167
224
                _attached:    {},
169
226
                _uidx:        0,
170
227
                _guidp:       'y',
171
228
                _loaded:      {},
172
 
                getBase: function(srcPattern, comboPattern) {
 
229
                getBase: G_ENV && G_ENV.getBase || function(srcPattern, comboPattern) {
173
230
                    var b, nodes, i, src, match;
174
231
                    // get from querystring
175
232
                    nodes = (doc && doc.getElementsByTagName('script')) || [];
176
233
                    for (i=0; i<nodes.length; i=i+1) {
177
234
                        src = nodes[i].src;
178
235
                        if (src) {
179
 
                            //src = "http://yui.yahooapis.com/combo?2.8.0r4/b
180
 
                            //uild/yuiloader-dom-event/yuiloader-dom-event.js
181
 
                            //&3.0.0/build/yui/yui-min.js"; // debug url
 
236
 
182
237
                            match = src.match(srcPattern);
183
238
                            b = match && match[1];
184
239
                            if (b) {
185
240
                                // this is to set up the path to the loader.  The file 
186
241
                                // filter for loader should match the yui include.
187
242
                                filter = match[2];
 
243
 
 
244
                                if (filter) {
 
245
                                    match = filter.indexOf('js');
 
246
 
 
247
                                    if (match > -1) {
 
248
                                        filter = filter.substr(0, match);
 
249
                                    }
 
250
                                }
 
251
 
188
252
                                // extract correct path for mixed combo urls
189
253
                                // http://yuilibrary.com/projects/yui3/ticket/2528423
190
254
                                match = src.match(comboPattern);
210
274
                Env._yidx  = ++G_ENV._yidx;
211
275
                Env._guidp = ('yui_' + VERSION + '_' + 
212
276
                             Env._yidx + '_' + time).replace(/\./g, '_');
 
277
            } else if (typeof _YUI != 'undefined') {
 
278
 
 
279
                G_ENV = _YUI.Env;
 
280
                Env._yidx += G_ENV._yidx;
 
281
                Env._uidx += G_ENV._uidx;
 
282
                
 
283
                for (prop in G_ENV) {
 
284
                    if (!(prop in Env)) {
 
285
                        Env[prop] = G_ENV[prop];
 
286
                    }
 
287
                }
213
288
            }
214
289
 
215
290
            Y.id = Y.stamp(Y);
221
296
 
222
297
        // configuration defaults
223
298
        Y.config = Y.config || {
 
299
            // _sig:              '',
224
300
            win:               win,
225
301
            doc:               doc,
226
302
            debug:             true,
230
306
            fetchCSS:          true
231
307
        };
232
308
 
233
 
        Y.config.base = YUI.config.base || 
 
309
        config = Y.config;
 
310
 
 
311
 
 
312
        config.base = YUI.config.base || 
234
313
            Y.Env.getBase(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/, 
235
314
                          /^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);
236
315
 
237
 
        Y.config.loaderPath = YUI.config.loaderPath || 
 
316
        config.loaderPath = YUI.config.loaderPath || 
238
317
            'loader/loader' + (filter || '-min.') + 'js';
239
318
 
240
319
    },
241
 
    
 
320
 
242
321
    /**
243
322
     * Finishes the instance setup. Attaches whatever modules were defined
244
323
     * when the yui modules was registered.
246
325
     * @private
247
326
     */
248
327
    _setup: function(o) {
249
 
 
250
328
        var i, Y = this,
251
329
            core = [],
252
330
            mods = YUI.Env.mods,
253
 
            extras = Y.config.core || ['get', 'intl-base', 'loader', 'yui-log', 'yui-later', 'yui-throttle'];
254
 
 
 
331
            extras = Y.config.core || [ 'get', 
 
332
                                        'rls', 
 
333
                                        'intl-base', 
 
334
                                        'loader', 
 
335
                                        'yui-log', 
 
336
                                        'yui-later', 
 
337
                                        'yui-throttle' ];
255
338
 
256
339
        for (i=0; i<extras.length; i++) {
257
340
            if (mods[extras[i]]) {
259
342
            }
260
343
        }
261
344
 
262
 
        Y.use('yui-base');
263
 
        Y.use.apply(Y, core);
 
345
        Y._attach(['yui-base']);
 
346
        Y._attach(core);
264
347
 
265
348
    },
266
349
 
275
358
     * @return {object} the return value from the applied method or null
276
359
     */
277
360
    applyTo: function(id, method, args) {
278
 
 
279
361
        if (!(method in APPLY_TO_AUTH)) {
280
362
            this.log(method + ': applyTo not allowed', 'warn', 'yui');
281
363
            return null;
326
408
     */
327
409
    add: function(name, fn, version, details) {
328
410
        details = details || {};
329
 
 
330
 
        YUI.Env.mods[name] = {
331
 
            name: name, 
332
 
            fn: fn,
333
 
            version: version,
334
 
            details: details
335
 
        };
 
411
        var env = YUI.Env,
 
412
            mod  = {
 
413
                name: name, 
 
414
                fn: fn,
 
415
                version: version,
 
416
                details: details
 
417
            },
 
418
            loader,
 
419
            i;
 
420
 
 
421
        env.mods[name] = mod;
 
422
        env.versions[version] = env.versions[version] || {};
 
423
        env.versions[version][name] = mod;
 
424
 
 
425
        for (i in instances) {
 
426
            if (instances.hasOwnProperty(i)) {
 
427
                loader = instances[i].Env._loader;
 
428
                if (loader) {
 
429
                    if (!loader.moduleInfo[name]) {
 
430
                        loader.addModule(details, name);
 
431
                    }
 
432
                }
 
433
            }
 
434
        }
336
435
 
337
436
        return this;
338
437
    },
344
443
     * @private
345
444
     */
346
445
    _attach: function(r, fromLoader) {
347
 
        var i, name, mod, details, req, use,
 
446
        var i, name, mod, details, req, use, 
348
447
            mods = YUI.Env.mods,
349
 
            done = this.Env._attached,
 
448
            Y    = this,
 
449
            done = Y.Env._attached,
350
450
            len  = r.length;
351
451
 
352
452
        for (i=0; i<len; i++) {
360
460
                use        = details.use;
361
461
 
362
462
                if (req && req.length) {
363
 
                    this._attach(this.Array(req));
 
463
                    if (!Y._attach(req)) {
 
464
                        return false;
 
465
                    }
364
466
                }
365
467
 
366
 
                // this.log('attaching ' + name, 'info', 'yui');
367
468
 
368
469
                if (mod.fn) {
369
 
                    mod.fn(this, name);
 
470
                    try {
 
471
                        mod.fn(Y, name);
 
472
                    } catch (e) {
 
473
                        Y.error('Attach error: ' + name, e, name);
 
474
                        return false;
 
475
                    }
370
476
                }
371
477
 
372
478
                if (use && use.length) {
373
 
                    this._attach(this.Array(use));
 
479
                    if (!Y._attach(use)) {
 
480
                        return false;
 
481
                    }
374
482
                }
375
483
            }
376
484
        }
 
485
 
 
486
        return true;
377
487
    },
378
488
 
379
489
    /**
419
529
 
420
530
        if (!this.Array) {
421
531
            this._attach(['yui-base']);
 
532
            // this._attach( this.config.core || ['yui-base', 'get', 'intl-base', 'loader', 'yui-log', 'yui-later', 'yui-throttle']);
422
533
        }
423
534
 
424
535
        var len, loader, handleBoot,
436
547
            boot     = config.bootstrap,
437
548
            missing  = [], 
438
549
            r        = [], 
 
550
            star,
 
551
            ret      = true,
439
552
            fetchCSS = config.fetchCSS,
440
 
            process  = function(name) {
441
 
 
442
 
                // add this module to full list of things to attach
443
 
                r.push(name);
444
 
 
445
 
                // only attach a module once
446
 
                if (used[name]) {
 
553
            process  = function(names, skip) {
 
554
 
 
555
                if (!names.length) {
447
556
                    return;
448
557
                }
449
558
 
450
 
                var m = mods[name], req, use;
451
 
 
452
 
                if (m) {
453
 
                    used[name] = true;
454
 
                    req = m.details.requires;
455
 
                    use = m.details.use;
456
 
                } else {
457
 
                    // CSS files don't register themselves, see if it has been loaded
458
 
                    if (!G_ENV._loaded[VERSION][name]) {
459
 
                        missing.push(name);
 
559
                YArray.each(names, function(name) {
 
560
 
 
561
                    // add this module to full list of things to attach
 
562
                    if (!skip) {
 
563
                        r.push(name);
 
564
                    }
 
565
 
 
566
                    // only attach a module once
 
567
                    if (used[name]) {
 
568
                        return;
 
569
                    }
 
570
 
 
571
                    var m = mods[name], req, use;
 
572
 
 
573
                    if (m) {
 
574
                        used[name] = true;
 
575
                        req = m.details.requires;
 
576
                        use = m.details.use;
460
577
                    } else {
461
 
                        used[name] = true; // probably css
462
 
                    }
463
 
                }
464
 
 
465
 
                if (req) { // make sure requirements are attached
466
 
                    YArray.each(YArray(req), process);
467
 
                }
468
 
 
469
 
                if (use) { // make sure we grab the submodule dependencies too
470
 
                    YArray.each(YArray(use), process);
471
 
                }
472
 
 
473
 
 
 
578
                        // CSS files don't register themselves, see if it has been loaded
 
579
                        if (!G_ENV._loaded[VERSION][name]) {
 
580
                            missing.push(name);
 
581
                        } else {
 
582
                            used[name] = true; // probably css
 
583
                        }
 
584
                    }
 
585
 
 
586
                    if (req && req.length) { // make sure requirements are attached
 
587
                        process(req);
 
588
                    }
 
589
 
 
590
                    if (use && use.length) { // make sure we grab the submodule dependencies too
 
591
                        process(use, 1);
 
592
                    }
 
593
                });
 
594
            },
 
595
 
 
596
            notify = function(response) {
 
597
                if (callback) {
 
598
                    try {
 
599
                        callback(Y, response);
 
600
                    } catch (e) {
 
601
                        Y.error('use callback error', e, args);
 
602
                    }
 
603
                }
474
604
            },
475
605
 
476
606
            handleLoader = function(fromLoader) {
478
608
                        success: true,
479
609
                        msg: 'not dynamic'
480
610
                    }, 
481
 
                    newData, redo, origMissing,
 
611
                    newData, redo, origMissing, 
 
612
                    ret = true,
482
613
                    data = response.data;
483
614
 
484
615
                Y._loading = false;
487
618
                if (data) {
488
619
                    origMissing = missing.concat();
489
620
                    missing = [];
490
 
                    Y.Array.each(data, process);
 
621
                    r = [];
 
622
                    process(data);
491
623
                    redo = missing.length;
492
624
                    if (redo) {
493
625
                        if (missing.sort().join() == origMissing.sort().join()) {
497
629
                }
498
630
 
499
631
                if (redo && data) {
500
 
                    newData = data.concat();
 
632
                    
 
633
                    // newData = data.concat();
 
634
                    // newData = args.concat();
 
635
                    newData = args.concat();
 
636
 
 
637
                    // newData = missing.concat();
 
638
 
501
639
                    newData.push(function() {
502
 
                        Y._attach(data);
503
 
                        if (callback) {
504
 
                            callback(Y, response);
 
640
                        if (Y._attach(data)) {
 
641
                            notify(response);
505
642
                        }
506
643
                    });
507
644
                    Y._loading  = false;
508
645
                    Y.use.apply(Y, newData);
509
646
                } else {
510
647
                    if (data) {
511
 
                        Y._attach(data);
 
648
                        ret = Y._attach(data);
512
649
                    }
513
 
                    if (callback) {
514
 
                        callback(Y, response);
 
650
                    if (ret) {
 
651
                        notify(response);
515
652
                    }
516
653
                }
517
654
 
537
674
 
538
675
        // YUI().use('*'); // bind everything available
539
676
        if (firstArg === "*") {
 
677
            star = true;
540
678
            args = Y.Object.keys(mods);
541
679
        }
 
680
 
542
681
        
543
682
        // use loader to expand dependencies and sort the 
544
683
        // requirements if it is available.
545
 
        if (Y.Loader) {
546
 
            loader = new Y.Loader(config);
 
684
        if (boot && !star && Y.Loader && args.length) {
 
685
 
 
686
 
 
687
            loader = getLoader(Y);
547
688
            loader.require(args);
548
689
            loader.ignoreRegistered = true;
549
690
            // loader.allowRollup = false;
550
691
            loader.calculate(null, (fetchCSS) ? null : 'js');
551
692
            args = loader.sorted;
 
693
 
 
694
            // YUI.Env.loaders[Y.config._sig] = loader;
552
695
        }
553
696
 
 
697
 
554
698
        // process each requirement and any additional requirements 
555
699
        // the module metadata specifies
556
 
        YArray.each(args, process);
 
700
        process(args);
557
701
 
558
702
        len = missing.length;
559
703
 
565
709
        // dynamic load
566
710
        if (boot && len && Y.Loader) {
567
711
            Y._loading = true;
568
 
            loader = new Y.Loader(config);
 
712
            // loader = new Y.Loader(config);
 
713
            loader = getLoader(Y);
569
714
            loader.onEnd = handleLoader;
570
715
            loader.context = Y;
571
 
            loader.attaching = args;
 
716
            // loader.attaching = args;
572
717
            loader.data = args;
573
718
            loader.require((fetchCSS) ? missing : args);
574
719
            loader.insert(null, (fetchCSS) ? null : 'js');
 
720
        } else if (len && Y.config.use_rls) {
 
721
 
 
722
            // server side loader service
 
723
            Y.Get.script(Y._rls(args), {
 
724
                onEnd: function(o) {
 
725
                    handleLoader(o);
 
726
                }, 
 
727
                data: args
 
728
            });
 
729
            
575
730
        } else if (boot && len && Y.Get && !Env.bootstrapped) {
576
731
 
577
732
            Y._loading = true;
581
736
                Y._loading = false;
582
737
                queue.running = false;
583
738
                Env.bootstrapped = true;
584
 
                Y._attach(['loader']);
585
 
                Y.use.apply(Y, args);
 
739
                if (Y._attach(['loader'])) {
 
740
                    Y.use.apply(Y, args);
 
741
                }
586
742
            };
587
743
 
588
744
            if (G_ENV._bootstrapping) {
598
754
            if (len) {
599
755
                Y.message('Requirement NOT loaded: ' + missing, 'warn', 'yui');
600
756
            }
601
 
            Y._attach(r);
602
 
            handleLoader();
 
757
            ret = Y._attach(args);
 
758
            if (ret) {
 
759
                handleLoader();
 
760
            }
603
761
        }
604
762
 
605
763
        return Y;
656
814
     * @return {YUI} this YUI instance
657
815
     */
658
816
    error: function(msg, e) {
659
 
        if (this.config.throwFail) {
 
817
 
 
818
        var Y = this, ret;
 
819
        
 
820
        if (Y.config.errorFn) {
 
821
            ret = Y.config.errorFn.apply(Y, arguments);
 
822
        }
 
823
 
 
824
        if (Y.config.throwFail && !ret) {
660
825
            throw (e || new Error(msg)); 
661
826
        } else {
662
 
            this.message(msg, "error"); // don't scrub this one
 
827
            Y.message(msg, "error"); // don't scrub this one
663
828
        }
664
829
 
665
 
        return this;
 
830
        return Y;
666
831
    },
667
832
 
668
833
    /**
687
852
     * @return {string} The object's guid or null
688
853
     */
689
854
    stamp: function(o, readOnly) {
 
855
        var uid;
690
856
        if (!o) {
691
857
            return o;
692
858
        }
693
 
        var uid = (typeof o === 'string') ? o : o._yuid;
 
859
        
 
860
        // IE generates its own unique ID for dom nodes
 
861
        // The uniqueID property of a document node returns a new ID
 
862
        if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
 
863
            uid = o.uniqueID;
 
864
        } else {
 
865
            uid = (typeof o === 'string') ? o : o._yuid;
 
866
        }
 
867
 
694
868
        if (!uid) {
695
869
            uid = this.guid();
696
870
            if (!readOnly) {
705
879
    }
706
880
};
707
881
 
708
 
// Give the YUI global the same properties as an instance.
709
 
// This makes it so that the YUI global can be used like the YAHOO
710
 
// global was used prior to 3.x.  More importantly, the YUI global
711
 
// provides global metadata, so env needs to be configured.
712
 
// @TODO review
713
 
 
714
 
    p = YUI.prototype;
 
882
    YUI.prototype = proto;
715
883
 
716
884
    // inheritance utilities are not available yet
717
 
    for (prop in p) {
718
 
        YUI[prop] = p[prop];
 
885
    for (prop in proto) {
 
886
        if (proto.hasOwnProperty(prop)) {
 
887
            YUI[prop] = proto[prop];
 
888
        }
719
889
    }
720
890
 
721
891
    // set up the environment
747
917
 * The config object contains all of the configuration options for
748
918
 * the YUI instance.  This object is supplied by the implementer 
749
919
 * when instantiating a YUI instance.  Some properties have default
750
 
 * values if they are not supplied by the implementer.
 
920
 * values if they are not supplied by the implementer.  This should
 
921
 * not be updated directly because some values are cached.  Use
 
922
 * applyConfig() to update the config object on a YUI instance that
 
923
 * has already been configured.
751
924
 *
752
925
 * @class config
753
926
 * @static
779
952
 */
780
953
 
781
954
/**
782
 
 * A hash of log sources that should be not be logged.  If specified, all sources are logged if not on this list.
 
955
 * A hash of log sources that should be not be logged.  If specified, 
 
956
 * all sources are logged if not on this list.
783
957
 *
784
958
 * @property logExclude
785
959
 * @type object
796
970
 */
797
971
 
798
972
/**
799
 
 * If throwFail is set, Y.fail will generate or re-throw a JS Error.  Otherwise the failure is logged.
 
973
 * If throwFail is set, Y.error will generate or re-throw a JS Error.  
 
974
 * Otherwise the failure is logged.
800
975
 *
801
976
 * @property throwFail
802
977
 * @type boolean
1006
1181
 */
1007
1182
 
1008
1183
/**
1009
 
 * charset for dynamic nodes
1010
 
 * @property charset
1011
 
 * @type string
1012
 
 * @deprecated use jsAttributes cssAttributes
1013
 
 */
1014
 
 
1015
 
/**
1016
1184
 * Object literal containing attributes to add to dynamically loaded script nodes.
1017
1185
 * @property jsAttributes
1018
1186
 * @type string
1049
1217
 * name, and the value is an object literal specifying the metdata
1050
1218
 * for the module.  * See Loader.addModule for the supported module
1051
1219
 * metadata fields.  Also @see groups, which provides a way to
1052
 
 * configure the base and combo spec for a 
 
1220
 * configure the base and combo spec for a set of modules.
1053
1221
 * <code>
1054
1222
 * modules: {
1055
1223
 * &nbsp; mymod1: {
1142
1310
 * @since 3.1.0
1143
1311
 * @property yui2 
1144
1312
 * @type string
1145
 
 * @default 2.8.0
 
1313
 * @default 2.8.1
1146
1314
 */
1147
1315
 
1148
1316
/**
1159
1327
 
1160
1328
/**
1161
1329
 * Alternative console log function for use in environments without
1162
 
 * a supported native console.
 
1330
 * a supported native console.  The function is executed in the
 
1331
 * YUI instance context.
1163
1332
 * @since 3.1.0
1164
1333
 * @property logFn
1165
1334
 * @type Function
1166
1335
 */
 
1336
 
 
1337
/**
 
1338
 * A callback to execute when Y.error is called.  It receives the
 
1339
 * error message and an javascript error object if Y.error was
 
1340
 * executed because a javascript error was caught.  The function
 
1341
 * is executed in the YUI instance context.
 
1342
 *
 
1343
 * @since 3.2.0
 
1344
 * @property errorFn
 
1345
 * @type Function
 
1346
 */
 
1347
 
 
1348
/**
 
1349
 * The parameter defaults for the remote loader service.
 
1350
 * Requires the rls submodule.  The properties that are
 
1351
 * supported:
 
1352
 * <pre>
 
1353
 * m: comma separated list of module requirements.  This 
 
1354
 *    must be the param name even for custom implemetations.
 
1355
 * v: the version of YUI to load.  Defaults to the version
 
1356
 *    of YUI that is being used.
 
1357
 * gv: the version of the gallery to load (@see the gallery config)
 
1358
 * env: comma separated list of modules already on the page.
 
1359
 *      this must be the param name even for custom implemetations.
 
1360
 * lang: the languages supported on the page (@see the lang config)
 
1361
 * '2in3v':  the version of the 2in3 wrapper to use (@see the 2in3 config).
 
1362
 * '2v': the version of yui2 to use in the yui 2in3 wrappers (@see the yui2 config)
 
1363
 * filt: a filter def to apply to the urls (@see the filter config).
 
1364
 * filts: a list of custom filters to apply per module (@see the filters config).
 
1365
 * tests: this is a map of conditional module test function id keys with the values
 
1366
 * of 1 if the test passes, 0 if not.  This must be the name of the querystring
 
1367
 * param in custom templates.
 
1368
 *</pre>
 
1369
 *
 
1370
 * @since 3.2.0
 
1371
 * @property rls
 
1372
 */
 
1373
 
 
1374
/**
 
1375
 * The base path to the remote loader service
 
1376
 *
 
1377
 * @since 3.2.0
 
1378
 * @property rls_base
 
1379
 */
 
1380
 
 
1381
/**
 
1382
 * The template to use for building the querystring portion
 
1383
 * of the remote loader service url.  The default is determined
 
1384
 * by the rls config -- each property that has a value will be
 
1385
 * represented.
 
1386
 *
 
1387
 * ex: m={m}&v={v}&env={env}&lang={lang}&filt={filt}&tests={tests}
 
1388
 *
 
1389
 *
 
1390
 * @since 3.2.0
 
1391
 * @property rls_tmpl
 
1392
 */
 
1393
 
 
1394
/**
 
1395
 * Configure the instance to use a remote loader service instead of
 
1396
 * the client loader.
 
1397
 *
 
1398
 * @since 3.2.0
 
1399
 * @property use_rls
 
1400
 */
1167
1401
YUI.add('yui-base', function(Y) {
1168
1402
 
1169
1403
/*
1177
1411
 * @module yui
1178
1412
 * @submodule yui-base
1179
1413
 */
1180
 
(function() {
 
1414
// (function() {
1181
1415
/**
1182
1416
 * Provides the language utilites and extensions used by the library
1183
1417
 * @class Lang
1213
1447
},
1214
1448
 
1215
1449
TRIMREGEX = /^\s+|\s+$/g,
1216
 
EMPTYSTRING = '';
 
1450
EMPTYSTRING = '',
 
1451
SUBREGEX  = /\{\s*([^\|\}]+?)\s*(?:\|([^\}]*))?\s*\}/g;
1217
1452
 
1218
1453
/**
1219
1454
 * Determines whether or not the provided item is an array.
1385
1620
    return  TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? OBJECT : NULL);
1386
1621
};
1387
1622
 
1388
 
})();
 
1623
/**
 
1624
 * Lightweight version of @see Y.substitute... it uses the same template
 
1625
 * structure as Y.substitute, but doesn't support recursion, auto-object
 
1626
 * coersion, or formats
 
1627
 * @method sub
 
1628
 * @since 3.2.0
 
1629
 */
 
1630
L.sub = function (s, o) {
 
1631
    return ((s.replace) ? s.replace(SUBREGEX, function (match, key) {
 
1632
        return (!L.isUndefined(o[key])) ? o[key] : match;
 
1633
    }) : s);
 
1634
};
 
1635
 
 
1636
// })();
1389
1637
 
1390
1638
/**
1391
1639
 * The YUI module contains the components required for building the YUI seed file.
1517
1765
YArray.hash = function(k, v) {
1518
1766
    var o = {}, l = k.length, vl = v && v.length, i;
1519
1767
    for (i=0; i<l; i=i+1) {
1520
 
        if (k[i]) {
1521
 
            o[k[i]] = (vl && vl > i) ? v[i] : true;
1522
 
        }
 
1768
        o[k[i]] = (vl && vl > i) ? v[i] : true;
1523
1769
    }
1524
1770
 
1525
1771
    return o;
1835
2081
Y.cached = function(source, cache, refetch){
1836
2082
    cache = cache || {};
1837
2083
 
1838
 
    return function(arg1, arg2) {
 
2084
    return function(arg1) {
1839
2085
 
1840
 
        var k = (arg2) ? Array.prototype.join.call(arguments, DELIMITER) : arg1;
 
2086
        var k = (arguments.length > 1) ? 
 
2087
            Array.prototype.join.call(arguments, DELIMITER) : arg1;
1841
2088
 
1842
2089
        if (!(k in cache) || (refetch && cache[k] == refetch)) {
1843
2090
            cache[k] = source.apply(source, arguments);
1881
2128
 
1882
2129
owns = function(o, k) {
1883
2130
    return o && o.hasOwnProperty && o.hasOwnProperty(k);
 
2131
    // return Object.prototype.hasOwnProperty.call(o, k);
1884
2132
},
1885
2133
 
1886
 
UNDEFINED = undefined,
 
2134
UNDEFINED,
1887
2135
 
1888
2136
/**
1889
2137
 * Extracts the keys, values, or size from an object
1984
2232
/**
1985
2233
 * Executes a function on each item. The function
1986
2234
 * receives the value, the key, and the object
1987
 
 * as paramters (in that order).
 
2235
 * as parameters (in that order).
1988
2236
 * @method each
1989
2237
 * @static
1990
2238
 * @param o the object to iterate
2005
2253
    return Y;
2006
2254
};
2007
2255
 
2008
 
/*
 
2256
/**
2009
2257
 * Executes a function on each item, but halts if the
2010
2258
 * function returns true.  The function
2011
2259
 * receives the value, the key, and the object
2094
2342
    return o;
2095
2343
};
2096
2344
 
 
2345
/**
 
2346
 * Returns true if the object has no properties of its own
 
2347
 * @method isEmpty
 
2348
 * @return {boolean} true if the object is empty
 
2349
 * @since 3.2.0
 
2350
 */
 
2351
O.isEmpty = function(o) {
 
2352
    for (var i in o) {
 
2353
        if (owns(o, i)) {
 
2354
            return false;
 
2355
        }
 
2356
    }
 
2357
    return true;
 
2358
};
 
2359
 
2097
2360
})();
2098
2361
 
2099
2362
/**
2116
2379
 * @class UA
2117
2380
 * @static
2118
2381
 */
2119
 
Y.UA = function() {
 
2382
Y.UA = YUI.Env.UA || function() {
2120
2383
 
2121
2384
    var numberify = function(s) {
2122
2385
            var c = 0;
2218
2481
         * @type float
2219
2482
         */
2220
2483
        air: 0,
 
2484
        /**
 
2485
         * Detects Apple iPad's OS version
 
2486
         * @property ipad
 
2487
         * @type float
 
2488
         * @static
 
2489
         */
 
2490
        ipad: 0,
 
2491
        /**
 
2492
         * Detects Apple iPhone's OS version
 
2493
         * @property iphone
 
2494
         * @type float
 
2495
         * @static
 
2496
         */
 
2497
        iphone: 0,
 
2498
        /**
 
2499
         * Detects Apples iPod's OS version
 
2500
         * @property ipod
 
2501
         * @type float
 
2502
         * @static
 
2503
         */
 
2504
        ipod: 0,
 
2505
        /**
 
2506
         * General truthy check for iPad, iPhone or iPod
 
2507
         * @property ios
 
2508
         * @type float
 
2509
         * @static
 
2510
         */
 
2511
        ios: null,
 
2512
        /**
 
2513
         * Detects Googles Android OS version
 
2514
         * @property android 
 
2515
         * @type float
 
2516
         * @static
 
2517
         */
 
2518
        android: 0,
2221
2519
 
2222
2520
        /**
2223
2521
         * Google Caja version number or 0.
2276
2574
            // Mobile browser check
2277
2575
            if (/ Mobile\//.test(ua)) {
2278
2576
                o.mobile = "Apple"; // iPhone or iPod Touch
 
2577
 
 
2578
                m = ua.match(/OS ([^\s]*)/);
 
2579
                if (m && m[1]) {
 
2580
                    m = numberify(m[1].replace('_', '.'));
 
2581
                }
 
2582
                o.ipad = (navigator.platform == 'iPad') ? m : 0;
 
2583
                o.ipod = (navigator.platform == 'iPod') ? m : 0;
 
2584
                o.iphone = (navigator.platform == 'iPhone') ? m : 0;
 
2585
                o.ios = o.ipad || o.iphone || o.ipod;
2279
2586
            } else {
2280
2587
                m=ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);
2281
2588
                if (m) {
2282
2589
                    o.mobile = m[0]; // Nokia N-series, Android, webOS, ex: NokiaN95
2283
2590
                }
 
2591
                if (/ Android/.test(ua)) {
 
2592
                    o.mobile = 'Android';
 
2593
                    m = ua.match(/Android ([^\s]*);/);
 
2594
                    if (m && m[1]) {
 
2595
                        o.android = numberify(m[1]);
 
2596
                    }
 
2597
 
 
2598
                }
2284
2599
            }
2285
2600
 
2286
2601
            m=ua.match(/Chrome\/([^\s]*)/);
2320
2635
            }
2321
2636
        }
2322
2637
    }
 
2638
 
 
2639
    YUI.Env.UA = o;
2323
2640
    
2324
2641
    return o;
2325
2642
}();
2326
2643
 
2327
2644
 
2328
 
}, '3.1.2' );
 
2645
}, '3.2.0' );
2329
2646
YUI.add('get', function(Y) {
2330
2647
 
2331
2648
(function() {
2557
2874
     * @private
2558
2875
     */
2559
2876
    _next = function(id, loaded) {
2560
 
        var q = queues[id], msg, w, d, h, n, url, s;
 
2877
        var q = queues[id], msg, w, d, h, n, url, s,
 
2878
            insertBefore;
2561
2879
 
2562
2880
        if (q.timer) {
2563
2881
            // q.timer.cancel();
2620
2938
        // add the node to the queue so we can return it to the user supplied callback
2621
2939
        q.nodes.push(n);
2622
2940
 
2623
 
        // add it to the head or insert it before 'insertBefore'
2624
 
        if (q.insertBefore) {
2625
 
            s = _get(q.insertBefore, id);
 
2941
        // add it to the head or insert it before 'insertBefore'.  Work around IE
 
2942
        // bug if there is a base tag.
 
2943
        insertBefore = q.insertBefore || 
 
2944
                       d.getElementsByTagName('base')[0];
 
2945
 
 
2946
        if (insertBefore) {
 
2947
            s = _get(insertBefore, id);
2626
2948
            if (s) {
2627
2949
                s.parentNode.insertBefore(n, s);
2628
2950
            }
2701
3023
 
2702
3024
        q.attributes = q.attributes || {};
2703
3025
        q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8';
2704
 
        // var charset = opts.charset || q.attributes.charset;
2705
 
        // if (charset) {
2706
 
        //     q.attributes.charset = charset;
2707
 
        // }
2708
3026
 
2709
 
        setTimeout(function() {
2710
 
            _next(id);
2711
 
        }, 0);
 
3027
        _next(id);
2712
3028
 
2713
3029
        return {
2714
3030
            tId: id
2787
3103
     * @private
2788
3104
     */
2789
3105
    _purge = function(tId) {
2790
 
        var n, l, d, h, s, i, node, attr,
 
3106
        var n, l, d, h, s, i, node, attr, insertBefore,
2791
3107
            q = queues[tId];
 
3108
            
2792
3109
        if (q) {
2793
3110
            n = q.nodes; 
2794
3111
            l = n.length;
2795
3112
            d = q.win.document;
2796
3113
            h = d.getElementsByTagName("head")[0];
2797
3114
 
2798
 
            if (q.insertBefore) {
2799
 
                s = _get(q.insertBefore, tId);
 
3115
            insertBefore = q.insertBefore || 
 
3116
                           d.getElementsByTagName('base')[0];
 
3117
 
 
3118
            if (insertBefore) {
 
3119
                s = _get(insertBefore, tId);
2800
3120
                if (s) {
2801
3121
                    h = s.parentNode;
2802
3122
                }
2948
3268
         * loaded.
2949
3269
         * </dd>
2950
3270
         * <dt>insertBefore</dt>
2951
 
         * <dd>node or node id that will become the new node's nextSibling</dd>
 
3271
         * <dd>node or node id that will become the new node's nextSibling.  If this
 
3272
         * is not specified, nodes will be inserted before a base tag should it exist.
 
3273
         * Otherwise, the nodes will be appended to the end of the document head.</dd>
2952
3274
         * </dl>
2953
3275
         * <dt>charset</dt>
2954
3276
         * <dd>Node charset, default utf-8 (deprecated, use the attributes config)</dd>
3044
3366
})();
3045
3367
 
3046
3368
 
3047
 
}, '3.1.2' );
 
3369
}, '3.2.0' );
 
3370
YUI.add('features', function(Y) {
 
3371
 
 
3372
var tests = {};
 
3373
 
 
3374
Y.mix(Y.namespace("Features"), {
 
3375
 
 
3376
    tests: tests,
 
3377
 
 
3378
    add: function(cat, name, o) {
 
3379
        tests[cat] = tests[cat] || {};
 
3380
        tests[cat][name] = o;
 
3381
    },
 
3382
 
 
3383
    all: function(cat, args) {
 
3384
        var cat_o   = tests[cat],
 
3385
            // results = {};
 
3386
            result = '';
 
3387
        if (cat_o) {
 
3388
            Y.Object.each(cat_o, function(v, k) {
 
3389
                // results[k] = Y.Features.test(cat, k, args);
 
3390
                result += k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0) + ';';
 
3391
            });
 
3392
        }
 
3393
 
 
3394
        return result;
 
3395
    },
 
3396
 
 
3397
    test: function(cat, name, args) {
 
3398
 
 
3399
        var result, ua, test,
 
3400
            cat_o   = tests[cat],
 
3401
            feature = cat_o && cat_o[name];
 
3402
 
 
3403
        if (!feature) {
 
3404
        } else {
 
3405
 
 
3406
            result = feature.result;
 
3407
 
 
3408
            if (Y.Lang.isUndefined(result)) {
 
3409
 
 
3410
                ua = feature.ua;
 
3411
                if (ua) {
 
3412
                    result = (Y.UA[ua]);
 
3413
                }
 
3414
 
 
3415
                test = feature.test;
 
3416
                if (test && ((!ua) || result)) {
 
3417
                    result = test.apply(Y, args);
 
3418
                }
 
3419
 
 
3420
                feature.result = result;
 
3421
            }
 
3422
        }
 
3423
 
 
3424
        return result;
 
3425
    }
 
3426
});
 
3427
 
 
3428
// Y.Features.add("load", "1", {});
 
3429
// Y.Features.test("load", "1");
 
3430
// caps=1:1;2:0;3:1;
 
3431
 
 
3432
/* This file is auto-generated by src/loader/meta_join.py */
 
3433
var add = Y.Features.add;
 
3434
// 0
 
3435
add('load', '0', {
 
3436
    "trigger": "dom-style", 
 
3437
    "ua": "ie"
 
3438
});
 
3439
// history-hash-ie-test.js
 
3440
add('load', '1', {
 
3441
    "test": function (Y) {
 
3442
    var docMode = Y.config.doc.documentMode;
 
3443
 
 
3444
    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
 
3445
            !docMode || docMode < 8);
 
3446
}, 
 
3447
    "trigger": "history-hash"
 
3448
});
 
3449
// dd-gestures-test.js
 
3450
add('load', '2', {
 
3451
    "test": function(Y) {
 
3452
    return (Y.config.win && ('ontouchstart' in Y.config.win && !Y.UA.chrome));
 
3453
}, 
 
3454
    "trigger": "dd-drag"
 
3455
});
 
3456
 
 
3457
 
 
3458
}, '3.2.0' ,{requires:['yui-base']});
 
3459
YUI.add('rls', function(Y) {
 
3460
 
 
3461
/**
 
3462
 * Implentation for building the remote loader service url.
 
3463
 * @method _rls
 
3464
 * @param what {Array} the requested modules
 
3465
 * @since 3.2.0
 
3466
 */
 
3467
Y._rls = function(what) {
 
3468
 
 
3469
    var config = Y.config,
 
3470
 
 
3471
        // the configuration
 
3472
        rls = config.rls || {
 
3473
            m:       1, // required in the template
 
3474
            v:       Y.version,
 
3475
            gv:      config.gallery,
 
3476
            env:     1, // required in the template
 
3477
            lang:    config.lang,
 
3478
            '2in3v': config['2in3'],
 
3479
            '2v':    config.yui2,
 
3480
            filt:    config.filter,
 
3481
            filts:   config.filters,
 
3482
            tests:   1 // required in the template
 
3483
        },
 
3484
 
 
3485
        // The rls base path
 
3486
        rls_base = config.rls_base || 'load?',
 
3487
 
 
3488
        // the template
 
3489
        rls_tmpl = config.rls_tmpl || function() {
 
3490
            var s = '', param;
 
3491
            for (param in rls) {
 
3492
                if (param in rls && rls[param]) {
 
3493
                    s += param + '={' + param + '}&';
 
3494
                }
 
3495
            }
 
3496
            // console.log('rls_tmpl: ' + s);
 
3497
            return s;
 
3498
        }(), 
 
3499
        
 
3500
        url;
 
3501
 
 
3502
    // update the request
 
3503
    rls.m     = what;
 
3504
    rls.env   = Y.Object.keys(YUI.Env.mods);
 
3505
    rls.tests = Y.Features.all('load', [Y]);
 
3506
 
 
3507
    url = Y.Lang.sub(rls_base + rls_tmpl, rls);
 
3508
 
 
3509
    config.rls = rls;
 
3510
    config.rls_tmpl = rls_tmpl;
 
3511
 
 
3512
    // console.log(url);
 
3513
    return url;
 
3514
};
 
3515
 
 
3516
 
 
3517
 
 
3518
}, '3.2.0' ,{requires:['yui-base','get','features']});
3048
3519
YUI.add('intl-base', function(Y) {
3049
3520
 
3050
3521
/** 
3128
3599
});
3129
3600
 
3130
3601
 
3131
 
}, '3.1.2' ,{requires:['yui-base']});
 
3602
}, '3.2.0' ,{requires:['yui-base']});
3132
3603
YUI.add('yui-log', function(Y) {
3133
3604
 
3134
3605
/**
3139
3610
 */
3140
3611
(function() {
3141
3612
 
3142
 
var _published,
3143
 
    INSTANCE  = Y,
 
3613
var INSTANCE  = Y,
3144
3614
    LOGEVENT  = 'yui:log',
3145
3615
    UNDEFINED = 'undefined',
3146
3616
    LEVELS    = { debug: 1, 
3169
3639
 */
3170
3640
INSTANCE.log = function(msg, cat, src, silent) {
3171
3641
    var bail, excl, incl, m, f,
3172
 
        Y = INSTANCE, 
3173
 
        c = Y.config;
 
3642
        Y         = INSTANCE, 
 
3643
        c         = Y.config,
 
3644
        publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
3174
3645
    // suppress log message if the config is off or the event stack
3175
3646
    // or the event call stack contains a consumer of the yui:log event
3176
3647
    if (c.debug) {
3188
3659
            if (c.useBrowserConsole) {
3189
3660
                m = (src) ? src + ': ' + msg : msg;
3190
3661
                if (Y.Lang.isFunction(c.logFn)) {
3191
 
                    c.logFn(msg, cat, src);
 
3662
                    c.logFn.call(Y, msg, cat, src);
3192
3663
                } else if (typeof console != UNDEFINED && console.log) {
3193
3664
                    f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
3194
3665
                    console[f](m);
3196
3667
                    opera.postError(m);
3197
3668
                }
3198
3669
            }
3199
 
            if (Y.fire && !silent) {
3200
 
                if (!_published) {
3201
 
                    Y.publish(LOGEVENT, {
 
3670
 
 
3671
            if (publisher && !silent) {
 
3672
 
 
3673
                if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {
 
3674
                    publisher.publish(LOGEVENT, {
3202
3675
                        broadcast: 2
3203
3676
                    });
3204
 
 
3205
 
                    _published = 1;
3206
 
 
3207
3677
                }
3208
 
                Y.fire(LOGEVENT, {
 
3678
 
 
3679
                publisher.fire(LOGEVENT, {
3209
3680
                    msg: msg, 
3210
3681
                    cat: cat, 
3211
3682
                    src: src
3237
3708
})();
3238
3709
 
3239
3710
 
3240
 
}, '3.1.2' ,{requires:['yui-base']});
 
3711
}, '3.2.0' ,{requires:['yui-base']});
3241
3712
YUI.add('yui-later', function(Y) {
3242
3713
 
3243
3714
/**
3271
3742
     */
3272
3743
    later = function(when, o, fn, data, periodic) {
3273
3744
        when = when || 0; 
3274
 
        o = o || {};
3275
 
        var m=fn, d=Y.Array(data), f, r;
3276
 
 
3277
 
        if (L.isString(fn)) {
 
3745
 
 
3746
        var m = fn, f, id;
 
3747
 
 
3748
        if (o && L.isString(fn)) {
3278
3749
            m = o[fn];
3279
3750
        }
3280
3751
 
3281
 
        if (!m) {
3282
 
        }
3283
 
 
3284
 
        f = function() {
3285
 
            m.apply(o, d);
 
3752
        f = !L.isUndefined(data) ? function() {
 
3753
            m.apply(o, Y.Array(data));
 
3754
        } : function() {
 
3755
            m.call(o);
3286
3756
        };
3287
3757
 
3288
 
        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
 
3758
        id = (periodic) ? setInterval(f, when) : setTimeout(f, when);
3289
3759
 
3290
3760
        return {
3291
 
            id: r,
 
3761
            id: id,
3292
3762
            interval: periodic,
3293
3763
            cancel: function() {
3294
3764
                if (this.interval) {
3295
 
                    clearInterval(r);
 
3765
                    clearInterval(id);
3296
3766
                } else {
3297
 
                    clearTimeout(r);
 
3767
                    clearTimeout(id);
3298
3768
                }
3299
3769
            }
3300
3770
        };
3306
3776
})();
3307
3777
 
3308
3778
 
3309
 
}, '3.1.2' ,{requires:['yui-base']});
 
3779
}, '3.2.0' ,{requires:['yui-base']});
3310
3780
YUI.add('yui-throttle', function(Y) {
3311
3781
 
3312
3782
/**
3356
3826
 
3357
3827
 
3358
3828
 
3359
 
}, '3.1.2' ,{requires:['yui-base']});
3360
 
 
3361
 
 
3362
 
YUI.add('yui', function(Y){}, '3.1.2' ,{use:['yui-base','get','intl-base','yui-log','yui-later','yui-throttle']});
 
3829
}, '3.2.0' ,{requires:['yui-base']});
 
3830
 
 
3831
 
 
3832
YUI.add('yui', function(Y){}, '3.2.0' ,{use:['yui-base','get','features','rls','intl-base','yui-log','yui-later','yui-throttle']});
3363
3833