update packaged ace
This commit is contained in:
parent
5cc67ba146
commit
a5eb376e4c
133 changed files with 13027 additions and 3335 deletions
29
build/pilot/proxy.js
Normal file
29
build/pilot/proxy.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
define(function(i, f) {
|
||||
var j = i("pilot/promise").Promise;
|
||||
f.xhr = function(c, g, h, e) {
|
||||
var d = new j;
|
||||
if(!skywriter.proxy || !skywriter.proxy.xhr) {
|
||||
var a = new XMLHttpRequest;
|
||||
a.onreadystatechange = function() {
|
||||
if(a.readyState === 4) {
|
||||
var b = a.status;
|
||||
if(b !== 0 && b !== 200) {
|
||||
b = new Error(a.responseText + " (Status " + a.status + ")");
|
||||
b.xhr = a;
|
||||
d.reject(b)
|
||||
}else {
|
||||
d.resolve(a.responseText)
|
||||
}
|
||||
}
|
||||
}.bind(this);
|
||||
a.open("GET", g, h);
|
||||
e && e(a);
|
||||
a.send()
|
||||
}else {
|
||||
skywriter.proxy.xhr.call(this, c, g, h, e, d)
|
||||
}return d
|
||||
};
|
||||
f.Worker = function(c) {
|
||||
return!skywriter.proxy || !skywriter.proxy.worker ? new Worker(c) : new skywriter.proxy.worker(c)
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue