소스 검색

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 년 전
부모
커밋
a6d4e75380
2개의 변경된 파일19개의 추가작업 그리고 5개의 파일을 삭제
  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]})`)
+                        }
+                    });
                 }
             }