From ab982ecc3cd3eb910ab2cbc1716cc8e84bea8729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Wed, 22 Nov 2017 02:13:52 -0500 Subject: [PATCH] Remove deprecated support for CSS filenames in theme configuration --- client/index.html.tpl | 2 +- client/js/options.js | 4 +--- src/helper.js | 8 -------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/client/index.html.tpl b/client/index.html.tpl index 44961931..a4d1af77 100644 --- a/client/index.html.tpl +++ b/client/index.html.tpl @@ -10,7 +10,7 @@ - + <% _.forEach(stylesheets, function(css) { %> <% }); %> diff --git a/client/js/options.js b/client/js/options.js index 7c61df88..a235771c 100644 --- a/client/js/options.js +++ b/client/js/options.js @@ -22,14 +22,12 @@ const options = { notifyAllMessages: false, showSeconds: false, statusMessages: "condensed", - theme: $("#theme").prop("href").match(/themes\/(.*?)\.css$/), // TODO: Make this a data attribute in v3 + theme: $("#theme").data("server-theme"), media: true, userStyles: userStyles.text(), }; let userOptions = JSON.parse(storage.get("settings")) || {}; -options.theme = options.theme ? options.theme[1] : "example"; // TODO: Remove in v3 - for (const key in options) { if (userOptions[key] !== undefined) { options[key] = userOptions[key]; diff --git a/src/helper.js b/src/helper.js index 6b6c2e9a..f5922467 100644 --- a/src/helper.js +++ b/src/helper.js @@ -99,14 +99,6 @@ function setHome(newPath) { // Load theme color from manifest.json const manifest = require("../public/manifest.json"); this.config.themeColor = manifest.theme_color; - - // TODO: Remove in future release - // Backwards compatibility for old way of specifying themes in settings - if (this.config.theme.includes(".css")) { - log.warn(`Referring to CSS files in the ${colors.green("theme")} setting of ${colors.green(configPath)} is ${colors.bold.red("deprecated")} and will be removed in a future version.`); - } else { - this.config.theme = `themes/${this.config.theme}.css`; - } } function getHomePath() {