Browse Source

Minor change on file explorer folder color and mobile.system background

Minor change of file explorer folder color under list mode
Fixed bug in mobile interface for customized background folder
TC pushbot 5 4 năm trước cách đây
mục cha
commit
a6d4e75380
2 tập tin đã thay đổi với 19 bổ sung5 xóa
  1. 1 1
      src/web/SystemAO/file_system/file_explorer.html
  2. 18 4
      src/web/mobile.system

+ 1 - 1
src/web/SystemAO/file_system/file_explorer.html

@@ -1561,7 +1561,7 @@
                        
                         $("#folderList").append(`<div class="fileObject item ${currentTheme}" draggable="true" ondragstart="onFileObjectDragStart(this,event);" ondrop="dropToFolder(event)" ondragover="allowDrop(event)" fileID="${i}" filename="${filename}" filepath="${filepath}" ondblclick="openthis(this,event);" type="folder">
                             <span style="display:inline-block !important;word-break: break-all;" class="${textclass}">
-                                <i class="${icon} icon" style="margin-right:12px; color:#9c9ee4;"></i>  ${displayName} ${shareicon}
+                                <i class="${icon} icon" style="margin-right:12px; color:#eab54e;"></i>  ${displayName} ${shareicon}
                             </span></div>`);
                     }else if (viewMode == "grid"){
                         var displayName = JSON.parse(JSON.stringify(filename));

+ 18 - 4
src/web/mobile.system

@@ -303,11 +303,25 @@
 
             function changeDesktopTheme(themename){
                 //Match the given theme to the themename
-                for (var i =0; i < desktopThemeList.length ; i++){
-                    if (desktopThemeList[i].Theme == themename){
-                        var targetImage = desktopThemeList[i].Bglist[0];
-                        $("#backdrop").css("background-image", `url(img/desktop/bg/${themename}/${targetImage})`)
+                if (themename.includes(":/") == false){
+                    //This is a path
+                    for (var i =0; i < desktopThemeList.length ; i++){
+                        if (desktopThemeList[i].Theme == themename){
+                            var targetImage = desktopThemeList[i].Bglist[0];
+                            $("#backdrop").css("background-image", `url(img/desktop/bg/${themename}/${targetImage})`)
+                        }
                     }
+                }else{
+                    //This is a path (user defined background folder)
+                    $.get("system/desktop/theme?load=" + themename, function(data){
+                        if (data.error !== undefined){
+                            //The folder is gone. Use default instead
+                            console.log(data.error);
+                            changeDesktopTheme("default");
+                        }else{
+                            $("#backdrop").css("background-image", `url(media/?file=${data[0]})`)
+                        }
+                    });
                 }
             }