~andreserl/maas/packaging_precise_rebase

« back to all changes in this revision

Viewing changes to debian/extras/jslibs/yui/history-base/history-base.js

  • Committer: Andres Rodriguez
  • Date: 2013-03-20 18:12:30 UTC
  • mfrom: (145.2.22 precise.sru)
  • Revision ID: andreserl@ubuntu.com-20130320181230-6l5guc0nhlv2z4p7
Re-base againts latest quantal released branch towards SRU

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.5.1 (build 22)
 
3
Copyright 2012 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
YUI.add('history-base', function(Y) {
 
8
 
 
9
/**
 
10
 * Provides browser history management functionality using a simple
 
11
 * add/replace/get paradigm. This can be used to ensure that the browser's back
 
12
 * and forward buttons work as the user expects and to provide bookmarkable URLs
 
13
 * that return the user to the current application state, even in an Ajax
 
14
 * application that doesn't perform full-page refreshes.
 
15
 *
 
16
 * @module history
 
17
 * @main history
 
18
 * @since 3.2.0
 
19
 */
 
20
 
 
21
/**
 
22
 * Provides global state management backed by an object, but with no browser
 
23
 * history integration. For actual browser history integration and back/forward
 
24
 * support, use the history-html5 or history-hash modules.
 
25
 *
 
26
 * @module history
 
27
 * @submodule history-base
 
28
 * @class HistoryBase
 
29
 * @uses EventTarget
 
30
 * @constructor
 
31
 * @param {Object} config (optional) configuration object, which may contain
 
32
 *   zero or more of the following properties:
 
33
 *
 
34
 * <dl>
 
35
 *   <dt>force (Boolean)</dt>
 
36
 *   <dd>
 
37
 *     If `true`, a `history:change` event will be fired whenever the URL
 
38
 *     changes, even if there is no associated state change. Default is `false`.
 
39
 *   </dd>
 
40
 *
 
41
 *   <dt>initialState (Object)</dt>
 
42
 *   <dd>
 
43
 *     Initial state to set, as an object hash of key/value pairs. This will be
 
44
 *     merged into the current global state.
 
45
 *   </dd>
 
46
 * </dl>
 
47
 */
 
48
 
 
49
var Lang      = Y.Lang,
 
50
    Obj       = Y.Object,
 
51
    GlobalEnv = YUI.namespace('Env.History'),
 
52
    YArray    = Y.Array,
 
53
 
 
54
    doc       = Y.config.doc,
 
55
    docMode   = doc.documentMode,
 
56
    win       = Y.config.win,
 
57
 
 
58
    DEFAULT_OPTIONS = {merge: true},
 
59
    EVT_CHANGE      = 'change',
 
60
    SRC_ADD         = 'add',
 
61
    SRC_REPLACE     = 'replace';
 
62
 
 
63
function HistoryBase() {
 
64
    this._init.apply(this, arguments);
 
65
}
 
66
 
 
67
Y.augment(HistoryBase, Y.EventTarget, null, null, {
 
68
    emitFacade : true,
 
69
    prefix     : 'history',
 
70
    preventable: false,
 
71
    queueable  : true
 
72
});
 
73
 
 
74
if (!GlobalEnv._state) {
 
75
    GlobalEnv._state = {};
 
76
}
 
77
 
 
78
// -- Private Methods ----------------------------------------------------------
 
79
 
 
80
/**
 
81
 * Returns <code>true</code> if <i>value</i> is a simple object and not a
 
82
 * function or an array.
 
83
 *
 
84
 * @method _isSimpleObject
 
85
 * @param {mixed} value
 
86
 * @return {Boolean}
 
87
 * @private
 
88
 */
 
89
function _isSimpleObject(value) {
 
90
    return Lang.type(value) === 'object';
 
91
}
 
92
 
 
93
// -- Public Static Properties -------------------------------------------------
 
94
 
 
95
/**
 
96
 * Name of this component.
 
97
 *
 
98
 * @property NAME
 
99
 * @type String
 
100
 * @static
 
101
 */
 
102
HistoryBase.NAME = 'historyBase';
 
103
 
 
104
/**
 
105
 * Constant used to identify state changes originating from the
 
106
 * <code>add()</code> method.
 
107
 *
 
108
 * @property SRC_ADD
 
109
 * @type String
 
110
 * @static
 
111
 * @final
 
112
 */
 
113
HistoryBase.SRC_ADD = SRC_ADD;
 
114
 
 
115
/**
 
116
 * Constant used to identify state changes originating from the
 
117
 * <code>replace()</code> method.
 
118
 *
 
119
 * @property SRC_REPLACE
 
120
 * @type String
 
121
 * @static
 
122
 * @final
 
123
 */
 
124
HistoryBase.SRC_REPLACE = SRC_REPLACE;
 
125
 
 
126
/**
 
127
 * Whether or not this browser supports the HTML5 History API.
 
128
 *
 
129
 * @property html5
 
130
 * @type Boolean
 
131
 * @static
 
132
 */
 
133
 
 
134
// All HTML5-capable browsers except Gecko 2+ (Firefox 4+) correctly return
 
135
// true for 'onpopstate' in win. In order to support Gecko 2, we fall back to a
 
136
// UA sniff for now. (current as of Firefox 4.0b2)
 
137
HistoryBase.html5 = !!(win.history && win.history.pushState &&
 
138
        win.history.replaceState && ('onpopstate' in win || Y.UA.gecko >= 2) &&
 
139
        (!Y.UA.android || Y.UA.android >= 2.4));
 
140
 
 
141
/**
 
142
 * Whether or not this browser supports the <code>window.onhashchange</code>
 
143
 * event natively. Note that even if this is <code>true</code>, you may
 
144
 * still want to use HistoryHash's synthetic <code>hashchange</code> event
 
145
 * since it normalizes implementation differences and fixes spec violations
 
146
 * across various browsers.
 
147
 *
 
148
 * @property nativeHashChange
 
149
 * @type Boolean
 
150
 * @static
 
151
 */
 
152
 
 
153
// Most browsers that support hashchange expose it on the window. Opera 10.6+
 
154
// exposes it on the document (but you can still attach to it on the window).
 
155
//
 
156
// IE8 supports the hashchange event, but only in IE8 Standards
 
157
// Mode. However, IE8 in IE7 compatibility mode still defines the
 
158
// event but never fires it, so we can't just detect the event. We also can't
 
159
// just UA sniff for IE8, since other browsers support this event as well.
 
160
HistoryBase.nativeHashChange = ('onhashchange' in win || 'onhashchange' in doc) &&
 
161
        (!docMode || docMode > 7);
 
162
 
 
163
Y.mix(HistoryBase.prototype, {
 
164
    // -- Initialization -------------------------------------------------------
 
165
 
 
166
    /**
 
167
     * Initializes this HistoryBase instance. This method is called by the
 
168
     * constructor.
 
169
     *
 
170
     * @method _init
 
171
     * @param {Object} config configuration object
 
172
     * @protected
 
173
     */
 
174
    _init: function (config) {
 
175
        var initialState;
 
176
 
 
177
        /**
 
178
         * Configuration object provided by the user on instantiation, or an
 
179
         * empty object if one wasn't provided.
 
180
         *
 
181
         * @property _config
 
182
         * @type Object
 
183
         * @default {}
 
184
         * @protected
 
185
         */
 
186
        config = this._config = config || {};
 
187
 
 
188
        /**
 
189
         * If `true`, a `history:change` event will be fired whenever the URL
 
190
         * changes, even if there is no associated state change.
 
191
         *
 
192
         * @property force
 
193
         * @type Boolean
 
194
         * @default false
 
195
         */
 
196
         this.force = !!config.force;
 
197
 
 
198
        /**
 
199
         * Resolved initial state: a merge of the user-supplied initial state
 
200
         * (if any) and any initial state provided by a subclass. This may
 
201
         * differ from <code>_config.initialState</code>. If neither the config
 
202
         * nor a subclass supplies an initial state, this property will be
 
203
         * <code>null</code>.
 
204
         *
 
205
         * @property _initialState
 
206
         * @type Object|null
 
207
         * @default {}
 
208
         * @protected
 
209
         */
 
210
        initialState = this._initialState = this._initialState ||
 
211
                config.initialState || null;
 
212
 
 
213
        /**
 
214
         * Fired when the state changes. To be notified of all state changes
 
215
         * regardless of the History or YUI instance that generated them,
 
216
         * subscribe to this event on <code>Y.Global</code>. If you would rather
 
217
         * be notified only about changes generated by this specific History
 
218
         * instance, subscribe to this event on the instance.
 
219
         *
 
220
         * @event history:change
 
221
         * @param {EventFacade} e Event facade with the following additional
 
222
         *   properties:
 
223
         *
 
224
         * <dl>
 
225
         *   <dt>changed (Object)</dt>
 
226
         *   <dd>
 
227
         *     Object hash of state items that have been added or changed. The
 
228
         *     key is the item key, and the value is an object containing
 
229
         *     <code>newVal</code> and <code>prevVal</code> properties
 
230
         *     representing the values of the item both before and after the
 
231
         *     change. If the item was newly added, <code>prevVal</code> will be
 
232
         *     <code>undefined</code>.
 
233
         *   </dd>
 
234
         *
 
235
         *   <dt>newVal (Object)</dt>
 
236
         *   <dd>
 
237
         *     Object hash of key/value pairs of all state items after the
 
238
         *     change.
 
239
         *   </dd>
 
240
         *
 
241
         *   <dt>prevVal (Object)</dt>
 
242
         *   <dd>
 
243
         *     Object hash of key/value pairs of all state items before the
 
244
         *     change.
 
245
         *   </dd>
 
246
         *
 
247
         *   <dt>removed (Object)</dt>
 
248
         *   <dd>
 
249
         *     Object hash of key/value pairs of state items that have been
 
250
         *     removed. Values are the old values prior to removal.
 
251
         *   </dd>
 
252
         *
 
253
         *   <dt>src (String)</dt>
 
254
         *   <dd>
 
255
         *     The source of the event. This can be used to selectively ignore
 
256
         *     events generated by certain sources.
 
257
         *   </dd>
 
258
         * </dl>
 
259
         */
 
260
        this.publish(EVT_CHANGE, {
 
261
            broadcast: 2,
 
262
            defaultFn: this._defChangeFn
 
263
        });
 
264
 
 
265
        // If initialState was provided, merge it into the current state.
 
266
        if (initialState) {
 
267
            this.replace(initialState);
 
268
        }
 
269
    },
 
270
 
 
271
    // -- Public Methods -------------------------------------------------------
 
272
 
 
273
    /**
 
274
     * Adds a state entry with new values for the specified keys. By default,
 
275
     * the new state will be merged into the existing state, and new values will
 
276
     * override existing values. Specifying a <code>null</code> or
 
277
     * <code>undefined</code> value will cause that key to be removed from the
 
278
     * new state entry.
 
279
     *
 
280
     * @method add
 
281
     * @param {Object} state Object hash of key/value pairs.
 
282
     * @param {Object} options (optional) Zero or more of the following options:
 
283
     *   <dl>
 
284
     *     <dt>merge (Boolean)</dt>
 
285
     *     <dd>
 
286
     *       <p>
 
287
     *       If <code>true</code> (the default), the new state will be merged
 
288
     *       into the existing state. New values will override existing values,
 
289
     *       and <code>null</code> or <code>undefined</code> values will be
 
290
     *       removed from the state.
 
291
     *       </p>
 
292
     *
 
293
     *       <p>
 
294
     *       If <code>false</code>, the existing state will be discarded as a
 
295
     *       whole and the new state will take its place.
 
296
     *       </p>
 
297
     *     </dd>
 
298
     *   </dl>
 
299
     * @chainable
 
300
     */
 
301
    add: function () {
 
302
        var args = YArray(arguments, 0, true);
 
303
        args.unshift(SRC_ADD);
 
304
        return this._change.apply(this, args);
 
305
    },
 
306
 
 
307
    /**
 
308
     * Adds a state entry with a new value for a single key. By default, the new
 
309
     * value will be merged into the existing state values, and will override an
 
310
     * existing value with the same key if there is one. Specifying a
 
311
     * <code>null</code> or <code>undefined</code> value will cause the key to
 
312
     * be removed from the new state entry.
 
313
     *
 
314
     * @method addValue
 
315
     * @param {String} key State parameter key.
 
316
     * @param {String} value New value.
 
317
     * @param {Object} options (optional) Zero or more options. See
 
318
     *   <code>add()</code> for a list of supported options.
 
319
     * @chainable
 
320
     */
 
321
    addValue: function (key, value, options) {
 
322
        var state = {};
 
323
        state[key] = value;
 
324
        return this._change(SRC_ADD, state, options);
 
325
    },
 
326
 
 
327
    /**
 
328
     * Returns the current value of the state parameter specified by <i>key</i>,
 
329
     * or an object hash of key/value pairs for all current state parameters if
 
330
     * no key is specified.
 
331
     *
 
332
     * @method get
 
333
     * @param {String} key (optional) State parameter key.
 
334
     * @return {Object|String} Value of the specified state parameter, or an
 
335
     *   object hash of key/value pairs for all current state parameters.
 
336
     */
 
337
    get: function (key) {
 
338
        var state    = GlobalEnv._state,
 
339
            isObject = _isSimpleObject(state);
 
340
 
 
341
        if (key) {
 
342
            return isObject && Obj.owns(state, key) ? state[key] : undefined;
 
343
        } else {
 
344
            return isObject ? Y.mix({}, state, true) : state; // mix provides a fast shallow clone.
 
345
        }
 
346
    },
 
347
 
 
348
    /**
 
349
     * Same as <code>add()</code> except that a new browser history entry will
 
350
     * not be created. Instead, the current history entry will be replaced with
 
351
     * the new state.
 
352
     *
 
353
     * @method replace
 
354
     * @param {Object} state Object hash of key/value pairs.
 
355
     * @param {Object} options (optional) Zero or more options. See
 
356
     *   <code>add()</code> for a list of supported options.
 
357
     * @chainable
 
358
     */
 
359
    replace: function () {
 
360
        var args = YArray(arguments, 0, true);
 
361
        args.unshift(SRC_REPLACE);
 
362
        return this._change.apply(this, args);
 
363
    },
 
364
 
 
365
    /**
 
366
     * Same as <code>addValue()</code> except that a new browser history entry
 
367
     * will not be created. Instead, the current history entry will be replaced
 
368
     * with the new state.
 
369
     *
 
370
     * @method replaceValue
 
371
     * @param {String} key State parameter key.
 
372
     * @param {String} value New value.
 
373
     * @param {Object} options (optional) Zero or more options. See
 
374
     *   <code>add()</code> for a list of supported options.
 
375
     * @chainable
 
376
     */
 
377
    replaceValue: function (key, value, options) {
 
378
        var state = {};
 
379
        state[key] = value;
 
380
        return this._change(SRC_REPLACE, state, options);
 
381
    },
 
382
 
 
383
    // -- Protected Methods ----------------------------------------------------
 
384
 
 
385
    /**
 
386
     * Changes the state. This method provides a common implementation shared by
 
387
     * the public methods for changing state.
 
388
     *
 
389
     * @method _change
 
390
     * @param {String} src Source of the change, for inclusion in event facades
 
391
     *   to facilitate filtering.
 
392
     * @param {Object} state Object hash of key/value pairs.
 
393
     * @param {Object} options (optional) Zero or more options. See
 
394
     *   <code>add()</code> for a list of supported options.
 
395
     * @protected
 
396
     * @chainable
 
397
     */
 
398
    _change: function (src, state, options) {
 
399
        options = options ? Y.merge(DEFAULT_OPTIONS, options) : DEFAULT_OPTIONS;
 
400
 
 
401
        if (options.merge && _isSimpleObject(state) &&
 
402
                _isSimpleObject(GlobalEnv._state)) {
 
403
            state = Y.merge(GlobalEnv._state, state);
 
404
        }
 
405
 
 
406
        this._resolveChanges(src, state, options);
 
407
        return this;
 
408
    },
 
409
 
 
410
    /**
 
411
     * Called by _resolveChanges() when the state has changed. This method takes
 
412
     * care of actually firing the necessary events.
 
413
     *
 
414
     * @method _fireEvents
 
415
     * @param {String} src Source of the changes, for inclusion in event facades
 
416
     *   to facilitate filtering.
 
417
     * @param {Object} changes Resolved changes.
 
418
     * @param {Object} options Zero or more options. See <code>add()</code> for
 
419
     *   a list of supported options.
 
420
     * @protected
 
421
     */
 
422
    _fireEvents: function (src, changes, options) {
 
423
        // Fire the global change event.
 
424
        this.fire(EVT_CHANGE, {
 
425
            _options: options,
 
426
            changed : changes.changed,
 
427
            newVal  : changes.newState,
 
428
            prevVal : changes.prevState,
 
429
            removed : changes.removed,
 
430
            src     : src
 
431
        });
 
432
 
 
433
        // Fire change/remove events for individual items.
 
434
        Obj.each(changes.changed, function (value, key) {
 
435
            this._fireChangeEvent(src, key, value);
 
436
        }, this);
 
437
 
 
438
        Obj.each(changes.removed, function (value, key) {
 
439
            this._fireRemoveEvent(src, key, value);
 
440
        }, this);
 
441
    },
 
442
 
 
443
    /**
 
444
     * Fires a dynamic "[key]Change" event.
 
445
     *
 
446
     * @method _fireChangeEvent
 
447
     * @param {String} src source of the change, for inclusion in event facades
 
448
     *   to facilitate filtering
 
449
     * @param {String} key key of the item that was changed
 
450
     * @param {Object} value object hash containing <i>newVal</i> and
 
451
     *   <i>prevVal</i> properties for the changed item
 
452
     * @protected
 
453
     */
 
454
    _fireChangeEvent: function (src, key, value) {
 
455
        /**
 
456
         * <p>
 
457
         * Dynamic event fired when an individual history item is added or
 
458
         * changed. The name of this event depends on the name of the key that
 
459
         * changed. To listen to change events for a key named "foo", subscribe
 
460
         * to the <code>fooChange</code> event; for a key named "bar", subscribe
 
461
         * to <code>barChange</code>, etc.
 
462
         * </p>
 
463
         *
 
464
         * <p>
 
465
         * Key-specific events are only fired for instance-level changes; that
 
466
         * is, changes that were made via the same History instance on which the
 
467
         * event is subscribed. To be notified of changes made by other History
 
468
         * instances, subscribe to the global <code>history:change</code> event.
 
469
         * </p>
 
470
         *
 
471
         * @event [key]Change
 
472
         * @param {EventFacade} e Event facade with the following additional
 
473
         *   properties:
 
474
         *
 
475
         * <dl>
 
476
         *   <dt>newVal (mixed)</dt>
 
477
         *   <dd>
 
478
         *     The new value of the item after the change.
 
479
         *   </dd>
 
480
         *
 
481
         *   <dt>prevVal (mixed)</dt>
 
482
         *   <dd>
 
483
         *     The previous value of the item before the change, or
 
484
         *     <code>undefined</code> if the item was just added and has no
 
485
         *     previous value.
 
486
         *   </dd>
 
487
         *
 
488
         *   <dt>src (String)</dt>
 
489
         *   <dd>
 
490
         *     The source of the event. This can be used to selectively ignore
 
491
         *     events generated by certain sources.
 
492
         *   </dd>
 
493
         * </dl>
 
494
         */
 
495
        this.fire(key + 'Change', {
 
496
            newVal : value.newVal,
 
497
            prevVal: value.prevVal,
 
498
            src    : src
 
499
        });
 
500
    },
 
501
 
 
502
    /**
 
503
     * Fires a dynamic "[key]Remove" event.
 
504
     *
 
505
     * @method _fireRemoveEvent
 
506
     * @param {String} src source of the change, for inclusion in event facades
 
507
     *   to facilitate filtering
 
508
     * @param {String} key key of the item that was removed
 
509
     * @param {mixed} value value of the item prior to its removal
 
510
     * @protected
 
511
     */
 
512
    _fireRemoveEvent: function (src, key, value) {
 
513
        /**
 
514
         * <p>
 
515
         * Dynamic event fired when an individual history item is removed. The
 
516
         * name of this event depends on the name of the key that was removed.
 
517
         * To listen to remove events for a key named "foo", subscribe to the
 
518
         * <code>fooRemove</code> event; for a key named "bar", subscribe to
 
519
         * <code>barRemove</code>, etc.
 
520
         * </p>
 
521
         *
 
522
         * <p>
 
523
         * Key-specific events are only fired for instance-level changes; that
 
524
         * is, changes that were made via the same History instance on which the
 
525
         * event is subscribed. To be notified of changes made by other History
 
526
         * instances, subscribe to the global <code>history:change</code> event.
 
527
         * </p>
 
528
         *
 
529
         * @event [key]Remove
 
530
         * @param {EventFacade} e Event facade with the following additional
 
531
         *   properties:
 
532
         *
 
533
         * <dl>
 
534
         *   <dt>prevVal (mixed)</dt>
 
535
         *   <dd>
 
536
         *     The value of the item before it was removed.
 
537
         *   </dd>
 
538
         *
 
539
         *   <dt>src (String)</dt>
 
540
         *   <dd>
 
541
         *     The source of the event. This can be used to selectively ignore
 
542
         *     events generated by certain sources.
 
543
         *   </dd>
 
544
         * </dl>
 
545
         */
 
546
        this.fire(key + 'Remove', {
 
547
            prevVal: value,
 
548
            src    : src
 
549
        });
 
550
    },
 
551
 
 
552
    /**
 
553
     * Resolves the changes (if any) between <i>newState</i> and the current
 
554
     * state and fires appropriate events if things have changed.
 
555
     *
 
556
     * @method _resolveChanges
 
557
     * @param {String} src source of the changes, for inclusion in event facades
 
558
     *   to facilitate filtering
 
559
     * @param {Object} newState object hash of key/value pairs representing the
 
560
     *   new state
 
561
     * @param {Object} options Zero or more options. See <code>add()</code> for
 
562
     *   a list of supported options.
 
563
     * @protected
 
564
     */
 
565
    _resolveChanges: function (src, newState, options) {
 
566
        var changed   = {},
 
567
            isChanged,
 
568
            prevState = GlobalEnv._state,
 
569
            removed   = {};
 
570
 
 
571
        newState || (newState = {});
 
572
        options  || (options  = {});
 
573
 
 
574
        if (_isSimpleObject(newState) && _isSimpleObject(prevState)) {
 
575
            // Figure out what was added or changed.
 
576
            Obj.each(newState, function (newVal, key) {
 
577
                var prevVal = prevState[key];
 
578
 
 
579
                if (newVal !== prevVal) {
 
580
                    changed[key] = {
 
581
                        newVal : newVal,
 
582
                        prevVal: prevVal
 
583
                    };
 
584
 
 
585
                    isChanged = true;
 
586
                }
 
587
            }, this);
 
588
 
 
589
            // Figure out what was removed.
 
590
            Obj.each(prevState, function (prevVal, key) {
 
591
                if (!Obj.owns(newState, key) || newState[key] === null) {
 
592
                    delete newState[key];
 
593
                    removed[key] = prevVal;
 
594
                    isChanged = true;
 
595
                }
 
596
            }, this);
 
597
        } else {
 
598
            isChanged = newState !== prevState;
 
599
        }
 
600
 
 
601
        if (isChanged || this.force) {
 
602
            this._fireEvents(src, {
 
603
                changed  : changed,
 
604
                newState : newState,
 
605
                prevState: prevState,
 
606
                removed  : removed
 
607
            }, options);
 
608
        }
 
609
    },
 
610
 
 
611
    /**
 
612
     * Stores the specified state. Don't call this method directly; go through
 
613
     * _resolveChanges() to ensure that changes are resolved and all events are
 
614
     * fired properly.
 
615
     *
 
616
     * @method _storeState
 
617
     * @param {String} src source of the changes
 
618
     * @param {Object} newState new state to store
 
619
     * @param {Object} options Zero or more options. See <code>add()</code> for
 
620
     *   a list of supported options.
 
621
     * @protected
 
622
     */
 
623
    _storeState: function (src, newState) {
 
624
        // Note: the src and options params aren't used here, but they are used
 
625
        // by subclasses.
 
626
        GlobalEnv._state = newState || {};
 
627
    },
 
628
 
 
629
    // -- Protected Event Handlers ---------------------------------------------
 
630
 
 
631
    /**
 
632
     * Default <code>history:change</code> event handler.
 
633
     *
 
634
     * @method _defChangeFn
 
635
     * @param {EventFacade} e state change event facade
 
636
     * @protected
 
637
     */
 
638
    _defChangeFn: function (e) {
 
639
        this._storeState(e.src, e.newVal, e._options);
 
640
    }
 
641
}, true);
 
642
 
 
643
Y.HistoryBase = HistoryBase;
 
644
 
 
645
 
 
646
}, '3.5.1' ,{requires:['event-custom-complex']});