|
38 | 38 | return output; |
39 | 39 | } |
40 | 40 |
|
| 41 | + var DataUtils = StrandLib.DataUtils; |
| 42 | + var BehaviorUtils = StrandLib.BehaviorUtils; |
| 43 | + var Request = StrandLib.Request; |
| 44 | + var RequestQueue = StrandLib.RequestQueue; |
| 45 | + |
41 | 46 | function Ajax(options) { |
42 | 47 | this._eventPrefix = _eventPrefix; |
43 | 48 | this.recent = {}; |
44 | 49 | this.requests = []; |
45 | | - this.options = StrandLib.DataUtils.copy({},{ |
| 50 | + this.options = DataUtils.copy({},{ |
46 | 51 | "contentType":"application/x-www-form-urlencoded", |
47 | | - "method":StrandLib.Request.GET, |
| 52 | + "method":Request.GET, |
48 | 53 | "withCredentials":false, |
49 | 54 | "timeout":10000 |
50 | 55 | }, options); |
51 | 56 | } |
52 | 57 |
|
53 | | - Ajax.GET = StrandLib.Request.GET; |
54 | | - Ajax.POST = StrandLib.Request.POST; |
55 | | - Ajax.PUT = StrandLib.Request.PUT; |
56 | | - Ajax.DELETE = StrandLib.Request.DELETE; |
| 58 | + Ajax.GET = Request.GET; |
| 59 | + Ajax.POST = Request.POST; |
| 60 | + Ajax.PUT = Request.PUT; |
| 61 | + Ajax.DELETE = Request.DELETE; |
57 | 62 |
|
58 | 63 | Ajax.prototype = { |
59 | 64 |
|
|
66 | 71 |
|
67 | 72 | execQueue: function(queueName) { |
68 | 73 | var q = this._getQueue(queueName); |
69 | | - var rq = new StrandLib.RequestQueue(q, this.options.concurrency, function(r) { |
| 74 | + var rq = new RequestQueue(q, this.options.concurrency, function(r) { |
70 | 75 | this.current = r; |
71 | 76 | }.bind(this)); |
72 | 77 | rq.exec(); |
|
101 | 106 |
|
102 | 107 | _requestFactory: function(data, options) { |
103 | 108 |
|
104 | | - var copy = StrandLib.DataUtils.copy; |
| 109 | + var copy = DataUtils.copy; |
105 | 110 |
|
106 | 111 | options = copy({}, this.options, options); |
107 | 112 |
|
108 | 113 | var url = this.serializeUrl(options.url, options.urlParams); |
109 | 114 | url = this.serializeQuery(url, options.query); |
110 | 115 | data = this.setRequestData(options.method, options.contentType, data, options.body); |
111 | 116 |
|
112 | | - return new StrandLib.Request(copy(options, { |
| 117 | + return new Request(copy(options, { |
113 | 118 | url: url, |
114 | 119 | body: data, |
115 | 120 | })); |
|
165 | 170 | if (typeof override === "string") { |
166 | 171 | return override; |
167 | 172 | } else { |
168 | | - input = StrandLib.DataUtils.copy({}, body, override); |
| 173 | + input = DataUtils.copy({}, body, override); |
169 | 174 | } |
170 | 175 | } else { |
171 | 176 | input = body; |
|
232 | 237 | // this.dispatchEvent(new CustomEvent(_eventPrefix + "error", {error:e, instance:this})); |
233 | 238 | } |
234 | 239 | } |
235 | | - if ( StrandLib.DataUtils.isType(data, "array") ) { |
| 240 | + if ( DataUtils.isType(data, "array") ) { |
236 | 241 | for (i = data.length - 1; i >= 0; i--) { |
237 | 242 | obj = data[i]; |
238 | 243 | if (obj.name !== null && obj.value !== null) { |
|
275 | 280 |
|
276 | 281 |
|
277 | 282 | Ajax.getBehavior = function() { |
278 | | - var beh = StrandLib.BehaviorUtils.extend({},Ajax.prototype,{ |
| 283 | + var beh = BehaviorUtils.extend({},Ajax.prototype,{ |
279 | 284 | properties: { |
280 | 285 | url: { |
281 | 286 | notify: true |
|
0 commit comments