diff --git a/4chan_x.user.js b/4chan_x.user.js index 77985dc8c..a58b99d39 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1529,6 +1529,9 @@ }, submit: function(e) { var captcha, challenge, el, id, input, op, qr, response, _ref; + if ($('form button', qr).disabled) { + return; + } if (!($('textarea', QR.qr).value || ((_ref = $('[type=file]', QR.qr)) != null ? _ref.files.length : void 0))) { if (e) { alert('Error: No text entered.'); @@ -1557,7 +1560,7 @@ if (input = $('#files input', qr)) { input.setAttribute('form', 'qr_form'); } - if (!(e || $('form button', qr).disabled)) { + if (!e) { $('#qr_form', qr).submit(); } QR.sage = /sage/i.test($('[name=email]', qr).value); diff --git a/script.coffee b/script.coffee index d9645b4da..4e05d276a 100644 --- a/script.coffee +++ b/script.coffee @@ -1176,6 +1176,7 @@ QR = $('[name=spoiler]', QR.qr)?.checked = false unless conf['Remember Spoiler'] $('textarea', QR.qr).value = '' submit: (e) -> + return if $('form button', qr).disabled #XXX e is undefined if method is called explicitly, eg, from auto posting unless $('textarea', QR.qr).value or $('[type=file]', QR.qr)?.files.length if e @@ -1196,8 +1197,7 @@ QR = $('#autohide', qr).checked = true if conf['Auto Hide QR'] if input = $ '#files input', qr input.setAttribute 'form', 'qr_form' - if not (e or $('form button', qr).disabled) - $('#qr_form', qr).submit() + $('#qr_form', qr).submit() if not e QR.sage = /sage/i.test $('[name=email]', qr).value if conf['Thread Watcher'] and conf['Auto Watch Reply'] id = $('input[name=resto]', qr.el).value