This commit is contained in:
Liang Ding 2014-09-16 17:54:50 +08:00
parent 5ed8033ef9
commit 86c811aa35
2 changed files with 19 additions and 15 deletions

View File

@ -271,25 +271,32 @@ func listFiles(dirname string) []string {
}
func getIconSkin(filenameExtension string) string {
if isImg(filenameExtension) {
return "ico-ztree-img "
}
switch filenameExtension {
case ".gitignore", "", ".exe", ".s", ".tar", ".zip", ".rar", ".gz": // 不支持显示图标的文件
return "ico-ztree-other "
case ".json", ".js":
return "ico-ztree-js "
case ".html", ".htm":
return "ico-ztree-html "
case ".go":
return "ico-ztree-go "
case ".css":
return "ico-ztree-css "
case ".txt":
return "ico-ztree-text "
case ".sql":
return "ico-ztree-sql "
case ".properties":
return "ico-ztree-pro "
case ".htm", ".html":
return "ico-ztree-html "
case ".md":
return "ico-ztree-md "
case ".js", "json":
return "ico-ztree-js "
case ".xml":
return "ico-ztree-xml "
default:
if isImg(filenameExtension) {
return "ico-ztree-img "
}
return "ico-ztree-" + filenameExtension[1:] + " "
return "ico-ztree-other "
}
return ""
}
func getEditorMode(filenameExtension string) string {

View File

@ -107,9 +107,6 @@ var tree = {
case "md":
iconSkin = "ico-ztree-md ";
break;
case "md":
iconSkin = "ico-ztree-md ";
break;
case "js", "json":
iconSkin = "ico-ztree-js ";
break;