1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Added centralized theme system and themed all pages

This commit is contained in:
kkapsner 2019-05-02 00:30:30 +02:00
parent c2a817478e
commit 6301b744d2
39 changed files with 448 additions and 127 deletions

View file

@ -14,21 +14,12 @@
const Notification = require("./Notification");
const {createActionButtons, modalPrompt, modalChoice} = require("./gui");
const lists = require("../lib/lists");
require("../lib/theme").init("pageAction");
Promise.all([
browser.tabs.query({active: true, currentWindow: true}),
settings.loaded
]).then(function(values){
// load theme
var themeLink = document.createElement("link");
themeLink.href = `pageAction-${settings.theme}.css`;
themeLink.rel = "stylesheet";
themeLink.type = "text/css";
document.head.appendChild(themeLink);
settings.on("theme", function(){
themeLink.href = `pageAction-${settings.theme}.css`;
});
const tabs = values[0];
notice("create global action buttons");