diff options
Diffstat (limited to '')
-rwxr-xr-x | dist/js/app.js | 22 | ||||
-rw-r--r-- | dist/js/lang/bundle.js | 19 | ||||
-rw-r--r-- | dist/js/settings.js | 19 | ||||
-rw-r--r-- | dist/js/setup-storage.js | 1 |
4 files changed, 50 insertions, 11 deletions
diff --git a/dist/js/app.js b/dist/js/app.js index 09e4c86..57996d3 100755 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -3,7 +3,7 @@ const app_version = "1.0.13-beta"; -const previous_commit = "5de19af5e33c527e4b47091b5eba010f002b73eb"; +const previous_commit = "bf35c28cb1089df86bdd57134f475f3abe9fb539"; if ("serviceWorker" in navigator) { navigator.serviceWorker.register("/sw.js") @@ -57,11 +57,21 @@ function gsecErrorHandlerUI(err) { var error_report_function = async function (msg, url, lineNo, columnNo, error) { - var data = {}; - data.error = {"msg": msg, "url": url, "line": lineNo, "column": columnNo, "obj": error}; - data.client = {"ua": navigator.userAgent, "app_version": app_version, "previous_commit": previous_commit}; - data.type = "error"; - $.post("https://beziapp-report.gimb.tk/", data); + localforage.getItem("errorReporting").then((value) => { + let selectedE = value; + if(value == null || value.length < 1) { + selectedE = "on"; + } + if(selectedE == "on") { + var data = {}; + data.error = {"msg": msg, "url": url, "line": lineNo, "column": columnNo, "obj": error}; + data.client = {"ua": navigator.userAgent, "app_version": app_version, "previous_commit": previous_commit}; + data.type = "error"; + $.post("https://beziapp-report.gimb.tk/", data); + } else { + console.log("error not reported as reporting is disabled!"); + } + }).catch(() => {}); return false; } diff --git a/dist/js/lang/bundle.js b/dist/js/lang/bundle.js index 999e540..7e269b0 100644 --- a/dist/js/lang/bundle.js +++ b/dist/js/lang/bundle.js @@ -288,10 +288,14 @@ var langstrings = { selectLanguage: "select desired language", languageSet: "language set, open another page for the changes to take effect", theme: "theme", - themeLight: "Light theme (default)", - themeDark: "Dark theme", - selectTheme: "Select a theme", + themeLight: "light theme (default)", + themeDark: "dark theme", + selectTheme: "select a theme", themeSet: "theme set, open another page for the changes to take effect", + errorReportingSet: "error reporting preference set", + errorReporting: "error reporting", + on: "on", + off: "off", // gsec gsecErrNet: "GimSIS connection error", gsecErrLogin: "GimSIS login error (bad password?), try logging out", @@ -417,7 +421,7 @@ var langstrings = { recipientNotInDirectory: "izbrane osebe ni v imeniku", chatExternalInfo: "dobili ste kratko sporočilo v standardu, ki ga GimSIS ne podpira. Pri odgovarjanju spremenite zadevo. Vsebina sporočila: ", // meals - loginError: "napaka pri prijavi", + loginError: "napaka pri prijavi", loginToLopolis: "prijava v Lopolis", loginToLopolisNote: "izgleda, da niste prijavljeni v eRestavracijo, zato se vam je prikazal prijavni obrazec. Za uporavljanje s prehrano se uporablja druga kombinacija uporabniškega imena in gesla, zato se prijavite s svojimi Lopolis prijavnimi podatki za nadaljevanje.", logInToLopolis: "prijava v Lopolis", @@ -474,7 +478,8 @@ var langstrings = { privacyRefuse: "you are free to refuse our request for your personal information, with the understanding that we may be unable to provide you with some of your desired services.", privacyAcceptWithUse: "your continued use of our website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how we handle user data and personal information, feel free to contact us.", privacyEffectiveAsOf: "this policy is effective as of", - language: "jezik", + // settings + language: "jezik", selectLanguage: "izberite željen jezik", languageSet: "jezik nastavljen, odprite neko drugo stran da se pokažejo spremembe", theme: "izgled", @@ -482,6 +487,10 @@ var langstrings = { themeDark: "temen izgled", themeSet: "izgled nastavljen, odprite neko drugo stran da se spremembe uveljavijo", selectTheme: "izberite željen izgled", + errorReportingSet: "nastavitev pošiljanja napak izbrana", + errorReporting: "pošiljanje napak", + on: "vklopljeno", + off: "izklopljeno", // gsec gsecErrNet: "napaka povezave na GimSIS", gsecErrLogin: "prijava v GimSIS ni uspela (napačno geslo?), poskusite se odjaviti", 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 }); diff --git a/dist/js/setup-storage.js b/dist/js/setup-storage.js index f9fa656..ce66bba 100644 --- a/dist/js/setup-storage.js +++ b/dist/js/setup-storage.js @@ -20,6 +20,7 @@ async function setupStorage(force = false) { localforage.setItem("meals", {}), localforage.setItem("chosenLang", "en"), localforage.setItem("theme", "light") + localforage.setItem("errorReporting", "on") ]; if (logged_in && force == false) { // torej, če je že bila prijava narejena, ne posodobi backwards-compatible vrednosti (username, password,...) |