From f1ef6dfd2b16f84291e662873213ef5b71277c84 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 29 Mar 2012 05:28:18 +0200 Subject: [PATCH] Do not ban/disable the QR on connection error. --- 4chan_x.user.js | 10 ++++++++-- script.coffee | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 3d77eb90b..d34578e03 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1994,11 +1994,17 @@ return QR.response(data.html); case 'status': 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': QR.error('_', $.el('a', { href: '//www.4chan.org/banned', target: '_blank', - textContent: 'Connection error, or you are banned.' + textContent: 'You are banned.' })); return QR.status({ ready: true, @@ -2072,7 +2078,7 @@ }, onerror: function() { return QR.message.send({ - req: 'banned' + req: 'connection error' }); } }; diff --git a/script.coffee b/script.coffee index c7c3d30fc..fd50fadd0 100644 --- a/script.coffee +++ b/script.coffee @@ -1676,11 +1676,16 @@ QR = QR.response data.html when 'status' QR.status data - when 'banned' + when 'connection error' QR.error '_', $.el 'a', href: '//www.4chan.org/banned' target: '_blank' 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 QR.status ready: true, banned: true else @@ -1742,8 +1747,9 @@ QR = req: 'response' html: @response onerror: -> + # Connection error, or # CORS disabled error: redirecting to banned page ;_; - QR.message.send req: 'banned' + QR.message.send req: 'connection error' opts = form: form type: 'post'