From f56c57109cf84e257717a73fa9bff4db8f6bb962 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 7 Sep 2014 00:13:25 +0800 Subject: [PATCH] gofmt --- editor/editors.go | 2 +- main.go | 2 +- static/js/wide.js | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/editors.go b/editor/editors.go index d72f28b..cb991b8 100644 --- a/editor/editors.go +++ b/editor/editors.go @@ -74,7 +74,7 @@ func WSHandler(w http.ResponseWriter, r *http.Request) { } } -func FmtHandler(w http.ResponseWriter, r *http.Request) { +func GoFmtHandler(w http.ResponseWriter, r *http.Request) { data := map[string]interface{}{"succ": true} defer util.RetJSON(w, r, data) diff --git a/main.go b/main.go index e71f0fc..5d1ed22 100644 --- a/main.go +++ b/main.go @@ -88,7 +88,7 @@ func main() { // 编辑器 http.HandleFunc("/editor/ws", editor.WSHandler) - http.HandleFunc("/fmt", editor.FmtHandler) + http.HandleFunc("/go/fmt", editor.GoFmtHandler) http.HandleFunc("/autocomplete", editor.AutocompleteHandler) // Shell diff --git a/static/js/wide.js b/static/js/wide.js index 64f3a13..9b30a09 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -127,9 +127,12 @@ var wide = { "cursorLine": wide.curEditor.getCursor().line, "cursorCh": wide.curEditor.getCursor().ch }; + + // TODO: HTML/XML/JSON 格式化处理 + $.ajax({ type: 'POST', - url: '/fmt', + url: '/go/fmt', data: JSON.stringify(request), dataType: "json", success: function(data) {