1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-03-02 02:31:35 +00:00

Add theme support, light theme, and edgeless light

This commit is contained in:
Cadence Ember 2021-12-28 16:32:11 +13:00
parent 4e1f2b3607
commit 0d23d66700
45 changed files with 433 additions and 212 deletions

View file

@ -9,6 +9,10 @@ let constants = {
type: "string",
default: "http://localhost:3000"
},
theme: {
type: "integer",
default: 0
},
save_history: {
type: "boolean",
default: false

8
utils/icon-loader.js Normal file
View file

@ -0,0 +1,8 @@
const fs = require("fs").promises
const names = ["subscriptions", "settings"]
const icons = names.map(name => fs.readFile(`html/static/images/${name}.svg`, "utf8"))
module.exports.icons = Promise.all(icons).then(resolvedIcons => {
return new Map(names.map((name, index) => [name, resolvedIcons[index]]))
})

View file

@ -70,6 +70,11 @@ const deltas = [
.run()
db.prepare("CREATE TABLE TakedownChannels (ucid TEXT NOT NULL, org TEXT, url TEXT, PRIMARY KEY (ucid))")
.run()
},
// 11: Settings +theme
function() {
db.prepare("ALTER TABLE Settings ADD COLUMN theme INTEGER DEFAULT 0")
.run()
}
]
@ -82,7 +87,7 @@ async function createBackup(entry) {
/**
* @param {number} entry
* @param {boolean} log
* @param {boolean} [log]
*/
function runDelta(entry, log) {
process.stdout.write(`Upgrading database to version ${entry}... `)