~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/docs/assets/widget/myplugin.js.txt

  • 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
 
// START WRAPPER: The YUI.add wrapper is added by the build system, when you use YUI Builder to build your component from the raw source in this file
2
 
// YUI.add("myplugin", function(Y) {
3
 
 
4
 
    /* Any frequently used shortcuts, strings and constants */
5
 
    var Lang = Y.Lang;
6
 
 
7
 
    /* MyPlugin class constructor */
8
 
    function MyPlugin(config) {
9
 
        MyPlugin.superclass.constructor.apply(this, arguments);
10
 
    }
11
 
 
12
 
    /* 
13
 
     * Required NAME static field, to identify the class and 
14
 
     * used as an event prefix, to generate class names etc. (set to the 
15
 
     * class name in camel case). 
16
 
     */
17
 
    MyPlugin.NAME = "myPlugin";
18
 
 
19
 
    /* 
20
 
     * Required NS static field, to identify the property on the host which will 
21
 
     * be used to refer to the plugin instance ( e.g. host.feature.doSomething() ).
22
 
     */
23
 
    MyPlugin.NS = "feature";     
24
 
 
25
 
    /*
26
 
     * The attribute configuration for the plugin. This defines the core user-facing state of the plugin
27
 
     */
28
 
    MyPlugin.ATTRS = {
29
 
 
30
 
        attrA : {
31
 
            value: "A"                     // The default value for attrA, used if the user does not set a value during construction.
32
 
 
33
 
            /*
34
 
            , valueFn: "_defAttrAVal"      // Can be used as a substitute for "value", when you need access to "this" to set the default value.
35
 
             
36
 
            , setter: "_setAttrA"          // Used to normalize attrA's value while during set. Refers to a prototype method, to make customization easier
37
 
            , getter: "_getAttrA"          // Used to normalize attrA's value while during get. Refers to a prototype method, to make customization easier
38
 
            , validator: "_validateAttrA"  // Used to validate attrA's value before updating it. Refers to a prototype method, to make customization easier
39
 
 
40
 
            , readOnly: true               // Cannot be set by the end user. Can be set by the component developer at any time, using _set
41
 
            , writeOnce: true              // Can only be set once by the end user (usually during construction). Can be set by the component developer at any time, using _set
42
 
            
43
 
            , lazyAdd: false               // Add (configure) the attribute during initialization. 
44
 
            
45
 
                                           // You only need to set lazyAdd to false if your attribute is
46
 
                                           // setting some other state in your setter which needs to be set during initialization 
47
 
                                           // (not generally recommended - the setter should be used for normalization. 
48
 
                                           // You should use listeners to update alternate state). 
49
 
 
50
 
            , broadcast: 1                 // Whether the attribute change event should be broadcast or not.
51
 
            */
52
 
        }
53
 
        
54
 
        // ... attrB, attrC, attrD ... attribute configurations. 
55
 
 
56
 
        // Can also include attributes for the super class if you want to override or add configuration parameters
57
 
    };
58
 
 
59
 
    /* MyPlugin extends the base Plugin.Base class */
60
 
    Y.extend(MyPlugin, Y.Plugin.Base, {
61
 
 
62
 
        initializer: function() {
63
 
            /*
64
 
             * initializer is part of the lifecycle introduced by 
65
 
             * the Base class. It is invoked during construction, when
66
 
             * the plugin is plugged into the host, and can be used to 
67
 
             * register listeners or to inject logic before or after methods
68
 
             * on the host.
69
 
             *             
70
 
             * It does not need to invoke the superclass initializer. 
71
 
             * init() will call initializer() for all classes in the hierarchy.
72
 
             */
73
 
 
74
 
             // See Y.Do.before, Y.Do.after
75
 
             this.beforeHostMethod("show", this._beforeHostShowMethod);
76
 
             this.afterHostMethod("show", this._afterHostShowMethod);
77
 
 
78
 
             // See Y.EventTarget.on, Y.EventTarget.after
79
 
             this.onHostEvent("render", this._onHostRenderEvent);             
80
 
             this.afterHostEvent("render", this._afterHostRenderEvent);
81
 
             
82
 
        },
83
 
 
84
 
        destructor : function() {
85
 
            /*
86
 
             * destructor is part of the lifecycle introduced by 
87
 
             * the Base class. It is invoked when the plugin is unplugged.
88
 
             *
89
 
             * Any listeners registered using Plugin.Base's onHostEvent/afterHostEvent methods,
90
 
             * or any methods displaced using it's beforeHostMethod/afterHostMethod methods 
91
 
             * will be detached/restored by Plugin.Base's destructor.
92
 
             *
93
 
             * We only need to clean up anything we change on the host
94
 
             *             
95
 
             * It does not need to invoke the superclass destructor. 
96
 
             * destroy() will call initializer() for all classes in the hierarchy.
97
 
             */
98
 
        },
99
 
 
100
 
        /* Supporting Methods */
101
 
 
102
 
        _onHostRenderEvent : function(e) {
103
 
            /* React on the host render event */
104
 
        },
105
 
 
106
 
        _afterHostRenderEvent : function(e) {
107
 
            /* React after the host render event */
108
 
        },
109
 
        
110
 
        _beforeHostShowMethod : function() {
111
 
            /* Inject logic before the host's show method is called. */
112
 
        },
113
 
 
114
 
        _afterHostShowMethod : function() {
115
 
            /* Inject logic after the host's show method is called. */
116
 
        }
117
 
 
118
 
    });
119
 
 
120
 
    Y.namespace("Plugin.MyApp").MyPlugin = MyPlugin;
121
 
 
122
 
// }, "3.2.0", {requires:["plugin"]});
123
 
// END WRAPPER