FestivalServer/Public/assets/festival-info.js
2021-11-20 12:19:50 +01:00

20 lines
846 B
JavaScript

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;
}
var list = '/lists/' + name;
txtFile.open("GET", list, true);
txtFile.send(null);
}