diff --git a/4chan_x.user.js b/4chan_x.user.js index 869ba9669..67de2b56e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1323,7 +1323,6 @@ }, message: function(e) { var data, duration, fileCount; - Recaptcha.reload(); $('iframe[name=iframe]').src = 'about:blank'; fileCount = $('#files', qr.el).childElementCount; data = e.data; @@ -1363,7 +1362,7 @@ return $.bind(quote, 'click', qr.quote); }, postInvalid: function() { - var captcha, captchas, content, cutoff; + var captcha, captchas, content, cutoff, dummy, response; content = $('textarea', qr.el).value || $('input[type=file]', qr.el).files.length; if (!content) { return 'Error: No text entered.'; @@ -1382,7 +1381,16 @@ $.set('captchas', captchas); $('#captchas', qr.el).textContent = captchas.length + ' captchas'; if (!captcha) { - return 'You forgot to type in the verification.'; + dummy = $('#dummy', qr.el); + if (!(response = dummy.value)) { + return 'You forgot to type in the verification'; + } + captcha = { + challenge: qr.challenge, + response: response + }; + dummy.value = ''; + Recaptcha.reload(); } $('#recaptcha_challenge_field', qr.el).value = captcha.challenge; $('#recaptcha_response_field', qr.el).value = captcha.response; diff --git a/script.coffee b/script.coffee index 4e0ffd92d..f8d73fbd3 100644 --- a/script.coffee +++ b/script.coffee @@ -1076,7 +1076,6 @@ qr = $.append d.body, qr.el message: (e) -> - Recaptcha.reload() $('iframe[name=iframe]').src = 'about:blank' fileCount = $('#files', qr.el).childElementCount @@ -1128,7 +1127,14 @@ qr = $('#captchas', qr.el).textContent = captchas.length + ' captchas' - return 'You forgot to type in the verification.' unless captcha + unless captcha + dummy = $ '#dummy', qr.el + return 'You forgot to type in the verification' unless response = dummy.value + captcha = + challenge: qr.challenge + response: response + dummy.value = '' + Recaptcha.reload() $('#recaptcha_challenge_field', qr.el).value = captcha.challenge $('#recaptcha_response_field', qr.el).value = captcha.response