|
@@ -802,31 +802,6 @@
|
|
|
highlightCurrentRoot();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- //Initial Host device drives
|
|
|
- /*
|
|
|
- $.ajax({
|
|
|
- url: "../../system/file_system/listDrives",
|
|
|
- success: function(data){
|
|
|
- $("#deviceList").html("");
|
|
|
- for (var i =0; i < data.length; i++){
|
|
|
- var drivePath = data[i].Drivepath;
|
|
|
- var usagePercentage = ((data[i].DriveTotalSpace - data[i].DriveFreeSpace) / data[i].DriveTotalSpace) * 100;
|
|
|
- var className = "primary";
|
|
|
- if (usagePercentage > 90){
|
|
|
- className = "negative";
|
|
|
- }
|
|
|
- $("#deviceList").append(`<div class="dir item" filepath="${drivePath}" ><i class="disk outline rightmargin icon"></i> ${drivePath}
|
|
|
- <div style="width:100px;height:15px !important; position:absolute;right:3px;top:6px;"">
|
|
|
- <div class="ui ${className} tiny progress">
|
|
|
- <div class="bar" style="width: ${usagePercentage}%"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>`);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- */
|
|
|
}
|
|
|
|
|
|
function highlightCurrentRoot(){
|
|
@@ -1078,6 +1053,18 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function listDirectoryAndHighlight(path, filenameToHighlight = ""){
|
|
|
+ listDirectory(path, function(){
|
|
|
+ if (filenameToHighlight != ""){
|
|
|
+ //Timeout to give the DOM time to render
|
|
|
+ setTimeout(function(){
|
|
|
+ focusFileObject(filenameToHighlight);
|
|
|
+ }, 100);
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
//Render filelist --> Convert a file list object into the visable form of file list
|
|
|
function renderDirectory(filelist, callback=undefined){
|
|
|
var data = filelist;
|
|
@@ -1959,6 +1946,7 @@
|
|
|
}
|
|
|
|
|
|
//Move the page focus to the given fileobject
|
|
|
+ //alias: Highlight file object / filename
|
|
|
function focusFileObject(targetFileName){
|
|
|
$(".fileObject").each(function(){
|
|
|
if ($(this).attr("filename") == targetFileName){
|
|
@@ -2801,7 +2789,6 @@
|
|
|
}
|
|
|
input.click();
|
|
|
}
|
|
|
-
|
|
|
|
|
|
function updatePathDisplay(path){
|
|
|
var pathInfo = path.split("/");
|
|
@@ -2819,7 +2806,11 @@
|
|
|
for(var i = 1; i < pathInfo.length; i++){
|
|
|
let thisname = pathInfo[i];
|
|
|
thisPath += thisname + "/";
|
|
|
- domPathChunks.push(`<div class="section selectable" onclick="event.stopImmediatePropagation(); listDirectory('${thisPath}');">${shortenLongFoldername(thisname, 20)}</div>`);
|
|
|
+ let pathHighlight = "";
|
|
|
+ if (i < pathInfo.length - 1){
|
|
|
+ pathHighlight = pathInfo[i + 1];
|
|
|
+ }
|
|
|
+ domPathChunks.push(`<div class="section selectable" onclick="event.stopImmediatePropagation(); listDirectoryAndHighlight('${thisPath}', '${pathHighlight}');">${shortenLongFoldername(thisname, 20)}</div>`);
|
|
|
}
|
|
|
|
|
|
let fullpath = domPathChunks.join(`<div class="divider">/</div>`);
|