文件类型基于 Mime Type

This commit is contained in:
Liang Ding 2014-09-06 22:33:09 +08:00
parent 60c820697c
commit 46cafd27a8
2 changed files with 12 additions and 12 deletions

View File

@ -235,7 +235,7 @@ func listFiles(dirname string) []string {
} }
func getIconSkin(filenameExtension string) string { func getIconSkin(filenameExtension string) string {
if "" == filenameExtension { if "" == filenameExtension || ".exe" == filenameExtension {
return "ico-ztree-other " return "ico-ztree-other "
} }
@ -263,25 +263,25 @@ func getIconSkin(filenameExtension string) string {
func getEditorMode(filenameExtension string) string { func getEditorMode(filenameExtension string) string {
switch filenameExtension { switch filenameExtension {
case ".go": case ".go":
return "go" return "text/x-go"
case ".html": case ".html":
return "htmlmixed" return "text/html"
case ".md": case ".md":
return "markdown" return "text/x-markdown"
case ".js": case ".js":
return "javascript" return "text/javascript"
case ".json": case ".json":
return "application/json" return "application/json"
case ".css": case ".css":
return "css" return "text/css"
case ".xml": case ".xml":
return "xml" return "application/xml"
case ".sh": case ".sh":
return "shell" return "text/x-sh"
case ".sql": case ".sql":
return "sql" return "text/x-sql"
default: default:
return "text" return "text/plain"
} }
} }