This commit is contained in:
		
							parent
							
								
									2a2262b11f
								
							
						
					
					
						commit
						07ece43f51
					
				| 
						 | 
					@ -198,7 +198,7 @@ type FileNode struct {
 | 
				
			||||||
	FileNodes []*FileNode `json:"children"`
 | 
						FileNodes []*FileNode `json:"children"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 遍历指定的 path,构造文件树.
 | 
					// 遍历指定的 path 构造文件树.
 | 
				
			||||||
func walk(path string, node *FileNode) {
 | 
					func walk(path string, node *FileNode) {
 | 
				
			||||||
	files := listFiles(path)
 | 
						files := listFiles(path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -264,20 +264,16 @@ func listFiles(dirname string) []string {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func getIconSkin(filenameExtension string) string {
 | 
					func getIconSkin(filenameExtension string) string {
 | 
				
			||||||
	if "" == filenameExtension || ".exe" == filenameExtension {
 | 
					 | 
				
			||||||
		return "ico-ztree-other "
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	switch filenameExtension {
 | 
						switch filenameExtension {
 | 
				
			||||||
	case ".gitignore":
 | 
						case ".gitignore", "", ".exe", ".s":
 | 
				
			||||||
		return "ico-ztree-other "
 | 
							return "ico-ztree-other "
 | 
				
			||||||
	case ".json":
 | 
						case ".json", ".js":
 | 
				
			||||||
		return "ico-ztree-js "
 | 
							return "ico-ztree-js "
 | 
				
			||||||
	case ".txt":
 | 
						case ".txt":
 | 
				
			||||||
		return "ico-ztree-text "
 | 
							return "ico-ztree-text "
 | 
				
			||||||
	case ".properties":
 | 
						case ".properties":
 | 
				
			||||||
		return "ico-ztree-pro "
 | 
							return "ico-ztree-pro "
 | 
				
			||||||
	case ".htm":
 | 
						case ".htm", ".html":
 | 
				
			||||||
		return "ico-ztree-html "
 | 
							return "ico-ztree-html "
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		if isImg(filenameExtension) {
 | 
							if isImg(filenameExtension) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue