diff --git a/4chan_x.user.js b/4chan_x.user.js index 21a54faab..13c6fe736 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1263,13 +1263,14 @@ return $('#recaptcha_challenge_field', qr.el).value = target.value; }, captchaKeydown: function(e) { - if (e.keyCode === 13 && cooldown.duration) { - $('#auto', qr.el).checked = true; - if (conf['Auto Hide QR']) { - $('#autohide', qr.el).checked = true; - } - return qr.captchaPush.call(this); + if (e.keyCode !== 13 || (!cooldown.duration || ($('textarea', qr.el).value || $('#qr_form input[type=file]', qr.el).length))) { + return; } + $('#auto', qr.el).checked = true; + if (conf['Auto Hide QR']) { + $('#autohide', qr.el).checked = true; + } + return qr.captchaPush.call(this); }, captchaPush: function() { var l; diff --git a/script.coffee b/script.coffee index e14e490fa..a65912f2b 100644 --- a/script.coffee +++ b/script.coffee @@ -997,10 +997,11 @@ qr = $('#recaptcha_challenge_field', qr.el).value = target.value captchaKeydown: (e) -> - if e.keyCode is 13 and cooldown.duration # press enter to enable auto-post if cooldown is still running - $('#auto', qr.el).checked = true - $('#autohide', qr.el).checked = true if conf['Auto Hide QR'] - qr.captchaPush.call this + return if e.keyCode isnt 13 or (!cooldown.duration or + ($('textarea', qr.el).value or $('#qr_form input[type=file]', qr.el).length)) + $('#auto', qr.el).checked = true + $('#autohide', qr.el).checked = true if conf['Auto Hide QR'] + qr.captchaPush.call this captchaPush: -> l = qr.captcha.push