From de95a6b78788da7472850dad13ed9b7de9e5b9b1 Mon Sep 17 00:00:00 2001 From: rstular Date: Sun, 17 May 2020 19:21:00 +0200 Subject: Merge --- assets/js/settings.js | 7 +++++-- assets/js/setup-storage.js | 6 ++++-- assets/pages-src/settings.bvr | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'assets') diff --git a/assets/js/settings.js b/assets/js/settings.js index 9a76ea5..f31bfaf 100644 --- a/assets/js/settings.js +++ b/assets/js/settings.js @@ -8,7 +8,7 @@ async function setLanguage(langCode) { } async function setTheme(targetTheme) { - localforage.setItem("targetTheme", targetTheme).then((value) => { + localforage.setItem("theme", targetTheme).then((value) => { console.log("Theme set: " + value); UIAlert(D("themeSet"), "setTheme(): themeSet"); }); @@ -40,7 +40,10 @@ document.addEventListener("DOMContentLoaded", async () => { const menus = document.querySelectorAll(".side-menu"); M.Sidenav.init(menus, { edge: "right", draggable: true }); + var elems = document.querySelectorAll(".theme-select"); + M.FormSelect.init(elems, {}); + // Setup language select dropdown - var elems = document.querySelectorAll('select'); + var elems = document.querySelectorAll(".lang-select"); M.FormSelect.init(elems, {}); }); diff --git a/assets/js/setup-storage.js b/assets/js/setup-storage.js index ad45ec7..f9fa656 100644 --- a/assets/js/setup-storage.js +++ b/assets/js/setup-storage.js @@ -18,7 +18,8 @@ async function setupStorage(force = false) { localforage.setItem("messages", { "0": [], "1": [], "2": []}), // see messages.js:129, commit 8eb9ca9caca30fbbe023243657535ab4088be377 localforage.setItem("directory", {}), //\\ well I could remember my own code but I didn't. localforage.setItem("meals", {}), - localforage.setItem("chosenLang", "en") + localforage.setItem("chosenLang", "en"), + localforage.setItem("theme", "light") ]; if (logged_in && force == false) { // torej, če je že bila prijava narejena, ne posodobi backwards-compatible vrednosti (username, password,...) @@ -30,7 +31,8 @@ async function setupStorage(force = false) { localforage.setItem("logged_in", false), localforage.setItem("username", ""), localforage.setItem("password", ""), - localforage.setItem("chosenLang", "en") + localforage.setItem("chosenLang", "en"), + localforage.setItem("theme", "light") ]; await localforage.clear(); await Promise.all(promises_first_install); diff --git a/assets/pages-src/settings.bvr b/assets/pages-src/settings.bvr index 8d5193c..2056184 100644 --- a/assets/pages-src/settings.bvr +++ b/assets/pages-src/settings.bvr @@ -58,7 +58,7 @@
language
translate - @@ -70,7 +70,7 @@
theme
palette - -- cgit v1.2.3