From 98688c884e754fcc239c0983fa373b37d067505f Mon Sep 17 00:00:00 2001 From: rstular Date: Thu, 30 Jan 2020 00:14:02 +0100 Subject: Temporary inclusion/exclusion option, fixed zoom --- index.html | 2 +- js/grades.js | 21 ++++++++++++++++----- login.html | 2 +- logout.html | 2 +- pages/about.html | 8 +++++--- pages/absences.html | 2 +- pages/grades.html | 21 ++++++++++++++++++++- pages/gradings.html | 2 +- pages/privacypolicy.html | 2 +- pages/teachers.html | 2 +- pages/timetable.html | 2 +- pages/tos.html | 2 +- sw.js | 2 +- 13 files changed, 51 insertions(+), 19 deletions(-) diff --git a/index.html b/index.html index 17c56a0..4c27e9a 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + BežiApp diff --git a/js/grades.js b/js/grades.js index 1768fb0..5c544fb 100644 --- a/js/grades.js +++ b/js/grades.js @@ -1,6 +1,8 @@ const API_ENDPOINT = "https://gimb.tk/test.php"; // const API_ENDPOINT = "http://localhost:5000/test.php"; +let checkbox_state = false; + async function checkLogin() { localforage.getItem("logged_in").then((value) => { // This code runs once the value has been loaded @@ -167,8 +169,8 @@ function displayGrades() { grade_node.appendChild(grade_node_div); - // Count the grade only if it's not temprary - if (!grade["temporary"]) { + // Count the grade only if it's not temporary or explicitly enabled + if (!grade["temporary"] || !checkbox_state) { grade_sum += grade["grade"]; grade_tot += 1; } @@ -205,9 +207,9 @@ function clearGrades() { } } -function refreshGrades() { +function refreshGrades(force) { clearGrades(); - loadGrades(true); + loadGrades(force); } function refreshClickHandlers() { @@ -252,9 +254,18 @@ document.addEventListener("DOMContentLoaded", async () => { // Setup refresh handler $("#refresh-icon").click(function () { - refreshGrades(); + refreshGrades(true); + }); + + // Setup checkbox handler + $("#permanent-grades-checkbox").change(function () { + checkbox_state = this.checked; + refreshGrades(false); }); + let elems = document.querySelectorAll('.modal'); + let instances = M.Modal.init(elems, {}); + // Setup side menu const menus = document.querySelectorAll('.side-menu'); M.Sidenav.init(menus, { edge: 'right', draggable: true }); diff --git a/login.html b/login.html index 6fe37b0..b43949d 100644 --- a/login.html +++ b/login.html @@ -2,7 +2,7 @@ - + BežiApp diff --git a/logout.html b/logout.html index bfdabcf..cf53cdd 100644 --- a/logout.html +++ b/logout.html @@ -2,7 +2,7 @@ - + BežiApp diff --git a/pages/about.html b/pages/about.html index d9e052e..f31292f 100644 --- a/pages/about.html +++ b/pages/about.html @@ -2,7 +2,7 @@ - + About @@ -71,7 +71,7 @@

BežiApp

