summaryrefslogtreecommitdiffstats
path: root/js/grades.js
diff options
context:
space:
mode:
authorAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-03-06 14:22:03 +0100
committerAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-03-06 14:22:03 +0100
commit64d26557a090b4f5bccb2d0d15c03e148f04f454 (patch)
tree2986b6252747ce561fb1692cbeee022ab73065b8 /js/grades.js
parentadded i18n, converted HTML files, TODO: js UI responses, TODO: translations (diff)
downloadbeziapp-64d26557a090b4f5bccb2d0d15c03e148f04f454.tar
beziapp-64d26557a090b4f5bccb2d0d15c03e148f04f454.tar.gz
beziapp-64d26557a090b4f5bccb2d0d15c03e148f04f454.tar.bz2
beziapp-64d26557a090b4f5bccb2d0d15c03e148f04f454.tar.lz
beziapp-64d26557a090b4f5bccb2d0d15c03e148f04f454.tar.xz
beziapp-64d26557a090b4f5bccb2d0d15c03e148f04f454.tar.zst
beziapp-64d26557a090b4f5bccb2d0d15c03e148f04f454.zip
Diffstat (limited to '')
-rw-r--r--js/grades.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/js/grades.js b/js/grades.js
index 2c247f1..ec5bbe8 100644
--- a/js/grades.js
+++ b/js/grades.js
@@ -1,6 +1,4 @@
const API_ENDPOINT = "https://gimb.tk/test.php";
-// const API_ENDPOINT = "http://localhost:5000/test.php";
-
let checkbox_state = false;
async function checkLogin() {
@@ -62,7 +60,7 @@ async function loadGrades(force_refresh = false) {
success: (data) => {
// If data is null, the request failed
if (data === null) {
- M.toast({ html: "Request failed!" });
+ UIAlert(S("requestFailed"), "loadGrades(): data === null; request failed");
setLoading(false);
} else {
// Save grades & populate view
@@ -75,7 +73,7 @@ async function loadGrades(force_refresh = false) {
},
error: () => {
- M.toast({ html: "No internet connection!" });
+ UIAlert(S("noInternetConnection"), "loadGrades(): $ajax-error");
setLoading(false);
}
@@ -222,18 +220,18 @@ function refreshClickHandlers() {
let term_element = document.getElementById("grade-term");
if (grade_obj["rok"] !== "") {
- term_element.innerText = "Term: " + grade_obj["rok"];
+ term_element.innerText = S("term") + ": " + grade_obj["rok"];
term_element.style["display"] = "";
} else {
term_element.style["display"] = "none";
}
- document.getElementById("grade-teacher").innerText = "Teacher: " + grade_obj["profesor"];
+ document.getElementById("grade-teacher").innerText = S("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.innerText = "(" + S("temporary") + ")";
temporary_object_root.style["display"] = "";
} else {
temporary_object_root.style["display"] = "none";