Merge Captcha.language.fixPage into init.
This commit is contained in:
parent
c54cf1fe0e
commit
bf461e1d6a
@ -64,7 +64,7 @@ Main =
|
||||
|
||||
switch location.hostname
|
||||
when 'www.4chan.org'
|
||||
Captcha.language.fixPage()
|
||||
Captcha.language.init()
|
||||
return
|
||||
when 'a.4cdn.org'
|
||||
return
|
||||
|
||||
@ -3,7 +3,7 @@ Report =
|
||||
|
||||
init: ->
|
||||
return unless /\bmode=report\b/.test(location.search) and match = location.search.match /\bno=(\d+)/
|
||||
Captcha.language.fixPage() unless Conf['Use Recaptcha v2 in Reports']
|
||||
Captcha.language.init() unless Conf['Use Recaptcha v2 in Reports']
|
||||
@postID = +match[1]
|
||||
$.ready @ready
|
||||
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
Captcha.language =
|
||||
init: ->
|
||||
return unless Conf['captchaLanguage'].trim() and d.cookie.indexOf('pass_enabled=1') < 0 and !Conf['Hide Original Post Form']
|
||||
$.onExists doc, '#captchaFormPart', true, (node) ->
|
||||
$.onExists node, 'iframe', true, Captcha.language.fixIframe
|
||||
return unless d.cookie.indexOf('pass_enabled=1') < 0
|
||||
return if location.hostname is 'boards.4chan.org' and Conf['Hide Original Post Form']
|
||||
|
||||
fixPage: ->
|
||||
return unless Conf['captchaLanguage'].trim() and d.cookie.indexOf('pass_enabled=1') < 0
|
||||
$.onExists doc, 'iframe', true, Captcha.language.fixIframe
|
||||
if Conf['captchaLanguage'].trim()
|
||||
if location.hostname is 'boards.4chan.org'
|
||||
$.onExists doc, '#captchaFormPart', true, (node) -> $.onExists node, 'iframe', true, Captcha.language.fixIframe
|
||||
else
|
||||
$.onExists doc, 'iframe', true, Captcha.language.fixIframe
|
||||
|
||||
fixIframe: (el) ->
|
||||
return unless lang = Conf['captchaLanguage'].trim()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user