diff options
author | rstular <rok@stular.eu> | 2020-05-20 20:47:22 +0200 |
---|---|---|
committer | rstular <rok@stular.eu> | 2020-05-20 20:47:22 +0200 |
commit | 8e8a1ece2e95e3817739b0ded93eac5214ba49b6 (patch) | |
tree | 9c20ec5f12942c1a7292d83b2fd295b8e82f779e /dist | |
parent | Indentation fix (diff) | |
download | beziapp-8e8a1ece2e95e3817739b0ded93eac5214ba49b6.tar beziapp-8e8a1ece2e95e3817739b0ded93eac5214ba49b6.tar.gz beziapp-8e8a1ece2e95e3817739b0ded93eac5214ba49b6.tar.bz2 beziapp-8e8a1ece2e95e3817739b0ded93eac5214ba49b6.tar.lz beziapp-8e8a1ece2e95e3817739b0ded93eac5214ba49b6.tar.xz beziapp-8e8a1ece2e95e3817739b0ded93eac5214ba49b6.tar.zst beziapp-8e8a1ece2e95e3817739b0ded93eac5214ba49b6.zip |
Diffstat (limited to '')
-rwxr-xr-x | dist/js/app.js | 2 | ||||
-rw-r--r-- | dist/js/lang/bundle.js | 26 | ||||
-rw-r--r-- | dist/js/lib/themes.js | 56 | ||||
-rw-r--r-- | dist/js/settings.js | 45 | ||||
-rw-r--r-- | dist/js/setup-storage.js | 8 | ||||
-rwxr-xr-x | dist/pages/about.html | 2 | ||||
-rwxr-xr-x | dist/pages/messaging.html | 2 | ||||
-rwxr-xr-x | dist/pages/settings.html | 19 | ||||
-rwxr-xr-x | dist/sw.js | 4 |
9 files changed, 145 insertions, 19 deletions
diff --git a/dist/js/app.js b/dist/js/app.js index e0be429..88246df 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 = "22bc85704a637175361d7447634f605d6a9102a1"; +const previous_commit = "db70845685ffe5fa725530ca03ba4c72e822e450"; if ("serviceWorker" in navigator) { navigator.serviceWorker.register("/sw.js") diff --git a/dist/js/lang/bundle.js b/dist/js/lang/bundle.js index 75fae14..9545c38 100644 --- a/dist/js/lang/bundle.js +++ b/dist/js/lang/bundle.js @@ -292,12 +292,16 @@ var langstrings = { themeDark: "dark theme", themeNight: "night theme", selectTheme: "select a theme", + triggerWarning: "the following switch enables additional settings, which some people may: disagree with, find annoying, be offended by them. By enabling the switch, you agree that you won't be triggered by any of the additional options and will not asociate any of the authors and/or their personal beliefs and opinions with additional options.", + triggerAgreement: "i agree with terms and conditions stated above", + triggerWarningSet: "additional settings toggled", + additionalOptions: "additional settings", themeSet: "theme set, open another page for the changes to take effect", errorReportingSet: "error reporting preference set", - errorReporting: "error reporting", - on: "on", - off: "off", - selectErrorReporting: "should error reports be submitted to the developers?", + errorReporting: "error reporting", + on: "on", + off: "off", + selectErrorReporting: "should error reports be submitted to the developers?", // gsec gsecErrNet: "GimSIS connection error", gsecErrLogin: "GimSIS login error (bad password?), try logging out", @@ -481,7 +485,7 @@ var langstrings = { 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", // settings - language: "jezik", + language: "jezik", selectLanguage: "izberite željen jezik", languageSet: "jezik nastavljen, odprite neko drugo stran da se pokažejo spremembe", theme: "izgled", @@ -491,10 +495,14 @@ var langstrings = { 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", - selectErrorReporting: "ali naj so napake v aplikaciji posredovane razvijalcem?", + errorReporting: "pošiljanje napak", + on: "vklopljeno", + off: "izklopljeno", + selectErrorReporting: "ali naj so napake v aplikaciji posredovane razvijalcem?", + triggerWarning: "spodnji gumb omogoči dodatne možnosti, ki lahko razburijo/vznevoljijo nekatere uporabnike. Če omogočite stikalo se strinjate, da avtorjev in/ali njihovih osebnih prepričanj ne boste povezovali s katerokoli od dodatnih omogočenih možnosti.", + triggerAgreement: "strinjam se z zgoraj navedenimi pogoji", + triggerWarningSet: "spremenili ste stanje dodatnih nastavitev", + additionalOptions: "dodatne nastavitve", // gsec gsecErrNet: "napaka povezave na GimSIS", gsecErrLogin: "prijava v GimSIS ni uspela (napačno geslo?), poskusite se odjaviti", diff --git a/dist/js/lib/themes.js b/dist/js/lib/themes.js index 611cae7..e42c9fd 100644 --- a/dist/js/lib/themes.js +++ b/dist/js/lib/themes.js @@ -83,6 +83,62 @@ const THEME_COLOR_SCHEMES = { "color-btn-flat": "rgba(178, 178, 178, 1)", "color-btn-flat-disabled": "rgba(52, 52, 52, 1)" + }, + left: { + "color-primary": "rgba(173, 0, 0, 1)", + "color-secondary": "rgba(148, 15, 15, 1)", + "color-accent": "rgba(181, 42, 42, 1)", + "color-primary-light": "rgba(250, 230, 230, 1)", + "color-invalid": "rgba(120, 0, 108, 1)", + "color-primary-transparent": "rgba(173, 0, 0, 0.3)", + + "background-color": "rgba(255, 255, 255, 1)", + "background-accent": "rgba(199, 38, 38, 0.2)", + "background-accent-1": "rgb(219, 192, 192, 1)", + + "color-header-bold": "rgba(255, 255, 255, 1)", + "color-header-span": "rgba(255, 255, 255, 1)", + + "color-text": "rgba(0, 0, 0, 1)", + "color-text-light": "rgba(97, 97, 97, 1)", + "color-label-text": "rgba(158, 158, 158, 1)", + "color-table-hover": "rgba(242, 242, 242, 0.5)", + + "color-sidenav-background": "rgba(255, 255, 255, 1)", + "color-sidenav-text": "rgba(0, 0, 0, 0.87)", + "color-sidenav-header": "rgba(0, 0, 0, 0.54)", + "color-divider": "rgba(224, 224, 224, 1)", + + "color-btn-flat": "rgba(52, 52, 52, 1)", + "color-btn-flat-disabled": "rgba(178, 178, 178, 1)" + }, + right: { + "color-primary": "rgba(7, 0, 105, 1)", + "color-secondary": "rgba(206, 217, 0, 1)", + "color-accent": "rgba(0, 94, 156, 1)", + "color-primary-light": "rgba(195, 191, 255, 1)", + "color-invalid": "rgba(192, 0, 0, 1)", + "color-primary-transparent": "rgba(7, 0, 105, 0.3)", + + "background-color": "rgba(255, 255, 255, 1)", + "background-accent": "rgba(0, 60, 156, 0.2)", + "background-accent-1": "rgb(215, 219, 192, 1)", + + "color-header-bold": "rgba(255, 255, 255, 1)", + "color-header-span": "rgba(255, 255, 255, 1)", + + "color-text": "rgba(0, 0, 0, 1)", + "color-text-light": "rgba(97, 97, 97, 1)", + "color-label-text": "rgba(158, 158, 158, 1)", + "color-table-hover": "rgba(242, 242, 242, 0.5)", + + "color-sidenav-background": "rgba(255, 255, 255, 1)", + "color-sidenav-text": "rgba(0, 0, 0, 0.87)", + "color-sidenav-header": "rgba(0, 0, 0, 0.54)", + "color-divider": "rgba(224, 224, 224, 1)", + + "color-btn-flat": "rgba(52, 52, 52, 1)", + "color-btn-flat-disabled": "rgba(178, 178, 178, 1)" } } diff --git a/dist/js/settings.js b/dist/js/settings.js index 1dd3bfc..0854042 100644 --- a/dist/js/settings.js +++ b/dist/js/settings.js @@ -21,8 +21,53 @@ async function setErrorReporting(targetE) { }); } +function shuffleArray(array) { + for (var i = array.length - 1; i > 0; i--) { + var j = Math.floor(Math.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } +} + +function setUIAdditionalOptions(state) { + var SENSITIVE_THEMES = { + "left": "Left / leva", + "right": "Right / desna" + }; + if (state === true) { + var theme_keys = Object.keys(SENSITIVE_THEMES); + shuffleArray(theme_keys); + theme_keys.forEach((item) => { + var option_element = $(`<option value="${item}" id="option-${item}" data-theme="${item}">${SENSITIVE_THEMES[item]}</option>`); + $("#select-theme").append(option_element); + }); + } else { + Object.keys(SENSITIVE_THEMES).forEach((item) => { + $("#option-" + item).remove(); + }); + } +} + +async function setAdditionalOptions(state) { + localforage.setItem("triggerWarningAccepted", state).then((value) => { + console.log("TriggerWarning set: " + value); + UIAlert(D("triggerWarningSet"), "setAdditionalOptions(): triggerWarningSet"); + setUIAdditionalOptions(value); + }); +} + document.addEventListener("DOMContentLoaded", async () => { + // Setup checkbox handler + $("#triggered-checkbox").change(function() { + if (this.checked) { + setAdditionalOptions(true); + } else { + setAdditionalOptions(false); + } + }); + $("#select-language").on("change", function() { setLanguage($(this).find(":selected").val()); }); diff --git a/dist/js/setup-storage.js b/dist/js/setup-storage.js index 7aaa089..0d2552a 100644 --- a/dist/js/setup-storage.js +++ b/dist/js/setup-storage.js @@ -2,7 +2,7 @@ async function setupStorage(force = false) { let logged_in; promises_check_if_already_installed = [ localforage.getItem("logged_in").then( function(val) { - console.log("[setupStorage] logged in status: "+val); + console.log("[setupStorage] logged in status: " + val); logged_in = val; }) ]; @@ -20,7 +20,8 @@ async function setupStorage(force = false) { localforage.setItem("meals", {}), localforage.setItem("chosenLang", "en"), localforage.setItem("theme", "light"), - localforage.setItem("errorReporting", "on") + localforage.setItem("errorReporting", "on"), + localforage.setItem("triggerWarningAccepted", false) ]; if (logged_in && force == false) { // torej, če je že bila prijava narejena, ne posodobi backwards-compatible vrednosti (username, password,...) @@ -33,7 +34,8 @@ async function setupStorage(force = false) { localforage.setItem("username", ""), localforage.setItem("password", ""), localforage.setItem("chosenLang", "en"), - localforage.setItem("theme", "light") + localforage.setItem("theme", "light"), + localforage.setItem("triggerWarningAccepted", false) ]; await localforage.clear(); await Promise.all(promises_first_install); diff --git a/dist/pages/about.html b/dist/pages/about.html index 24bdb01..3d5f05a 100755 --- a/dist/pages/about.html +++ b/dist/pages/about.html @@ -142,7 +142,7 @@ <div class="row"> <p> <small> - ^HEAD 22bc85704a637175361d7447634f605d6a9102a1 + ^HEAD db70845685ffe5fa725530ca03ba4c72e822e450 </small> </p> </div> diff --git a/dist/pages/messaging.html b/dist/pages/messaging.html index d90e53d..e5c85e5 100755 --- a/dist/pages/messaging.html +++ b/dist/pages/messaging.html @@ -145,7 +145,7 @@ <span><x-su>encryptMessage</x-su></span> </label> </div> - </div> + </div> <div class="row"> <div class="col s12 m12"> <div class="input-field" id="encryption-key-input" hidden> diff --git a/dist/pages/settings.html b/dist/pages/settings.html index 1316581..73a7ead 100755 --- a/dist/pages/settings.html +++ b/dist/pages/settings.html @@ -97,7 +97,7 @@ <select class="theme-select input-select" id="select-theme"> <option value="light" id="option-light" data-theme="light" selected>Light / svetla</option> <option value="dark" id="option-dark" data-theme="dark">Dark / temna</option> - <option value="night" id="option-night" data-theme="night">Night / nočna</x-su></option> + <option value="night" id="option-night" data-theme="night">Night / nočna</option> </select> <label><x-su>selectTheme</x-su></label> </div> @@ -112,10 +112,25 @@ <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>On / Vklopljeno</option> - <option value="off" id="option-off" data-errorreporting="off">Off / Izklopljeno</option> + <option value="off" id="option-off" data-errorreporting="off">Off / Izklopljeno</option> </select> <label><x-su>selectErrorReporting</x-su></label> </div> + </div> + + <div class="row"> + <div class="col s12"> + <h5 class="general-text"><x-su>additionalOptions</x-su></h5> + </div> + <div class="col s12"> + <p class="flow-text general-text"><x-du>triggerWarning</x-du></p> + </div> + <div class="valign-wrapper col s12 m12"> + <label> + <input type="checkbox" id="triggered-checkbox" /> + <span><x-su>triggerAgreement</x-su></span> + </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-22bc857"; -// commit before the latest is 22bc85704a637175361d7447634f605d6a9102a1 +const static_cache_name = "site-static-1.0.13-beta-db70845"; +// commit before the latest is db70845685ffe5fa725530ca03ba4c72e822e450 // Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js // sw.js NE SME BITI CACHAN, ker vsebuje verzijo! |