From fe5e0a08d4be01a1f602c0cea47565729eaa62a2 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 26 Jan 2012 02:41:20 +0100 Subject: [PATCH] Disable auto-posting if there is an error before post submission. --- 4chan_x.user.js | 4 +++- script.coffee | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 356d50959..028c8822b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1287,7 +1287,7 @@ } if (!qr.el) return; input = qr.status.input; - input.value = qr.cooldown.auto ? value ? "Auto " + value : 'Auto' : value || 'Submit'; + input.value = qr.cooldown.auto && conf['Cooldown'] ? value ? "Auto " + value : 'Auto' : value || 'Submit'; return input.disabled = disabled || false; }, cooldown: { @@ -1653,6 +1653,8 @@ if (!response) err = 'No valid captcha.'; } if (err) { + qr.cooldown.auto = false; + qr.status(); qr.error(err); return; } diff --git a/script.coffee b/script.coffee index ab604180d..fab45e68b 100644 --- a/script.coffee +++ b/script.coffee @@ -929,7 +929,7 @@ qr = return unless qr.el {input} = qr.status input.value = - if qr.cooldown.auto + if qr.cooldown.auto and conf['Cooldown'] if value then "Auto #{value}" else 'Auto' else value or 'Submit' @@ -1223,6 +1223,9 @@ qr = err = 'No valid captcha.' if err + # stop auto-posting + qr.cooldown.auto = false + qr.status() qr.error err return qr.cleanError()