Cleanup of logic and look.
This commit is contained in:
parent
3dbbaa063d
commit
ce7e86cbef
@ -1,21 +1,20 @@
|
|||||||
|
|
||||||
function updateHTMLDirList(returnData) {
|
function updateHTMLDirList(returnData) {
|
||||||
var dirPath = returnData.getElementsByTagName('PATH_HEAD')[0];
|
var dirPath = returnData.getElementsByTagName('PATH_HEAD')[0].innerHTML;
|
||||||
var dirs = returnData.getElementsByTagName('DIR');
|
var dirs = returnData.getElementsByTagName('DIR');
|
||||||
var videos = returnData.getElementsByTagName('VID_FILE');
|
var videos = returnData.getElementsByTagName('VID_FILE');
|
||||||
var images = returnData.getElementsByTagName('IMG_FILE');
|
var images = returnData.getElementsByTagName('IMG_FILE');
|
||||||
var files = returnData.getElementsByTagName('FILE');
|
var files = returnData.getElementsByTagName('FILE');
|
||||||
var insertArea = document.getElementById('dynDiv');
|
var insertArea = document.getElementById('dynDiv');
|
||||||
var workingDir = dirPath.innerHTML;
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var size = 0;
|
var size = 0;
|
||||||
|
|
||||||
// Insert dirs
|
// Insert dirs
|
||||||
document.getElementById("path").innerHTML = workingDir;
|
document.getElementById("path").innerHTML = dirPath;
|
||||||
insertArea.innerHTML = "";
|
insertArea.innerHTML = "";
|
||||||
|
|
||||||
// Remove . and ../ if in "root"
|
// Remove . and ../ if in "root"
|
||||||
if (workingDir === "./") {
|
if (dirPath === "./") {
|
||||||
var i = 2
|
var i = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,12 +23,13 @@ function updateHTMLDirList(returnData) {
|
|||||||
var dir = dirs[i].innerHTML;
|
var dir = dirs[i].innerHTML;
|
||||||
|
|
||||||
if (dir != "resources/") {
|
if (dir != "resources/") {
|
||||||
insertArea.innerHTML += "<div class=\"dirStyle\"> <img id=\"dirID\""
|
insertArea.innerHTML +=
|
||||||
+" class=\"systemIcon\" src=\"resources/images/icons/folder.png\" />"
|
"<div class=\"dirStyle\"> <img id=\"dirID\""
|
||||||
+ "<input type=\"text\" id=\"titleID\" class=\"dirTitle\""
|
+" class=\"systemIcon\" src=\"resources/images/icons/folder.png\" />"
|
||||||
+ " readonly=\"true\" value=\"" + dir + "\" "
|
+ "<input type=\"text\" id=\"titleID\" class=\"dirTitle\""
|
||||||
+ " onfocusout=\"disableEdits(this)\"/>"
|
+ " readonly=\"true\" value=\"" + dir + "\" "
|
||||||
+"</dir>";
|
+ " onfocusout=\"disableEdits(this)\"/>"
|
||||||
|
+"</dir>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,19 +42,20 @@ function updateHTMLDirList(returnData) {
|
|||||||
thumbnail = videos[i].children[0].innerHTML;
|
thumbnail = videos[i].children[0].innerHTML;
|
||||||
vidNme = videos[i].children[1].innerHTML;
|
vidNme = videos[i].children[1].innerHTML;
|
||||||
|
|
||||||
insertArea.innerHTML += "<span class=\"movieStyle\" title=\"" + vidNme + "\" >"
|
insertArea.innerHTML +=
|
||||||
+ "<img id=\"movieID\" class=\"thumbnail\""
|
"<span class=\"movieStyle\" title=\"" + vidNme + "\" >"
|
||||||
+ " src=\"" + thumbnail + "\" alt=\"" + vidNme + "\" />"
|
+ "<img id=\"movieID\" class=\"thumbnail\""
|
||||||
+ "<input type=\"text\" id=\"titleID\" class=\"movieTitle\""
|
+ " src=\"" + thumbnail + "\" alt=\"" + vidNme + "\" />"
|
||||||
+ " readonly=\"true\"" + " value=\"" + vidNme + "\" "
|
+ "<input type=\"text\" id=\"titleID\" class=\"movieTitle\""
|
||||||
+ " onfocusout=\"disableEdits(this)\"/>"
|
+ " readonly=\"true\"" + " value=\"" + vidNme + "\" "
|
||||||
+ "</span>";
|
+ " onfocusout=\"disableEdits(this)\"/>"
|
||||||
|
+ "</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert images
|
// Insert images
|
||||||
var path = document.getElementById("path").innerHTML;
|
var path = document.getElementById("path").innerHTML;
|
||||||
var thumbnail = ""
|
var thumbnail = ""
|
||||||
size = images.length;
|
size = images.length;
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
thumbnail = images[i].children[0].innerHTML;
|
thumbnail = images[i].children[0].innerHTML;
|
||||||
@ -67,14 +68,10 @@ function updateHTMLDirList(returnData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (images[0] != undefined) {
|
// Setup background if there is a 000.* in selection
|
||||||
var imgText = images[0].children[0].innerHTML;
|
var bgImgPth = images[0].children[0].innerHTML;
|
||||||
|
if (bgImgPth.match(/000\.(jpg|png|gif)\b/) != null) {
|
||||||
if (imgText.match(/000\.(jpg|png|gif)\b/) != null) {
|
updateBG(path + bgImgPth);
|
||||||
updateBG(path + images[0].children[0].innerHTML);
|
|
||||||
} else {
|
|
||||||
updateBG("resources/images/backgrounds/000.jpg");
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
updateBG("resources/images/backgrounds/000.jpg");
|
updateBG("resources/images/backgrounds/000.jpg");
|
||||||
}
|
}
|
||||||
@ -86,12 +83,13 @@ function updateHTMLDirList(returnData) {
|
|||||||
var iconImg = "<img id=\"fileID\" class=\"systemIcon\""
|
var iconImg = "<img id=\"fileID\" class=\"systemIcon\""
|
||||||
+ setFileIconType(fileName);
|
+ setFileIconType(fileName);
|
||||||
|
|
||||||
insertArea.innerHTML += "<div class=\"fileStyle\">"
|
insertArea.innerHTML +=
|
||||||
+ iconImg
|
"<div class=\"fileStyle\">"
|
||||||
+ "<input type=\"text\" id=\"titleID\" class=\"fileTitle\""
|
+ iconImg
|
||||||
+ " readonly=\"true\"" + " value=\"" + fileName + "\" "
|
+ "<input type=\"text\" id=\"titleID\" class=\"fileTitle\""
|
||||||
+ " onfocusout=\"disableEdits(this)\"/>"
|
+ " readonly=\"true\"" + " value=\"" + fileName + "\" "
|
||||||
+ "</dir>";
|
+ " onfocusout=\"disableEdits(this)\"/>"
|
||||||
|
+ "</dir>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user