diff --git a/4chan_x.user.js b/4chan_x.user.js index f8a4d21d7..f2178522b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -4930,11 +4930,23 @@ case 'sys.4chan.org': if (/report/.test(location.search)) { $.ready(function() { - return $.on($.id('recaptcha_response_field'), 'keydown', function(e) { + var field, form; + form = $('form'); + field = $.id('recaptcha_response_field'); + $.on(field, 'keydown', function(e) { if (e.keyCode === 8 && !e.target.value) { return window.location = 'javascript:Recaptcha.reload()'; } }); + return $.on(form, 'submit', function(e) { + var response; + e.preventDefault(); + response = field.value.trim(); + if (!/\s/.test(response)) { + field.value = "" + response + " " + response; + } + return form.submit(); + }); }); } return; diff --git a/changelog b/changelog index 3bdf29f28..c292dc797 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,6 @@ master - Mayhem + One-word-captcha now works in the report window. Fix duplicate file upload error link. 2.34.8 diff --git a/script.coffee b/script.coffee index da687f053..634a33c4c 100644 --- a/script.coffee +++ b/script.coffee @@ -3855,8 +3855,15 @@ Main = when 'sys.4chan.org' if /report/.test location.search $.ready -> - $.on $.id('recaptcha_response_field'), 'keydown', (e) -> + form = $ 'form' + field = $.id 'recaptcha_response_field' + $.on field, 'keydown', (e) -> window.location = 'javascript:Recaptcha.reload()' if e.keyCode is 8 and not e.target.value + $.on form, 'submit', (e) -> + e.preventDefault() + response = field.value.trim() + field.value = "#{response} #{response}" unless /\s/.test response + form.submit() return when 'images.4chan.org' $.ready ->