~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/datasource/datasource-io-debug.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.1.2
6
 
build: 56
 
5
version: 3.2.0
 
6
build: 2676
7
7
*/
8
8
YUI.add('datasource-io', function(Y) {
9
9
 
60
60
        io: {
61
61
            value: Y.io,
62
62
            cloneDefaultValue: false
63
 
        }
 
63
        },
 
64
        
 
65
        /**
 
66
         * Default IO Config.
 
67
         *
 
68
         * @attribute ioConfig
 
69
         * @type Object
 
70
         * @default null
 
71
         */
 
72
         ioConfig: {
 
73
                value: null
 
74
         }
64
75
    }
65
76
});
66
77
    
116
127
    _defRequestFn: function(e) {
117
128
        var uri = this.get("source"),
118
129
            io = this.get("io"),
 
130
            defIOConfig = this.get("ioConfig"),
119
131
            request = e.request,
120
 
            cfg = Y.mix(e.cfg, {
121
 
                on: {
 
132
            cfg = Y.merge(defIOConfig, e.cfg, {
 
133
                on: Y.merge(defIOConfig, {
122
134
                    success: function (id, response, e) {
 
135
                        delete Y.DataSource.Local.transactions[e.tId];
 
136
 
123
137
                        this.fire("data", Y.mix({data:response}, e));
124
138
                        Y.log("Received IO data response for \"" + request + "\"", "info", "datasource-io");
 
139
                        if (defIOConfig && defIOConfig.on && defIOConfig.on.success) {
 
140
                                defIOConfig.on.success.apply(defIOConfig.context || Y, arguments);
 
141
                        }
125
142
                    },
126
143
                    failure: function (id, response, e) {
 
144
                        delete Y.DataSource.Local.transactions[e.tId];
 
145
 
127
146
                        e.error = new Error("IO data failure");
128
 
                        this.fire("error", Y.mix({data:response}, e));
 
147
                        Y.log("IO data failure", "error", "datasource-io");
129
148
                        this.fire("data", Y.mix({data:response}, e));
130
149
                        Y.log("Received IO data failure for \"" + request + "\"", "info", "datasource-io");
 
150
                        if (defIOConfig && defIOConfig.on && defIOConfig.on.failure) {
 
151
                                defIOConfig.on.failure.apply(defIOConfig.context || Y, arguments);
 
152
                        }
131
153
                    }
132
 
                },
 
154
                }),
133
155
                context: this,
134
 
                arguments: e
 
156
                "arguments": e
135
157
            });
136
158
        
137
159
        // Support for POST transactions
143
165
                uri += request;
144
166
            }
145
167
        }
146
 
        io(uri, cfg);
 
168
        Y.DataSource.Local.transactions[e.tId] = io(uri, cfg);
147
169
        return e.tId;
148
170
    }
149
171
});
150
172
  
151
173
Y.DataSource.IO = DSIO;
152
 
    
153
 
 
154
 
 
155
 
}, '3.1.2' ,{requires:['datasource-local', 'io']});
 
174
 
 
175
 
 
176
 
 
177
}, '3.2.0' ,{requires:['datasource-local', 'io']});