From bd688515e9ce8e2da27911773d241f07dd7cdc63 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 11 Apr 2013 14:54:44 -0700 Subject: [PATCH] Fix SFW/NSFW themes. --- appchan-x.user.js | 5 +++++ src/config.coffee | 6 ++++-- src/main.coffee | 6 ++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/appchan-x.user.js b/appchan-x.user.js index ec5f20faf..3a8a754dd 100644 --- a/appchan-x.user.js +++ b/appchan-x.user.js @@ -295,6 +295,8 @@ embedWidth: 640, embedHeight: 390, theme: 'Yotsuba B', + 'theme_sfw': 'Yotsuba B', + 'theme_nsfw': 'Yotsuba', mascot: '' }; @@ -12831,6 +12833,9 @@ } else { g.MASCOTSTRING = "Enabled Mascots"; } + if (Conf["NSFW/SFW Themes"]) { + Conf["theme"] = Conf["theme_" + g.TYPE]; + } switch (location.hostname) { case 'sys.4chan.org': Report.init(); diff --git a/src/config.coffee b/src/config.coffee index 6deb0d21a..ccc4cb56c 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -897,7 +897,9 @@ box-shadow: inset 2px 2px 2px rgba(0,0,0,0.2); ] 'Interval': 30 - embedWidth: 640 + embedWidth: 640 embedHeight: 390 - theme : 'Yotsuba B' + theme : 'Yotsuba B' + 'theme_sfw': 'Yotsuba B' + 'theme_nsfw': 'Yotsuba' mascot : '' diff --git a/src/main.coffee b/src/main.coffee index 263a639e6..8e4587cc2 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -334,8 +334,7 @@ Main = if ['b', 'd', 'e', 'gif', 'h', 'hc', 'hm', 'hr', 'pol', 'r', 'r9k', 'rs', 's', 'soc', 't', 'u', 'y'].contains g.BOARD g.TYPE = 'nsfw' - - $.extend Themes, Conf["userThemes"] + $.extend Themes, Conf["userThemes"] $.extend Mascots, Conf["userMascots"] if Conf["NSFW/SFW Mascots"] @@ -343,6 +342,9 @@ Main = else g.MASCOTSTRING = "Enabled Mascots" + if Conf["NSFW/SFW Themes"] + Conf["theme"] = Conf["theme_#{g.TYPE}"] + switch location.hostname when 'sys.4chan.org' Report.init()