diff --git a/4chan_x.user.js b/4chan_x.user.js index fe7630925..76bb7bb43 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1237,7 +1237,8 @@ }); $.append(d.body, iframe); $.bind(window, 'message', qr.cb.message); - return $('#recaptcha_response_field').id = ''; + $('#recaptcha_response_field').id = ''; + return qr.captcha = []; }, autohide: { set: function() { @@ -1296,6 +1297,13 @@ return qr.quote(this); } }, + push: function() { + this.nextSibling.textContent = qr.captcha.push({ + challenge: $('input[name=recaptcha_challenge_field]', qr.el).value, + response: this.value + }); + return Recaptcha.reload(); + }, submit: function(e) { var id, inputfile, isQR, op; if (conf['Auto Watch Reply'] && conf['Thread Watcher']) { @@ -1373,7 +1381,7 @@ THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id; spoiler = $('.postarea label') ? '' : ''; challenge = $('input[name=recaptcha_challenge_field]').value; - html = "
Quick Reply X
" + spoiler + "
Upload another file
"; + html = "
Quick Reply X
" + spoiler + "
0
upload another file
"; qr.el = ui.dialog('qr', { top: '0px', left: '0px' @@ -2467,8 +2475,9 @@ if (e.keyCode === 13 && cooldown.duration) { $('#auto', qr.el).checked = true; if (conf['Auto Hide QR']) { - return qr.autohide.set(); + qr.autohide.set(); } + return qr.push.call(this); } }, reload: function() { diff --git a/script.coffee b/script.coffee index afb5c8a8d..a8f61223d 100644 --- a/script.coffee +++ b/script.coffee @@ -966,6 +966,7 @@ qr = #hack - nuke id so it doesn't grab focus when reloading $('#recaptcha_response_field').id = '' + qr.captcha = [] autohide: set: -> @@ -1013,6 +1014,12 @@ qr = e.preventDefault() qr.quote @ + push: -> + @nextSibling.textContent = qr.captcha.push + challenge: $('input[name=recaptcha_challenge_field]', qr.el).value + response: @value + Recaptcha.reload() + submit: (e) -> if conf['Auto Watch Reply'] and conf['Thread Watcher'] if g.REPLY and $('img.favicon').src is Favicon.empty @@ -1092,9 +1099,9 @@ qr =
-
Upload another file
+
0
-
+
upload another file
@@ -1863,6 +1870,7 @@ Recaptcha = if e.keyCode is 13 and cooldown.duration # press enter to enable auto-post if cooldown is still running $('#auto', qr.el).checked = true qr.autohide.set() if conf['Auto Hide QR'] + qr.push.call this reload: -> window.location = 'javascript:Recaptcha.reload()' reloaded: (e) ->