Give the status and status code on QR reponse if it isn't 200.
This commit is contained in:
parent
e8c54cc6e0
commit
22c341e46d
@ -6417,7 +6417,7 @@
|
||||
};
|
||||
callbacks = {
|
||||
onload: function() {
|
||||
return QR.response(this.response);
|
||||
return QR.response(this);
|
||||
},
|
||||
onerror: function() {
|
||||
delete QR.ajax;
|
||||
@ -6447,11 +6447,11 @@
|
||||
};
|
||||
return QR.ajax = $.ajax($.id('postForm').parentNode.action, callbacks, opts);
|
||||
},
|
||||
response: function(html) {
|
||||
response: function(req) {
|
||||
var ban, board, err, h1, persona, postID, reply, threadID, tmpDoc, _, _ref, _ref1;
|
||||
delete QR.ajax;
|
||||
tmpDoc = d.implementation.createHTMLDocument('');
|
||||
tmpDoc.documentElement.innerHTML = html;
|
||||
tmpDoc.documentElement.innerHTML = req.response;
|
||||
if (ban = $('.banType', tmpDoc)) {
|
||||
board = $('.board', tmpDoc).innerHTML;
|
||||
err = $.el('span', {
|
||||
@ -6463,6 +6463,8 @@
|
||||
}
|
||||
} else if (tmpDoc.title !== 'Post successful!') {
|
||||
err = 'Connection error with sys.4chan.org.';
|
||||
} else if (req.status !== 200) {
|
||||
err = "Error " + req.statusText + " (" + req.status + ")";
|
||||
}
|
||||
if (err) {
|
||||
if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
|
||||
|
||||
@ -720,7 +720,7 @@ QR =
|
||||
|
||||
callbacks =
|
||||
onload: ->
|
||||
QR.response @response
|
||||
QR.response @
|
||||
onerror: ->
|
||||
delete QR.ajax
|
||||
# Connection error, or
|
||||
@ -743,11 +743,11 @@ QR =
|
||||
|
||||
QR.ajax = $.ajax $.id('postForm').parentNode.action, callbacks, opts
|
||||
|
||||
response: (html) ->
|
||||
response: (req) ->
|
||||
delete QR.ajax
|
||||
|
||||
tmpDoc = d.implementation.createHTMLDocument ''
|
||||
tmpDoc.documentElement.innerHTML = html
|
||||
tmpDoc.documentElement.innerHTML = req.response
|
||||
if ban = $ '.banType', tmpDoc # banned/warning
|
||||
board = $('.board', tmpDoc).innerHTML
|
||||
err = $.el 'span', innerHTML:
|
||||
@ -761,6 +761,8 @@ QR =
|
||||
$('a', err)?.target = '_blank' # duplicate image link
|
||||
else if tmpDoc.title isnt 'Post successful!'
|
||||
err = 'Connection error with sys.4chan.org.'
|
||||
else if req.status isnt 200
|
||||
err = "Error #{req.statusText} (#{req.status})"
|
||||
|
||||
if err
|
||||
if /captcha|verification/i.test(err.textContent) or err is 'Connection error with sys.4chan.org.'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user