diff --git a/4chan_x.user.js b/4chan_x.user.js index d454767c4..2f319a5ad 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1278,9 +1278,19 @@ if (conf['Auto Hide QR']) { $('#autohide', qr.el).checked = true; } - return qr.push.call(this); + return qr.captchaPush.call(this); } }, + captchaPush: function() { + var l; + l = qr.captcha.push({ + challenge: $('#recaptcha_challenge_field', qr.el).value, + response: this.value + }); + this.nextSibling.textContent = l + ' captcha cached'; + Recaptcha.reload(); + return this.value = ''; + }, close: function() { $.rm(qr.el); return qr.el = null; @@ -1350,16 +1360,6 @@ quote = $('a.quotejs:not(:first-child)', root); return $.bind(quote, 'click', qr.quote); }, - push: function() { - var l; - l = qr.captcha.push({ - challenge: $('#recaptcha_challenge_field', qr.el).value, - response: this.value - }); - this.nextSibling.textContent = l + ' captcha cached'; - Recaptcha.reload(); - return this.value = ''; - }, quote: function(e) { var id, s, selection, selectionID, ta, text, _ref; if (e) { diff --git a/script.coffee b/script.coffee index 7ba4c80f6..9c2ebb627 100644 --- a/script.coffee +++ b/script.coffee @@ -971,7 +971,6 @@ qr = # rm Recaptcha # group captcha # error too large error should happen on attach - # attaching = persistent qr init: -> g.callbacks.push qr.node $.bind window, 'message', qr.message @@ -1011,7 +1010,15 @@ qr = 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.push.call this + qr.captchaPush.call this + + captchaPush: -> + l = qr.captcha.push + challenge: $('#recaptcha_challenge_field', qr.el).value + response: @value + @nextSibling.textContent = l + ' captcha cached' + Recaptcha.reload() + @value = '' close: -> $.rm qr.el @@ -1094,14 +1101,6 @@ qr = quote = $ 'a.quotejs:not(:first-child)', root $.bind quote, 'click', qr.quote - push: -> - l = qr.captcha.push - challenge: $('#recaptcha_challenge_field', qr.el).value - response: @value - @nextSibling.textContent = l + ' captcha cached' - Recaptcha.reload() - @value = '' - quote: (e) -> e.preventDefault() if e