Do not ban/disable the QR on connection error.

This commit is contained in:
Nicolas Stepien 2012-03-29 05:28:18 +02:00
parent 6f9b6641de
commit f1ef6dfd2b
2 changed files with 16 additions and 4 deletions

View File

@ -1994,11 +1994,17 @@
return QR.response(data.html); return QR.response(data.html);
case 'status': case 'status':
return QR.status(data); return QR.status(data);
case 'connection error':
return QR.error('_', $.el('a', {
href: '//www.4chan.org/banned',
target: '_blank',
textContent: 'Connection error, or you are banned.'
}));
case 'banned': case 'banned':
QR.error('_', $.el('a', { QR.error('_', $.el('a', {
href: '//www.4chan.org/banned', href: '//www.4chan.org/banned',
target: '_blank', target: '_blank',
textContent: 'Connection error, or you are banned.' textContent: 'You are banned.'
})); }));
return QR.status({ return QR.status({
ready: true, ready: true,
@ -2072,7 +2078,7 @@
}, },
onerror: function() { onerror: function() {
return QR.message.send({ return QR.message.send({
req: 'banned' req: 'connection error'
}); });
} }
}; };

View File

@ -1676,11 +1676,16 @@ QR =
QR.response data.html QR.response data.html
when 'status' when 'status'
QR.status data QR.status data
when 'banned' when 'connection error'
QR.error '_', $.el 'a', QR.error '_', $.el 'a',
href: '//www.4chan.org/banned' href: '//www.4chan.org/banned'
target: '_blank' target: '_blank'
textContent: 'Connection error, or you are banned.' textContent: 'Connection error, or you are banned.'
when 'banned'
QR.error '_', $.el 'a',
href: '//www.4chan.org/banned'
target: '_blank'
textContent: 'You are banned.'
# Disable iframe reloading # Disable iframe reloading
QR.status ready: true, banned: true QR.status ready: true, banned: true
else else
@ -1742,8 +1747,9 @@ QR =
req: 'response' req: 'response'
html: @response html: @response
onerror: -> onerror: ->
# Connection error, or
# CORS disabled error: redirecting to banned page ;_; # CORS disabled error: redirecting to banned page ;_;
QR.message.send req: 'banned' QR.message.send req: 'connection error'
opts = opts =
form: form form: form
type: 'post' type: 'post'