From 9664a7cadad2f0a88772f52017144ec8e76a3cfa Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 31 Aug 2014 14:07:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E9=99=A4=20.git=20=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- file/files.go | 7 ++++++- static/js/editor.js | 3 --- static/js/tree.js | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/file/files.go b/file/files.go index f38a3ce..26de794 100644 --- a/file/files.go +++ b/file/files.go @@ -203,11 +203,16 @@ func listFiles(dirname string) []string { dirs := []string{} files := []string{} - // 目录靠前,文件靠后 + // 排序:目录靠前,文件靠后 for _, name := range names { fio, _ := os.Lstat(filepath.Join(dirname, name)) if fio.IsDir() { + // 排除 .git 目录 + if ".git" == fio.Name() { + continue + } + dirs = append(dirs, name) } else { files = append(files, name) diff --git a/static/js/editor.js b/static/js/editor.js index 062cd2d..4ad3604 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -75,9 +75,6 @@ var editors = { cursorCh: editor.getCursor().ch }; - // XXX: 回调有问题,暂时不使用 WS 协议 - //editorWS.send(JSON.stringify(request)); - var autocompleteHints = []; $.ajax({ diff --git a/static/js/tree.js b/static/js/tree.js index 56558d5..26e5fa3 100644 --- a/static/js/tree.js +++ b/static/js/tree.js @@ -126,8 +126,7 @@ var tree = { } }; tree.fileTree = $.fn.zTree.init($("#files"), setting, data.root.children); - // TODO: remove - tree.fileTree.expandAll(true); + // tree.fileTree.expandAll(true); } } });