From 0c0846441fea147fa44156f7c6840ddd378d30fe Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 10 Aug 2011 20:28:55 -0700 Subject: [PATCH] save captcha correctly --- 4chan_x.user.js | 7 ++++--- script.coffee | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index e62aa5283..250f786e8 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1281,7 +1281,7 @@ return qr.captchaTime = Date.now(); }, captchaKeydown: function(e) { - var blank, captcha, l; + var blank, captcha; if (!(e.keyCode === 13 && this.value)) { return; } @@ -1294,12 +1294,13 @@ $('#autohide', qr.el).checked = true; } captcha = $.get('captcha', []); - l = captcha.push({ + captcha.push({ challenge: $('#recaptcha_challenge_field', qr.el).value, response: this.value, time: qr.captchaTime }); - this.nextSibling.textContent = l + ' captcha cached'; + $.set('captcha', captcha); + this.nextSibling.textContent = captcha.length + ' captcha cached'; Recaptcha.reload(); return this.value = ''; }, diff --git a/script.coffee b/script.coffee index 578a37640..186be84bb 100644 --- a/script.coffee +++ b/script.coffee @@ -1027,11 +1027,12 @@ qr = $('#autohide', qr.el).checked = true if conf['Auto Hide QR'] captcha = $.get 'captcha', [] - l = captcha.push + captcha.push challenge: $('#recaptcha_challenge_field', qr.el).value response: @value time: qr.captchaTime - @nextSibling.textContent = l + ' captcha cached' + $.set 'captcha', captcha + @nextSibling.textContent = captcha.length + ' captcha cached' Recaptcha.reload() @value = ''