captcha cached

This commit is contained in:
James Campos 2011-08-06 19:22:28 -07:00
parent 48e3fb74d6
commit 239bcc25c8
2 changed files with 9 additions and 6 deletions

View File

@ -1257,7 +1257,7 @@
if (!responseField.value && (captcha = qr.captcha.shift())) {
$('#recaptcha_challenge_field', qr.el).value = captcha.challenge;
responseField.value = captcha.response;
responseField.nextSibling.textContent = qr.captcha.length;
responseField.nextSibling.textContent = qr.captcha.length + ' captcha cached';
}
return qr.submit.call($('form', qr.el));
},
@ -1290,7 +1290,7 @@
THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id;
spoiler = $('.postarea label') ? '<label> [<input type=checkbox name=spoiler>Spoiler Image?]</label>' : '';
challenge = $('#recaptcha_challenge_field').value;
html = " <a id=close title=close>X</a> <input type=checkbox id=autohide title=autohide> <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form> Quick Reply </div> <form name=post action=http://sys.4chan.org/" + g.BOARD + "/post method=POST enctype=multipart/form-data target=iframe id=qr_form> <input type=hidden name=resto value=" + THREAD_ID + "> <input type=hidden name=recaptcha_challenge_field id=recaptcha_challenge_field value=" + challenge + "> <div><input class=inputtext type=text name=email placeholder=E-mail>" + spoiler + "</div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=" + submitValue + " id=com_submit " + submitDisabled + "><label><input type=checkbox id=auto>auto</label></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div><img src=http://www.google.com/recaptcha/api/image?c=" + challenge + "></div> <div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off id=recaptcha_response_field><a name=captcha title='captcha cached'>0</a></div> <div><input type=file name=upfile></div> <div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password><input type=hidden name=mode value=regist><a name=attach>attach another file</a></div> </form> <div id=files></div> <a id=error class=error></a> ";
html = " <a id=close title=close>X</a> <input type=checkbox id=autohide title=autohide> <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form> Quick Reply </div> <form name=post action=http://sys.4chan.org/" + g.BOARD + "/post method=POST enctype=multipart/form-data target=iframe id=qr_form> <input type=hidden name=resto value=" + THREAD_ID + "> <input type=hidden name=recaptcha_challenge_field id=recaptcha_challenge_field value=" + challenge + "> <div><input class=inputtext type=text name=email placeholder=E-mail>" + spoiler + "</div> <div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=" + submitValue + " id=com_submit " + submitDisabled + "><label><input type=checkbox id=auto>auto</label></div> <div><textarea class=inputtext name=com placeholder=Comment></textarea></div> <div><img src=http://www.google.com/recaptcha/api/image?c=" + challenge + "></div> <div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off id=recaptcha_response_field>0 captcha cached</div> <div><input type=file name=upfile></div> <div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password><input type=hidden name=mode value=regist><a name=attach>attach another file</a></div> </form> <div id=files></div> <a id=error class=error></a> ";
qr.el = ui.dialog('qr', {
top: '0px',
left: '0px'
@ -1347,10 +1347,12 @@
return $.bind(quote, 'click', qr.quote);
},
push: function() {
this.nextSibling.textContent = qr.captcha.push({
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 = '';
},

View File

@ -997,7 +997,7 @@ qr =
if !responseField.value and captcha = qr.captcha.shift()
$('#recaptcha_challenge_field', qr.el).value = captcha.challenge
responseField.value = captcha.response
responseField.nextSibling.textContent = qr.captcha.length
responseField.nextSibling.textContent = qr.captcha.length + ' captcha cached'
qr.submit.call $ 'form', qr.el
captchaNode: (e) ->
@ -1037,7 +1037,7 @@ qr =
<div><input class=inputtext type=text name=sub placeholder=Subject><input type=submit value=#{submitValue} id=com_submit #{submitDisabled}><label><input type=checkbox id=auto>auto</label></div>
<div><textarea class=inputtext name=com placeholder=Comment></textarea></div>
<div><img src=http://www.google.com/recaptcha/api/image?c=#{challenge}></div>
<div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off id=recaptcha_response_field><a name=captcha title='captcha cached'>0</a></div>
<div><input class=inputtext type=text name=recaptcha_response_field placeholder=Verification required autocomplete=off id=recaptcha_response_field>0 captcha cached</div>
<div><input type=file name=upfile></div>
<div><input class=inputtext type=password name=pwd maxlength=8 placeholder=Password><input type=hidden name=mode value=regist><a name=attach>attach another file</a></div>
</form>
@ -1092,9 +1092,10 @@ qr =
$.bind quote, 'click', qr.quote
push: ->
@nextSibling.textContent = qr.captcha.push
l = qr.captcha.push
challenge: $('#recaptcha_challenge_field', qr.el).value
response: @value
@nextSibling.textContent = l + ' captcha cached'
Recaptcha.reload()
@value = ''