save captcha correctly

This commit is contained in:
James Campos 2011-08-10 20:28:55 -07:00
parent 56e583c87f
commit 0c0846441f
2 changed files with 7 additions and 5 deletions

View File

@ -1281,7 +1281,7 @@
return qr.captchaTime = Date.now(); return qr.captchaTime = Date.now();
}, },
captchaKeydown: function(e) { captchaKeydown: function(e) {
var blank, captcha, l; var blank, captcha;
if (!(e.keyCode === 13 && this.value)) { if (!(e.keyCode === 13 && this.value)) {
return; return;
} }
@ -1294,12 +1294,13 @@
$('#autohide', qr.el).checked = true; $('#autohide', qr.el).checked = true;
} }
captcha = $.get('captcha', []); captcha = $.get('captcha', []);
l = captcha.push({ captcha.push({
challenge: $('#recaptcha_challenge_field', qr.el).value, challenge: $('#recaptcha_challenge_field', qr.el).value,
response: this.value, response: this.value,
time: qr.captchaTime time: qr.captchaTime
}); });
this.nextSibling.textContent = l + ' captcha cached'; $.set('captcha', captcha);
this.nextSibling.textContent = captcha.length + ' captcha cached';
Recaptcha.reload(); Recaptcha.reload();
return this.value = ''; return this.value = '';
}, },

View File

@ -1027,11 +1027,12 @@ qr =
$('#autohide', qr.el).checked = true if conf['Auto Hide QR'] $('#autohide', qr.el).checked = true if conf['Auto Hide QR']
captcha = $.get 'captcha', [] captcha = $.get 'captcha', []
l = captcha.push captcha.push
challenge: $('#recaptcha_challenge_field', qr.el).value challenge: $('#recaptcha_challenge_field', qr.el).value
response: @value response: @value
time: qr.captchaTime time: qr.captchaTime
@nextSibling.textContent = l + ' captcha cached' $.set 'captcha', captcha
@nextSibling.textContent = captcha.length + ' captcha cached'
Recaptcha.reload() Recaptcha.reload()
@value = '' @value = ''