FestivalServer/Public/festival/assets/festival-info.js

34 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-11-20 12:19:50 +01:00
function loadList(name, source) {
document.getElementById("left-button").style.backgroundColor = 'rgba(255, 255, 255, 0.1)'
document.getElementById("middle-button").style.backgroundColor = 'rgba(255, 255, 255, 0.1)'
document.getElementById("right-button").style.backgroundColor = 'rgba(255, 255, 255, 0.1)'
source.style.backgroundColor = 'rgba(255, 255, 255, 0.3)'
var txtFile = new XMLHttpRequest();
var allText = "Liste nicht geladen";
txtFile.onreadystatechange = function () {
if (txtFile.readyState === XMLHttpRequest.DONE && txtFile.status == 200) {
allText = txtFile.responseText.split("\n").join("<br>");
}
document.getElementById("remote-content").innerHTML = allText;
}
2022-02-10 17:25:41 +01:00
var list = '/festival/lists/' + name;
2021-11-20 12:19:50 +01:00
txtFile.open("GET", list, true);
txtFile.send(null);
}
2022-01-10 23:50:47 +01:00
function loadCount() {
var txtFile = new XMLHttpRequest();
var allText = "";
txtFile.onreadystatechange = function () {
if (txtFile.readyState === XMLHttpRequest.DONE && txtFile.status == 200) {
allText = txtFile.responseText;
}
document.getElementById("left-button").innerHTML = "Registered (" + allText + ")";
}
var list = '/festival/api/count' + name;
txtFile.open("GET", list, true);
txtFile.send(null);
}