Added sideswitch functionality, cleanup, comments
This commit is contained in:
@@ -68,7 +68,6 @@ async function initialUpdate() {
|
||||
// Request monitor refresh for index frontend
|
||||
async function refreshMonitor() {
|
||||
const response = await fetch("/admin/refreshMonitor"); // Call API Endpoint /admin/timerStart
|
||||
const data = await response.json(); // Wait for asyncronous transfer to complete
|
||||
}
|
||||
|
||||
// ######################################################################################################################################################
|
||||
@@ -160,8 +159,8 @@ async function scoreAlterScore(team, dir) {
|
||||
}
|
||||
|
||||
// Switch sides
|
||||
async function scoreSwitch() {
|
||||
const response = await fetch("/admin/scoreSwitch"); // Call API Endpoint /admin/scoreSwitch
|
||||
async function scoreToggleSideswitch() {
|
||||
const response = await fetch("/admin/scoreToggleSideswitch");// Call API Endpoint /admin/scoreSwitch
|
||||
const data = await response.json(); // Wait for asyncronous transfer to complete
|
||||
updateScoreFrontend(data); // Update admin frontend
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@ socket.on('score', (message) => {
|
||||
document.getElementById("score").innerHTML = message; // Display score in corresponding html Element
|
||||
});
|
||||
|
||||
socket.on('scoreSideswitch', (message) => {
|
||||
scoreGetValues(); // Update frontend when sides have been switch (switches team name sides)
|
||||
});
|
||||
|
||||
// ######################################################################################################################################################
|
||||
// General functions
|
||||
// ######################################################################################################################################################
|
||||
|
||||
Reference in New Issue
Block a user