diff --git a/scoreboard/public/javascripts/admin.js b/scoreboard/public/javascripts/admin.js new file mode 100644 index 0000000..31b03ce --- /dev/null +++ b/scoreboard/public/javascripts/admin.js @@ -0,0 +1,11 @@ + +function timerStart() +{ + fetch("/admin/timerStart", { + method: "POST", + headers: {'Content-Type': 'text/html'}, + body: "" + }).then(res => { + console.log(res); + }) +} \ No newline at end of file diff --git a/scoreboard/public/javascripts/index.js b/scoreboard/public/javascripts/index.js index 6cb4d31..bc30483 100644 --- a/scoreboard/public/javascripts/index.js +++ b/scoreboard/public/javascripts/index.js @@ -1,23 +1,15 @@ - -let wss = "ws://" + window.location.hostname + ":3001" -const socket = io(wss); +let wss = "ws://" + window.location.hostname + ":3001" // Build socketio endpoint from window.location +const socket = io(wss); // Connect to socketio server socket.on('connected', (message) => { console.log("Connected"); }) socket.on('timerDurationLeft', (message) => { - console.log(message) - document.getElementById("durationLeft").innerHTML = message; + console.log(message) // Log durationLeft in client console + document.getElementById("durationLeft").innerHTML = message; // Display durationLeft in corresponding html Element }); socket.on('timerEnded', (message) => { - console.log(message) - document.getElementById("durationLeft").innerHTML = "STOP"; -}); - -// let minutes = currentTime.setMinutes(6); -// let seconds = currentTime.setSeconds(25); - - -// document.getElementById("timer").innerHTML = minutes + ":" + seconds; + document.getElementById("durationLeft").innerHTML = "STOP"; // Display "STOP" in same html element as the duration +}); \ No newline at end of file diff --git a/scoreboard/views/admin.hbs b/scoreboard/views/admin.hbs index b058818..5b4836d 100644 --- a/scoreboard/views/admin.hbs +++ b/scoreboard/views/admin.hbs @@ -7,27 +7,24 @@ Interface zur Bedienung des Zeit-/Scoreboards. - - -
-
-
- -
-
-
-
- -
-
-
- -
-
-
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ \ No newline at end of file diff --git a/scoreboard/views/index.hbs b/scoreboard/views/index.hbs index 26cd337..d8fa528 100644 --- a/scoreboard/views/index.hbs +++ b/scoreboard/views/index.hbs @@ -8,12 +8,10 @@ -
{{ durationLeft }}
-

L
LLLLLLLLLLLLLL
L
@@ -26,11 +24,9 @@

- - - - - - + + + + \ No newline at end of file