fix captcha after latest changes
This commit is contained in:
parent
1174430791
commit
4ca58ff430
@ -1,3 +1,6 @@
|
|||||||
|
**ccd0**
|
||||||
|
- Update due to more Recaptcha changes.
|
||||||
|
|
||||||
### v1.7.26
|
### v1.7.26
|
||||||
*2014-05-02*
|
*2014-05-02*
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,8 @@ QR.captcha =
|
|||||||
QR.captcha.clear()
|
QR.captcha.clear()
|
||||||
$.sync 'captchas', @sync
|
$.sync 'captchas', @sync
|
||||||
|
|
||||||
|
new MutationObserver(@afterSetup).observe $.id('captchaContainer'), childList: true
|
||||||
|
|
||||||
@beforeSetup()
|
@beforeSetup()
|
||||||
@afterSetup() # reCAPTCHA might have loaded before the QR.
|
@afterSetup() # reCAPTCHA might have loaded before the QR.
|
||||||
beforeSetup: ->
|
beforeSetup: ->
|
||||||
@ -42,14 +44,11 @@ QR.captcha =
|
|||||||
input.placeholder = 'Focus to load reCAPTCHA'
|
input.placeholder = 'Focus to load reCAPTCHA'
|
||||||
@count()
|
@count()
|
||||||
$.on input, 'focus', @setup
|
$.on input, 'focus', @setup
|
||||||
@setupObserver = new MutationObserver @afterSetup
|
|
||||||
@setupObserver.observe $.id('captchaContainer'), childList: true
|
|
||||||
setup: ->
|
setup: ->
|
||||||
$.globalEval 'loadRecaptcha()'
|
$.globalEval 'loadRecaptcha()'
|
||||||
afterSetup: ->
|
afterSetup: ->
|
||||||
return unless challenge = $.id 'recaptcha_challenge_field_holder'
|
return unless challenge = $.id 'recaptcha_challenge_field_holder'
|
||||||
QR.captcha.setupObserver.disconnect()
|
return if challenge is QR.captcha.nodes.challenge
|
||||||
delete QR.captcha.setupObserver
|
|
||||||
|
|
||||||
setLifetime = (e) -> QR.captcha.lifetime = e.detail
|
setLifetime = (e) -> QR.captcha.lifetime = e.detail
|
||||||
$.on window, 'captcha:timeout', setLifetime
|
$.on window, 'captcha:timeout', setLifetime
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user