var formerFileName = ""; function tgglElmView(id) { var elm = document.getElementById(id); if (elm.style.display == "none") { elm.style.display = "block"; } else { elm.style.display = "none"; } } function enableEdit(obj) { obj.style.backgroundColor = "#ffffffff"; obj.style.color = '#000000ff'; obj.readOnly = ''; formerFileName = obj.value; } function disableEdits() { // this references the passed object from // addEventListener than us passing it this.style.backgroundColor = "#ffffff00"; this.style.color = '#ffffff'; this.value = formerFileName; this.readOnly = "true"; } function showImg(imgLoc) { var path = document.getElementById("path").innerHTML; var imgView = document.getElementById("imgView"); var fullImage = path + imgLoc; var toPlayerButton = "
"; var popButton = "
"; var CloseBttn = "
X
"; imgView.style.display = "block"; imgView.innerHTML = CloseBttn + popButton + toPlayerButton; imgView.innerHTML += "
"; dragContainer(imgView); // Set for dragging events } function showMedia(media) { var path = document.getElementById("path").innerHTML; var tempRef = media.toLowerCase(); var fullMedia = path + media; if (tempRef.includes(".mp4") || tempRef.includes(".webm") || tempRef.includes(".mp3") || tempRef.includes(".ogg") || tempRef.includes(".pdf") || tempRef.includes(".flac")) { var mediaView = document.getElementById("fileView"); var toPlayerButton = "
"; var popButton = "
"; var CloseBttn = "
X
"; mediaView.style.display = "block"; mediaView.innerHTML = CloseBttn + popButton + toPlayerButton; mediaView.innerHTML += ""; dragContainer(mediaView); // Set for dragging events } else { openInLocalProg(fullMedia); } } function closeImg() { var imgView = document.getElementById("imgView"); imgView.style.display = "none"; } function closeMedia() { var mediaView = document.getElementById("fileView"); mediaView.style.display = "none"; mediaView.children[3].src = ""; } function clearDirCookie() { var expireDate = "Thu, 01 Jan 1970 00:00:00 UTC"; document.cookie = "dirQuery=; expires=" + expireDate; getDir("/"); } function clearDlList() { document.getElementById("CLEARBTTN").click(); } function onloadSetBG() { updateBG("resources/images/backgrounds/000.jpg"); } function updateBG(bgImg) { document.getElementById("bg").src = bgImg; }