diff --git a/file/files.go b/file/files.go index 1c6a826..718c59a 100644 --- a/file/files.go +++ b/file/files.go @@ -235,7 +235,7 @@ func listFiles(dirname string) []string { } func getIconSkin(filenameExtension string) string { - if "" == filenameExtension { + if "" == filenameExtension || ".exe" == filenameExtension { return "ico-ztree-other " } @@ -263,25 +263,25 @@ func getIconSkin(filenameExtension string) string { func getEditorMode(filenameExtension string) string { switch filenameExtension { case ".go": - return "go" + return "text/x-go" case ".html": - return "htmlmixed" + return "text/html" case ".md": - return "markdown" + return "text/x-markdown" case ".js": - return "javascript" + return "text/javascript" case ".json": return "application/json" case ".css": - return "css" + return "text/css" case ".xml": - return "xml" + return "application/xml" case ".sh": - return "shell" + return "text/x-sh" case ".sql": - return "sql" + return "text/x-sql" default: - return "text" + return "text/plain" } } diff --git a/static/js/editor.js b/static/js/editor.js index 8c21dc9..b729e60 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -173,9 +173,9 @@ var editors = { editor.setSize('100%', $(".edit-panel").height() - $(".edit-header").height()); editor.setValue(data.content); editor.setOption("mode", data.mode); - + editor.setOption("gutters", ["CodeMirror-lint-markers"]); - + if ("application/json" === data.mode) { editor.setOption("lint", true); }