@qooxdoo/framework 7.0.0-beta.3 → 7.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/Manifest.json +1 -1
- package/README.md +9 -3
- package/lib/compiler/compile-info.json +60 -58
- package/lib/compiler/index.js +3242 -1883
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +1 -1
- package/lib/resource/qx/tool/loadsass.js +6 -4
- package/lib/resource/qx/tool/schema/compile-1-0-0.json +6 -11
- package/package.json +17 -3
- package/source/class/qx/Bootstrap.js +22 -1
- package/source/class/qx/bom/Blocker.js +2 -1
- package/source/class/qx/core/Environment.js +3 -12
- package/source/class/qx/core/MProperty.js +1 -1
- package/source/class/qx/dev/unit/Sinon.js +1 -1
- package/source/class/qx/io/__init__.js +5 -3
- package/source/class/qx/io/exception/Cancel.js +34 -0
- package/source/class/qx/io/exception/Exception.js +38 -0
- package/source/class/qx/io/exception/Protocol.js +26 -0
- package/source/class/qx/io/exception/Transport.js +39 -0
- package/source/class/qx/io/exception/__init__.js +4 -0
- package/source/class/qx/io/graphql/Client.js +112 -0
- package/source/class/qx/io/graphql/__init__.js +9 -0
- package/source/class/qx/io/graphql/protocol/Message.js +65 -0
- package/source/class/qx/io/graphql/protocol/Request.js +95 -0
- package/source/class/qx/io/graphql/protocol/Response.js +61 -0
- package/source/class/qx/io/graphql/protocol/__init__.js +6 -0
- package/source/class/qx/io/jsonrpc/Client.js +323 -0
- package/source/class/qx/io/jsonrpc/__init__.js +15 -0
- package/source/class/qx/io/jsonrpc/protocol/Batch.js +97 -0
- package/source/class/qx/io/jsonrpc/protocol/Error.js +63 -0
- package/source/class/qx/io/jsonrpc/protocol/Message.js +48 -0
- package/source/class/qx/io/jsonrpc/protocol/Notification.js +45 -0
- package/source/class/qx/io/jsonrpc/protocol/Parser.js +81 -0
- package/source/class/qx/io/jsonrpc/protocol/Request.js +93 -0
- package/source/class/qx/io/jsonrpc/protocol/Result.js +48 -0
- package/source/class/qx/io/jsonrpc/protocol/__init__.js +5 -0
- package/source/class/qx/io/request/authentication/Bearer.js +52 -0
- package/source/class/qx/io/transport/AbstractClient.js +100 -0
- package/source/class/qx/io/transport/AbstractTransport.js +41 -0
- package/source/class/qx/io/transport/Fetch.js +95 -0
- package/source/class/qx/io/transport/ITransport.js +40 -0
- package/source/class/qx/io/transport/PostMessage.js +55 -0
- package/source/class/qx/io/transport/Websocket.js +97 -0
- package/source/class/qx/io/transport/Xhr.js +139 -0
- package/source/class/qx/io/transport/__init__.js +18 -0
- package/source/class/qx/test/core/Assert.js +1 -1
- package/source/class/qx/test/core/Environment.js +0 -3
- package/source/class/qx/test/io/MAssert.js +46 -0
- package/source/class/qx/test/io/graphql/Client.js +169 -0
- package/source/class/qx/test/io/graphql/ClientFetch.js +34 -0
- package/source/class/qx/test/io/graphql/Request.js +42 -0
- package/source/class/qx/test/io/jsonrpc/Client.js +267 -0
- package/source/class/qx/test/io/jsonrpc/Protocol.js +80 -0
- package/source/class/qx/test/io/transport/PostMessage.js +56 -0
- package/source/class/qx/test/io/transport/Websocket.js +63 -0
- package/source/class/qx/test/ui/embed/Iframe.js +1 -1
- package/source/class/qx/test/util/DateFormat.js +45 -6
- package/source/class/qx/tool/cli/Cli.js +1 -0
- package/source/class/qx/tool/cli/commands/Compile.js +13 -3
- package/source/class/qx/tool/cli/commands/Es6ify.js +93 -0
- package/source/class/qx/tool/cli/commands/package/Install.js +1 -1
- package/source/class/qx/tool/cli/commands/package/Publish.js +14 -0
- package/source/class/qx/tool/compiler/ClassFile.js +67 -27
- package/source/class/qx/tool/compiler/Es6ify.js +368 -0
- package/source/class/qx/tool/compiler/makers/AppMaker.js +2 -1
- package/source/class/qx/tool/compiler/targets/Target.js +57 -47
- package/source/class/qx/tool/compiler/targets/meta/AbstractJavascriptMeta.js +25 -18
- package/source/class/qx/tool/compiler/targets/meta/BootJs.js +16 -16
- package/source/class/qx/tool/compiler/targets/meta/PolyfillJs.js +11 -3
- package/source/class/qx/tool/compiler/targets/meta/Uglify.js +10 -10
- package/source/class/qx/ui/core/Widget.js +70 -0
- package/source/class/qx/ui/decoration/MLinearBackgroundGradient.js +2 -1
- package/source/class/qx/ui/form/ComboBox.js +8 -3
- package/source/class/qx/ui/form/DateField.js +16 -1
- package/source/class/qx/ui/form/MenuButton.js +8 -4
- package/source/class/qx/ui/form/SelectBox.js +8 -3
- package/source/class/qx/ui/menu/AbstractButton.js +12 -8
- package/source/class/qx/ui/menu/Menu.js +18 -8
- package/source/class/qx/ui/table/pane/Model.js +10 -4
- package/source/class/qx/ui/window/Window.js +8 -0
- package/source/class/qx/util/format/DateFormat.js +44 -17
- package/source/resource/qx/tool/loadsass.js +6 -4
- package/source/resource/qx/tool/schema/compile-1-0-0.json +6 -11
- package/source/translation/hr.po +297 -0
- package/lib/resource/qx/static/blank.gif +0 -0
- package/source/class/qx/io/remote/Exchange.js +0 -1063
- package/source/class/qx/io/remote/Request.js +0 -1021
- package/source/class/qx/io/remote/RequestQueue.js +0 -521
- package/source/class/qx/io/remote/Response.js +0 -137
- package/source/class/qx/io/remote/Rpc.js +0 -1075
- package/source/class/qx/io/remote/RpcError.js +0 -198
- package/source/class/qx/io/remote/__init__.js +0 -88
- package/source/class/qx/io/remote/transport/Abstract.js +0 -513
- package/source/class/qx/io/remote/transport/Iframe.js +0 -652
- package/source/class/qx/io/remote/transport/Script.js +0 -475
- package/source/class/qx/io/remote/transport/XmlHttp.js +0 -1019
- package/source/class/qx/io/remote/transport/__init__.js +0 -3
- package/source/class/qx/test/io/remote/AbstractRequest.js +0 -150
- package/source/class/qx/test/io/remote/RequestIframe.js +0 -105
- package/source/class/qx/test/io/remote/RequestXhr.js +0 -151
- package/source/class/qx/test/io/remote/Rpc.js +0 -205
- package/source/class/qx/test/io/remote/__init__.js +0 -4
- package/source/class/qx/test/io/remote/transport/Iframe.js +0 -67
- package/source/class/qx/test/io/remote/transport/XmlHttp.js +0 -133
- package/source/class/qx/test/io/remote/transport/__init__.js +0 -4
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
/* ************************************************************************
|
|
2
|
-
|
|
3
|
-
qooxdoo - the new era of web development
|
|
4
|
-
|
|
5
|
-
http://qooxdoo.org
|
|
6
|
-
|
|
7
|
-
Copyright:
|
|
8
|
-
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
|
|
9
|
-
2006 Derrell Lipman
|
|
10
|
-
|
|
11
|
-
License:
|
|
12
|
-
MIT: https://opensource.org/licenses/MIT
|
|
13
|
-
See the LICENSE file in the project's top-level directory for details.
|
|
14
|
-
|
|
15
|
-
Authors:
|
|
16
|
-
* Sebastian Werner (wpbasti)
|
|
17
|
-
* Andreas Ecker (ecker)
|
|
18
|
-
* Derrell Lipman (derrell)
|
|
19
|
-
|
|
20
|
-
************************************************************************ */
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Handles scheduling of requests to be sent to a server.
|
|
24
|
-
*
|
|
25
|
-
* This class is a singleton and is used by qx.io.remote.Request to schedule its
|
|
26
|
-
* requests. It should not be used directly.
|
|
27
|
-
*
|
|
28
|
-
* NOTE: Instances of this class must be disposed of after use
|
|
29
|
-
*
|
|
30
|
-
* @internal
|
|
31
|
-
* @require(qx.bom.client.Transport)
|
|
32
|
-
*/
|
|
33
|
-
qx.Class.define("qx.io.remote.RequestQueue",
|
|
34
|
-
{
|
|
35
|
-
type : "singleton",
|
|
36
|
-
extend : qx.core.Object,
|
|
37
|
-
implement : [ qx.core.IDisposable ],
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/*
|
|
43
|
-
*****************************************************************************
|
|
44
|
-
CONSTRUCTOR
|
|
45
|
-
*****************************************************************************
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
construct : function()
|
|
49
|
-
{
|
|
50
|
-
this.base(arguments);
|
|
51
|
-
|
|
52
|
-
this.__queue = [];
|
|
53
|
-
this.__active = [];
|
|
54
|
-
|
|
55
|
-
this.__totalRequests = 0;
|
|
56
|
-
|
|
57
|
-
// timeout handling
|
|
58
|
-
this.__timer = new qx.event.Timer(500);
|
|
59
|
-
this.__timer.addListener("interval", this._oninterval, this);
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/*
|
|
66
|
-
*****************************************************************************
|
|
67
|
-
PROPERTIES
|
|
68
|
-
*****************************************************************************
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
properties :
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Indicates whether queue is enabled or not.
|
|
76
|
-
*/
|
|
77
|
-
enabled :
|
|
78
|
-
{
|
|
79
|
-
init : true,
|
|
80
|
-
check : "Boolean",
|
|
81
|
-
apply : "_applyEnabled"
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* The maximum number of total requests.
|
|
86
|
-
*/
|
|
87
|
-
maxTotalRequests :
|
|
88
|
-
{
|
|
89
|
-
check : "Integer",
|
|
90
|
-
nullable : true
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Maximum number of parallel requests.
|
|
96
|
-
*/
|
|
97
|
-
maxConcurrentRequests :
|
|
98
|
-
{
|
|
99
|
-
check : "Integer",
|
|
100
|
-
init : qx.core.Environment.get("io.maxrequests")
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Default timeout for remote requests in milliseconds.
|
|
106
|
-
*/
|
|
107
|
-
defaultTimeout :
|
|
108
|
-
{
|
|
109
|
-
check : "Integer",
|
|
110
|
-
init : 5000
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/*
|
|
118
|
-
*****************************************************************************
|
|
119
|
-
MEMBERS
|
|
120
|
-
*****************************************************************************
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
members :
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
__queue : null,
|
|
127
|
-
__active : null,
|
|
128
|
-
__totalRequests : null,
|
|
129
|
-
__timer : null,
|
|
130
|
-
|
|
131
|
-
/*
|
|
132
|
-
---------------------------------------------------------------------------
|
|
133
|
-
QUEUE HANDLING
|
|
134
|
-
---------------------------------------------------------------------------
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Get a list of queued requests
|
|
140
|
-
*
|
|
141
|
-
* @return {qx.io.remote.Request[]} The list of queued requests
|
|
142
|
-
*/
|
|
143
|
-
getRequestQueue : function() {
|
|
144
|
-
return this.__queue;
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Get a list of active queued requests, each one wrapped in an instance of
|
|
150
|
-
* {@link qx.io.remote.Exchange}
|
|
151
|
-
*
|
|
152
|
-
* @return {qx.io.remote.Exchange[]} The list of active queued requests, each one
|
|
153
|
-
* wrapped in an instance of {@link qx.io.remote.Exchange}
|
|
154
|
-
*/
|
|
155
|
-
getActiveQueue : function() {
|
|
156
|
-
return this.__active;
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Generates debug output
|
|
162
|
-
*/
|
|
163
|
-
_debug : function()
|
|
164
|
-
{
|
|
165
|
-
if (qx.core.Environment.get("qx.debug"))
|
|
166
|
-
{
|
|
167
|
-
if (qx.core.Environment.get("qx.debug.io.remote"))
|
|
168
|
-
{
|
|
169
|
-
// Debug output
|
|
170
|
-
var vText = this.__active.length + "/" + (this.__queue.length + this.__active.length);
|
|
171
|
-
|
|
172
|
-
this.debug("Progress: " + vText);
|
|
173
|
-
window.status = "Request-Queue Progress: " + vText;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Checks the queue if any request is left to send and uses the transport
|
|
181
|
-
* layer to send the open requests.
|
|
182
|
-
* This method calls itself until every request in the queue is send.
|
|
183
|
-
*
|
|
184
|
-
*/
|
|
185
|
-
_check : function()
|
|
186
|
-
{
|
|
187
|
-
// Debug output
|
|
188
|
-
this._debug();
|
|
189
|
-
|
|
190
|
-
// Check queues and stop timer if not needed anymore
|
|
191
|
-
if (this.__active.length == 0 && this.__queue.length == 0) {
|
|
192
|
-
this.__timer.stop();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Checking if enabled
|
|
196
|
-
if (!this.getEnabled()) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// Checking active queue fill
|
|
201
|
-
if ( this.__queue.length == 0 ||(this.__queue[0].isAsynchronous() && this.__active.length >= this.getMaxConcurrentRequests())) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Checking number of total requests
|
|
206
|
-
if (this.getMaxTotalRequests() != null && this.__totalRequests >= this.getMaxTotalRequests()) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
var vRequest = this.__queue.shift();
|
|
211
|
-
var vTransport = new qx.io.remote.Exchange(vRequest);
|
|
212
|
-
|
|
213
|
-
// Increment counter
|
|
214
|
-
this.__totalRequests++;
|
|
215
|
-
|
|
216
|
-
// Add to active queue
|
|
217
|
-
this.__active.push(vTransport);
|
|
218
|
-
|
|
219
|
-
// Debug output
|
|
220
|
-
this._debug();
|
|
221
|
-
|
|
222
|
-
// Establish event connection between qx.io.remote.Exchange and me.
|
|
223
|
-
vTransport.addListener("sending", this._onsending, this);
|
|
224
|
-
vTransport.addListener("receiving", this._onreceiving, this);
|
|
225
|
-
vTransport.addListener("completed", this._oncompleted, this);
|
|
226
|
-
vTransport.addListener("aborted", this._oncompleted, this);
|
|
227
|
-
vTransport.addListener("timeout", this._oncompleted, this);
|
|
228
|
-
vTransport.addListener("failed", this._oncompleted, this);
|
|
229
|
-
|
|
230
|
-
// Store send timestamp
|
|
231
|
-
vTransport._start = (new Date).valueOf();
|
|
232
|
-
|
|
233
|
-
// Send
|
|
234
|
-
vTransport.send();
|
|
235
|
-
|
|
236
|
-
// Retry
|
|
237
|
-
if (this.__queue.length > 0) {
|
|
238
|
-
this._check();
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Removes a transport object from the active queue and disposes the
|
|
245
|
-
* transport object in order stop the request.
|
|
246
|
-
*
|
|
247
|
-
* @param vTransport {qx.io.remote.Exchange} Transport object
|
|
248
|
-
*/
|
|
249
|
-
_remove : function(vTransport)
|
|
250
|
-
{
|
|
251
|
-
// Remove from active transports
|
|
252
|
-
qx.lang.Array.remove(this.__active, vTransport);
|
|
253
|
-
|
|
254
|
-
// Dispose transport object
|
|
255
|
-
vTransport.dispose();
|
|
256
|
-
|
|
257
|
-
// Check again
|
|
258
|
-
this._check();
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/*
|
|
265
|
-
---------------------------------------------------------------------------
|
|
266
|
-
EVENT HANDLING
|
|
267
|
-
---------------------------------------------------------------------------
|
|
268
|
-
*/
|
|
269
|
-
|
|
270
|
-
__activeCount : 0,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Listens for the "sending" event of the transport object and increases
|
|
275
|
-
* the counter for active requests.
|
|
276
|
-
*
|
|
277
|
-
* @param e {qx.event.type.Event} event object
|
|
278
|
-
*/
|
|
279
|
-
_onsending : function(e)
|
|
280
|
-
{
|
|
281
|
-
if (qx.core.Environment.get("qx.debug"))
|
|
282
|
-
{
|
|
283
|
-
if (qx.core.Environment.get("qx.debug.io.remote"))
|
|
284
|
-
{
|
|
285
|
-
this.__activeCount++;
|
|
286
|
-
e.getTarget()._counted = true;
|
|
287
|
-
|
|
288
|
-
this.debug("ActiveCount: " + this.__activeCount);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
e.getTarget().getRequest()._onsending(e);
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Listens for the "receiving" event of the transport object and delegate
|
|
298
|
-
* the event to the current request object.
|
|
299
|
-
*
|
|
300
|
-
* @param e {qx.event.type.Event} event object
|
|
301
|
-
*/
|
|
302
|
-
_onreceiving : function(e) {
|
|
303
|
-
e.getTarget().getRequest()._onreceiving(e);
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Listens for the "completed" event of the transport object and decreases
|
|
309
|
-
* the counter for active requests.
|
|
310
|
-
*
|
|
311
|
-
* @param e {qx.event.type.Event} event object
|
|
312
|
-
*/
|
|
313
|
-
_oncompleted : function(e)
|
|
314
|
-
{
|
|
315
|
-
if (qx.core.Environment.get("qx.debug"))
|
|
316
|
-
{
|
|
317
|
-
if (qx.core.Environment.get("qx.debug.io.remote"))
|
|
318
|
-
{
|
|
319
|
-
if (e.getTarget()._counted)
|
|
320
|
-
{
|
|
321
|
-
this.__activeCount--;
|
|
322
|
-
this.debug("ActiveCount: " + this.__activeCount);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// delegate the event to the handler method of the request depending
|
|
328
|
-
// on the current type of the event ( completed|aborted|timeout|failed )
|
|
329
|
-
var request = e.getTarget().getRequest();
|
|
330
|
-
var requestHandler = "_on" + e.getType();
|
|
331
|
-
|
|
332
|
-
// remove the request from the queue,
|
|
333
|
-
// keep local reference, see [BUG #4422]
|
|
334
|
-
this._remove(e.getTarget());
|
|
335
|
-
|
|
336
|
-
// It's possible that the request handler can fail, possibly due to
|
|
337
|
-
// being sent garbage data. We want to prevent that from crashing
|
|
338
|
-
// the program, but instead display an error.
|
|
339
|
-
try
|
|
340
|
-
{
|
|
341
|
-
if (request[requestHandler])
|
|
342
|
-
{
|
|
343
|
-
request[requestHandler](e);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
catch(ex)
|
|
347
|
-
{
|
|
348
|
-
this.error("Request " + request + " handler " + requestHandler +
|
|
349
|
-
" threw an error: ", ex);
|
|
350
|
-
|
|
351
|
-
// Issue an "aborted" event so the application gets notified.
|
|
352
|
-
// If that too fails, or if there's no "aborted" handler, ignore it.
|
|
353
|
-
try
|
|
354
|
-
{
|
|
355
|
-
if (request["_onaborted"])
|
|
356
|
-
{
|
|
357
|
-
var event = qx.event.Registration.createEvent("aborted",
|
|
358
|
-
qx.event.type.Event);
|
|
359
|
-
request["_onaborted"](event);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
catch(ex1)
|
|
363
|
-
{
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
/*
|
|
372
|
-
---------------------------------------------------------------------------
|
|
373
|
-
TIMEOUT HANDLING
|
|
374
|
-
---------------------------------------------------------------------------
|
|
375
|
-
*/
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Listens for the "interval" event of the transport object and checks
|
|
379
|
-
* if the active requests are timed out.
|
|
380
|
-
*
|
|
381
|
-
* @param e {qx.event.type.Event} event object
|
|
382
|
-
*/
|
|
383
|
-
_oninterval : function(e)
|
|
384
|
-
{
|
|
385
|
-
var vActive = this.__active;
|
|
386
|
-
|
|
387
|
-
if (vActive.length == 0)
|
|
388
|
-
{
|
|
389
|
-
this.__timer.stop();
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
var vCurrent = (new Date).valueOf();
|
|
394
|
-
var vTransport;
|
|
395
|
-
var vRequest;
|
|
396
|
-
var vDefaultTimeout = this.getDefaultTimeout();
|
|
397
|
-
var vTimeout;
|
|
398
|
-
var vTime;
|
|
399
|
-
|
|
400
|
-
for (var i=vActive.length-1; i>=0; i--)
|
|
401
|
-
{
|
|
402
|
-
vTransport = vActive[i];
|
|
403
|
-
vRequest = vTransport.getRequest();
|
|
404
|
-
|
|
405
|
-
if (vRequest.isAsynchronous())
|
|
406
|
-
{
|
|
407
|
-
vTimeout = vRequest.getTimeout();
|
|
408
|
-
|
|
409
|
-
// if timer is disabled...
|
|
410
|
-
if (vTimeout == 0)
|
|
411
|
-
{
|
|
412
|
-
// then ignore it.
|
|
413
|
-
continue;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
if (vTimeout == null) {
|
|
417
|
-
vTimeout = vDefaultTimeout;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
vTime = vCurrent - vTransport._start;
|
|
421
|
-
|
|
422
|
-
if (vTime > vTimeout)
|
|
423
|
-
{
|
|
424
|
-
this.warn("Timeout: transport " + vTransport.toHashCode());
|
|
425
|
-
this.warn(vTime + "ms > " + vTimeout + "ms");
|
|
426
|
-
vTransport.timeout();
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
},
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
/*
|
|
436
|
-
---------------------------------------------------------------------------
|
|
437
|
-
MODIFIERS
|
|
438
|
-
---------------------------------------------------------------------------
|
|
439
|
-
*/
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
// property apply
|
|
443
|
-
_applyEnabled : function(value, old)
|
|
444
|
-
{
|
|
445
|
-
if (value) {
|
|
446
|
-
this._check();
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
this.__timer.setEnabled(value);
|
|
450
|
-
},
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
/*
|
|
456
|
-
---------------------------------------------------------------------------
|
|
457
|
-
CORE METHODS
|
|
458
|
-
---------------------------------------------------------------------------
|
|
459
|
-
*/
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Add the request to the pending requests queue.
|
|
463
|
-
*
|
|
464
|
-
* @param vRequest {var} The request
|
|
465
|
-
*/
|
|
466
|
-
add : function(vRequest)
|
|
467
|
-
{
|
|
468
|
-
vRequest.setState("queued");
|
|
469
|
-
|
|
470
|
-
if (vRequest.isAsynchronous()) {
|
|
471
|
-
this.__queue.push(vRequest);
|
|
472
|
-
} else {
|
|
473
|
-
this.__queue.unshift(vRequest);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
this._check();
|
|
477
|
-
|
|
478
|
-
if (this.getEnabled()) {
|
|
479
|
-
this.__timer.start();
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Remove the request from the pending requests queue.
|
|
486
|
-
*
|
|
487
|
-
* The underlying transport of the request is forced into the aborted
|
|
488
|
-
* state ("aborted") and listeners of the "aborted"
|
|
489
|
-
* signal are notified about the event. If the request isn't in the
|
|
490
|
-
* pending requests queue, this method is a noop.
|
|
491
|
-
*
|
|
492
|
-
* @param vRequest {var} The request
|
|
493
|
-
*/
|
|
494
|
-
abort : function(vRequest)
|
|
495
|
-
{
|
|
496
|
-
var vTransport = vRequest.getTransport();
|
|
497
|
-
|
|
498
|
-
if (vTransport) {
|
|
499
|
-
vTransport.abort();
|
|
500
|
-
} else if (this.__queue.includes(vRequest)) {
|
|
501
|
-
qx.lang.Array.remove(this.__queue, vRequest);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
},
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
/*
|
|
510
|
-
*****************************************************************************
|
|
511
|
-
DESTRUCTOR
|
|
512
|
-
*****************************************************************************
|
|
513
|
-
*/
|
|
514
|
-
|
|
515
|
-
destruct : function()
|
|
516
|
-
{
|
|
517
|
-
this._disposeArray("__active");
|
|
518
|
-
this._disposeObjects("__timer");
|
|
519
|
-
this.__queue = null;
|
|
520
|
-
}
|
|
521
|
-
});
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/* ************************************************************************
|
|
2
|
-
|
|
3
|
-
qooxdoo - the new era of web development
|
|
4
|
-
|
|
5
|
-
http://qooxdoo.org
|
|
6
|
-
|
|
7
|
-
Copyright:
|
|
8
|
-
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
|
|
9
|
-
|
|
10
|
-
License:
|
|
11
|
-
MIT: https://opensource.org/licenses/MIT
|
|
12
|
-
See the LICENSE file in the project's top-level directory for details.
|
|
13
|
-
|
|
14
|
-
Authors:
|
|
15
|
-
* Sebastian Werner (wpbasti)
|
|
16
|
-
* Andreas Ecker (ecker)
|
|
17
|
-
|
|
18
|
-
************************************************************************ */
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* This class is used to work with the result of a HTTP request.
|
|
22
|
-
*/
|
|
23
|
-
qx.Class.define("qx.io.remote.Response",
|
|
24
|
-
{
|
|
25
|
-
extend : qx.event.type.Event,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/*
|
|
31
|
-
*****************************************************************************
|
|
32
|
-
PROPERTIES
|
|
33
|
-
*****************************************************************************
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
properties :
|
|
37
|
-
{
|
|
38
|
-
/*
|
|
39
|
-
---------------------------------------------------------------------------
|
|
40
|
-
PROPERTIES
|
|
41
|
-
---------------------------------------------------------------------------
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
/** State of the response. */
|
|
45
|
-
state :
|
|
46
|
-
{
|
|
47
|
-
check : "Integer",
|
|
48
|
-
nullable : true
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
/** Status code of the response. */
|
|
52
|
-
statusCode :
|
|
53
|
-
{
|
|
54
|
-
check : "Integer",
|
|
55
|
-
nullable : true
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
/** Content of the response. */
|
|
59
|
-
content :
|
|
60
|
-
{
|
|
61
|
-
nullable : true
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
/** The headers of the response. */
|
|
65
|
-
responseHeaders :
|
|
66
|
-
{
|
|
67
|
-
check : "Object",
|
|
68
|
-
nullable : true,
|
|
69
|
-
apply : "_applyResponseHeaders"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/*
|
|
77
|
-
*****************************************************************************
|
|
78
|
-
MEMBERS
|
|
79
|
-
*****************************************************************************
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
members :
|
|
83
|
-
{
|
|
84
|
-
__lowerHeaders: null,
|
|
85
|
-
|
|
86
|
-
/*
|
|
87
|
-
---------------------------------------------------------------------------
|
|
88
|
-
USER METHODS
|
|
89
|
-
---------------------------------------------------------------------------
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
// overridden
|
|
93
|
-
clone : function(embryo)
|
|
94
|
-
{
|
|
95
|
-
var clone = this.base(arguments, embryo);
|
|
96
|
-
clone.setType(this.getType());
|
|
97
|
-
clone.setState(this.getState());
|
|
98
|
-
clone.setStatusCode(this.getStatusCode());
|
|
99
|
-
clone.setContent(this.getContent());
|
|
100
|
-
clone.setResponseHeaders(this.getResponseHeaders());
|
|
101
|
-
return clone;
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Returns a specific response header
|
|
107
|
-
* @param vHeader {String} Response header name
|
|
108
|
-
* @return {Object | null} The header value or null;
|
|
109
|
-
*/
|
|
110
|
-
getResponseHeader : function(vHeader)
|
|
111
|
-
{
|
|
112
|
-
if (this.__lowerHeaders) {
|
|
113
|
-
return this.__lowerHeaders[vHeader.toLowerCase()] || null;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return null;
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Keep lower-cased shadow of response headers for later
|
|
121
|
-
* case-insensitive matching.
|
|
122
|
-
*
|
|
123
|
-
* @param value {var} Current value
|
|
124
|
-
* @param old {var} Previous value
|
|
125
|
-
*/
|
|
126
|
-
_applyResponseHeaders : function(value, old) {
|
|
127
|
-
var lowerHeaders = {};
|
|
128
|
-
|
|
129
|
-
if (value !== null) {
|
|
130
|
-
Object.keys(value).forEach(function(key) {
|
|
131
|
-
lowerHeaders[key.toLowerCase()] = value[key];
|
|
132
|
-
});
|
|
133
|
-
this.__lowerHeaders = lowerHeaders;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
});
|