~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/event-outside/event-outside-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('event-outside', function(Y) {
8
 
 
9
 
/**
10
 
 * Outside events are synthetic DOM events that fire when a corresponding native
11
 
 * or synthetic DOM event occurs outside a bound element.
12
 
 *
13
 
 * The following outside events are pre-defined by this module:
14
 
 * <ul>
15
 
 *   <li>blur</li>
16
 
 *   <li>change</li>
17
 
 *   <li>click</li>
18
 
 *   <li>dblclick</li>
19
 
 *   <li>focus</li>
20
 
 *   <li>keydown</li>
21
 
 *   <li>keypress</li>
22
 
 *   <li>keyup</li>
23
 
 *   <li>mousedown</li>
24
 
 *   <li>mousemove</li>
25
 
 *   <li>mouseout</li>
26
 
 *   <li>mouseover</li>
27
 
 *   <li>mouseup</li>
28
 
 *   <li>select</li>
29
 
 *   <li>submit</li>
30
 
 * </ul>
31
 
 *
32
 
 * Define new outside events with
33
 
 * <code>Y.Event.defineOutside(eventType);</code>.
34
 
 * By default, the created synthetic event name will be the name of the event
35
 
 * with "outside" appended (e.g. "click" becomes "clickoutside"). If you want
36
 
 * a different name for the created Event, pass it as a second argument like so:
37
 
 * <code>Y.Event.defineOutside(eventType, "yonderclick")</code>.
38
 
 *
39
 
 * @module event
40
 
 * @submodule event-outside
41
 
 */
42
 
 
43
 
// Outside events are pre-defined for each of these native DOM events
44
 
var nativeEvents = [
45
 
        'blur', 'change', 'click', 'dblclick', 'focus', 'keydown', 'keypress',
46
 
        'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup',
47
 
        'select', 'submit'
48
 
    ];
49
 
 
50
 
/**
51
 
 * Defines a new outside event to correspond with the given DOM event.
52
 
 *
53
 
 * By default, the created synthetic event name will be the name of the event
54
 
 * with "outside" appended (e.g. "click" becomes "clickoutside"). If you want
55
 
 * a different name for the created Event, pass it as a second argument like so:
56
 
 * <code>Y.Event.defineOutside(eventType, "yonderclick")</code>.
57
 
 *
58
 
 * @method Y.Event.defineOutside
59
 
 * @param {String} event DOM event
60
 
 * @param {String} name (optional) custom outside event name
61
 
 * @static
62
 
 */
63
 
Y.Event.defineOutside = function (event, name) {
64
 
    name = name || (event + 'outside');
65
 
 
66
 
    var config = {
67
 
    
68
 
        on: function (node, sub, notifier) {
69
 
            sub.handle = Y.one('doc').on(event, function(e) {
70
 
                if (this.isOutside(node, e.target)) {
71
 
                    e.currentTarget = node;
72
 
                    notifier.fire(e);
73
 
                }
74
 
            }, this);
75
 
        },
76
 
        
77
 
        detach: function (node, sub, notifier) {
78
 
            sub.handle.detach();
79
 
        },
80
 
        
81
 
        delegate: function (node, sub, notifier, filter) {
82
 
            sub.handle = Y.one('doc').delegate(event, function (e) {
83
 
                if (this.isOutside(node, e.target)) {
84
 
                    notifier.fire(e);
85
 
                }
86
 
            }, filter, this);
87
 
        },
88
 
        
89
 
        isOutside: function (node, target) {
90
 
            return target !== node && !target.ancestor(function (p) {
91
 
                    return p === node;
92
 
                });
93
 
        }
94
 
    };
95
 
    config.detachDelegate = config.detach;
96
 
 
97
 
    Y.Event.define(name, config);
98
 
};
99
 
 
100
 
// Define outside events for some common native DOM events
101
 
Y.Array.each(nativeEvents, function (event) {
102
 
    Y.Event.defineOutside(event);
103
 
});
104
 
 
105
 
 
106
 
}, '3.4.1' ,{requires:['event-synthetic']});