We do need to remove the old captcha when forcing noscript one.

Fix for 210b6bd20161286ace683ad1590a8df637f60de7.
This commit is contained in:
ccd0 2015-11-20 04:20:46 -08:00
parent a49580e6be
commit 0387642fcb
2 changed files with 3 additions and 2 deletions

View File

@ -24,10 +24,11 @@ Captcha.replace =
noscript: ->
return unless (original = $ '#g-recaptcha, #captchaContainerAlt') and (noscript = $ 'noscript')
span = $.el 'span',
id: 'captcha-forced-noscript'
innerHTML: noscript.textContent
Captcha.replace.iframe $('iframe', span)
$.replace noscript, span
original.hidden = true
$.rm original
v1: ->
return unless $.id 'g-recaptcha'

View File

@ -3,7 +3,7 @@ Captcha.v2 =
init: ->
return if d.cookie.indexOf('pass_enabled=1') >= 0
return unless (@isEnabled = !!$ '#g-recaptcha, #captchaContainerAlt')
return unless (@isEnabled = !!$ '#g-recaptcha, #captchaContainerAlt, #captcha-forced-noscript')
if (@noscript = Conf['Force Noscript Captcha'] or not Main.jsEnabled)
$.addClass QR.nodes.el, 'noscript-captcha'