#recaptcha_response_field

This commit is contained in:
James Campos 2011-08-06 09:53:04 -07:00
parent 27cea18498
commit dbb96e975c
2 changed files with 14 additions and 14 deletions

View File

@ -1252,7 +1252,7 @@
}, },
auto: function() { auto: function() {
var captcha, responseField; var captcha, responseField;
responseField = $('input[name=recaptcha_response_field]', qr.el); responseField = $('#recaptcha_response_field', qr.el);
if (!responseField.value && (captcha = qr.captcha.shift())) { if (!responseField.value && (captcha = qr.captcha.shift())) {
$('input[name=recaptcha_challenge_field]', qr.el).value = captcha.challenge; $('input[name=recaptcha_challenge_field]', qr.el).value = captcha.challenge;
responseField.value = captcha.response; responseField.value = captcha.response;
@ -1294,7 +1294,7 @@
THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id; 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>' : ''; spoiler = $('.postarea label') ? '<label> [<input type=checkbox name=spoiler>Spoiler Image?]</label>' : '';
challenge = $('input[name=recaptcha_challenge_field]').value; challenge = $('input[name=recaptcha_challenge_field]').value;
html = " <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form> Quick Reply <input type=checkbox id=autohide title=autohide> <a name=close title=close>X</a> </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 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><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 = " <div class=move> <input class=inputtext type=text name=name placeholder=Name form=qr_form> Quick Reply <input type=checkbox id=autohide title=autohide> <a name=close title=close>X</a> </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 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> ";
qr.el = ui.dialog('qr', { qr.el = ui.dialog('qr', {
top: '0px', top: '0px',
left: '0px' left: '0px'
@ -1309,7 +1309,7 @@
$.bind($('form', qr.el), 'submit', qr.submit); $.bind($('form', qr.el), 'submit', qr.submit);
$.bind($('a[name=attach]', qr.el), 'click', qr.attach); $.bind($('a[name=attach]', qr.el), 'click', qr.attach);
$.bind($('img', qr.el), 'click', Recaptcha.reload); $.bind($('img', qr.el), 'click', Recaptcha.reload);
$.bind($('input[name=recaptcha_response_field]', qr.el), 'keydown', Recaptcha.listener); $.bind($('#recaptcha_response_field', qr.el), 'keydown', Recaptcha.listener);
return $.append(d.body, qr.el); return $.append(d.body, qr.el);
}, },
message: function(e) { message: function(e) {
@ -1320,7 +1320,7 @@
if (data) { if (data) {
data = JSON.parse(data); data = JSON.parse(data);
$.extend($('#error', qr.el), data); $.extend($('#error', qr.el), data);
$('input[name=recaptcha_response_field]', qr.el).value = ''; $('#recaptcha_response_field', qr.el).value = '';
qr.autohide.unset(); qr.autohide.unset();
if (data.textContent === 'You seem to have mistyped the verification.') { if (data.textContent === 'You seem to have mistyped the verification.') {
qr.auto(); qr.auto();

View File

@ -985,7 +985,7 @@ qr =
$.append files, file $.append files, file
auto: -> auto: ->
responseField = $ 'input[name=recaptcha_response_field]', qr.el responseField = $ '#recaptcha_response_field', qr.el
if !responseField.value and captcha = qr.captcha.shift() if !responseField.value and captcha = qr.captcha.shift()
$('input[name=recaptcha_challenge_field]', qr.el).value = captcha.challenge $('input[name=recaptcha_challenge_field]', qr.el).value = captcha.challenge
responseField.value = captcha.response responseField.value = captcha.response
@ -1034,7 +1034,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><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><textarea class=inputtext name=com placeholder=Comment></textarea></div>
<div><img src=http://www.google.com/recaptcha/api/image?c=#{challenge}></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><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><a name=captcha title='captcha cached'>0</a></div>
<div><input type=file name=upfile></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> <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> </form>
@ -1046,13 +1046,13 @@ qr =
qr.refresh() qr.refresh()
$('textarea', qr.el).value = $('textarea').value $('textarea', qr.el).value = $('textarea').value
$.bind $('input[name=name]', qr.el), 'mousedown', (e) -> e.stopPropagation() $.bind $('input[name=name]', qr.el), 'mousedown', (e) -> e.stopPropagation()
$.bind $('#autohide', qr.el), 'click', qr.cb.autohide $.bind $('#autohide', qr.el), 'click', qr.cb.autohide
$.bind $('a[name=close]', qr.el), 'click', qr.close $.bind $('a[name=close]', qr.el), 'click', qr.close
$.bind $('form', qr.el), 'submit', qr.submit $.bind $('form', qr.el), 'submit', qr.submit
$.bind $('a[name=attach]', qr.el), 'click', qr.attach $.bind $('a[name=attach]', qr.el), 'click', qr.attach
$.bind $('img', qr.el), 'click', Recaptcha.reload $.bind $('img', qr.el), 'click', Recaptcha.reload
$.bind $('input[name=recaptcha_response_field]', qr.el), 'keydown', Recaptcha.listener $.bind $('#recaptcha_response_field', qr.el), 'keydown', Recaptcha.listener
$.append d.body, qr.el $.append d.body, qr.el
@ -1064,7 +1064,7 @@ qr =
if data # error message if data # error message
data = JSON.parse data data = JSON.parse data
$.extend $('#error', qr.el), data $.extend $('#error', qr.el), data
$('input[name=recaptcha_response_field]', qr.el).value = '' $('#recaptcha_response_field', qr.el).value = ''
qr.autohide.unset() qr.autohide.unset()
if data.textContent is 'You seem to have mistyped the verification.' if data.textContent is 'You seem to have mistyped the verification.'
qr.auto() qr.auto()