summaryrefslogtreecommitdiffstats
path: root/dist/js/settings.js
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-05-20 19:21:31 +0200
committersijanec <sijanecantonluka@gmail.com>2020-05-20 19:21:31 +0200
commit448708182490d551721767bffc34ef35375f5082 (patch)
treef039502e4b2bb7aee1ad162aca38f89a2fb7cc5f /dist/js/settings.js
parentMerge branch 'dev' of https://github.com/beziapp/beziapp.github.io into dev (diff)
downloadbeziapp-448708182490d551721767bffc34ef35375f5082.tar
beziapp-448708182490d551721767bffc34ef35375f5082.tar.gz
beziapp-448708182490d551721767bffc34ef35375f5082.tar.bz2
beziapp-448708182490d551721767bffc34ef35375f5082.tar.lz
beziapp-448708182490d551721767bffc34ef35375f5082.tar.xz
beziapp-448708182490d551721767bffc34ef35375f5082.tar.zst
beziapp-448708182490d551721767bffc34ef35375f5082.zip
Diffstat (limited to '')
-rw-r--r--dist/js/settings.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/dist/js/settings.js b/dist/js/settings.js
index b53d2ce..7ea0b47 100644
--- a/dist/js/settings.js
+++ b/dist/js/settings.js
@@ -14,6 +14,13 @@ async function setTheme(targetTheme) {
});
}
+async function setErrorReporting(targetE) {
+ localforage.setItem("errorReporting", targetE).then((value) => {
+ console.log("ErrorReporing set: " + value);
+ UIAlert(D("errorReportingSet"), "setErrorReporting(): errorReportingSet");
+ });
+}
+
document.addEventListener("DOMContentLoaded", async () => {
$("#select-language").on("change", function() {
@@ -24,6 +31,10 @@ document.addEventListener("DOMContentLoaded", async () => {
setTheme($(this).find(":selected").val());
});
+ $("#select-errorreporting").on("change", function() {
+ setErrorReporting($(this).find(":selected").val());
+ });
+
localforage.getItem("chosenLang").then((value) => {
let selectedLanguage = value;
if(value == null || value.length < 1) {
@@ -40,6 +51,14 @@ document.addEventListener("DOMContentLoaded", async () => {
$(`#option-${selectedTheme}`).attr("selected", true);
}).catch(() => {});
+ localforage.getItem("errorReporting").then((value) => {
+ let selectedE = value;
+ if(value == null || value.length < 1) {
+ selectedE = "on";
+ }
+ $(`#option-${selectedE}`).attr("selected", true);
+ }).catch(() => {});
+
// Setup side menu
const menus = document.querySelectorAll(".side-menu");
M.Sidenav.init(menus, { edge: "right", draggable: true });