2021-11-28 23:59:24 +01:00
|
|
|
/**
|
|
|
|
* This file acts as an abstraction layer between HTML and JS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function hideLoginWindow() {
|
|
|
|
document.getElementById("signup-window").style.display = "none"
|
|
|
|
}
|
|
|
|
|
|
|
|
function showLoginWindow() {
|
|
|
|
document.getElementById("signup-window").style.display = "table"
|
|
|
|
}
|
|
|
|
|
2021-11-29 11:06:20 +01:00
|
|
|
function hideTableListElements() {
|
|
|
|
document.getElementById("table-list-bar").style.display = "none"
|
|
|
|
document.getElementById("table-list").style.display = "none"
|
|
|
|
}
|
|
|
|
|
|
|
|
function showTableListElements() {
|
|
|
|
document.getElementById("table-list-bar").style.display = "grid"
|
|
|
|
document.getElementById("table-list").style.display = "inherit"
|
|
|
|
}
|
|
|
|
|
2021-11-30 20:55:25 +01:00
|
|
|
function showGameElements() {
|
|
|
|
document.getElementById("game-bar").style.display = "grid"
|
|
|
|
}
|
|
|
|
|
|
|
|
function hideGameElements() {
|
|
|
|
document.getElementById("game-bar").style.display = "none"
|
|
|
|
}
|
|
|
|
|
2021-11-28 23:59:24 +01:00
|
|
|
function setPlayerName(name) {
|
|
|
|
document.getElementById("player-name").innerHTML = name
|
|
|
|
}
|
|
|
|
|
|
|
|
function getPlayerName() {
|
|
|
|
return document.getElementById("player-name").innerHTML
|
|
|
|
}
|
|
|
|
|
|
|
|
function getLoginName() {
|
|
|
|
return document.getElementById("user-name").value
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearLoginName() {
|
|
|
|
document.getElementById("user-name").value = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
function getLoginPassword() {
|
|
|
|
return document.getElementById("user-pwd").value
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearLoginPassword() {
|
|
|
|
document.getElementById("user-pwd").value = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
function getSessionToken() {
|
|
|
|
return localStorage.getItem('token')
|
|
|
|
}
|
|
|
|
|
|
|
|
function setSessionToken(token) {
|
|
|
|
localStorage.setItem('token', token)
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteSessionToken() {
|
|
|
|
localStorage.removeItem('token')
|
|
|
|
}
|
|
|
|
|
|
|
|
function setLoginError(text) {
|
|
|
|
document.getElementById("login-error").innerHTML = text
|
|
|
|
}
|
|
|
|
|
|
|
|
function getTableName() {
|
|
|
|
return document.getElementById("table-name-field").value
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearTableName() {
|
|
|
|
return document.getElementById("table-name-field").value = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
function getTableVisibility() {
|
|
|
|
return document.getElementById("table-public-checkbox").checked
|
|
|
|
}
|
|
|
|
|
|
|
|
function setTableListContent(content) {
|
|
|
|
document.getElementById("table-list").innerHTML = content
|
|
|
|
}
|