From bf461e1d6ad6afd8e4dea20ff3e85632de387bfa Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 22 Jun 2015 20:54:17 -0700 Subject: [PATCH] Merge Captcha.language.fixPage into init. --- src/General/Main.coffee | 2 +- src/Miscellaneous/Report.coffee | 2 +- src/Posting/Captcha.language.coffee | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 20e7e9936..22027b52d 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -64,7 +64,7 @@ Main = switch location.hostname when 'www.4chan.org' - Captcha.language.fixPage() + Captcha.language.init() return when 'a.4cdn.org' return diff --git a/src/Miscellaneous/Report.coffee b/src/Miscellaneous/Report.coffee index 742e10ea7..ae6f96c6f 100755 --- a/src/Miscellaneous/Report.coffee +++ b/src/Miscellaneous/Report.coffee @@ -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 diff --git a/src/Posting/Captcha.language.coffee b/src/Posting/Captcha.language.coffee index bd63efb72..92711d38a 100644 --- a/src/Posting/Captcha.language.coffee +++ b/src/Posting/Captcha.language.coffee @@ -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()