-
Version 1.0.3-beta
+
Version 1.0.4-beta
@@ -101,9 +101,11 @@ diff --git a/pages/absences.html b/pages/absences.html index 78bfd79..ae7a23b 100644 --- a/pages/absences.html +++ b/pages/absences.html @@ -2,7 +2,7 @@ - + Absences diff --git a/pages/grades.html b/pages/grades.html index 95acd22..6332d59 100644 --- a/pages/grades.html +++ b/pages/grades.html @@ -2,7 +2,7 @@ - + Grades @@ -88,8 +88,27 @@
  • + +
    +

    +

      diff --git a/pages/gradings.html b/pages/gradings.html index 14f0694..676b5ad 100644 --- a/pages/gradings.html +++ b/pages/gradings.html @@ -2,7 +2,7 @@ - + Gradings diff --git a/pages/privacypolicy.html b/pages/privacypolicy.html index 72e0c2c..8daa469 100644 --- a/pages/privacypolicy.html +++ b/pages/privacypolicy.html @@ -2,7 +2,7 @@ - + Privacy policy diff --git a/pages/teachers.html b/pages/teachers.html index 7e869ca..6c4bc19 100644 --- a/pages/teachers.html +++ b/pages/teachers.html @@ -2,7 +2,7 @@ - + Teachers diff --git a/pages/timetable.html b/pages/timetable.html index 9d6922e..f3426f1 100644 --- a/pages/timetable.html +++ b/pages/timetable.html @@ -2,7 +2,7 @@ - + Timetable diff --git a/pages/tos.html b/pages/tos.html index e25a022..2f0304c 100644 --- a/pages/tos.html +++ b/pages/tos.html @@ -2,7 +2,7 @@ - + Terms and Conditions diff --git a/sw.js b/sw.js index 0e5ef4e..af54e19 100644 --- a/sw.js +++ b/sw.js @@ -1,5 +1,5 @@ // Change version to cause cache refresh -const static_cache_name = "site-static-v1.0.3"; +const static_cache_name = "site-static-v1.0.4"; // Got them with du -a and minor cleaning up const assets = [ "/img/avatars/asijanec.png", -- cgit v1.2.3 From e32fb47304ab8b4aa21f11ec42f454077276dfcc Mon Sep 17 00:00:00 2001 From: rstular Date: Thu, 30 Jan 2020 00:14:29 +0100 Subject: Added changelog --- js/changelog.js | 24 ++++++++++++++++++++ pages/changelog.html | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 js/changelog.js create mode 100644 pages/changelog.html diff --git a/js/changelog.js b/js/changelog.js new file mode 100644 index 0000000..9fb9a84 --- /dev/null +++ b/js/changelog.js @@ -0,0 +1,24 @@ +async function checkLogin() { + localforage.getItem("logged_in").then(function (value) { + // This code runs once the value has been loaded + // from the offline store. + if (value !== true) { + window.location.replace("/index.html"); + } + }).catch(function (err) { + // This code runs if there were any errors + console.log(err); + }); +} + +document.addEventListener("DOMContentLoaded", () => { + checkLogin(); + + // Setup back button + $("#nav-back-button").click(function () { + window.location.replace("/pages/about.html"); + }); + + var elems = document.querySelectorAll(".collapsible"); + var instances = M.Collapsible.init(elems, {}); +}); \ No newline at end of file diff --git a/pages/changelog.html b/pages/changelog.html new file mode 100644 index 0000000..ad0b737 --- /dev/null +++ b/pages/changelog.html @@ -0,0 +1,64 @@ + + + + + + + Changelog + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +

      Changelog

      +
        +
      • +
        Version 1.0.4-beta
        +
        +
          +
        • Introduced the changelog
        • +
        • Option for including/excluding temporary grades in average + calculation (credit: Tinkara)
        • +
        +
        +
      • +
      +
      +
      + + + + \ No newline at end of file -- cgit v1.2.3 From c3a3e0b527e4760f0667de77d91b6fc61db677b6 Mon Sep 17 00:00:00 2001 From: rstular Date: Thu, 30 Jan 2020 00:15:10 +0100 Subject: Added changelog to cache --- sw.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sw.js b/sw.js index af54e19..adb6539 100644 --- a/sw.js +++ b/sw.js @@ -21,6 +21,7 @@ const assets = [ "/pages/timetable.html", "/pages/tos.html", "/pages/privacypolicy.html", + "/pages/changelog.html", "/fonts/materialicons.woff2", "/fonts/fa-regular-400.eot", @@ -51,6 +52,7 @@ const assets = [ "/js/absences.js", "/js/tos.js", "/js/privacypolicy.js", + "/js/changelog.js", "/js/lib/materialize.min.js", "/js/lib/fullcalendar/daygrid/main.min.js", -- cgit v1.2.3 From 8e205b667eef926bfb5944f8e664cc8be500839f Mon Sep 17 00:00:00 2001 From: rstular Date: Thu, 30 Jan 2020 00:29:08 +0100 Subject: Fixed datetime picker colors --- css/styles.css | 28 +++++++++++++++++++++++++++- pages/changelog.html | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/css/styles.css b/css/styles.css index d02ed1e..afd7674 100644 --- a/css/styles.css +++ b/css/styles.css @@ -2,6 +2,7 @@ --color-primary: rgba(0, 128, 83, 1); --color-secondary: rgba(0, 77, 50, 1); --color-accent: rgba(0, 156, 101, 1); + --color-primary-light: rgba(230, 250, 231, 1); } .title-primary { @@ -59,4 +60,29 @@ a { a.collection-item { color: var(--color-primary) !important; -} \ No newline at end of file +} + +.datepicker-date-display { + background-color: var(--color-primary); +} + +.datepicker-table td.is-today { + color: var(--color-primary); +} + +.datepicker-table td.is-selected { + background-color: var(--color-primary); +} + +.datepicker-table td.is-selected.is-today { + background-color: var(--color-primary); + color: white; +} + +.datepicker-cancel { + color: var(--color-primary); +} + +.datepicker-done { + color: var(--color-primary); +} diff --git a/pages/changelog.html b/pages/changelog.html index ad0b737..12121e5 100644 --- a/pages/changelog.html +++ b/pages/changelog.html @@ -50,6 +50,7 @@
      • Introduced the changelog
      • +
      • Fixed date picker color
      • Option for including/excluding temporary grades in average calculation (credit: Tinkara)
      -- cgit v1.2.3 From 9a2fc408126a6a19e5571774054dd8d79162b26a Mon Sep 17 00:00:00 2001 From: rstular Date: Thu, 30 Jan 2020 00:30:13 +0100 Subject: Weekly calendar accent color --- css/styles.css | 4 ++++ pages/changelog.html | 1 + 2 files changed, 5 insertions(+) diff --git a/css/styles.css b/css/styles.css index afd7674..25e5fe0 100644 --- a/css/styles.css +++ b/css/styles.css @@ -86,3 +86,7 @@ a.collection-item { .datepicker-done { color: var(--color-primary); } + +.fc-unthemed td.fc-today { + background: var(--color-primary-light); +} \ No newline at end of file diff --git a/pages/changelog.html b/pages/changelog.html index 12121e5..a2abb77 100644 --- a/pages/changelog.html +++ b/pages/changelog.html @@ -51,6 +51,7 @@
      • Introduced the changelog
      • Fixed date picker color
      • +
      • Changed weekly timetable accent color
      • Option for including/excluding temporary grades in average calculation (credit: Tinkara)
      -- cgit v1.2.3