2018-04-18 10:57:57 +00:00
|
|
|
var formerFileName = "";
|
|
|
|
|
2018-07-07 20:32:45 +00:00
|
|
|
function tgglElmView(id) {
|
|
|
|
var elm = document.getElementById(id);
|
|
|
|
if (elm.style.display == "none") {
|
|
|
|
elm.style.display = "block";
|
2018-04-23 07:34:12 +00:00
|
|
|
} else {
|
2018-07-07 20:32:45 +00:00
|
|
|
elm.style.display = "none";
|
2018-04-23 07:34:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-23 01:43:19 +00:00
|
|
|
function enableEdit(obj) {
|
2018-07-07 20:32:45 +00:00
|
|
|
obj.style.backgroundColor = "#ffffffff";
|
|
|
|
obj.style.color = '#000000ff';
|
|
|
|
obj.readOnly = '';
|
|
|
|
formerFileName = obj.value;
|
2018-04-23 01:43:19 +00:00
|
|
|
}
|
|
|
|
|
2018-05-03 08:14:28 +00:00
|
|
|
function disableEdits() {
|
|
|
|
// this references the passed object from
|
|
|
|
// addEventListener than us passing it
|
2018-07-07 20:32:45 +00:00
|
|
|
this.style.backgroundColor = "#ffffff00";
|
|
|
|
this.style.color = '#ffffff';
|
|
|
|
this.value = formerFileName;
|
|
|
|
this.readOnly = "true";
|
2018-04-23 01:43:19 +00:00
|
|
|
}
|
|
|
|
|
2018-04-18 10:57:57 +00:00
|
|
|
function showImg(imgLoc) {
|
|
|
|
var path = document.getElementById("path").innerHTML;
|
|
|
|
var imgView = document.getElementById("imgView");
|
|
|
|
var fullImage = path + imgLoc;
|
|
|
|
var toPlayerButton = "<div title=\"Open In Local Program\" class=\"popOutBttn\" onclick=\"openInLocalProg('" + fullImage + "')\">∽</div>";
|
|
|
|
var popButton = "<a href=\"" + fullImage + "\" target=\"_blank\"><div class=\"popOutBttn\">↗</div></a>";
|
|
|
|
var CloseBttn = "<div class=\"closeBttn\" onclick=\"closeImg()\">X</div>";
|
|
|
|
imgView.style.display = "block";
|
|
|
|
imgView.innerHTML = CloseBttn + popButton + toPlayerButton;
|
|
|
|
|
|
|
|
imgView.innerHTML += "<div id=\"imgArea\"><img class=\"imgViewImg\" src=\"" + fullImage + "\" /></div>";
|
|
|
|
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 = "<div title=\"Open In Local Program\" class=\"popOutBttn\" onclick=\"openInLocalProg('" + fullMedia + "')\">∽</div>";
|
|
|
|
var popButton = "<a title=\"New Tab\" href=\"" + fullMedia + "\" target=\"_blank\"><div class=\"popOutBttn\">↗</div></a>";
|
|
|
|
var CloseBttn = "<div class=\"closeBttn\" title=\"Close\" onclick=\"closeMedia()\">X</div>";
|
|
|
|
|
2018-07-07 20:32:45 +00:00
|
|
|
mediaView.style.display = "block";
|
|
|
|
mediaView.innerHTML = CloseBttn + popButton + toPlayerButton;
|
|
|
|
mediaView.innerHTML += "<iframe id=\"fileViewInner\" src=\"" + fullMedia + "\"></iframe>";
|
2018-04-18 10:57:57 +00:00
|
|
|
|
|
|
|
dragContainer(mediaView); // Set for dragging events
|
|
|
|
} else {
|
|
|
|
openInLocalProg(fullMedia);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-23 01:43:19 +00:00
|
|
|
function closeImg() {
|
2018-07-07 20:32:45 +00:00
|
|
|
var imgView = document.getElementById("imgView");
|
2018-04-23 01:43:19 +00:00
|
|
|
imgView.style.display = "none";
|
2018-04-18 10:57:57 +00:00
|
|
|
}
|
|
|
|
|
2018-04-23 01:43:19 +00:00
|
|
|
function closeMedia() {
|
2018-07-07 20:32:45 +00:00
|
|
|
var mediaView = document.getElementById("fileView");
|
|
|
|
mediaView.style.display = "none";
|
2018-04-23 01:43:19 +00:00
|
|
|
mediaView.children[3].src = "";
|
2018-04-18 10:57:57 +00:00
|
|
|
}
|
|
|
|
|
2018-04-23 01:43:19 +00:00
|
|
|
function clearDirCookie() {
|
|
|
|
var expireDate = "Thu, 01 Jan 1970 00:00:00 UTC";
|
|
|
|
document.cookie = "dirQuery=; expires=" + expireDate;
|
|
|
|
getDir("/");
|
2018-04-18 10:57:57 +00:00
|
|
|
}
|
|
|
|
|
2018-07-07 20:32:45 +00:00
|
|
|
function clearDlList() { document.getElementById("CLEARBTTN").click(); }
|
|
|
|
function onloadSetBG() { updateBG("resources/images/backgrounds/000.jpg"); }
|
|
|
|
function updateBG(bgImg) { document.getElementById("bg").src = bgImg; }
|