From 46cafd27a8419dcc1f886441833fe7f711a3d48e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 6 Sep 2014 22:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=9F=BA?= =?UTF-8?q?=E4=BA=8E=20Mime=20Type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- file/files.go | 20 ++++++++++---------- static/js/editor.js | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) 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); }