summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-02-25 20:22:33 +0100
committerAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-02-25 20:22:33 +0100
commit4f38105bc4017248568e4c8c8b0506f6ac09a3b8 (patch)
tree5001ef3e2f30cd78daf8cb294a0f7c41791bd50d
parentsmall fix 32 (diff)
downloadbeziapp-4f38105bc4017248568e4c8c8b0506f6ac09a3b8.tar
beziapp-4f38105bc4017248568e4c8c8b0506f6ac09a3b8.tar.gz
beziapp-4f38105bc4017248568e4c8c8b0506f6ac09a3b8.tar.bz2
beziapp-4f38105bc4017248568e4c8c8b0506f6ac09a3b8.tar.lz
beziapp-4f38105bc4017248568e4c8c8b0506f6ac09a3b8.tar.xz
beziapp-4f38105bc4017248568e4c8c8b0506f6ac09a3b8.tar.zst
beziapp-4f38105bc4017248568e4c8c8b0506f6ac09a3b8.zip
-rw-r--r--js/initialize.js2
-rw-r--r--js/meals.js45
-rw-r--r--js/messaging.js14
-rw-r--r--pages/about.html24
-rw-r--r--pages/changelog.html9
-rw-r--r--pages/meals.html2
-rw-r--r--sw.js4
7 files changed, 46 insertions, 54 deletions
diff --git a/js/initialize.js b/js/initialize.js
index 2305742..d62e8d4 100644
--- a/js/initialize.js
+++ b/js/initialize.js
@@ -45,7 +45,7 @@ localforage.getItem("logged_in")
// User is logged in, execute appropriate action
if (getUrlParameter("m") !== "") {
- window.location.replace("/pages/messaging.html?m=" + getUrlParameter("m"));
+ window.location.replace("/pages/messaging.html#" + getUrlParameter("m"));
} else {
window.location.replace("/pages/timetable.html");
}
diff --git a/js/meals.js b/js/meals.js
index bb3653f..59463c0 100644
--- a/js/meals.js
+++ b/js/meals.js
@@ -109,6 +109,8 @@ function displayMeals() {
let root_element = document.getElementById("meals-collapsible");
for(const [date, mealzz] of Object.entries(meals.data)) {
+ let unabletochoosequestionmark = "";
+ let readonly = mealzz.readonly;
var datum = new Date(date);
// Create root element for a date entry
let subject_entry = document.createElement("li");
@@ -118,8 +120,11 @@ function displayMeals() {
subject_header.classList.add("collapsible-header-root");
// Create header text element
let subject_header_text = document.createElement("span");
+ if(mealzz.readonly) {
+ unabletochoosequestionmark = "*Read only*";
+ }
subject_header_text.innerText = jsDateDayString[datum.getDay()]+", "+datum.getDate()+". "+jsDateMonthString[datum.getMonth()]+" "+datum.getFullYear()+" ("+mealzz.meal+"@"
- +mealzz.location+")";
+ +mealzz.location+") "+unabletochoosequestionmark;
// Create collection for displaying individuals meals
let subject_body = document.createElement("div");
@@ -134,8 +139,10 @@ function displayMeals() {
meal_node.classList.add("collection-item")
meal_node.classList.add("meal-node");
meal_node.dataset["index"] = dindex;
- meal_node.onclick = function () {
- setMenu(date, dmil.value);
+ if(!readonly) {
+ meal_node.onclick = function () {
+ setMenu(date, dmil.value);
+ }
}
let meal_node_div = document.createElement("div");
@@ -195,38 +202,6 @@ function refreshMeals(force) {
loadMeals(force);
}
-function refreshClickHandlers() { // unused
- $("#meals-collapsible").find(".collection-item.meal-node").click(function () {
- let grade_obj = grades[parseInt(this.dataset["index"])];
- document.getElementById("grade-header").innerText = grade_obj["predmet"] + ": " + grade_obj["ocena"];
- document.getElementById("grade-date").innerText = grade_obj["datum"];
- document.getElementById("grade-title").innerText = grade_obj["naslov"];
- document.getElementById("grade-type").innerText = "Type: " + grade_obj["vrsta"];
-
- let term_element = document.getElementById("grade-term");
- if (grade_obj["rok"] !== "") {
- term_element.innerText = "Term: " + grade_obj["rok"];
- term_element.style["display"] = "";
- } else {
- term_element.style["display"] = "none";
- }
-
- document.getElementById("grade-teacher").innerText = "Teacher: " + grade_obj["profesor"];
-
- let temporary_object = document.getElementById("grade-temporary");
- let temporary_object_root = document.getElementById("grade-temporary-root");
- if (grade_obj["zacasna"]) {
- temporary_object.innerText = "(zacasna)";
- temporary_object_root.style["display"] = "";
- } else {
- temporary_object_root.style["display"] = "none";
- }
-
- const modal = document.querySelectorAll('.side-modal')[0];
- M.Sidenav.getInstance(modal).open();
- });
-}
-
function lopolisLogout() {
localforage.setItem("logged_in_lopolis", false);
checkLogin();
diff --git a/js/messaging.js b/js/messaging.js
index f5d2e13..70b7545 100644
--- a/js/messaging.js
+++ b/js/messaging.js
@@ -82,6 +82,13 @@ function populateAutocomplete() {
onAutocomplete: validateName,
minLength: 0
});
+ if(window.location.hash.length > 1) {
+ document.getElementById("full-name").value = decodeURIComponent(window.location.hash.substring(1));
+ } else {
+ document.getElementById("full-name").value = getUrlParameter("m");
+ }
+ M.updateTextFields();
+ validateName();
}
// Function to toggle loading bar
@@ -317,9 +324,8 @@ async function sendMessage(recipient_number, subject, body) {
});
}
-function validateName() {
+async function validateName() {
if (directory !== null) {
-
if ($("#full-name").val() in directory) {
$("#full-name").addClass("valid");
$("#full-name").removeClass("invalid");
@@ -329,7 +335,6 @@ function validateName() {
$("#full-name").removeClass("valid");
document.getElementById("msg-send").disabled = true;
}
-
}
}
@@ -398,10 +403,7 @@ document.addEventListener("DOMContentLoaded", () => {
var receivedmessages = null;
loadMessages(true, 0);
-
- document.getElementById("full-name").value = getUrlParameter("m");
M.updateTextFields();
- validateName();
// Setup side menu
const menus = document.querySelectorAll(".side-menu");
diff --git a/pages/about.html b/pages/about.html
index 682af72..4a90f5d 100644
--- a/pages/about.html
+++ b/pages/about.html
@@ -48,14 +48,11 @@
<h4><b>Beži</b>App</h4>
</a>
</li>
- <li><a href="/pages/timetable.html" class="waves-effect"><i class="material-icons">view_module</i>Timetable</a>
- </li>
+ <li><a href="/pages/timetable.html" class="waves-effect"><i class="material-icons">view_module</i>Timetable</a></li>
<li><a href="/pages/gradings.html" class="waves-effect"><i class="material-icons">event</i>Gradings</a></li>
<li><a href="/pages/grades.html" class="waves-effect"><i class="material-icons">receipt</i>Grades</a></li>
- <li><a href="/pages/teachers.html" class="waves-effect"><i
- class="material-icons">supervisor_account</i>Teachers</a></li>
- <li><a href="/pages/absences.html" class="waves-effect"><i class="material-icons">query_builder</i>Absences</a>
- </li>
+ <li><a href="/pages/teachers.html" class="waves-effect"><i class="material-icons">supervisor_account</i>Teachers</a></li>
+ <li><a href="/pages/absences.html" class="waves-effect"><i class="material-icons">query_builder</i>Absences</a></li>
<li><a href="/pages/messaging.html" class="waves-effect"><i class="material-icons">message</i>Messaging</a></li>
<li><a href="/pages/meals.html" class="waves-effect"><i class="material-icons">fastfood</i>Meals</a></li>
<li>
@@ -77,7 +74,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.9-beta</h5>
+ <h5 class="subheader">Version 1.0.10-beta</h5>
</div>
</div>
<div class="row">
@@ -89,6 +86,10 @@
<li class="collection-item avatar">
<img src="/img/avatars/rstular.png" class="circle">
<span class="title about-text">Rok Štular</span>
+ &nbsp;&nbsp;&nbsp;&nbsp; <!-- technology -->
+ <a href="messaging.html#Rok Štular" class="btn waves-effect waves-light" type="button">
+ <i class="material-icons">message</i>
+ </a>
<a target="_blank" href="https://instagram.com/rstular/"
class="secondary-content btn-floating btn-medium waves-effect waves-light button-theme-gimb"><i
class="fab fa-instagram"></i></a>
@@ -100,6 +101,11 @@
<a target="_blank" href="https://instagram.com/asijanec/"
class="secondary-content btn-floating btn-medium waves-effect waves-light button-theme-gimb"><i
class="fab fa-instagram"></i></a>
+ </a>
+ &nbsp;&nbsp;&nbsp;&nbsp; <!-- technology -->
+ <a href="messaging.html#Anton Luka Šijanec" class="btn waves-effect waves-light" type="button">
+ <i class="material-icons">message</i>
+ </a>
</li>
</ul>
</div>
@@ -111,11 +117,11 @@
<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 suggestion (instagram: @beziapp)</a>
</div>
</div>
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/pages/changelog.html b/pages/changelog.html
index dd97c72..b225acb 100644
--- a/pages/changelog.html
+++ b/pages/changelog.html
@@ -47,6 +47,13 @@
<h3>Changelog</h3>
<ul class="collapsible">
<li>
+ <div class="collapsible-header">Version 1.0.10-beta</div>
+ <div class="collapsible-body">
+ <ul class="collection">
+ <li class="collection-item">Added meals</li>
+ </ul>
+ </div>
+
<div class="collapsible-header">Version 1.0.9-beta</div>
<div class="collapsible-body">
<ul class="collection">
@@ -100,4 +107,4 @@
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/pages/meals.html b/pages/meals.html
index f59df4a..c4548f1 100644
--- a/pages/meals.html
+++ b/pages/meals.html
@@ -134,7 +134,7 @@
<i class="material-icons right">exit_to_app</i>
</button>
</h4>
- <div id="meals-collapsible"></div>
+ <ul id="meals-collapsible" class="collapsible"></ul>
</div>
</body>
diff --git a/sw.js b/sw.js
index 7d64a88..a8d4e8f 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.9";
+const static_cache_name = "site-static-v1.0.10";
// Tukej ne met notr directory namov, samo imena fajlov,
// ker v primeru index.html to prpele do double-cachinga, oz. do velik 404
@@ -45,6 +45,7 @@ const assets = [
"/js/tos.js",
"/js/login.js",
"/js/app.js",
+ "/js/meals.js",
"/js/lib/materialize.min.js",
"/js/lib/jquery.min.js",
@@ -71,6 +72,7 @@ const assets = [
"/pages/grades.html",
"/pages/privacypolicy.html",
"/pages/tos.html",
+ "/pages/meals.html",
"/manifest.json",
"/index.html",