diff options
-rw-r--r-- | css/styles.css | 10 | ||||
-rw-r--r-- | js/gradings.js | 73 | ||||
-rw-r--r-- | js/initialize.js | 2 | ||||
-rw-r--r-- | pages/about.html | 4 | ||||
-rw-r--r-- | pages/changelog.html | 7 | ||||
-rw-r--r-- | pages/grades.html | 2 |
6 files changed, 58 insertions, 40 deletions
diff --git a/css/styles.css b/css/styles.css index 25e5fe0..73c6be6 100644 --- a/css/styles.css +++ b/css/styles.css @@ -89,4 +89,14 @@ a.collection-item { .fc-unthemed td.fc-today { background: var(--color-primary-light); +} + +.no-select { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; }
\ No newline at end of file diff --git a/js/gradings.js b/js/gradings.js index 8902a5d..1109961 100644 --- a/js/gradings.js +++ b/js/gradings.js @@ -91,51 +91,52 @@ async function loadGradings(force_refresh = false) { }) ]; - await Promise.all(promises_to_run); + Promise.all(promises_to_run).then(() => { - if (gradings === null || force_refresh) { - $.ajax({ - url: API_ENDPOINT, - crossDomain: true, + if (gradings === null || force_refresh) { + $.ajax({ + url: API_ENDPOINT, + crossDomain: true, - data: { - "u": username, - "p": password, - "m": "fetchocenjevanja" - }, - dataType: "json", + data: { + "u": username, + "p": password, + "m": "fetchocenjevanja" + }, + dataType: "json", - cache: false, - type: "GET", + cache: false, + type: "GET", - success: (data) => { + success: (data) => { - // If data is null, the credentials were incorrect - if (data === null) { - M.toast({ html: "Request failed!" }); - setLoading(false); - } else { - // Save gradings & populate calendar - localforage.setItem("gradings", data).then((value) => { - gradings = value; - displayData(); + // If data is null, the credentials were incorrect + if (data === null) { + M.toast({ html: "Request failed!" }); setLoading(false); - }); + } else { + // Save gradings & populate calendar + localforage.setItem("gradings", data).then((value) => { + gradings = value; + displayData(); + setLoading(false); + }); + } + + }, + + error: () => { + M.toast({ html: "No internet connection!" }); + setLoading(false); } - }, - - error: () => { - M.toast({ html: "No internet connection!" }); - setLoading(false); - } - - }) + }) - } else { - displayData(); - setLoading(false); - } + } else { + displayData(); + setLoading(false); + } + }); } diff --git a/js/initialize.js b/js/initialize.js index bfad5fc..39ed505 100644 --- a/js/initialize.js +++ b/js/initialize.js @@ -28,7 +28,7 @@ localforage.getItem("logged_in") } else if (value === false) { window.location.replace("/login.html"); } else { - window.location.replace("/pages/teachers.html"); + window.location.replace("/pages/timetable.html"); } } ).catch( diff --git a/pages/about.html b/pages/about.html index f31292f..7a12a2a 100644 --- a/pages/about.html +++ b/pages/about.html @@ -71,7 +71,7 @@ <div class="col s12"> <h3><b class="title-secondary">Beži</b><span class="title-primary">App</span> </h3> - <h5 class="subheader">Version 1.0.4-beta</h5> + <h5 class="subheader">Version 1.0.5-beta</h5> </div> </div> <div class="row"> @@ -112,4 +112,4 @@ </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/pages/changelog.html b/pages/changelog.html index a2abb77..529394e 100644 --- a/pages/changelog.html +++ b/pages/changelog.html @@ -46,6 +46,13 @@ <h3>Changelog</h3> <ul class="collapsible"> <li> + <div class="collapsible-header">Version 1.0.5-beta</div> + <div class="collapsible-body"> + <ul class="collection"> + <li class="collection-item">Fixed default view on startup</li> + <li class="collection-item">Changed promise handling in gradings (#5)</li> + </ul> + </div> <div class="collapsible-header">Version 1.0.4-beta</div> <div class="collapsible-body"> <ul class="collection"> diff --git a/pages/grades.html b/pages/grades.html index 6332d59..2c300cc 100644 --- a/pages/grades.html +++ b/pages/grades.html @@ -103,7 +103,7 @@ <div class="container"> <p> <label> - <input id="permanent-grades-checkbox" type="checkbox" /> + <input id="permanent-grades-checkbox" class="no-select" type="checkbox" /> <span style="vertical-align: sub;">Use only permanent grades <a id="help-icon" class="modal-trigger" href="#help-modal"><i class="material-icons" style="vertical-align: sub;">help_outline</i></a></span> |