This commit is contained in:
Nicolas Stepien 2012-03-19 23:19:46 +01:00
parent 991c88fc75
commit 4ea4dc863b
2 changed files with 12 additions and 17 deletions

View File

@ -2079,6 +2079,13 @@
req: 'response',
html: this.response
});
},
onerror: function() {
return qr.message.send({
req: 'status',
ready: true,
banned: true
});
}
};
opts = {
@ -2104,17 +2111,7 @@
'Content-Type': 'multipart/form-data;boundary=' + boundary
};
}
try {
return qr.ajax = $.ajax(url, callbacks, opts);
} catch (e) {
if (e.name === 'NETWORK_ERR') {
return qr.message.send({
req: 'status',
ready: true,
banned: true
});
}
}
return qr.ajax = $.ajax(url, callbacks, opts);
}
}
};

View File

@ -1747,6 +1747,9 @@ qr =
qr.message.send
req: 'response'
html: @response
onerror: ->
# CORS disabled error: redirecting to banned page ;_;
qr.message.send req: 'status', ready: true, banned: true
opts =
form: form
type: 'post'
@ -1763,12 +1766,7 @@ qr =
opts.headers =
'Content-Type': 'multipart/form-data;boundary=' + boundary
try
qr.ajax = $.ajax url, callbacks, opts
catch e
# CORS disabled error: redirecting to banned page ;_;
if e.name is 'NETWORK_ERR'
qr.message.send req: 'status', ready: true, banned: true
qr.ajax = $.ajax url, callbacks, opts
Options =
init: ->