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

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/datasource/datasource-get-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-get', function(Y) {
9
9
 
26
26
    
27
27
    
28
28
Y.DataSource.Get = Y.extend(DSGet, Y.DataSource.Local, {
29
 
 
30
 
// Y.DataSouce.Get.prototype
31
 
 
32
29
    /**
33
30
     * Passes query string to Get Utility. Fires <code>response</code> event when
34
31
     * response is received asynchronously.
52
49
        var uri  = this.get("source"),
53
50
            get  = this.get("get"),
54
51
            guid = Y.guid().replace(/\-/g, '_'),
55
 
            generateRequest = this.get( "generateRequestCallback" );
 
52
            generateRequest = this.get( "generateRequestCallback" ),
 
53
            o;
56
54
 
57
55
        /**
58
56
         * Stores the most recent request id for validation against stale
67
65
        // Dynamically add handler function with a closure to the callback stack
68
66
        YUI.Env.DataSource.callbacks[guid] = Y.bind(function(response) {
69
67
            delete YUI.Env.DataSource.callbacks[guid];
 
68
            delete Y.DataSource.Local.transactions[e.tId];
70
69
 
71
70
            var process = this.get('asyncMode') !== "ignoreStaleResponses" ||
72
71
                          this._last === guid;
84
83
 
85
84
        Y.log("DataSource is querying URL " + uri, "info", "datasource-get");
86
85
 
87
 
        get.script(uri, {
 
86
        Y.DataSource.Local.transactions[e.tId] = get.script(uri, {
88
87
            autopurge: true,
89
88
            // Works in Firefox only....
90
 
            onFailure: Y.bind(function(e) {
91
 
                e.error = new Error("Script node data failure");
92
 
                this.fire("error", e);
 
89
            onFailure: Y.bind(function(e, o) {
 
90
                delete YUI.Env.DataSource.callbacks[guid];
 
91
                delete Y.DataSource.Local.transactions[e.tId];
 
92
 
 
93
                e.error = new Error(o.msg || "Script node data failure");
 
94
                Y.log("Script node data failure", "error", "datasource-get");
 
95
                this.fire("data", e);
 
96
            }, this, e),
 
97
            onTimeout: Y.bind(function(e, o) {
 
98
                delete YUI.Env.DataSource.callbacks[guid];
 
99
                delete Y.DataSource.Local.transactions[e.tId];
 
100
 
 
101
                e.error = new Error(o.msg || "Script node data timeout");
 
102
                Y.log("Script node data timeout", "error", "datasource-get");
 
103
                this.fire("data", e);
93
104
            }, this, e)
94
105
        });
95
106
 
112
123
 
113
124
}, {
114
125
 
115
 
// Y.DataSouce.Get static properties
116
 
 
117
126
    /**
118
127
     * Class name.
119
128
     *
200
209
YUI.namespace("Env.DataSource.callbacks");
201
210
 
202
211
 
203
 
}, '3.1.2' ,{requires:['datasource-local', 'get']});
 
212
 
 
213
}, '3.2.0' ,{requires:['datasource-local', 'get']});