~ubuntu-branches/ubuntu/quantal/maas/quantal-proposed

« back to all changes in this revision

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

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
YUI 3.4.1 (build 4118)
3
 
Copyright 2011 Yahoo! Inc. All rights reserved.
4
 
Licensed under the BSD License.
5
 
http://yuilibrary.com/license/
6
 
*/
7
 
YUI.add('yui-later', function(Y) {
8
 
 
9
 
/**
10
 
 * 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>.
11
 
 *
12
 
 * @module yui
13
 
 * @submodule yui-later
14
 
 */
15
 
 
16
 
var NO_ARGS = [];
17
 
 
18
 
/**
19
 
 * Executes the supplied function in the context of the supplied
20
 
 * object 'when' milliseconds later.  Executes the function a
21
 
 * single time unless periodic is set to true.
22
 
 * @for YUI
23
 
 * @method later
24
 
 * @param when {int} the number of milliseconds to wait until the fn
25
 
 * is executed.
26
 
 * @param o the context object.
27
 
 * @param fn {Function|String} the function to execute or the name of
28
 
 * the method in the 'o' object to execute.
29
 
 * @param data [Array] data that is provided to the function.  This
30
 
 * accepts either a single item or an array.  If an array is provided,
31
 
 * the function is executed with one parameter for each array item.
32
 
 * If you need to pass a single array parameter, it needs to be wrapped
33
 
 * in an array [myarray].
34
 
 *
35
 
 * Note: native methods in IE may not have the call and apply methods.
36
 
 * In this case, it will work, but you are limited to four arguments.
37
 
 *
38
 
 * @param periodic {boolean} if true, executes continuously at supplied
39
 
 * interval until canceled.
40
 
 * @return {object} a timer object. Call the cancel() method on this
41
 
 * object to stop the timer.
42
 
 */
43
 
Y.later = function(when, o, fn, data, periodic) {
44
 
    when = when || 0;
45
 
    data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
46
 
    o = o || Y.config.win || Y;
47
 
 
48
 
    var cancelled = false,
49
 
        method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
50
 
        wrapper = function() {
51
 
            // IE 8- may execute a setInterval callback one last time
52
 
            // after clearInterval was called, so in order to preserve
53
 
            // the cancel() === no more runny-run, we have to jump through
54
 
            // an extra hoop.
55
 
            if (!cancelled) {
56
 
                if (!method.apply) {
57
 
                    method(data[0], data[1], data[2], data[3]);
58
 
                } else {
59
 
                    method.apply(o, data || NO_ARGS);
60
 
                }
61
 
            }
62
 
        },
63
 
        id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
64
 
 
65
 
    return {
66
 
        id: id,
67
 
        interval: periodic,
68
 
        cancel: function() {
69
 
            cancelled = true;
70
 
            if (this.interval) {
71
 
                clearInterval(id);
72
 
            } else {
73
 
                clearTimeout(id);
74
 
            }
75
 
        }
76
 
    };
77
 
};
78
 
 
79
 
Y.Lang.later = Y.later;
80
 
 
81
 
 
82
 
 
83
 
}, '3.4.1' ,{requires:['yui-base']});