diff --git a/4chan_x.user.js b/4chan_x.user.js index 99e93219b..b10c37f0d 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1263,7 +1263,12 @@ return $('#recaptcha_challenge_field', qr.el).value = target.value; }, captchaKeydown: function(e) { - if (e.keyCode !== 13 || (!cooldown.duration || ($('textarea', qr.el).value || $('#qr_form input[type=file]', qr.el).length))) { + var blank; + if (e.keyCode !== 13) { + return; + } + blank = !$('textarea', qr.el).value && !$('input[type=file]', qr.el).files.length; + if (!(blank || cooldown.duration)) { return; } $('#auto', qr.el).checked = true; diff --git a/script.coffee b/script.coffee index f43d770f8..efe1ecb59 100644 --- a/script.coffee +++ b/script.coffee @@ -997,8 +997,11 @@ qr = $('#recaptcha_challenge_field', qr.el).value = target.value captchaKeydown: (e) -> - return if e.keyCode isnt 13 or (!cooldown.duration or - ($('textarea', qr.el).value or $('#qr_form input[type=file]', qr.el).length)) + return unless e.keyCode is 13 #enter + + blank = !$('textarea', qr.el).value and !$('input[type=file]', qr.el).files.length + return unless blank or cooldown.duration + $('#auto', qr.el).checked = true $('#autohide', qr.el).checked = true if conf['Auto Hide QR'] qr.captchaPush.call this