summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/js/settings.js7
-rw-r--r--assets/js/setup-storage.js6
-rw-r--r--assets/pages-src/settings.bvr4
-rw-r--r--dist/js/settings.js7
-rw-r--r--dist/js/setup-storage.js6
-rw-r--r--dist/pages/about.html2
-rw-r--r--dist/pages/settings.html4
-rw-r--r--dist/sw.js4
8 files changed, 25 insertions, 15 deletions
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 @@
<h5><x-su>language</x-su></h5>
<div class="input-field col s12">
<i class="material-icons prefix">translate</i>
- <select class="icons" id="select-language">
+ <select class="lang-select icons" id="select-language">
<option value="" id="option-sl" data-language="sl" data-icon="/img/flags/sl.svg" selected>Slovenščina</option>
<option value="" id="option-en" data-language="en" data-icon="/img/flags/en.svg">English</option>
</select>
@@ -70,7 +70,7 @@
<h5><x-su>theme</x-su></h5>
<div class="input-field col s12">
<i class="material-icons prefix">palette</i>
- <select class="icons" id="select-theme">
+ <select class="theme-select" id="select-theme">
<option value="" id="option-light" data-theme="light" selected><x-su>themeLight</x-su></option>
<option value="" id="option-dark" data-theme="dark"><x-su>themeDark</x-su></option>
</select>
diff --git a/dist/js/settings.js b/dist/js/settings.js
index 9a76ea5..f31bfaf 100644
--- a/dist/js/settings.js
+++ b/dist/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/dist/js/setup-storage.js b/dist/js/setup-storage.js
index ad45ec7..f9fa656 100644
--- a/dist/js/setup-storage.js
+++ b/dist/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/dist/pages/about.html b/dist/pages/about.html
index 6dfb1ef..6f5fa03 100644
--- a/dist/pages/about.html
+++ b/dist/pages/about.html
@@ -143,7 +143,7 @@
<div class="row">
<p>
<small>
- ^HEAD b2c1b20b7c90ea481082c82ca2dba0e0e907566b
+ ^HEAD dbb621cf007277597a39d0dec72193f81cc0d0a7
</p>
</div>
</div>
diff --git a/dist/pages/settings.html b/dist/pages/settings.html
index 2eeb724..38d442a 100644
--- a/dist/pages/settings.html
+++ b/dist/pages/settings.html
@@ -79,7 +79,7 @@
<h5><x-su>language</x-su></h5>
<div class="input-field col s12">
<i class="material-icons prefix">translate</i>
- <select class="icons" id="select-language">
+ <select class="lang-select icons" id="select-language">
<option value="" id="option-sl" data-language="sl" data-icon="/img/flags/sl.svg" selected>Slovenščina</option>
<option value="" id="option-en" data-language="en" data-icon="/img/flags/en.svg">English</option>
</select>
@@ -91,7 +91,7 @@
<h5><x-su>theme</x-su></h5>
<div class="input-field col s12">
<i class="material-icons prefix">palette</i>
- <select class="icons" id="select-theme">
+ <select class="theme-select" id="select-theme">
<option value="" id="option-light" data-theme="light" selected><x-su>themeLight</x-su></option>
<option value="" id="option-dark" data-theme="dark"><x-su>themeDark</x-su></option>
</select>
diff --git a/dist/sw.js b/dist/sw.js
index 0f88ec1..385c54e 100644
--- a/dist/sw.js
+++ b/dist/sw.js
@@ -3,8 +3,8 @@
// Change version to cause cache refresh
-const static_cache_name = "site-static-1.0.13-beta-b2c1b20";
-// latest commit is b2c1b20b7c90ea481082c82ca2dba0e0e907566b
+const static_cache_name = "site-static-1.0.13-beta-dbb621c";
+// latest commit is dbb621cf007277597a39d0dec72193f81cc0d0a7
// Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js
// sw.js NE SME BITI CACHAN, ker vsebuje verzijo!