move auto auto post into qr
This commit is contained in:
parent
5eb88f735f
commit
9adfa5f866
@ -1280,6 +1280,15 @@
|
|||||||
$('img', qr.el).src = "http://www.google.com/recaptcha/api/image?c=" + target.value;
|
$('img', qr.el).src = "http://www.google.com/recaptcha/api/image?c=" + target.value;
|
||||||
return $('#recaptcha_challenge_field', qr.el).value = target.value;
|
return $('#recaptcha_challenge_field', qr.el).value = target.value;
|
||||||
},
|
},
|
||||||
|
captchaKeydown: function(e) {
|
||||||
|
if (e.keyCode === 13 && cooldown.duration) {
|
||||||
|
$('#auto', qr.el).checked = true;
|
||||||
|
if (conf['Auto Hide QR']) {
|
||||||
|
qr.autohide.set();
|
||||||
|
}
|
||||||
|
return qr.push.call(this);
|
||||||
|
}
|
||||||
|
},
|
||||||
cb: {
|
cb: {
|
||||||
autohide: function(e) {
|
autohide: function(e) {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
@ -1320,6 +1329,7 @@
|
|||||||
$.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($('#recaptcha_response_field', qr.el), 'keydown', Recaptcha.listener);
|
$.bind($('#recaptcha_response_field', qr.el), 'keydown', Recaptcha.listener);
|
||||||
|
$.bind($('#recaptcha_response_field', qr.el), 'keydown', qr.captchaKeydown);
|
||||||
return $.append(d.body, qr.el);
|
return $.append(d.body, qr.el);
|
||||||
},
|
},
|
||||||
message: function(e) {
|
message: function(e) {
|
||||||
@ -2485,14 +2495,7 @@
|
|||||||
},
|
},
|
||||||
listener: function(e) {
|
listener: function(e) {
|
||||||
if (e.keyCode === 8 && this.value === '') {
|
if (e.keyCode === 8 && this.value === '') {
|
||||||
Recaptcha.reload();
|
return Recaptcha.reload();
|
||||||
}
|
|
||||||
if (e.keyCode === 13 && cooldown.duration) {
|
|
||||||
$('#auto', qr.el).checked = true;
|
|
||||||
if (conf['Auto Hide QR']) {
|
|
||||||
qr.autohide.set();
|
|
||||||
}
|
|
||||||
return qr.push.call(this);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reload: function() {
|
reload: function() {
|
||||||
|
|||||||
@ -1009,6 +1009,12 @@ qr =
|
|||||||
$('img', qr.el).src = "http://www.google.com/recaptcha/api/image?c=" + target.value
|
$('img', qr.el).src = "http://www.google.com/recaptcha/api/image?c=" + target.value
|
||||||
$('#recaptcha_challenge_field', qr.el).value = target.value
|
$('#recaptcha_challenge_field', qr.el).value = target.value
|
||||||
|
|
||||||
|
captchaKeydown: (e) ->
|
||||||
|
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
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
autohide: (e) ->
|
autohide: (e) ->
|
||||||
if @checked
|
if @checked
|
||||||
@ -1064,6 +1070,7 @@ qr =
|
|||||||
$.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 $('#recaptcha_response_field', qr.el), 'keydown', Recaptcha.listener
|
$.bind $('#recaptcha_response_field', qr.el), 'keydown', Recaptcha.listener
|
||||||
|
$.bind $('#recaptcha_response_field', qr.el), 'keydown', qr.captchaKeydown
|
||||||
|
|
||||||
$.append d.body, qr.el
|
$.append d.body, qr.el
|
||||||
|
|
||||||
@ -1894,10 +1901,6 @@ Recaptcha =
|
|||||||
listener: (e) ->
|
listener: (e) ->
|
||||||
if e.keyCode is 8 and @value is '' # backspace to reload
|
if e.keyCode is 8 and @value is '' # backspace to reload
|
||||||
Recaptcha.reload()
|
Recaptcha.reload()
|
||||||
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: ->
|
reload: ->
|
||||||
window.location = 'javascript:Recaptcha.reload()'
|
window.location = 'javascript:Recaptcha.reload()'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user