summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2019-11-11 17:03:33 +0100
committerMarvin Borner2019-11-11 17:03:33 +0100
commit853ff4c74f74894e5fd976b85d93940e9fcdbb1c (patch)
treebd5b18c12e577725e1d73aba0f95d09697600e52
parent5e0898c9794a6d041a33b4e38e3806119b5c9050 (diff)
Fixed some server-thingiesHEADmaster
-rw-r--r--static/index.html4
-rw-r--r--static/script.js17
2 files changed, 11 insertions, 10 deletions
diff --git a/static/index.html b/static/index.html
index 891f219..4026e43 100644
--- a/static/index.html
+++ b/static/index.html
@@ -118,6 +118,6 @@
}
</style>
-<script src="/static/script.js"></script>
+<script src="/rbs/static/script.js"></script>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/static/script.js b/static/script.js
index cfab383..77f55b0 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,10 +1,12 @@
-const xmlHttp = new XMLHttpRequest();
+/*const xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState === 4 && xmlHttp.status === 200)
renderTable(JSON.parse(xmlHttp.responseText));
};
xmlHttp.open("GET", "http://127.0.0.1:5000/api", true);
-xmlHttp.send();
+xmlHttp.send();*/
+
+renderTable([]);
function renderTable(data) {
const configs = getConfigs();
@@ -73,12 +75,11 @@ function getConfigs() {
}
}
-Date.prototype.getWeek = function () {
- const firstJan = new Date(this.getFullYear(), 0, 1);
- return Math.ceil((((this - firstJan) / 86400000) + firstJan.getDay() + 1) / 7);
-};
-
function getWeekType() {
+ Date.prototype.getWeek = function () {
+ const firstJan = new Date(this.getFullYear(), 0, 1);
+ return Math.ceil((((this - firstJan) / 86400000) + firstJan.getDay() + 1) / 7);
+ };
const table = {
37: "a",
38: "b",
@@ -126,7 +127,7 @@ function getWeekType() {
try {
return table[date.getWeek()]
} catch (e) {
- alert("Ferien!");
+ alert("Ferien!");
return "a"
}
}