diff options
-rw-r--r-- | assets/js/app.js.bvr | 20 | ||||
-rw-r--r-- | assets/js/lang/bundle.js | 19 | ||||
-rw-r--r-- | assets/js/settings.js | 19 | ||||
-rw-r--r-- | assets/js/setup-storage.js | 1 | ||||
-rw-r--r-- | assets/pages-src/settings.bvr | 20 | ||||
-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 | ||||
-rwxr-xr-x | dist/pages/about.html | 2 | ||||
-rwxr-xr-x | dist/pages/settings.html | 20 | ||||
-rwxr-xr-x | dist/sw.js | 4 |
12 files changed, 138 insertions, 28 deletions
diff --git a/assets/js/app.js.bvr b/assets/js/app.js.bvr index 413c4a6..a75505e 100644 --- a/assets/js/app.js.bvr +++ b/assets/js/app.js.bvr @@ -54,11 +54,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/assets/js/lang/bundle.js b/assets/js/lang/bundle.js index 999e540..7e269b0 100644 --- a/assets/js/lang/bundle.js +++ b/assets/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/assets/js/settings.js b/assets/js/settings.js index b53d2ce..7ea0b47 100644 --- a/assets/js/settings.js +++ b/assets/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/assets/js/setup-storage.js b/assets/js/setup-storage.js index f9fa656..ce66bba 100644 --- a/assets/js/setup-storage.js +++ b/assets/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,...) diff --git a/assets/pages-src/settings.bvr b/assets/pages-src/settings.bvr index 4eed647..4c55da6 100644 --- a/assets/pages-src/settings.bvr +++ b/assets/pages-src/settings.bvr @@ -75,12 +75,28 @@ <div class="input-field col s12"> <i class="material-icons prefix">palette</i> <select class="theme-select input-select" id="select-theme"> - <option value="light" id="option-light" data-theme="light" selected>Light</option> - <option value="dark" id="option-dark" data-theme="dark">Dark</option> + <option value="light" id="option-light" data-theme="light" selected><x-su>themeLight</x-su></option> + <option value="dark" id="option-dark" data-theme="dark"><x-su>themeDark</x-su></option> </select> <label><x-su>selectTheme</x-su></label> </div> </div> + + + <div class="row"> + <div class="col s12"> + <h5 class="general-text"><x-su>errorReporting</x-su></h5> + </div> + <div class="input-field col s12"> + <i class="material-icons prefix">report_problem</i> + <select class="errorreporting-select input-select" id="select-errorreporting"> + <option value="on" id="option-on" data-errorreporting="on" selected><x-su>on</x-su></option> + <option value="off" id="option-off" data-errorreporting="off"><x-su>off</x-su></option> + </select> + <label><x-su>selectErrorReporting</x-su></label> + </div> + </div> + </div> </body> 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,...) diff --git a/dist/pages/about.html b/dist/pages/about.html index 0618a8a..0f80536 100755 --- a/dist/pages/about.html +++ b/dist/pages/about.html @@ -142,7 +142,7 @@ <div class="row"> <p> <small> - ^HEAD 5de19af5e33c527e4b47091b5eba010f002b73eb + ^HEAD bf35c28cb1089df86bdd57134f475f3abe9fb539 </small> </p> </div> diff --git a/dist/pages/settings.html b/dist/pages/settings.html index d4f720a..612be7d 100755 --- a/dist/pages/settings.html +++ b/dist/pages/settings.html @@ -95,12 +95,28 @@ <div class="input-field col s12"> <i class="material-icons prefix">palette</i> <select class="theme-select input-select" id="select-theme"> - <option value="light" id="option-light" data-theme="light" selected>Light</option> - <option value="dark" id="option-dark" data-theme="dark">Dark</option> + <option value="light" id="option-light" data-theme="light" selected><x-su>themeLight</x-su></option> + <option value="dark" id="option-dark" data-theme="dark"><x-su>themeDark</x-su></option> </select> <label><x-su>selectTheme</x-su></label> </div> </div> + + + <div class="row"> + <div class="col s12"> + <h5 class="general-text"><x-su>errorReporting</x-su></h5> + </div> + <div class="input-field col s12"> + <i class="material-icons prefix">report_problem</i> + <select class="errorreporting-select input-select" id="select-errorreporting"> + <option value="on" id="option-on" data-errorreporting="on" selected><x-su>on</x-su></option> + <option value="off" id="option-off" data-errorreporting="off"><x-su>off</x-su></option> + </select> + <label><x-su>selectErrorReporting</x-su></label> + </div> + </div> + </div> </body> @@ -3,8 +3,8 @@ // Change version to cause cache refresh -const static_cache_name = "site-static-1.0.13-beta-5de19af"; -// latest commit is 5de19af5e33c527e4b47091b5eba010f002b73eb +const static_cache_name = "site-static-1.0.13-beta-bf35c28"; +// latest commit is bf35c28cb1089df86bdd57134f475f3abe9fb539 // Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js // sw.js NE SME BITI CACHAN, ker vsebuje verzijo! |