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
|
||||
*2014-05-02*
|
||||
|
||||
|
||||
@ -33,6 +33,8 @@ QR.captcha =
|
||||
QR.captcha.clear()
|
||||
$.sync 'captchas', @sync
|
||||
|
||||
new MutationObserver(@afterSetup).observe $.id('captchaContainer'), childList: true
|
||||
|
||||
@beforeSetup()
|
||||
@afterSetup() # reCAPTCHA might have loaded before the QR.
|
||||
beforeSetup: ->
|
||||
@ -42,14 +44,11 @@ QR.captcha =
|
||||
input.placeholder = 'Focus to load reCAPTCHA'
|
||||
@count()
|
||||
$.on input, 'focus', @setup
|
||||
@setupObserver = new MutationObserver @afterSetup
|
||||
@setupObserver.observe $.id('captchaContainer'), childList: true
|
||||
setup: ->
|
||||
$.globalEval 'loadRecaptcha()'
|
||||
afterSetup: ->
|
||||
return unless challenge = $.id 'recaptcha_challenge_field_holder'
|
||||
QR.captcha.setupObserver.disconnect()
|
||||
delete QR.captcha.setupObserver
|
||||
return if challenge is QR.captcha.nodes.challenge
|
||||
|
||||
setLifetime = (e) -> QR.captcha.lifetime = e.detail
|
||||
$.on window, 'captcha:timeout', setLifetime
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user