function updateHTMLDirList(returnData) { var dirPath = returnData.getElementsByTagName('PATH_HEAD')[0]; var dirs = returnData.getElementsByTagName('DIR'); var videos = returnData.getElementsByTagName('VID_FILE'); var images = returnData.getElementsByTagName('IMG_FILE'); var files = returnData.getElementsByTagName('FILE'); var insertArea = document.getElementById('dynDiv'); var workingDir = dirPath.innerHTML; var i = 0; // Insert dirs document.getElementById("path").innerHTML = dirPath.innerHTML; insertArea.innerHTML = ""; if (workingDir === "./") { var i = 2 } // Remove ,. and ../ if in "root" var size = dirs.length; for (; i < size; i++) { var dir = dirs[i].innerHTML; if (dir != "resources/") { insertArea.innerHTML += "
" + "" +""; } } // Insert videos size = videos .length; for (i = 0; i < size; i++) { var thumbnail = videos[i].children[0].innerHTML; var vidNme = videos[i].children[1].innerHTML; insertArea.innerHTML += "" + "\""" + "" + ""; } // Insert images var path = document.getElementById("path").innerHTML; size = images.length; for (i = 0; i < size; i++) { var thumbnail = images[i].children[0].innerHTML; if (!thumbnail.includes("favicon.png") && !thumbnail.includes("000.png") && !thumbnail.includes("000.jpg") && !thumbnail.includes("000.gif")) { insertArea.innerHTML += "\"""; } } if (images[0] != undefined) { if (images[0].children[0].innerHTML.includes("000.jpg") || images[0].children[0].innerHTML.includes("000.png") || images[0].children[0].innerHTML.includes("000.gif")) { updateBG(path + images[0].children[0].innerHTML); } else { updateBG("resources/images/backgrounds/000.jpg"); } } else { updateBG("resources/images/backgrounds/000.jpg"); } // Insert files size = files.length; for (i = 0; i < size; i++) { var fileName = files[i].children[0].innerHTML; var iconImg = ""; } else if (fileName.includes(".7z") || fileName.includes(".7zip") || fileName.includes(".zip") || fileName.includes(".tar.gz") || fileName.includes(".tar.xz") || fileName.includes(".gz") || fileName.includes(".rar") || fileName.includes(".jar")) { iconImg += " src=\"resources/images/icons/arc.png\" />"; } else if (fileName.includes(".pdf")) { iconImg += " src=\"resources/images/icons/pdf.png\" />"; } else if (fileName.includes(".html")) { iconImg += " src=\"resources/images/icons/html.png\" />"; } else if (fileName.includes(".txt") || fileName.includes(".conf")) { iconImg += " src=\"resources/images/icons/text.png\" />"; } else if (fileName.includes(".iso") || fileName.includes(".img")) { iconImg += " src=\"resources/images/icons/img.png\" />"; } else if (fileName.includes(".sh") || fileName.includes(".batch") || fileName.includes(".exe")) { iconImg += " src=\"resources/images/icons/scrip.png\" />"; } else { iconImg += " src=\"resources/images/icons/bin.png\" />"; } if (fileName != "sse.php" && fileName != "upload.php" && fileName != "open.php" && fileName != "process.php") { insertArea.innerHTML += "
" + iconImg + "" + ""; } } }