summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrstular <rok@stular.eu>2020-02-05 11:18:06 +0100
committerGitHub <noreply@github.com>2020-02-05 11:18:06 +0100
commit5088c34735cd4f1fc9ae8162ed1a43838a2a4b20 (patch)
tree07a81116d656f96b88e7ff374d0faff5fbaa2947
parentMerge pull request #4 from beziapp/dev (diff)
parentMerge branch 'dev' of https://github.com/beziapp/beziapp.github.io into dev (diff)
downloadbeziapp-5088c34735cd4f1fc9ae8162ed1a43838a2a4b20.tar
beziapp-5088c34735cd4f1fc9ae8162ed1a43838a2a4b20.tar.gz
beziapp-5088c34735cd4f1fc9ae8162ed1a43838a2a4b20.tar.bz2
beziapp-5088c34735cd4f1fc9ae8162ed1a43838a2a4b20.tar.lz
beziapp-5088c34735cd4f1fc9ae8162ed1a43838a2a4b20.tar.xz
beziapp-5088c34735cd4f1fc9ae8162ed1a43838a2a4b20.tar.zst
beziapp-5088c34735cd4f1fc9ae8162ed1a43838a2a4b20.zip
-rw-r--r--css/styles.css10
-rw-r--r--js/gradings.js73
-rw-r--r--js/initialize.js2
-rw-r--r--pages/about.html4
-rw-r--r--pages/changelog.html7
-rw-r--r--pages/grades.html2
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..0b8b53b 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 || gradings === [] || gradings === -1 || 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>