Merge pull request #1730 from thelounge/astorije/rm-css-theme-deprecation

Remove deprecated support for CSS filenames in theme configuration
This commit is contained in:
Jérémie Astori 2018-02-19 12:55:38 -05:00 committed by GitHub
commit 26fa60f475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 12 deletions

View File

@ -10,7 +10,7 @@
<link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/primer-tooltips.css"> <link rel="stylesheet" href="css/primer-tooltips.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<link id="theme" rel="stylesheet" href="<%- theme %>"> <link id="theme" rel="stylesheet" href="themes/<%- theme %>.css" data-server-theme="<%- theme %>">
<% _.forEach(stylesheets, function(css) { %> <% _.forEach(stylesheets, function(css) { %>
<link rel="stylesheet" href="packages/<%- css %>"> <link rel="stylesheet" href="packages/<%- css %>">
<% }); %> <% }); %>

View File

@ -22,14 +22,12 @@ const options = {
notifyAllMessages: false, notifyAllMessages: false,
showSeconds: false, showSeconds: false,
statusMessages: "condensed", statusMessages: "condensed",
theme: $("#theme").prop("href").match(/themes\/(.*?)\.css$/), // TODO: Make this a data attribute in v3 theme: $("#theme").data("server-theme"),
media: true, media: true,
userStyles: userStyles.text(), userStyles: userStyles.text(),
}; };
let userOptions = JSON.parse(storage.get("settings")) || {}; let userOptions = JSON.parse(storage.get("settings")) || {};
options.theme = options.theme ? options.theme[1] : "example"; // TODO: Remove in v3
for (const key in options) { for (const key in options) {
if (userOptions[key] !== undefined) { if (userOptions[key] !== undefined) {
options[key] = userOptions[key]; options[key] = userOptions[key];

View File

@ -99,14 +99,6 @@ function setHome(newPath) {
// Load theme color from manifest.json // Load theme color from manifest.json
const manifest = require("../public/manifest.json"); const manifest = require("../public/manifest.json");
this.config.themeColor = manifest.theme_color; 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() { function getHomePath() {