From c54cf1fe0e7d869ae6ca0d3cc3ea1919aa7d2de1 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 22 Jun 2015 20:27:20 -0700 Subject: [PATCH] Move www.4chan.org init code to a more normal place. --- src/General/Main.coffee | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 108e9b43d..20e7e9936 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -11,14 +11,6 @@ Main = $.ready -> Captcha.fixes.init() return - if location.hostname is 'www.4chan.org' - $.onExists d.documentElement, 'body', false, -> $.addStyle Main.cssWWW - Conf = {'captchaLanguage': Config.captchaLanguage} - $.get Conf, (items) -> - $.extend Conf, items - Captcha.language.fixPage() - return - g.threads = new SimpleDict() g.posts = new SimpleDict() @@ -71,6 +63,9 @@ Main = $.globalEval 'document.documentElement.classList.add("js-enabled");' switch location.hostname + when 'www.4chan.org' + Captcha.language.fixPage() + return when 'a.4cdn.org' return when 'sys.4chan.org' @@ -119,7 +114,10 @@ Main = $.ready Main.initReady initStyle: -> + $.addStyle Main.cssWWW if location.hostname is 'www.4chan.org' + return if !Main.isThisPageLegit() or $.hasClass doc, 'fourchan-x' + # disable the mobile layout $('link[href*=mobile]', d.head)?.disabled = true $.addClass doc, 'fourchan-x', 'seaweedchan'