aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-09-17 21:57:07 +0200
committerMarvin Borner2020-09-17 21:57:07 +0200
commit76fbbc2c6812d78999b20a2de7b419e1f0ed3e94 (patch)
tree5cbcd416a870f3697161710103b2629c9e947d75
parent47800e5226ed3cddcacbd68d35bc9a14dbddc5eb (diff)
Server sync
-rw-r--r--motto/index.js2
-rw-r--r--motto/public/index.html2
-rw-r--r--motto/public/script.js10
3 files changed, 9 insertions, 5 deletions
diff --git a/motto/index.js b/motto/index.js
index 429e367..eb1acab 100644
--- a/motto/index.js
+++ b/motto/index.js
@@ -92,4 +92,4 @@ app.on("close", () => {
create_db();
console.log("Listening on port 3000");
-app.listen(3000);
+app.listen(5005);
diff --git a/motto/public/index.html b/motto/public/index.html
index 008087a..c5c71f3 100644
--- a/motto/public/index.html
+++ b/motto/public/index.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width" />
+ <meta name="viewport" content="width=device-width, minimal-ui" />
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
<title>Motto</title>
</head>
diff --git a/motto/public/script.js b/motto/public/script.js
index d2950b7..112b023 100644
--- a/motto/public/script.js
+++ b/motto/public/script.js
@@ -4,7 +4,7 @@ document.querySelector(".wrapper").style.opacity = 1;
function send(id, vote) {
var xhp = new XMLHttpRequest();
- xhp.open("POST", "/api/vote");
+ xhp.open("POST", "/abi/api/vote");
xhp.setRequestHeader("Content-type", "application/json");
xhp.onreadystatechange = () => {
if (xhp.readyState == 4 && xhp.status == 200) console.log(xhp.responseText);
@@ -16,7 +16,7 @@ function send(id, vote) {
function add(main, description) {
var xhp = new XMLHttpRequest();
- xhp.open("POST", "/api/add");
+ xhp.open("POST", "/abi/api/add");
xhp.setRequestHeader("Content-type", "application/json");
xhp.onreadystatechange = () => {
if (xhp.readyState == 4 && xhp.status == 200) console.log(xhp.responseText);
@@ -141,7 +141,7 @@ function createButtonListener(yay) {
}
var xhp = new XMLHttpRequest();
-xhp.open("GET", "/api/list");
+xhp.open("GET", "/abi/api/list");
xhp.onreadystatechange = () => {
if (xhp.readyState == 4 && xhp.status == 200) {
let list = JSON.parse(xhp.responseText);
@@ -206,3 +206,7 @@ document.getElementById("aah").addEventListener("click", () => {
document.getElementById("all").addEventListener("click", toggleOverview);
document.getElementById("go").addEventListener("click", toggleOverview);
+
+addEventListener("load", () => {
+ window.scrollTo(1, 0);
+}, false);