diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js
index 7c3ce858a..6ac19652c 100644
--- a/builds/appchan-x.user.js
+++ b/builds/appchan-x.user.js
@@ -13062,7 +13062,7 @@
});
ctx = el.getContext('2d');
ctx.font = "40px " + Conf['Font'];
- ctx.fillStyle = (new Color((Themes[Conf['theme']] || Themes['Yotsuba B'])['Text'])).hex();
+ ctx.fillStyle = (new Color((Themes[Conf[g.THEMESTRING]] || Themes[g.TYPE === 'sfw' ? 'Yotsuba B' : 'Yotsuba'])['Text'])).hex();
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText("Mascot 404", 124, 50);
@@ -13484,7 +13484,7 @@
init: function() {
var i, item, items, theme;
Style.svgs = {};
- theme = Themes[Conf['theme']] || Themes['Yotsuba B'];
+ theme = Themes[Conf[g.THEMESTRING]] || Themes['Yotsuba B'];
items = [['layout', Style.layout], ['theme', Style.theme(theme)], ['emoji', Emoji.css()], ['dynamic', Style.dynamic()], ['padding', ""], ['mascots', ""]];
i = 0;
while (item = items[i++]) {
@@ -15794,7 +15794,7 @@
}
if (Conf["NSFW/SFW Themes"]) {
Main.setThemeString();
- theme = Themes[Conf[g.STYLESTRING] || (sfw ? 'Yotsuba B' : 'Yotsuba')] || Themes[Conf[g.STYLESTRING] = sfw ? 'Yotsuba B' : 'Yotsuba'];
+ theme = Themes[Conf[g.THEMESTRING] || (sfw ? 'Yotsuba B' : 'Yotsuba')] || Themes[Conf[g.THEMESTRING] = sfw ? 'Yotsuba B' : 'Yotsuba'];
Style.setTheme(theme);
}
Favicon.SFW = sfw;
@@ -16657,7 +16657,7 @@
continue;
}
div = $.el('div', {
- className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
+ className: "theme " + (name === Conf[g.THEMESTRING] ? 'selectedtheme' : ''),
id: name,
innerHTML: "
"
});
@@ -17026,10 +17026,10 @@
theme: {
select: function() {
var current;
- if (current = $.id(Conf[g.STYLESTRING])) {
+ if (current = $.id(Conf[g.THEMESTRING])) {
$.rmClass(current, 'selectedtheme');
}
- $.set(g.STYLESTRING, Conf[g.STYLESTRING] = this.id);
+ $.set(g.THEMESTRING, Conf[g.THEMESTRING] = this.id);
$.addClass(this, 'selectedtheme');
return Style.setTheme(Themes[this.id]);
},
@@ -17067,11 +17067,11 @@
return;
}
if (confirm("Are you sure you want to delete \"" + this.name + "\"?")) {
- if (this.name === Conf['theme']) {
+ if (this.name === Conf[g.THEMESTRING]) {
if (settheme = container.previousSibling || container.nextSibling) {
- Conf['theme'] = settheme.id;
+ Conf[g.THEMESTRING] = settheme.id;
$.addClass(settheme, 'selectedtheme');
- $.set('theme', Conf['theme']);
+ $.set(g.THEMESTRING, Conf[g.THEMESTRING]);
}
}
Themes[this.name]["Deleted"] = true;
@@ -17412,7 +17412,7 @@
if (Conf["NSFW/SFW Themes"]) {
type += "_" + g.TYPE;
}
- return g.STYLESTRING = type;
+ return g.THEMESTRING = type;
}
};
diff --git a/builds/crx/script.js b/builds/crx/script.js
index 56edb383e..4c7cbd126 100644
--- a/builds/crx/script.js
+++ b/builds/crx/script.js
@@ -13051,7 +13051,7 @@
});
ctx = el.getContext('2d');
ctx.font = "40px " + Conf['Font'];
- ctx.fillStyle = (new Color((Themes[Conf['theme']] || Themes['Yotsuba B'])['Text'])).hex();
+ ctx.fillStyle = (new Color((Themes[Conf[g.THEMESTRING]] || Themes[g.TYPE === 'sfw' ? 'Yotsuba B' : 'Yotsuba'])['Text'])).hex();
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText("Mascot 404", 124, 50);
@@ -13477,7 +13477,7 @@
id: 'svg_filters'
})
};
- theme = Themes[Conf['theme']] || Themes['Yotsuba B'];
+ theme = Themes[Conf[g.THEMESTRING]] || Themes['Yotsuba B'];
items = [['layout', Style.layout], ['theme', Style.theme(theme)], ['emoji', Emoji.css()], ['dynamic', Style.dynamic()], ['padding', ""], ['mascots', ""]];
i = 0;
while (item = items[i++]) {
@@ -15789,7 +15789,7 @@
}
if (Conf["NSFW/SFW Themes"]) {
Main.setThemeString();
- theme = Themes[Conf[g.STYLESTRING] || (sfw ? 'Yotsuba B' : 'Yotsuba')] || Themes[Conf[g.STYLESTRING] = sfw ? 'Yotsuba B' : 'Yotsuba'];
+ theme = Themes[Conf[g.THEMESTRING] || (sfw ? 'Yotsuba B' : 'Yotsuba')] || Themes[Conf[g.THEMESTRING] = sfw ? 'Yotsuba B' : 'Yotsuba'];
Style.setTheme(theme);
}
Favicon.SFW = sfw;
@@ -16650,7 +16650,7 @@
continue;
}
div = $.el('div', {
- className: "theme " + (name === Conf['theme'] ? 'selectedtheme' : ''),
+ className: "theme " + (name === Conf[g.THEMESTRING] ? 'selectedtheme' : ''),
id: name,
innerHTML: ""
});
@@ -17016,10 +17016,10 @@
theme: {
select: function() {
var current;
- if (current = $.id(Conf[g.STYLESTRING])) {
+ if (current = $.id(Conf[g.THEMESTRING])) {
$.rmClass(current, 'selectedtheme');
}
- $.set(g.STYLESTRING, Conf[g.STYLESTRING] = this.id);
+ $.set(g.THEMESTRING, Conf[g.THEMESTRING] = this.id);
$.addClass(this, 'selectedtheme');
return Style.setTheme(Themes[this.id]);
},
@@ -17054,11 +17054,11 @@
return;
}
if (confirm("Are you sure you want to delete \"" + this.name + "\"?")) {
- if (this.name === Conf['theme']) {
+ if (this.name === Conf[g.THEMESTRING]) {
if (settheme = container.previousSibling || container.nextSibling) {
- Conf['theme'] = settheme.id;
+ Conf[g.THEMESTRING] = settheme.id;
$.addClass(settheme, 'selectedtheme');
- $.set('theme', Conf['theme']);
+ $.set(g.THEMESTRING, Conf[g.THEMESTRING]);
}
}
Themes[this.name]["Deleted"] = true;
@@ -17389,7 +17389,7 @@
if (Conf["NSFW/SFW Themes"]) {
type += "_" + g.TYPE;
}
- return g.STYLESTRING = type;
+ return g.THEMESTRING = type;
}
};
diff --git a/src/General/Main.coffee b/src/General/Main.coffee
index 3a32245c2..e20fc852c 100644
--- a/src/General/Main.coffee
+++ b/src/General/Main.coffee
@@ -316,6 +316,6 @@ Main =
type = "theme"
if Conf["NSFW/SFW Themes"]
type += "_#{g.TYPE}"
- g.STYLESTRING = type
+ g.THEMESTRING = type
Main.init()
diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee
index cb830b8b7..fc78440d8 100644
--- a/src/General/Navigate.coffee
+++ b/src/General/Navigate.coffee
@@ -140,7 +140,7 @@ Navigate =
if Conf["NSFW/SFW Themes"]
Main.setThemeString()
- theme = Themes[Conf[g.STYLESTRING] or if sfw then 'Yotsuba B' else 'Yotsuba'] or Themes[Conf[g.STYLESTRING] = if sfw then 'Yotsuba B' else 'Yotsuba']
+ theme = Themes[Conf[g.THEMESTRING] or if sfw then 'Yotsuba B' else 'Yotsuba'] or Themes[Conf[g.THEMESTRING] = if sfw then 'Yotsuba B' else 'Yotsuba']
Style.setTheme theme
Favicon.SFW = sfw
diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee
index 886ff81a7..0bff26718 100755
--- a/src/General/Settings.coffee
+++ b/src/General/Settings.coffee
@@ -549,7 +549,7 @@ Settings =
continue if theme["Deleted"]
div = $.el 'div',
- className: "theme #{if name is Conf['theme'] then 'selectedtheme' else ''}"
+ className: "theme #{if name is Conf[g.THEMESTRING] then 'selectedtheme' else ''}"
id: name
innerHTML: """<%= grunt.file.read('src/General/html/Settings/Theme.html').replace(/>\s+<').trim() %>"""
@@ -880,10 +880,10 @@ Settings =
theme:
select: ->
- if current = $.id(Conf[g.STYLESTRING])
+ if current = $.id(Conf[g.THEMESTRING])
$.rmClass current, 'selectedtheme'
- $.set g.STYLESTRING, Conf[g.STYLESTRING] = @id
+ $.set g.THEMESTRING, Conf[g.THEMESTRING] = @id
$.addClass @, 'selectedtheme'
Style.setTheme Themes[@id]
@@ -923,11 +923,11 @@ Settings =
return
if confirm "Are you sure you want to delete \"#{@name}\"?"
- if @name is Conf['theme']
+ if @name is Conf[g.THEMESTRING]
if settheme = container.previousSibling or container.nextSibling
- Conf['theme'] = settheme.id
+ Conf[g.THEMESTRING] = settheme.id
$.addClass settheme, 'selectedtheme'
- $.set 'theme', Conf['theme']
+ $.set g.THEMESTRING, Conf[g.THEMESTRING]
Themes[@name]["Deleted"] = true
$.get "userThemes", {}, ({userThemes}) =>
diff --git a/src/Theming/Mascots.coffee b/src/Theming/Mascots.coffee
index 5ce60d272..4d41b2b65 100644
--- a/src/Theming/Mascots.coffee
+++ b/src/Theming/Mascots.coffee
@@ -52,7 +52,7 @@ MascotTools =
height: 100
ctx = el.getContext('2d')
ctx.font = "40px #{Conf['Font']}"
- ctx.fillStyle = (new Color (Themes[Conf['theme']] or Themes['Yotsuba B'])['Text']).hex()
+ ctx.fillStyle = (new Color (Themes[Conf[g.THEMESTRING]] or Themes[if g.TYPE is 'sfw' then 'Yotsuba B' else 'Yotsuba'])['Text']).hex()
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
ctx.fillText "Mascot 404", 124, 50
diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee
index 1d941eace..5e81236a1 100644
--- a/src/Theming/Style.coffee
+++ b/src/Theming/Style.coffee
@@ -8,7 +8,7 @@ Style =
<% } %>
}
- theme = Themes[Conf['theme']] or Themes['Yotsuba B']
+ theme = Themes[Conf[g.THEMESTRING]] or Themes['Yotsuba B']
items = [
['layout', Style.layout]
['theme', Style.theme theme]