summaryrefslogtreecommitdiffstats
path: root/dist/js
diff options
context:
space:
mode:
Diffstat (limited to 'dist/js')
-rwxr-xr-xdist/js/app.js2
-rw-r--r--dist/js/lang/bundle.js26
-rw-r--r--dist/js/lib/themes.js56
-rw-r--r--dist/js/settings.js46
-rw-r--r--dist/js/setup-storage.js8
5 files changed, 125 insertions, 13 deletions
diff --git a/dist/js/app.js b/dist/js/app.js
index 88246df..1d36346 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 = "db70845685ffe5fa725530ca03ba4c72e822e450";
+const previous_commit = "3f938cc55a938da9cd7bf4151eb442b580ae4546";
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 f158a98..d2e99ce 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..f9e3c79 100644
--- a/dist/js/settings.js
+++ b/dist/js/settings.js
@@ -21,8 +21,54 @@ 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();
+ });
+ }
+ $("#select-theme").formSelect();
+}
+
+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);