summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrstular <rok@stular.eu>2020-01-30 00:14:02 +0100
committerrstular <rok@stular.eu>2020-01-30 00:14:02 +0100
commit98688c884e754fcc239c0983fa373b37d067505f (patch)
tree0dbe257830cdb91de4c6ec785157af15627bdc09
parentRemoved woff fonts (diff)
downloadbeziapp-98688c884e754fcc239c0983fa373b37d067505f.tar
beziapp-98688c884e754fcc239c0983fa373b37d067505f.tar.gz
beziapp-98688c884e754fcc239c0983fa373b37d067505f.tar.bz2
beziapp-98688c884e754fcc239c0983fa373b37d067505f.tar.lz
beziapp-98688c884e754fcc239c0983fa373b37d067505f.tar.xz
beziapp-98688c884e754fcc239c0983fa373b37d067505f.tar.zst
beziapp-98688c884e754fcc239c0983fa373b37d067505f.zip
-rw-r--r--index.html2
-rw-r--r--js/grades.js21
-rw-r--r--login.html2
-rw-r--r--logout.html2
-rw-r--r--pages/about.html8
-rw-r--r--pages/absences.html2
-rw-r--r--pages/grades.html21
-rw-r--r--pages/gradings.html2
-rw-r--r--pages/privacypolicy.html2
-rw-r--r--pages/teachers.html2
-rw-r--r--pages/timetable.html2
-rw-r--r--pages/tos.html2
-rw-r--r--sw.js2
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BežiApp</title>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BežiApp</title>
diff --git a/logout.html b/logout.html
index bfdabcf..cf53cdd 100644
--- a/logout.html
+++ b/logout.html
@@ -2,7 +2,7 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BežiApp</title>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>About</title>
@@ -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.3-beta</h5>
+ <h5 class="subheader">Version 1.0.4-beta</h5>
</div>
</div>
<div class="row">
@@ -101,9 +101,11 @@
<div class="row">
<div class="col s12">
<div class="collection">
+ <a href="/pages/changelog.html" class="collection-item">What's new</a>
<a href="/pages/tos.html" class="collection-item">Terms of Service</a>
<a href="/pages/privacypolicy.html" class="collection-item">Privacy policy</a>
- <a href="https://instagram.com/beziapp/" target="_blank" class="collection-item">Report a bug / Send a suggestion</a>
+ <a href="https://instagram.com/beziapp/" target="_blank" class="collection-item">Report a bug / Send
+ a suggestion</a>
</div>
</div>
</div>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Absences</title>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Grades</title>
@@ -88,8 +88,27 @@
<li><a class="waves-effect" id="grade-type"></a></li>
</ul>
+ <div id="help-modal" class="modal bottom-sheet">
+ <div class="modal-content">
+ <h4>Use only permanent grades</h4>
+ <p>If checked, only permanent grades will be used in the average grade calculation.</p>
+ <p>If left unchecked, the calculation will include every available grade.</p>
+ </div>
+ <!-- <div class="modal-footer">
+ <a href="#!" class="modal-close waves-effect waves-green btn-flat">Agree</a>
+ </div> -->
+ </div>
+
<br>
<div class="container">
+ <p>
+ <label>
+ <input id="permanent-grades-checkbox" 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>
+
+ </label></p>
<ul class="collapsible" id="grades-collapsible"></ul>
</div>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Gradings</title>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Privacy policy</title>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Teachers</title>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Timetable</title>
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 @@
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Terms and Conditions</title>
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",