~ubuntu-branches/ubuntu/quantal/maas/quantal-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/build/datasource-arrayschema/datasource-arrayschema-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('datasource-arrayschema', function(Y) {
8
 
 
9
 
/**
10
 
 * Extends DataSource with schema-parsing on array data.
11
 
 *
12
 
 * @module datasource
13
 
 * @submodule datasource-arrayschema
14
 
 */
15
 
 
16
 
/**
17
 
 * Adds schema-parsing to the DataSource Utility.
18
 
 * @class DataSourceArraySchema
19
 
 * @extends Plugin.Base
20
 
 */    
21
 
var DataSourceArraySchema = function() {
22
 
    DataSourceArraySchema.superclass.constructor.apply(this, arguments);
23
 
};
24
 
 
25
 
Y.mix(DataSourceArraySchema, {
26
 
    /**
27
 
     * The namespace for the plugin. This will be the property on the host which
28
 
     * references the plugin instance.
29
 
     *
30
 
     * @property NS
31
 
     * @type String
32
 
     * @static
33
 
     * @final
34
 
     * @value "schema"
35
 
     */
36
 
    NS: "schema",
37
 
 
38
 
    /**
39
 
     * Class name.
40
 
     *
41
 
     * @property NAME
42
 
     * @type String
43
 
     * @static
44
 
     * @final
45
 
     * @value "dataSourceArraySchema"
46
 
     */
47
 
    NAME: "dataSourceArraySchema",
48
 
 
49
 
    /////////////////////////////////////////////////////////////////////////////
50
 
    //
51
 
    // DataSourceArraySchema Attributes
52
 
    //
53
 
    /////////////////////////////////////////////////////////////////////////////
54
 
 
55
 
    ATTRS: {
56
 
        schema: {
57
 
            //value: {}
58
 
        }
59
 
    }
60
 
});
61
 
 
62
 
Y.extend(DataSourceArraySchema, Y.Plugin.Base, {
63
 
    /**
64
 
    * Internal init() handler.
65
 
    *
66
 
    * @method initializer
67
 
    * @param config {Object} Config object.
68
 
    * @private
69
 
    */
70
 
    initializer: function(config) {
71
 
        this.doBefore("_defDataFn", this._beforeDefDataFn);
72
 
    },
73
 
 
74
 
    /**
75
 
     * Parses raw data into a normalized response.
76
 
     *
77
 
     * @method _beforeDefDataFn
78
 
     * @param tId {Number} Unique transaction ID.
79
 
     * @param request {Object} The request.
80
 
     * @param callback {Object} The callback object with the following properties:
81
 
     *     <dl>
82
 
     *         <dt>success (Function)</dt> <dd>Success handler.</dd>
83
 
     *         <dt>failure (Function)</dt> <dd>Failure handler.</dd>
84
 
     *     </dl>
85
 
     * @param data {Object} Raw data.
86
 
     * @protected
87
 
     */
88
 
    _beforeDefDataFn: function(e) {
89
 
        var data = (Y.DataSource.IO && (this.get("host") instanceof Y.DataSource.IO) && Y.Lang.isString(e.data.responseText)) ? e.data.responseText : e.data,
90
 
            response = Y.DataSchema.Array.apply.call(this, this.get("schema"), data),
91
 
            payload = e.details[0];
92
 
            
93
 
        // Default
94
 
        if (!response) {
95
 
            response = {
96
 
                meta: {},
97
 
                results: data
98
 
            };
99
 
        }
100
 
        
101
 
        payload.response = response;
102
 
 
103
 
        this.get("host").fire("response", payload);
104
 
 
105
 
        return new Y.Do.Halt("DataSourceArraySchema plugin halted _defDataFn");
106
 
    }
107
 
});
108
 
    
109
 
Y.namespace('Plugin').DataSourceArraySchema = DataSourceArraySchema;
110
 
 
111
 
 
112
 
}, '3.4.1' ,{requires:['datasource-local', 'plugin', 'dataschema-array']});