diff --git a/conf/wide.go b/conf/wide.go index a3ffffb..d0861e1 100644 --- a/conf/wide.go +++ b/conf/wide.go @@ -102,7 +102,7 @@ func Load(confPath, confData, confServer, confLogLevel string) { } func initUsers() { - os.MkdirAll(Wide.Data + PathSeparator + "users", 0755) + os.MkdirAll(Wide.Data+PathSeparator+"users", 0755) f, err := os.Open(Wide.Data + PathSeparator + "users") if nil != err { @@ -325,7 +325,7 @@ func initCustomizedConfs() { // UpdateCustomizedConf creates (if not exists) or updates user customized configuration files. // -// 1. /static/user/{userId}/style.css +// 1. /static/users/{userId}/style.css func UpdateCustomizedConf(userId string) { var u *User for _, user := range Users { // maybe it is a beauty of the trade-off of the another world between design and implementation @@ -347,7 +347,7 @@ func UpdateCustomizedConf(userId string) { os.Exit(-1) } - dir := filepath.Clean(Wide.Data + "/static/" + userId) + dir := filepath.Clean(Wide.Data + "/static/users/" + userId) if err := os.MkdirAll(dir, 0755); nil != err { logger.Error(err) diff --git a/main.go b/main.go index ab8ecf3..386fbba 100644 --- a/main.go +++ b/main.go @@ -95,18 +95,13 @@ func main() { // static resources http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) + http.Handle("/static/users/", http.StripPrefix("/static/", http.FileServer(http.Dir("C:\\Users\\DL882\\wide\\static\\")))) serveSingle("/favicon.ico", "./static/favicon.ico") // oauth http.HandleFunc("/oauth/github", session.RedirectGitHubHandler) http.HandleFunc("/oauth/github/callback", session.GithubCallbackHandler) - // workspaces - for _, user := range conf.Users { - http.Handle("/workspace/"+user.Id+"/", http.StripPrefix("/workspace/"+user.Id+"/", http.FileServer(http.Dir(user.WorkspacePath())))) - http.Handle("/static/user/", http.StripPrefix("/workspace/"+user.Id+"/", http.FileServer(http.Dir(conf.Wide.Data + conf.PathSeparator + "static")))) - } - // session http.HandleFunc("/session/ws", handlerWrapper(session.WSHandler)) http.HandleFunc("/session/save", handlerWrapper(session.SaveContentHandler)) diff --git a/session/oauthctl.go b/session/oauthctl.go index f72ec26..9e4bad3 100644 --- a/session/oauthctl.go +++ b/session/oauthctl.go @@ -185,9 +185,6 @@ func addUser(userId, userName, userAvatar string) string { helloWorld(workspace) conf.UpdateCustomizedConf(userId) - http.Handle("/workspace/"+userId+"/", - http.StripPrefix("/workspace/"+userId+"/", http.FileServer(http.Dir(newUser.WorkspacePath())))) - logger.Infof("Created a user [%s]", userId) return userCreated diff --git a/static/js/editors.js b/static/js/editors.js index 6383e05..83762c5 100644 --- a/static/js/editors.js +++ b/static/js/editors.js @@ -246,7 +246,7 @@ var editors = { + '"> ' + config.label.start_page + '', content: '
', after: function () { - $("#startPage").load(config.context + '/start?sid=' + config.wideSessionId); + $("#startPage").load('/start?sid=' + config.wideSessionId); $.ajax({ url: "https://hacpai.com/apis/articles?tags=wide,golang&p=1&size=20", type: "GET", @@ -329,7 +329,7 @@ var editors = { $.ajax({ async: false, // 同步执行 type: 'POST', - url: config.context + '/autocomplete', + url: '/autocomplete', data: JSON.stringify(request), dataType: "json", success: function (data) { @@ -435,7 +435,7 @@ var editors = { $.ajax({ type: 'POST', - url: config.context + '/exprinfo', + url: '/exprinfo', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -583,7 +583,7 @@ var editors = { $.ajax({ type: 'POST', - url: config.context + '/find/decl', + url: '/find/decl', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -613,7 +613,7 @@ var editors = { $.ajax({ type: 'POST', - url: config.context + '/find/usages', + url: '/find/usages', data: JSON.stringify(request), dataType: "json", success: function (result) { diff --git a/static/js/menu.js b/static/js/menu.js index cc461da..422a52c 100644 --- a/static/js/menu.js +++ b/static/js/menu.js @@ -61,7 +61,7 @@ var menu = { }); }, _initAbout: function () { - $("#dialogAbout").load(config.context + '/about', function () { + $("#dialogAbout").load('/about', function () { $("#dialogAbout").dialog({ "modal": true, "title": config.label.about, @@ -159,12 +159,12 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/logout', + url: '/logout', data: JSON.stringify(request), dataType: "json", success: function (result) { if (result.succ) { - window.location.href = config.context + "/login"; + window.location.href = "/login"; } } }); @@ -189,7 +189,7 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/go/get', + url: '/go/get', data: JSON.stringify(request), dataType: "json", beforeSend: function () { @@ -216,7 +216,7 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/go/install', + url: '/go/install', data: JSON.stringify(request), dataType: "json", beforeSend: function () { @@ -244,7 +244,7 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/go/test', + url: '/go/test', data: JSON.stringify(request), dataType: "json", beforeSend: function () { @@ -272,7 +272,7 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/go/vet', + url: '/go/vet', data: JSON.stringify(request), dataType: "json", beforeSend: function () { @@ -307,7 +307,7 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/build', + url: '/build', data: JSON.stringify(request), dataType: "json", beforeSend: function () { @@ -340,7 +340,7 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/build', + url: '/build', data: JSON.stringify(request), dataType: "json", beforeSend: function () { @@ -351,7 +351,7 @@ var menu = { }); }, _initPreference: function () { - $("#dialogPreference").load(config.context + '/preference', function () { + $("#dialogPreference").load('/preference', function () { $("#dialogPreference input").keyup(function () { var isChange = false, emptys = [], @@ -465,7 +465,7 @@ var menu = { $.ajax({ type: 'POST', - url: config.context + '/preference', + url: '/preference', data: JSON.stringify(request), success: function (result, textStatus, jqXHR) { if (!result.succ) { @@ -496,7 +496,7 @@ var menu = { var $okBtn = $("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)"); $okBtn.prop("disabled", true); - $("#themesLink").attr("href", config.staticServer + '/static/css/themes/' + $theme.val() + '.css'); + $("#themesLink").attr("href", '/static/css/themes/' + $theme.val() + '.css'); config.editorTheme = $editorTheme.val(); for (var i = 0, ii = editors.data.length; i < ii; i++) { diff --git a/static/js/playground.js b/static/js/playground.js index bbf73e6..ae6a253 100644 --- a/static/js/playground.js +++ b/static/js/playground.js @@ -91,7 +91,7 @@ var playground = { $.ajax({ async: false, // 同步执行 type: 'POST', - url: config.context + '/playground/autocomplete', + url: '/playground/autocomplete', data: JSON.stringify(request), dataType: "json", success: function (data) { @@ -356,7 +356,7 @@ var playground = { $.ajax({ type: 'POST', - url: config.context + '/playground/save', + url: '/playground/save', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -375,7 +375,7 @@ var playground = { request.url = url; $.ajax({ type: 'POST', - url: config.context + '/playground/short-url', + url: '/playground/short-url', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -420,7 +420,7 @@ var playground = { $.ajax({ type: 'POST', - url: config.context + '/playground/stop', + url: '/playground/stop', data: JSON.stringify(request), dataType: "json" }); @@ -443,7 +443,7 @@ var playground = { $.ajax({ type: 'POST', - url: config.context + '/playground/save', + url: '/playground/save', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -462,7 +462,7 @@ var playground = { $.ajax({ type: 'POST', - url: config.context + '/playground/build', + url: '/playground/build', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -482,7 +482,7 @@ var playground = { $.ajax({ type: 'POST', - url: config.context + '/playground/run', + url: '/playground/run', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -509,7 +509,7 @@ var playground = { $.ajax({ type: 'POST', - url: config.context + '/playground/save', + url: '/playground/save', data: JSON.stringify(request), dataType: "json", success: function (result) { diff --git a/static/js/session.js b/static/js/session.js index 85adb1a..d93915c 100644 --- a/static/js/session.js +++ b/static/js/session.js @@ -74,7 +74,7 @@ var session = { $.ajax({ type: 'POST', - url: config.context + '/session/save', + url: '/session/save', data: JSON.stringify(request), dataType: "json", success: function (result) { diff --git a/static/js/shell.js b/static/js/shell.js deleted file mode 100644 index 61ccd3f..0000000 --- a/static/js/shell.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2014-2019, b3log.org & hacpai.com - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @file shell.js - * - * @author Liang Ding - * @version 1.0.0.1, Dec 8, 2015 - */ -var shell = { - _shellWS: undefined, - _initWS: function () { - shell.shellWS = new ReconnectingWebSocket(config.channel + '/shell/ws?sid=' + config.wideSessionId); - shell.shellWS.onopen = function () { - console.log('[shell onopen] connected'); - }; - shell.shellWS.onmessage = function (e) { - console.log('[shell onmessage]' + e.data); - var data = JSON.parse(e.data); - if ('init-shell' !== data.cmd) { - $('#shellOutput').val(data.output); - } - }; - shell.shellWS.onclose = function (e) { - console.log('[shell onclose] disconnected (' + e.code + ')'); - }; - shell.shellWS.onerror = function (e) { - console.log('[shell onerror] ' + e); - }; - }, - init: function () { - this._initWS(); - - $('#shellInput').keydown(function (event) { - if (13 === event.which) { - var input = { - cmd: $('#shellInput').val() - }; - shell.shellWS.send(JSON.stringify(input)); - $('#shellInput').val(''); - } - }); - } -}; - -$(document).ready(function () { - shell.init(); -}); \ No newline at end of file diff --git a/static/js/tree.js b/static/js/tree.js index c86ae10..c048266 100644 --- a/static/js/tree.js +++ b/static/js/tree.js @@ -160,7 +160,7 @@ var tree = { $.ajax({ async: false, type: 'POST', - url: config.context + '/file/zip/new', + url: '/file/zip/new', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -175,7 +175,7 @@ var tree = { }); if (isSucc) { - window.open(config.context + '/file/zip?path=' + wide.curNode.path + ".zip"); + window.open('/file/zip?path=' + wide.curNode.path + ".zip"); } }, crossCompile: function (platform) { @@ -186,7 +186,7 @@ var tree = { $.ajax({ async: false, type: 'POST', - url: config.context + '/cross', + url: '/cross', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -198,28 +198,6 @@ var tree = { } }); }, - decompress: function () { - var request = newWideRequest(); - request.path = wide.curNode.path; - - $.ajax({ - async: false, - type: 'POST', - url: config.context + '/file/decompress', - data: JSON.stringify(request), - dataType: "json", - success: function (result) { - if (!result.succ) { - $("#dialogAlert").dialog("open", result.msg); - - return false; - } - - var dir = wide.curNode.getParentNode(); - tree.fileTree.reAsyncChildNodes(dir, "refresh"); - } - }); - }, refresh: function (it) { if (it) { if ($(it).hasClass("disabled")) { @@ -238,7 +216,7 @@ var tree = { $.ajax({ type: 'POST', - url: config.context + '/files', + url: '/files', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -257,7 +235,7 @@ var tree = { }, async: { enable: true, - url: config.context + "/file/refresh", + url: "/file/refresh", autoParam: ["path"] }, callback: { @@ -392,7 +370,7 @@ var tree = { $.ajax({ async: false, type: 'POST', - url: config.context + '/file', + url: '/file', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -419,7 +397,7 @@ var tree = { if ("img" === data.mode) { // 是图片文件的话新建 tab 打开 // 最好是开 tab,但这个最终取决于浏览器设置 - var w = window.open(config.context + data.path); + var w = window.open(data.path); return false; } @@ -481,7 +459,7 @@ var tree = { $.ajax({ type: 'POST', - url: config.context + '/file/search/text', + url: '/file/search/text', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -517,7 +495,7 @@ var tree = { $.ajax({ type: 'POST', - url: config.context + '/file/rename', + url: '/file/rename', data: JSON.stringify(request), dataType: "json", success: function (result) { diff --git a/static/js/wide.js b/static/js/wide.js index 2d5d691..3825780 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -38,7 +38,7 @@ var wide = { $.ajax({ type: 'POST', async: false, - url: config.context + '/outline', + url: '/outline', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -121,7 +121,7 @@ var wide = { $.ajax({ type: 'POST', - url: config.context + '/file/remove', + url: '/file/remove', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -159,7 +159,7 @@ var wide = { $.ajax({ type: 'POST', - url: config.context + '/file/new', + url: '/file/new', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -203,7 +203,7 @@ var wide = { $.ajax({ type: 'POST', - url: config.context + '/file/new', + url: '/file/new', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -264,7 +264,7 @@ var wide = { $.ajax({ type: 'POST', - url: config.context + '/file/find/name', + url: '/file/find/name', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -360,7 +360,7 @@ var wide = { $.ajax({ type: 'POST', - url: config.context + '/run', + url: '/run', data: JSON.stringify(request), dataType: "json" }); @@ -441,7 +441,7 @@ var wide = { $.ajax({ async: false, type: 'POST', - url: config.context + '/file/zip/new', + url: '/file/zip/new', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -456,7 +456,7 @@ var wide = { }); if (path) { - window.open(config.context + '/file/zip?path=' + path + ".zip"); + window.open('/file/zip?path=' + path + ".zip"); } } } @@ -521,7 +521,7 @@ var wide = { $.ajax({ type: 'POST', - url: config.context + '/file/save', + url: '/file/save', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -557,7 +557,7 @@ var wide = { request.nextCmd = ""; // build only, no following operation $.ajax({ type: 'POST', - url: config.context + '/build', + url: '/build', data: JSON.stringify(request), dataType: "json", beforeSend: function () { @@ -590,7 +590,7 @@ var wide = { $.ajax({ type: 'POST', - url: config.context + '/stop', + url: '/stop', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -612,7 +612,7 @@ var wide = { $.ajax({ async: false, // sync type: 'POST', - url: config.context + '/go/fmt', + url: '/go/fmt', data: JSON.stringify(request), dataType: "json", success: function (result) { @@ -645,7 +645,7 @@ var wide = { $.ajax({ async: false, // sync type: 'POST', - url: config.context + '/go/fmt', + url: '/go/fmt', data: JSON.stringify(request), dataType: "json", success: function (result) { diff --git a/static/js/wide.min.js b/static/js/wide.min.js index 91f63e0..0bb316b 100644 --- a/static/js/wide.min.js +++ b/static/js/wide.min.js @@ -1,11 +1,11 @@ var Tabs=function(e){e._$tabsPanel=$(e.id+" > .tabs-panel"),e._$tabs=$(e.id+" > .tabs"),e._stack=[],this.obj=e,this.obj.STACKSIZE=64,this._init(e);var i=this;$(e.id+" > .tabs > div").each(function(){var t=$(this).data("index");e._stack.length===i.obj.STACKSIZE&&e._stack.splice(0,1),e._stack[e._stack.length-1]!==t&&i.obj._stack.push(t)})};$.extend(Tabs.prototype,{_init:function(r){var n=this;r._$tabs.on("click","div",function(t){if($(this).hasClass("current"))return!1;var e=$(this).data("index");n.setCurrent(e),"function"==typeof r.clickAfter&&r.clickAfter(e)}),r._$tabs.on("click",".ico-close",function(t){var e=$(this).parent().data("index"),i=!0;"function"==typeof r.removeBefore&&(i=r.removeBefore(e)),i&&n.del(e),t.stopPropagation()})},_hasId:function(t){return 0!==this.obj._$tabs.find('div[data-index="'+t+'"]').length},add:function(t){if(this.getCurrentId()===t.id)return!1;if(this._hasId(t.id))return this.setCurrent(t.id),!1;var e=this.obj._$tabsPanel;this.obj._$tabs.append('
'+t.title+'
'),e.append('
'+t.content+"
"),this.setCurrent(t.id),"function"==typeof t.after&&t.after()},del:function(t){var e,i=this.obj._$tabsPanel,r=this.obj._$tabs,n=this.obj._stack;r.children("div[data-index='"+t+"']").remove(),i.children("div[data-index='"+t+"']").remove();for(var a=0;a
"+o.title+"
";o.hideFooter||(o.hiddenOk||(r=""),r+="");var h="
"+c+"
"+r+"
",g="";o.modal&&0===p("."+l.background).length&&(g="
");p("#"+i).wrap("
");var u=p(t).clone(!0);p(t).remove(),p("body").append(g+h),p(p("#"+i+"Dialog ."+l.main+" div").get(0)).append(u),p(u).show(),p("#"+i+"Dialog ."+l.closeIcon).bind("click",function(){p.dialog._close(i,o)});var f=p("#"+i+"Dialog ."+l.footer+" button");p(f.get(1)).bind("click",function(){p.dialog._close(i,o)}),p(f.get(0)).bind("click",function(){(void 0===o.ok||o.ok())&&p.dialog._close(i,o)}),this._bindMove(i,l.headerBg,s,d),p(window).keyup(function(t){27===t.keyCode&&p.dialog._close(i,o)}),p(window).resize(function(){var t=p("body").height()>p(window).height()?p("body").height():p(window).height();p(".dialog-background").height(t)}),"function"==typeof o.afterInit&&o.afterInit()},_bindMove:function(i,t){p("#"+i+"Dialog ."+t).mousedown(function(t){var e=document;t||(t=window.event);var o=document.getElementById(i+"Dialog"),n=t.clientX-parseInt(o.style.left),a=t.clientY-parseInt(o.style.top);e.ondragstart="return false;",e.onselectstart="return false;",e.onselect="document.selection.empty();",this.setCapture?this.setCapture():window.captureEvents&&window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP),e.onmousemove=function(t){t||(t=window.event);var e=t.clientX-n,i=t.clientY-a;e<0&&(e=0),e>p(window).width()-p(o).width()&&(e=p(window).width()-p(o).width()),i>p(window).height()-p(o).height()&&(i=p(window).height()-p(o).height()),i<0&&(i=0),o.style.left=e+"px",o.style.top=i+"px"},e.onmouseup=function(){this.releaseCapture?this.releaseCapture():window.captureEvents&&window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP),e.onmousemove=null,e.onmouseup=null,e.ondragstart=null,e.onselectstart=null,e.onselect=null}})},_close:function(t,e){if("none"!==p("#"+t+"Dialog").css("display")&&(void 0===e.close||e.close())&&(p("#"+t+"Dialog").hide(),e.modal)){var i=this._getDefaults(p.dialog._defaults,e,"styleClass");p("."+i.background).hide()}},_closeDialog:function(t){var e=this._getInst(t),i=e.id,o=e.settings;p.dialog._close(i,o)},_openDialog:function(t,e){var i=this._getInst(t),o=i.id,n=i.settings,a="",l="",s=p("#"+o+"Dialog"),d=p(window).height(),r=p(window).width(),c=n.height?n.height:parseInt(.6*d),h=n.width?n.width:parseInt(.6*r);if(l=n.position?(a=n.position.top,n.position.left):((a=parseInt((d-c-43)/2))<0&&(a=0),parseInt((r-h)/2)),s.css({top:a+"px",left:l+"px"}).show(),n.modal){var g=this._getDefaults(p.dialog._defaults,n,"styleClass");p("."+g.background).show()}"function"==typeof n.afterOpen&&n.afterOpen(e),p("#"+o+"Dialog .dialog-footer button:eq(0)").focus()},_updateDialog:function(t,e){var i=this._getInst(t),o=i.id,n=i.settings,a=this._getDefaults(p.dialog._defaults,n,"styleClass");p.extend(n,e);var l=p("#"+o+"Dialog");e.position&&l.css({top:e.position.top,left:e.position.left}),e.width&&(l.width(e.width+26),l.find("."+a.main+" div")[0].style.width=e.width+"px",l.find("."+a.headerBg).width(e.width+18)),e.height&&(l.find("."+a.main+" div")[0].style.height=e.height+"px"),e.title&&l.find("."+a.title).html(e.title),void 0!==e.modal&&(e.modal?p("."+a.background).show():p("."+a.background).hide()),void 0!==e.hideFooter&&(e.hideFooter?l.find("."+a.footer).hide():l.find("."+a.footer).show())},_getDefaults:function(t,e,i){if("styleClass"===i){if("default"===e.theme||void 0===e.theme)return t.styleClass;for(var o in e.styleClass={},t[i])e.styleClass[o]=e.theme+"-"+t.styleClass[o]}else{if("height"===i||"width"===i)return null===e[i]||void 0===e[i]?"auto":e[i]+"px";if(null===e[i]||void 0===e[i])return t[i]}return e[i]}}),p.fn.dialog=function(t){var e=Array.prototype.slice.call(arguments);return"string"==typeof t?(e.shift(),p.dialog["_"+t+"Dialog"].apply(p.dialog,[this[0]].concat(e))):this.each(function(){p.dialog._attach(this,t)})},p.dialog=new e,window["DP_jQuery_"+t]=p}(jQuery); -var editors={autocompleteMutex:!1,data:[],tabs:{},getEditorByPath:function(e){for(var t=0,o=editors.data.length;t div[data-index="'+$(".edit-panel .frame").data("index")+"]").find(".ico-close").click()},closeOther:function(){var t=$(".edit-panel .frame").data("index"),o=[];if($(".edit-panel .tabs > div").each(function(e){t!==$(this).data("index")&&o.push($(this).data("index"))}),0===o.length)return!1;var e=o.splice(0,1);$("#dialogCloseEditor").data("removeData",o),$('.edit-panel .tabs > div[data-index="'+e+'"]').find(".ico-close").click()},_removeAllMarker:function(){var e=$("#dialogCloseEditor").data("removeData");if(e&&0 div[data-index="'+t+'"] .ico-close').click()}wide.curEditor&&wide.curEditor.focus()},_initClose:function(){new ZeroClipboard($("#copyFilePath")),$(".edit-panel").on("mouseup",".tabs > div",function(e){if(e.stopPropagation(),0===e.button)return $(".edit-panel .frame").hide(),!1;var t=e.screenX;return"auto"!==$(".side").css("left")&&"0px"!==$(".side").css("left")||(t=e.screenX-$(".side").width()),$(".edit-panel .frame").show().css({left:t+"px",top:"21px"}).data("index",$(this).data("index")),$("#copyFilePath").attr("data-clipboard-text",$(this).find("span:eq(0)").attr("title")),!1})},init:function(){$("#dialogCloseEditor").dialog({modal:!0,height:90,width:260,title:config.label.tip,hideFooter:!0,afterOpen:function(e){$("#dialogCloseEditor > div:eq(0)").html(config.label.file+" "+e+". "+config.label.confirm_save+"?"),$("#dialogCloseEditor button:eq(0)").focus()},afterInit:function(){$("#dialogCloseEditor button.save").click(function(){var e=$("#dialogCloseEditor").data("index");wide.fmt(editors.data[e].id,editors.data[e].editor),editors.tabs.del(editors.data[e].id),$("#dialogCloseEditor").dialog("close"),editors._removeAllMarker()}),$("#dialogCloseEditor button.discard").click(function(){var e=$("#dialogCloseEditor").data("index");editors.tabs.del(editors.data[e].id),$("#dialogCloseEditor").dialog("close"),editors._removeAllMarker()}),$("#dialogCloseEditor button.cancel").click(function(e){$("#dialogCloseEditor").dialog("close"),editors._removeAllMarker()})}}),editors.tabs=new Tabs({id:".edit-panel",setAfter:function(){wide.curEditor&&wide.curEditor.focus()},clickAfter:function(e){if("startPage"===e)return wide.curEditor=void 0,$(".footer .cursor").text(""),wide.refreshOutline(),!1},removeBefore:function(e){if("startPage"===e)return editors._removeAllMarker(),!0;for(var t=0,o=editors.data.length;t div[data-index="'+editors.data[t].id+'"] > span:eq(0)').text()),$("#dialogCloseEditor").data("index",t),!1)},removeAfter:function(e,t){0===$(".edit-panel .tabs > div").length&&menu.disabled(["close-all"]);for(var o=0,i=editors.data.length;o '+config.label.start_page+"",content:'
',after:function(){$("#startPage").load(config.context+"/start?sid="+config.wideSessionId),$.ajax({url:"https://hacpai.com/apis/articles?tags=wide,golang&p=1&size=20",type:"GET",dataType:"jsonp",jsonp:"callback",success:function(e,t){var o=e.articles;if(0!==o.length){var i=o.length;9边看边练",a=0;a"+n.articleTitle+"  "+s(n.articleCreateTime,"yyyy-MM-dd")}$("#startPage .news").html(r+"")}}})}})},getCurrentId:function(){var e=editors.tabs.getCurrentId();return"startPage"===e&&(e=null),e},getCurrentPath:function(){var e=$(".edit-panel .tabs .current span:eq(0)").attr("title");return e===config.label.start_page&&(e=null),e},_initCodeMirrorHotKeys:function(){CodeMirror.registerHelper("hint","go",function(a){for(var e=/[\w$]+/,t=(a=wide.curEditor).getCursor(),o=a.getLine(t.line),i=t.ch,r=i;r span:eq(0)").attr("title"),n.code=a.getValue(),n.cursorLine=t.line,n.cursorCh=t.ch;var s=[];if(!editors.autocompleteMutex||!a.state.completionActive)return editors.autocompleteMutex=!0,$.ajax({async:!1,type:"POST",url:config.context+"/autocomplete",data:JSON.stringify(n),dataType:"json",success:function(e){var t=e[1];if(t)for(var o=0;o'+t[o].name+" "+t[o].type+"";break;case"const":i=''+t[o].name+" "+t[o].type+"";break;case"var":i=''+t[o].name+" "+t[o].type+"";break;case"package":i=''+t[o].name+" "+t[o].type+"";break;case"func":i=''+t[o].name+""+t[o].type.substring(4)+"",r+="()";break;default:console.warn("Can't handle autocomplete ["+t[o].class+"]")}s[o]={displayText:i,text:r}}a.doc.markClean(),$(".edit-panel .tabs .current > span:eq(0)").removeClass("changed")}}),setTimeout(function(){editors.autocompleteMutex=!1},20),{list:s,from:CodeMirror.Pos(t.line,i),to:CodeMirror.Pos(t.line,r)}}),CodeMirror.commands.autocompleteAfterDot=function(e){var t=e.getMode();if(t&&"go"!==t.name)return CodeMirror.Pass;var o=e.getTokenAt(e.getCursor());return"comment"===o.type||"string"===o.type||setTimeout(function(){e.state.completionActive||e.showHint({hint:CodeMirror.hint.go,completeSingle:!1})},50),CodeMirror.Pass},CodeMirror.commands.autocompleteAnyWord=function(e){e.showHint({hint:CodeMirror.hint.auto})},CodeMirror.commands.gotoLine=function(e){$("#dialogGoLinePrompt").dialog("open")},CodeMirror.commands.doNothing=function(e){},CodeMirror.commands.exprInfo=function(e){var t=wide.curEditor.getCursor(),o=newWideRequest();o.path=$(".edit-panel .tabs .current > span:eq(0)").attr("title"),o.code=wide.curEditor.getValue(),o.cursorLine=t.line,o.cursorCh=t.ch,$.ajax({type:"POST",url:config.context+"/exprinfo",data:JSON.stringify(o),dataType:"json",success:function(e){if(e.succ){var t=wide.curEditor.cursorCoords();$("body").append('
'+e.data+"
")}}})},CodeMirror.commands.copyLinesDown=function(e){var t="",o=e.listSelections()[0],i=o.anchor,r=o.head;i.line>r.line&&(i=o.head,r=o.anchor);for(var a=i.line,n=r.line;a<=n;a++)0===r.ch&&a===n||(t+="\n"+e.getLine(a));var s=r.line;0===r.ch&&(s=r.line-1),e.replaceRange(t,CodeMirror.Pos(s));var d=s-i.line+1;e.setSelection(CodeMirror.Pos(i.line+d,i.ch),CodeMirror.Pos(r.line+d,r.ch))},CodeMirror.commands.copyLinesUp=function(e){var t="",o=e.listSelections()[0],i=o.anchor,r=o.head;i.line>r.line&&(i=o.head,r=o.anchor);for(var a=i.line,n=r.line;a<=n;a++)0===r.ch&&a===n||(t+="\n"+e.getLine(a));var s=r.line;0===r.ch&&(s=r.line-1),e.replaceRange(t,CodeMirror.Pos(s)),e.setSelection(CodeMirror.Pos(i.line,i.ch),CodeMirror.Pos(r.line,r.ch))},CodeMirror.commands.moveLinesUp=function(e){var t=e.listSelections()[0],o=t.anchor,i=t.head;if(o.line>i.line&&(o=t.head,i=t.anchor),0===o.line)return!1;var r=i.line;0===i.ch&&(r=i.line-1),e.replaceRange("\n"+e.getLine(o.line-1),CodeMirror.Pos(r)),1===o.line?e.replaceRange("",CodeMirror.Pos(0,0),CodeMirror.Pos(1,0)):e.replaceRange("",CodeMirror.Pos(o.line-2,e.getLine(o.line-2).length),CodeMirror.Pos(o.line-1,e.getLine(o.line-1).length)),e.setSelection(CodeMirror.Pos(o.line-1,o.ch),CodeMirror.Pos(i.line-1,i.ch))},CodeMirror.commands.moveLinesDown=function(e){var t=e.listSelections()[0],o=t.anchor,i=t.head;if(o.line>i.line&&(o=t.head,i=t.anchor),i.line===e.lastLine())return!1;var r=i.line;0===i.ch&&(r=i.line-1),0===o.line?e.replaceRange(e.getLine(r+1)+"\n",CodeMirror.Pos(0,0)):e.replaceRange("\n"+e.getLine(r+1),CodeMirror.Pos(o.line-1)),e.replaceRange("",CodeMirror.Pos(r+1,e.getLine(r+1).length),CodeMirror.Pos(r+2,e.getLine(r+2).length)),e.setSelection(CodeMirror.Pos(o.line+1,o.ch),CodeMirror.Pos(i.line+1,i.ch))},CodeMirror.commands.jumpToDecl=function(e){var t=wide.curEditor.getCursor(),o=newWideRequest();o.path=$(".edit-panel .tabs .current > span:eq(0)").attr("title"),o.code=wide.curEditor.getValue(),o.cursorLine=t.line,o.cursorCh=t.ch,$.ajax({type:"POST",url:config.context+"/find/decl",data:JSON.stringify(o),dataType:"json",success:function(e){if(e.succ){var t=e.data,o=tree.getTIdByPath(t.path);wide.curNode=tree.fileTree.getNodeByTId(o),tree.fileTree.selectNode(wide.curNode),tree.openFile(wide.curNode,CodeMirror.Pos(t.cursorLine-1,t.cursorCh-1))}}})},CodeMirror.commands.findUsages=function(e){var t=wide.curEditor.getCursor(),o=newWideRequest();o.path=$(".edit-panel .tabs .current > span:eq(0)").attr("title"),o.code=wide.curEditor.getValue(),o.cursorLine=t.line,o.cursorCh=t.ch,$.ajax({type:"POST",url:config.context+"/find/usages",data:JSON.stringify(o),dataType:"json",success:function(e){e.succ&&editors.appendSearch(e.data,"usages","")}})},CodeMirror.commands.selectIdentifier=function(e){var t=e.getCursor(),o=e.findWordAt(t);e.extendSelection(o.anchor,o.head)}},appendSearch:function(e,t,o){for(var i='
    ',r=(o=o.toLowerCase(),0),a=e.length;r"+p+""),n+=e[r].contents[0].substring(d-s[c].length,d)+p}i+='
  • '+n+"    "+e[r].path+' ('+e[r].line+":"+e[r].ch+")
  • "}0===e.length&&(i+="
  • "+config.label.search_no_match+"
  • "),i+="
";var f=$(".bottom-window-group .search"),g=config.label.find_usages;"founds"===t&&(g=config.label.search_text),0===f.find("ul").length?(bottomGroup.searchTab=new Tabs({id:".bottom-window-group .search",removeAfter:function(e,t){1===f.find("ul").length&&f.find(".tabs").hide()}}),f.on("click","li",function(){f.find("li").removeClass("selected"),$(this).addClass("selected")}),f.on("dblclick","li",function(){var e=$(this),t=tree.getTIdByPath(e.attr("title"));tree.openFile(tree.fileTree.getNodeByTId(t)),tree.fileTree.selectNode(wide.curNode);var o=e.find(".position").data("line")-1,i=CodeMirror.Pos(o,e.find(".position").data("ch")-1),r=wide.curEditor;r.setCursor(i);var a=Math.floor(r.getScrollInfo().clientHeight/r.defaultTextHeight()/2),n=r.cursorCoords({line:i.line-a,ch:0},"local");r.scrollTo(0,n.top),wide.curEditor.focus()}),f.find(".tabs-panel > div").append(i),f.find(".tabs .first").text(g)):(f.find(".tabs").show(),bottomGroup.searchTab.add({id:"search"+(new Date).getTime(),title:g,content:i})),bottomGroup.tabs.setCurrent("search"),windows.flowBottom(),$(".bottom-window-group .search").focus()},newEditor:function(e,t){var o=wide.curNode.id;editors.tabs.add({id:o,title:''+wide.curNode.name+"",content:''}),menu.undisabled(["save-all","close-all","build","run","go-test","go-vet","go-get","go-install","find","find-next","find-previous","replace","replace-all","format","autocomplete","jump-to-decl","expr-info","find-usages","toggle-comment","edit"]);var i=document.getElementById("editor"+o);i.value=e.content;var r=CodeMirror.fromTextArea(i,{lineNumbers:!0,autofocus:!0,autoCloseBrackets:!0,matchBrackets:!0,highlightSelectionMatches:{showToken:/\w/},rulers:[{color:"#ccc",column:120,lineStyle:"dashed"}],styleActiveLine:!0,theme:config.editorTheme,tabSize:config.editorTabSize,indentUnit:4,indentWithTabs:!0,foldGutter:!0,cursorHeight:1,path:e.path,readOnly:wide.curNode.isGOAPI,profile:"xhtml",extraKeys:{"Ctrl-\\":"autocompleteAnyWord",".":"autocompleteAfterDot","Ctrl-/":"toggleComment","Ctrl-I":"exprInfo","Ctrl-L":"gotoLine","Ctrl-E":"deleteLine","Ctrl-D":"doNothing","Ctrl-B":"jumpToDecl","Ctrl-S":function(){wide.saveFile()},"Shift-Ctrl-S":function(){menu.saveAllFiles()},"Shift-Alt-F":function(){var e=editors.getCurrentPath();if(!e)return!1;wide.fmt(e,wide.curEditor)},"Alt-F7":"findUsages","Shift-Alt-Enter":function(){windows.isMaxEditor?windows.restoreEditor():windows.maxEditor()},"Shift-Ctrl-Up":"copyLinesUp","Shift-Ctrl-Down":"copyLinesDown","Shift-Alt-Up":"moveLinesUp","Shift-Alt-Down":"moveLinesDown","Shift-Alt-J":"selectIdentifier"}});"text/html"===e.mode&&emmetCodeMirror(r),r.on("cursorActivity",function(e){$(".edit-exprinfo").remove();var t=e.getCursor();$(".footer .cursor").text("| "+(t.line+1)+":"+(t.ch+1)+" |")}),r.on("blur",function(e){$(".edit-exprinfo").remove()}),r.on("changes",function(t){t.doc.isClean()?$(".edit-panel .tabs > div").each(function(){var e=$(this).find("span:eq(0)");e.attr("title")===t.options.path&&e.removeClass("changed")}):$(".edit-panel .tabs > div").each(function(){var e=$(this).find("span:eq(0)");e.attr("title")===t.options.path&&e.addClass("changed")})}),r.on("keydown",function(e,t){if(!(t.altKey||t.ctrlKey||t.shiftKey)){var o=t.which;o<48||57 div[data-index="'+$(".edit-panel .frame").data("index")+"]").find(".ico-close").click()},closeOther:function(){var t=$(".edit-panel .frame").data("index"),o=[];if($(".edit-panel .tabs > div").each(function(e){t!==$(this).data("index")&&o.push($(this).data("index"))}),0===o.length)return!1;var e=o.splice(0,1);$("#dialogCloseEditor").data("removeData",o),$('.edit-panel .tabs > div[data-index="'+e+'"]').find(".ico-close").click()},_removeAllMarker:function(){var e=$("#dialogCloseEditor").data("removeData");if(e&&0 div[data-index="'+t+'"] .ico-close').click()}wide.curEditor&&wide.curEditor.focus()},_initClose:function(){new ZeroClipboard($("#copyFilePath")),$(".edit-panel").on("mouseup",".tabs > div",function(e){if(e.stopPropagation(),0===e.button)return $(".edit-panel .frame").hide(),!1;var t=e.screenX;return"auto"!==$(".side").css("left")&&"0px"!==$(".side").css("left")||(t=e.screenX-$(".side").width()),$(".edit-panel .frame").show().css({left:t+"px",top:"21px"}).data("index",$(this).data("index")),$("#copyFilePath").attr("data-clipboard-text",$(this).find("span:eq(0)").attr("title")),!1})},init:function(){$("#dialogCloseEditor").dialog({modal:!0,height:90,width:260,title:config.label.tip,hideFooter:!0,afterOpen:function(e){$("#dialogCloseEditor > div:eq(0)").html(config.label.file+" "+e+". "+config.label.confirm_save+"?"),$("#dialogCloseEditor button:eq(0)").focus()},afterInit:function(){$("#dialogCloseEditor button.save").click(function(){var e=$("#dialogCloseEditor").data("index");wide.fmt(editors.data[e].id,editors.data[e].editor),editors.tabs.del(editors.data[e].id),$("#dialogCloseEditor").dialog("close"),editors._removeAllMarker()}),$("#dialogCloseEditor button.discard").click(function(){var e=$("#dialogCloseEditor").data("index");editors.tabs.del(editors.data[e].id),$("#dialogCloseEditor").dialog("close"),editors._removeAllMarker()}),$("#dialogCloseEditor button.cancel").click(function(e){$("#dialogCloseEditor").dialog("close"),editors._removeAllMarker()})}}),editors.tabs=new Tabs({id:".edit-panel",setAfter:function(){wide.curEditor&&wide.curEditor.focus()},clickAfter:function(e){if("startPage"===e)return wide.curEditor=void 0,$(".footer .cursor").text(""),wide.refreshOutline(),!1},removeBefore:function(e){if("startPage"===e)return editors._removeAllMarker(),!0;for(var t=0,o=editors.data.length;t div[data-index="'+editors.data[t].id+'"] > span:eq(0)').text()),$("#dialogCloseEditor").data("index",t),!1)},removeAfter:function(e,t){0===$(".edit-panel .tabs > div").length&&menu.disabled(["close-all"]);for(var o=0,i=editors.data.length;o '+config.label.start_page+"",content:'
',after:function(){$("#startPage").load("/start?sid="+config.wideSessionId),$.ajax({url:"https://hacpai.com/apis/articles?tags=wide,golang&p=1&size=20",type:"GET",dataType:"jsonp",jsonp:"callback",success:function(e,t){var o=e.articles;if(0!==o.length){var i=o.length;9边看边练",a=0;a"+n.articleTitle+"  "+s(n.articleCreateTime,"yyyy-MM-dd")}$("#startPage .news").html(r+"")}}})}})},getCurrentId:function(){var e=editors.tabs.getCurrentId();return"startPage"===e&&(e=null),e},getCurrentPath:function(){var e=$(".edit-panel .tabs .current span:eq(0)").attr("title");return e===config.label.start_page&&(e=null),e},_initCodeMirrorHotKeys:function(){CodeMirror.registerHelper("hint","go",function(a){for(var e=/[\w$]+/,t=(a=wide.curEditor).getCursor(),o=a.getLine(t.line),i=t.ch,r=i;r span:eq(0)").attr("title"),n.code=a.getValue(),n.cursorLine=t.line,n.cursorCh=t.ch;var s=[];if(!editors.autocompleteMutex||!a.state.completionActive)return editors.autocompleteMutex=!0,$.ajax({async:!1,type:"POST",url:"/autocomplete",data:JSON.stringify(n),dataType:"json",success:function(e){var t=e[1];if(t)for(var o=0;o'+t[o].name+" "+t[o].type+"";break;case"const":i=''+t[o].name+" "+t[o].type+"";break;case"var":i=''+t[o].name+" "+t[o].type+"";break;case"package":i=''+t[o].name+" "+t[o].type+"";break;case"func":i=''+t[o].name+""+t[o].type.substring(4)+"",r+="()";break;default:console.warn("Can't handle autocomplete ["+t[o].class+"]")}s[o]={displayText:i,text:r}}a.doc.markClean(),$(".edit-panel .tabs .current > span:eq(0)").removeClass("changed")}}),setTimeout(function(){editors.autocompleteMutex=!1},20),{list:s,from:CodeMirror.Pos(t.line,i),to:CodeMirror.Pos(t.line,r)}}),CodeMirror.commands.autocompleteAfterDot=function(e){var t=e.getMode();if(t&&"go"!==t.name)return CodeMirror.Pass;var o=e.getTokenAt(e.getCursor());return"comment"===o.type||"string"===o.type||setTimeout(function(){e.state.completionActive||e.showHint({hint:CodeMirror.hint.go,completeSingle:!1})},50),CodeMirror.Pass},CodeMirror.commands.autocompleteAnyWord=function(e){e.showHint({hint:CodeMirror.hint.auto})},CodeMirror.commands.gotoLine=function(e){$("#dialogGoLinePrompt").dialog("open")},CodeMirror.commands.doNothing=function(e){},CodeMirror.commands.exprInfo=function(e){var t=wide.curEditor.getCursor(),o=newWideRequest();o.path=$(".edit-panel .tabs .current > span:eq(0)").attr("title"),o.code=wide.curEditor.getValue(),o.cursorLine=t.line,o.cursorCh=t.ch,$.ajax({type:"POST",url:"/exprinfo",data:JSON.stringify(o),dataType:"json",success:function(e){if(e.succ){var t=wide.curEditor.cursorCoords();$("body").append('
'+e.data+"
")}}})},CodeMirror.commands.copyLinesDown=function(e){var t="",o=e.listSelections()[0],i=o.anchor,r=o.head;i.line>r.line&&(i=o.head,r=o.anchor);for(var a=i.line,n=r.line;a<=n;a++)0===r.ch&&a===n||(t+="\n"+e.getLine(a));var s=r.line;0===r.ch&&(s=r.line-1),e.replaceRange(t,CodeMirror.Pos(s));var d=s-i.line+1;e.setSelection(CodeMirror.Pos(i.line+d,i.ch),CodeMirror.Pos(r.line+d,r.ch))},CodeMirror.commands.copyLinesUp=function(e){var t="",o=e.listSelections()[0],i=o.anchor,r=o.head;i.line>r.line&&(i=o.head,r=o.anchor);for(var a=i.line,n=r.line;a<=n;a++)0===r.ch&&a===n||(t+="\n"+e.getLine(a));var s=r.line;0===r.ch&&(s=r.line-1),e.replaceRange(t,CodeMirror.Pos(s)),e.setSelection(CodeMirror.Pos(i.line,i.ch),CodeMirror.Pos(r.line,r.ch))},CodeMirror.commands.moveLinesUp=function(e){var t=e.listSelections()[0],o=t.anchor,i=t.head;if(o.line>i.line&&(o=t.head,i=t.anchor),0===o.line)return!1;var r=i.line;0===i.ch&&(r=i.line-1),e.replaceRange("\n"+e.getLine(o.line-1),CodeMirror.Pos(r)),1===o.line?e.replaceRange("",CodeMirror.Pos(0,0),CodeMirror.Pos(1,0)):e.replaceRange("",CodeMirror.Pos(o.line-2,e.getLine(o.line-2).length),CodeMirror.Pos(o.line-1,e.getLine(o.line-1).length)),e.setSelection(CodeMirror.Pos(o.line-1,o.ch),CodeMirror.Pos(i.line-1,i.ch))},CodeMirror.commands.moveLinesDown=function(e){var t=e.listSelections()[0],o=t.anchor,i=t.head;if(o.line>i.line&&(o=t.head,i=t.anchor),i.line===e.lastLine())return!1;var r=i.line;0===i.ch&&(r=i.line-1),0===o.line?e.replaceRange(e.getLine(r+1)+"\n",CodeMirror.Pos(0,0)):e.replaceRange("\n"+e.getLine(r+1),CodeMirror.Pos(o.line-1)),e.replaceRange("",CodeMirror.Pos(r+1,e.getLine(r+1).length),CodeMirror.Pos(r+2,e.getLine(r+2).length)),e.setSelection(CodeMirror.Pos(o.line+1,o.ch),CodeMirror.Pos(i.line+1,i.ch))},CodeMirror.commands.jumpToDecl=function(e){var t=wide.curEditor.getCursor(),o=newWideRequest();o.path=$(".edit-panel .tabs .current > span:eq(0)").attr("title"),o.code=wide.curEditor.getValue(),o.cursorLine=t.line,o.cursorCh=t.ch,$.ajax({type:"POST",url:"/find/decl",data:JSON.stringify(o),dataType:"json",success:function(e){if(e.succ){var t=e.data,o=tree.getTIdByPath(t.path);wide.curNode=tree.fileTree.getNodeByTId(o),tree.fileTree.selectNode(wide.curNode),tree.openFile(wide.curNode,CodeMirror.Pos(t.cursorLine-1,t.cursorCh-1))}}})},CodeMirror.commands.findUsages=function(e){var t=wide.curEditor.getCursor(),o=newWideRequest();o.path=$(".edit-panel .tabs .current > span:eq(0)").attr("title"),o.code=wide.curEditor.getValue(),o.cursorLine=t.line,o.cursorCh=t.ch,$.ajax({type:"POST",url:"/find/usages",data:JSON.stringify(o),dataType:"json",success:function(e){e.succ&&editors.appendSearch(e.data,"usages","")}})},CodeMirror.commands.selectIdentifier=function(e){var t=e.getCursor(),o=e.findWordAt(t);e.extendSelection(o.anchor,o.head)}},appendSearch:function(e,t,o){for(var i='
    ',r=(o=o.toLowerCase(),0),a=e.length;r"+p+""),n+=e[r].contents[0].substring(d-s[c].length,d)+p}i+='
  • '+n+"    "+e[r].path+' ('+e[r].line+":"+e[r].ch+")
  • "}0===e.length&&(i+="
  • "+config.label.search_no_match+"
  • "),i+="
";var f=$(".bottom-window-group .search"),g=config.label.find_usages;"founds"===t&&(g=config.label.search_text),0===f.find("ul").length?(bottomGroup.searchTab=new Tabs({id:".bottom-window-group .search",removeAfter:function(e,t){1===f.find("ul").length&&f.find(".tabs").hide()}}),f.on("click","li",function(){f.find("li").removeClass("selected"),$(this).addClass("selected")}),f.on("dblclick","li",function(){var e=$(this),t=tree.getTIdByPath(e.attr("title"));tree.openFile(tree.fileTree.getNodeByTId(t)),tree.fileTree.selectNode(wide.curNode);var o=e.find(".position").data("line")-1,i=CodeMirror.Pos(o,e.find(".position").data("ch")-1),r=wide.curEditor;r.setCursor(i);var a=Math.floor(r.getScrollInfo().clientHeight/r.defaultTextHeight()/2),n=r.cursorCoords({line:i.line-a,ch:0},"local");r.scrollTo(0,n.top),wide.curEditor.focus()}),f.find(".tabs-panel > div").append(i),f.find(".tabs .first").text(g)):(f.find(".tabs").show(),bottomGroup.searchTab.add({id:"search"+(new Date).getTime(),title:g,content:i})),bottomGroup.tabs.setCurrent("search"),windows.flowBottom(),$(".bottom-window-group .search").focus()},newEditor:function(e,t){var o=wide.curNode.id;editors.tabs.add({id:o,title:''+wide.curNode.name+"",content:''}),menu.undisabled(["save-all","close-all","build","run","go-test","go-vet","go-get","go-install","find","find-next","find-previous","replace","replace-all","format","autocomplete","jump-to-decl","expr-info","find-usages","toggle-comment","edit"]);var i=document.getElementById("editor"+o);i.value=e.content;var r=CodeMirror.fromTextArea(i,{lineNumbers:!0,autofocus:!0,autoCloseBrackets:!0,matchBrackets:!0,highlightSelectionMatches:{showToken:/\w/},rulers:[{color:"#ccc",column:120,lineStyle:"dashed"}],styleActiveLine:!0,theme:config.editorTheme,tabSize:config.editorTabSize,indentUnit:4,indentWithTabs:!0,foldGutter:!0,cursorHeight:1,path:e.path,readOnly:wide.curNode.isGOAPI,profile:"xhtml",extraKeys:{"Ctrl-\\":"autocompleteAnyWord",".":"autocompleteAfterDot","Ctrl-/":"toggleComment","Ctrl-I":"exprInfo","Ctrl-L":"gotoLine","Ctrl-E":"deleteLine","Ctrl-D":"doNothing","Ctrl-B":"jumpToDecl","Ctrl-S":function(){wide.saveFile()},"Shift-Ctrl-S":function(){menu.saveAllFiles()},"Shift-Alt-F":function(){var e=editors.getCurrentPath();if(!e)return!1;wide.fmt(e,wide.curEditor)},"Alt-F7":"findUsages","Shift-Alt-Enter":function(){windows.isMaxEditor?windows.restoreEditor():windows.maxEditor()},"Shift-Ctrl-Up":"copyLinesUp","Shift-Ctrl-Down":"copyLinesDown","Shift-Alt-Up":"moveLinesUp","Shift-Alt-Down":"moveLinesDown","Shift-Alt-J":"selectIdentifier"}});"text/html"===e.mode&&emmetCodeMirror(r),r.on("cursorActivity",function(e){$(".edit-exprinfo").remove();var t=e.getCursor();$(".footer .cursor").text("| "+(t.line+1)+":"+(t.ch+1)+" |")}),r.on("blur",function(e){$(".edit-exprinfo").remove()}),r.on("changes",function(t){t.doc.isClean()?$(".edit-panel .tabs > div").each(function(){var e=$(this).find("span:eq(0)");e.attr("title")===t.options.path&&e.removeClass("changed")}):$(".edit-panel .tabs > div").each(function(){var e=$(this).find("span:eq(0)");e.attr("title")===t.options.path&&e.addClass("changed")})}),r.on("keydown",function(e,t){if(!(t.altKey||t.ctrlKey||t.shiftKey)){var o=t.which;o<48||57 table"),i="";n.cmd&&"init-notification"===n.cmd?console.log("[notification onmessage]"+o.data):(i+=''+n.severity+''+n.message+''+n.type+"",t.append(i),$(".notification-count").show())},o.onclose=function(o){console.log("[notification onclose] disconnected ("+o.code+")")},o.onerror=function(o){console.log("[notification onerror]")}}}; -var tree={fileTree:void 0,getCurrentNodeLastNode:function(e){var t=e.children[e.children.length-1];return t.open?tree.getCurrentNodeLastNode(t):t},getNextShowNode:function(e){return 0!==e.level?e.getParentNode().getNextNode()?e.getParentNode().getNextNode():tree.getNextShowNode(e.getParentNode()):e.getNextNode()},isBottomNode:function(e){return!e.open&&(e.getParentNode()?!!e.getParentNode().isLastNode&&tree.isBottomNode(e.getParentNode()):!!e.isLastNode)},getTIdByPath:function(e){for(var t=tree.fileTree.transformToArray(tree.fileTree.getNodes()),i=0,o=t.length;i$(".content").height()&&(o=o-r.height()-25),r.css({top:o+"px",left:e.clientX+"px",display:"block"}).show(),n.hide()}else{wide.curNode.removable?n.find(".remove").removeClass("disabled"):n.find(".remove").addClass("disabled"),-1===wide.curNode.path.indexOf("zip",wide.curNode.path.length-"zip".length)?n.find(".decompress").hide():n.find(".decompress").show(),-1===wide.curNode.path.indexOf("go",wide.curNode.path.length-"go".length)?n.find(".linux64").hide():n.find(".linux64").show();var o=e.clientY-10;n.height()+o>$(".content").height()&&(o=o-n.height()-25),n.css({top:o+"px",left:e.clientX+"px",display:"block"}).show(),r.hide(),menu.disabled(["import","git-clone"])}$("#files").focus()}},onClick:function(e,t,i,o){i&&(wide.curNode=i,tree.fileTree.selectNode(i),menu.undisabled(["import","export","git-clone"]),tree.isDir()||menu.disabled(["import","git-clone"]),$("#files").focus())}}};tree.fileTree=$.fn.zTree.init($("#files"),t,e.data.children),session.restore()}}}),this._initSearch(),this._initRename()},openFile:function(o,e){wide.curNode=o;for(var r=e,t=0,i=editors.data.length;t input:eq(0)").keyup(function(e){var t=$(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");13!==e.which||t.prop("disabled")||t.click(),""===$.trim($(this).val())?t.prop("disabled",!0):t.prop("disabled",!1)}),$("#dialogSearchForm > input:eq(1)").keyup(function(e){var t=$(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");13!==e.which||t.prop("disabled")||t.click()}),$("#dialogSearchForm").dialog({modal:!0,height:80,width:260,title:config.label.search,okText:config.label.search,cancelText:config.label.cancel,afterOpen:function(){$("#dialogSearchForm > input:eq(0)").val("").focus(),$("#dialogSearchForm > input:eq(1)").val(""),$("#dialogSearchForm").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var t=newWideRequest();wide.curNode?t.dir=wide.curNode.path:t.dir="",t.text=$("#dialogSearchForm > input:eq(0)").val(),t.extension=$("#dialogSearchForm > input:eq(1)").val(),$.ajax({type:"POST",url:config.context+"/file/search/text",data:JSON.stringify(t),dataType:"json",success:function(e){e.succ&&($("#dialogSearchForm").dialog("close"),editors.appendSearch(e.data,"founds",t.text))}})}})},_initRename:function(){$("#dialogRenamePrompt").dialog({modal:!0,height:52,width:260,title:config.label.rename,okText:config.label.rename,cancelText:config.label.cancel,afterOpen:function(){$("#dialogRenamePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0),$("#dialogRenamePrompt > input").val(wide.curNode.name).select().focus()},ok:function(){var e=$("#dialogRenamePrompt > input").val(),t=newWideRequest();t.oldPath=wide.curNode.path,t.newPath=wide.curNode.path.substring(0,wide.curNode.path.lastIndexOf("/")+1)+e,$.ajax({type:"POST",url:config.context+"/file/rename",data:JSON.stringify(t),dataType:"json",success:function(e){if(!e.succ)return $("#dialogRenamePrompt").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogRenamePrompt").dialog("close")}})}})}}; -var wide={curNode:void 0,curEditor:void 0,curProcessId:void 0,refreshOutline:function(){if(!wide.curEditor||wide.curEditor&&"go"!==wide.curEditor.doc.getMode().name)return $("#outline").html(""),!1;var e=newWideRequest();e.code=wide.curEditor.getValue(),$.ajax({type:"POST",async:!1,url:config.context+"/outline",data:JSON.stringify(e),dataType:"json",success:function(e){if(e.succ){for(var t=e.data,o='
    ',i=["constDecls","varDecls","funcDecls","structDecls","interfaceDecls","typeDecls"],a=0,n=i.length;a '+s.Name+""}$("#outline").html(o+"
"),$("#outline li").dblclick(function(){var e=$(this),t=CodeMirror.Pos(e.data("line"),e.data("ch")),o=wide.curEditor;o.setCursor(t);var i=Math.floor(o.getScrollInfo().clientHeight/o.defaultTextHeight()/2),a=o.cursorCoords({line:t.line-i,ch:0},"local");o.scrollTo(0,a.top),o.focus()})}}})},_initDialog:function(){$(".dialog-prompt > input").keyup(function(e){var t=$(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");13!==e.which||t.prop("disabled")||t.click(),""===$.trim($(this).val())?t.prop("disabled",!0):t.prop("disabled",!1)}),$("#dialogAlert").dialog({modal:!0,height:40,width:350,title:config.label.tip,hiddenOk:!0,cancelText:config.label.confirm,afterOpen:function(e){$("#dialogAlert").html(e)}}),$("#dialogRemoveConfirm").dialog({modal:!0,height:36,width:260,title:config.label.delete,okText:config.label.delete,cancelText:config.label.cancel,afterOpen:function(){$("#dialogRemoveConfirm > b").html('"'+wide.curNode.name+'"')},ok:function(){var e=newWideRequest();e.path=wide.curNode.path,$.ajax({type:"POST",url:config.context+"/file/remove",data:JSON.stringify(e),dataType:"json",success:function(e){if(!e.succ)return $("#dialogRemoveConfirm").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogRemoveConfirm").dialog("close")}})}}),$("#dialogNewFilePrompt").dialog({modal:!0,height:52,width:260,title:config.label.create_file,okText:config.label.create,cancelText:config.label.cancel,afterOpen:function(){$("#dialogNewFilePrompt > input").val("").focus(),$("#dialogNewFilePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var t=newWideRequest(),e=$("#dialogNewFilePrompt > input").val();t.path=wide.curNode.path+"/"+e,t.fileType="f",$.ajax({type:"POST",url:config.context+"/file/new",data:JSON.stringify(t),dataType:"json",success:function(e){if(!e.succ)return $("#dialogNewFilePrompt").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogNewFilePrompt").dialog("close"),setTimeout(function(){var e=tree.getTIdByPath(t.path);tree.openFile(tree.fileTree.getNodeByTId(e)),tree.fileTree.selectNode(wide.curNode)},100)}})}}),$("#dialogNewDirPrompt").dialog({modal:!0,height:52,width:260,title:config.label.create_dir,okText:config.label.create,cancelText:config.label.cancel,afterOpen:function(){$("#dialogNewDirPrompt > input").val("").focus(),$("#dialogNewDirPrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var e=$("#dialogNewDirPrompt > input").val(),t=newWideRequest();t.path=wide.curNode.path+"/"+e,t.fileType="d",$.ajax({type:"POST",url:config.context+"/file/new",data:JSON.stringify(t),dataType:"json",success:function(e){if(!e.succ)return $("#dialogNewDirPrompt").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogNewDirPrompt").dialog("close")}})}}),$("#dialogGoFilePrompt").dialog({modal:!0,height:320,width:660,title:config.label.goto_file,okText:config.label.go,cancelText:config.label.cancel,afterInit:function(){$("#dialogGoFilePrompt").on("dblclick","li",function(){var e=tree.getTIdByPath($(this).find(".ft-small").text());tree.openFile(tree.fileTree.getNodeByTId(e)),tree.fileTree.selectNode(wide.curNode),$("#dialogGoFilePrompt").dialog("close"),wide.curEditor.focus()}),$("#dialogGoFilePrompt").on("click","li",function(){var e=$("#dialogGoFilePrompt > .list");e.find("li").removeClass("selected"),e.data("index",$(this).data("index")),$(this).addClass("selected")}),hotkeys.bindList($("#dialogGoFilePrompt > input"),$("#dialogGoFilePrompt > .list"),function(e){var t=tree.getTIdByPath(e.find(".ft-small").text());tree.openFile(tree.fileTree.getNodeByTId(t)),tree.fileTree.selectNode(wide.curNode),$("#dialogGoFilePrompt").dialog("close"),wide.curEditor.focus()}),$("#dialogGoFilePrompt > input").bind("input",function(){var e=$("#dialogGoFilePrompt > input").val(),t=newWideRequest();t.path="",t.name="*"+e+"*",wide.curNode&&(t.path=wide.curNode.path),$.ajax({type:"POST",url:config.context+"/file/find/name",data:JSON.stringify(t),dataType:"json",success:function(e){if(e.succ){for(var t=e.data,o="",i=0,a=t.length;i'+l+'    '+n+"":'
  • '+l+'    '+n+"
  • "}$("#dialogGoFilePrompt > ul").html(o)}}})})},afterOpen:function(){$("#dialogGoFilePrompt > input").val("").focus(),$("#dialogGoFilePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0),$("#dialogGoFilePrompt .list").html("").data("index",0)},ok:function(){var e=tree.getTIdByPath($("#dialogGoFilePrompt .selected .ft-small").text());tree.openFile(tree.fileTree.getNodeByTId(e)),tree.fileTree.selectNode(wide.curNode),$("#dialogGoFilePrompt").dialog("close"),wide.curEditor.focus()}}),$("#dialogGoLinePrompt").dialog({modal:!0,height:52,width:260,title:config.label.goto_line,okText:config.label.go,cancelText:config.label.cancel,afterOpen:function(){$("#dialogGoLinePrompt > input").val("").focus(),$("#dialogGoLinePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var e=parseInt($("#dialogGoLinePrompt > input").val())-1;$("#dialogGoLinePrompt").dialog("close");var t=wide.curEditor,o=t.getCursor();t.setCursor(CodeMirror.Pos(e,o.ch));var i=Math.floor(t.getScrollInfo().clientHeight/t.defaultTextHeight()/2),a=t.cursorCoords({line:e-i,ch:o.ch},"local");t.scrollTo(0,a.top),t.focus()}})},_initWS:function(){var e=new ReconnectingWebSocket(config.channel+"/output/ws?sid="+config.wideSessionId);e.onopen=function(){console.log("[output onopen] connected")},e.onmessage=function(e){console.log("[output onmessage]"+e.data);var t=JSON.parse(e.data);(goLintFound&&(goLintFound=[]),"run"===t.nextCmd)&&((c=newWideRequest()).executable=t.executable,$.ajax({type:"POST",url:config.context+"/run",data:JSON.stringify(c),dataType:"json"}));switch(t.cmd){case"run":var o=$(".bottom-window-group .output > div").html();wide.curProcessId&&""!==o?bottomGroup.fillOutput(o.replace(/<\/pre>$/g,t.output+"")):bottomGroup.fillOutput(o+"
    "+t.output+"
    "),wide.curProcessId=t.pid;break;case"run-done":bottomGroup.fillOutput($(".bottom-window-group .output > div").html().replace(/<\/pre>$/g,t.output+"")),wide.curProcessId=void 0,$("#buildRun").removeClass("ico-stop").addClass("ico-buildrun").attr("title",config.label.build_n_run);break;case"start-build":case"start-test":case"start-vet":case"start-install":case"start-get":bottomGroup.fillOutput(t.output);break;case"go test":case"go vet":case"go install":case"go get":bottomGroup.fillOutput($(".bottom-window-group .output > div").html()+t.output);break;case"git clone":bottomGroup.fillOutput($(".bottom-window-group .output > div").html()+t.output),tree.fileTree.reAsyncChildNodes(wide.curNode,"refresh",!1);break;case"build":case"cross-build":if(bottomGroup.fillOutput($(".bottom-window-group .output > div").html()+t.output),t.lints){for(var i={},a=0;a ul > li").unbind().removeClass("selected"),menu.subMenu())}),window.onbeforeunload=function(){if(0 div").each(function(){var e=$(this).find("span:eq(0)");e.attr("title")===t&&e.removeClass("changed")})}})},saveFile:function(){var e=editors.getCurrentPath();if(!e)return!1;var t=wide.curEditor;if(t.doc.isClean())return!1;if("text/x-go"===t.getOption("mode")){wide.gofmt(e,wide.curEditor);var o=newWideRequest();return o.file=e,o.code=t.getValue(),o.nextCmd="",$.ajax({type:"POST",url:config.context+"/build",data:JSON.stringify(o),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}}),void wide.refreshOutline()}wide._save(e,wide.curEditor)},stop:function(){if($("#buildRun").hasClass("ico-buildrun"))return menu.run(),!1;if(!wide.curProcessId)return!1;var e=newWideRequest();e.pid=wide.curProcessId,$.ajax({type:"POST",url:config.context+"/stop",data:JSON.stringify(e),dataType:"json",success:function(e){$("#buildRun").removeClass("ico-stop").addClass("ico-buildrun").attr("title",config.label.build_n_run)}})},gofmt:function(t,o){var i=o.getCursor(),a=o.getScrollInfo(),e=newWideRequest();e.file=t,e.code=o.getValue(),e.cursorLine=i.line,e.cursorCh=i.ch,$.ajax({async:!1,type:"POST",url:config.context+"/go/fmt",data:JSON.stringify(e),dataType:"json",success:function(e){e.succ&&(o.setValue(e.data.code),o.setCursor(i),o.scrollTo(null,a.top),wide._save(t,o))}})},fmt:function(e,t){var o=t.getOption("mode"),i=t.getCursor(),a=t.getScrollInfo(),n=newWideRequest();n.file=e,n.code=t.getValue(),n.cursorLine=i.line,n.cursorCh=i.ch;var l=null;switch(o){case"text/x-go":$.ajax({async:!1,type:"POST",url:config.context+"/go/fmt",data:JSON.stringify(n),dataType:"json",success:function(e){e.succ&&(l=e.data.code)}});break;case"text/html":l=html_beautify(t.getValue());break;case"text/javascript":case"application/json":l=js_beautify(t.getValue());break;case"text/css":l=css_beautify(t.getValue())}l&&(t.setValue(l),t.setCursor(i),t.scrollTo(null,a.top),wide._save(e,t))},getClassBySuffix:function(e){var t="ico-ztree-other ";switch(e){case"html":case"htm":t="ico-ztree-html ";break;case"go":t="ico-ztree-go ";break;case"css":t="ico-ztree-css ";break;case"txt":t="ico-ztree-text ";break;case"sql":t="ico-ztree-sql ";break;case"properties":t="ico-ztree-pro ";break;case"md":t="ico-ztree-md ";break;case"json":t="ico-ztree-js ";break;case"xml":t="ico-ztree-xml ";break;case"jpg":case"jpeg":case"bmp":case"gif":case"png":case"svg":case"ico":t="ico-ztree-img "}return t}};$(document).ready(function(){wide.init(),tree.init(),menu.init(),hotkeys.init(),session.init(),notification.init(),editors.init(),windows.init(),bottomGroup.init()}); -var session={init:function(){this._initWS();var s=function(e){var t="normal";return e.isClosed?t="min":e.size>=$("body").width()&&(t="max"),t};setInterval(function(){var e,t=newWideRequest(),o=[],n=editors.getCurrentId()?editors.getCurrentPath():"";editors.tabs.obj._$tabs.find("div").each(function(){var e=$(this);e.find("span:eq(0)").attr("title")!==config.label.start_page&&o.push(e.find("span:eq(0)").attr("title"))}),e=tree.getOpenPaths(),t.currentFile=n,t.fileTree=e,t.files=o,t.layout={side:{size:windows.outerLayout.west.state.size,state:s(windows.outerLayout.west.state)},sideRight:{size:windows.innerLayout.east.state.size,state:s(windows.innerLayout.east.state)},bottom:{size:windows.innerLayout.south.state.size,state:s(windows.innerLayout.south.state)}},$.ajax({type:"POST",url:config.context+"/session/save",data:JSON.stringify(t),dataType:"json",success:function(e){}})},3e4)},restore:function(){if(config.latestSessionContent){for(var e=config.latestSessionContent.fileTree,t=config.latestSessionContent.files,o=config.latestSessionContent.currentFile,n="",s=[],i=tree.fileTree.transformToArray(tree.fileTree.getNodes()),r=0,a=i.length;r'+("Connected to server [sid="+config.wideSessionId+"], "+function(e,t){var o=new Date(e),n={"M+":o.getMonth()+1,"d+":o.getDate(),"h+":o.getHours(),"m+":o.getMinutes(),"s+":o.getSeconds(),"q+":Math.floor((o.getMonth()+3)/3),S:o.getMilliseconds()};for(var s in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(o.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?n[s]:("00"+n[s]).substr((""+n[s]).length)));return t}((new Date).getTime(),"yyyy-MM-dd hh:mm:ss"))+''+e+"",$(".bottom-window-group .notification > table").append(t)},e.onmessage=function(e){var t=JSON.parse(e.data);switch(t.cmd){case"create-file":var o=tree.fileTree.getNodeByTId(tree.getTIdByPath(t.dir)),n=t.path.replace(t.dir+"/",""),s=CodeMirror.findModeByFileName(n),i=wide.getClassBySuffix(n.split(".")[1]);t.type&&"f"===t.type?tree.fileTree.addNodes(o,[{id:t.path,name:n,iconSkin:i,path:t.path,mode:s,removable:!0,creatable:!0}]):tree.fileTree.addNodes(o,[{id:t.path,name:n,iconSkin:"ico-ztree-dir ",path:t.path,removable:!0,creatable:!0,isParent:!0}]);break;case"remove-file":case"rename-file":o=tree.fileTree.getNodeByTId(tree.getTIdByPath(t.path));tree.fileTree.removeNode(o);for(var r=tree.fileTree.transformToArray(o),a=0,d=r.length;a'+("Disconnected from server, trying to reconnect it [sid="+config.wideSessionId+"]")+''+t+"",$(".bottom-window-group .notification > table").append(o),$(".notification-count").show()},e.onerror=function(e){console.log("[session onerror]")}}}; -var menu={init:function(){this.subMenu(),this._initPreference(),this._initAbout(),this._initShare(),$(".menu .frame li").click(function(){$(".menu > ul > li").unbind().removeClass("selected"),menu.subMenu()})},_initShare:function(){$(".menu .ico-share").hover(function(){$(".menu .share-panel").show()}),$(".share-panel .font-ico").click(function(){var e=$(this).attr("class").split("-")[2],t="https://wide.b3log.org",a="https://wide.b3log.org/static/images/wide-logo.png",n={};n.email="mailto:?subject="+$("title").text()+"&body="+$("meta[name=description]").attr("content")+" "+t;var i=encodeURIComponent($("meta[name=description]").attr("content")+" "+t+" #golang");n.twitter="https://twitter.com/intent/tweet?status="+i,n.facebook="https://www.facebook.com/sharer/sharer.php?u="+t,n.googleplus="https://plus.google.com/share?url="+t;var o=encodeURIComponent($("title").text()+". \n"+$("meta[name=description]").attr("content")+" #golang#");n.weibo="http://v.t.sina.com.cn/share/share.php?title="+o+"&url="+t+"&pic="+a,n.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+t+"&sharesource=qzone&title="+o+"&pics="+a,window.open(n[e],"_blank","top=100,left=200,width=648,height=618")})},_initAbout:function(){$("#dialogAbout").load(config.context+"/about",function(){$("#dialogAbout").dialog({modal:!0,title:config.label.about,hideFooter:!0,afterOpen:function(){$.ajax({url:"https://rhythm.b3log.org/version/wide/latest",type:"GET",dataType:"jsonp",jsonp:"callback",success:function(e,t){$("#dialogAbout .version").text()===e.wideVersion?$(".upgrade").text(config.label.uptodate):$(".upgrade").html(config.label.new_version_available+config.label.colon+""+e.wideVersion+"")}})}})})},disabled:function(e){for(var t=0,a=e.length;t ul > li").click(function(e){1!==$(e.target).closest(".frame").length&&($(this).find(".frame").show(),$(".menu > ul > li").removeClass("selected"),$(this).addClass("selected"),$(".menu > ul > li").unbind(),$(".menu > ul > li").mouseover(function(){1!==$(e.target).closest(".frame").length&&($(".menu .frame").hide(),$(this).find(".frame").show(),$(".menu > ul > li").removeClass("selected"),$(this).addClass("selected"))}))})},openPreference:function(){$("#dialogPreference").dialog("open")},saveAllFiles:function(){if($(".menu li.save-all").hasClass("disabled"))return!1;for(var e=0,t=editors.data.length;e div").each(function(e){0!==e&&t.push($(this).data("index"))}),$("#dialogCloseEditor").data("removeData",t),$(".edit-panel .tabs .ico-close:eq(0)").click()},exit:function(){var e=newWideRequest();$.ajax({type:"POST",url:config.context+"/logout",data:JSON.stringify(e),dataType:"json",success:function(e){e.succ&&(window.location.href=config.context+"/login")}})},openAbout:function(){$("#dialogAbout").dialog("open")},goget:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-get").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:config.context+"/go/get",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},goinstall:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-install").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:config.context+"/go/install",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},test:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-test").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:config.context+"/go/test",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},govet:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-vet").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:config.context+"/go/vet",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},run:function(){if(menu.saveAllFiles(),$("#buildRun").hasClass("ico-stop"))return wide.stop(),!1;var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.run").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,t.code=wide.curEditor.getValue(),t.nextCmd="run",$.ajax({type:"POST",url:config.context+"/build",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput(),$("#buildRun").addClass("ico-stop").removeClass("ico-buildrun").attr("title",config.label.stop)},success:function(e){}})},build:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.build").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,t.code=wide.curEditor.getValue(),t.nextCmd="",$.ajax({type:"POST",url:config.context+"/build",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},_initPreference:function(){$("#dialogPreference").load(config.context+"/preference",function(){$("#dialogPreference input").keyup(function(){var t=!1,a=[],e="";$("#dialogPreference input").each(function(){var e=$(this);e.val()!=e.data("value")&&(t=!0),""===$.trim(e.val())&&a.push(e)});var n=$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)");if(t?n.prop("disabled",!1):n.prop("disabled",!0),0===a.length)$("#dialogPreference").find(".tip").html(""),n.prop("disabled",!1);else{for(var i=0,o=a.length;i div[data-index="'+l+'"]').text()+"] -> ["+r.substr(0,r.length-1)+"]: "+config.label.no_empty+"
    "}$("#dialogPreference").find(".tip").html(e),n.prop("disabled",!0)}}),$("#dialogPreference select").on("change",function(){var e=!1;$("#dialogPreference select").each(function(){$(this).val()!==$(this).data("value")&&(e=!0)});var t=$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)");e?t.prop("disabled",!1):t.prop("disabled",!0)}),$("#dialogPreference").dialog({modal:!0,height:280,width:800,title:config.label.preference,okText:config.label.apply,cancelText:config.label.cancel,afterOpen:function(){$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var e=newWideRequest(),t=$("#dialogPreference"),o=t.find("input[name=fontFamily]"),l=t.find("input[name=fontSize]"),r=t.find("select[name=goFmt]"),s=t.find("input[name=GoBuildArgsForLinux]"),d=t.find("input[name=GoBuildArgsForWindows]"),u=t.find("input[name=GoBuildArgsForDarwin]"),c=t.find("input[name=workspace]"),f=t.find("input[name=password]"),g=t.find("input[name=email]"),p=t.find("select[name=locale]"),v=t.find("select[name=theme]"),m=t.find("input[name=editorFontFamily]"),h=t.find("input[name=editorFontSize]"),b=t.find("input[name=editorLineHeight]"),w=t.find("select[name=editorTheme]"),x=t.find("input[name=editorTabSize]"),y=t.find("select[name=keymap]");$.extend(e,{fontFamily:o.val(),fontSize:l.val(),goFmt:r.val(),GoBuildArgsForLinux:s.val(),GoBuildArgsForWindows:d.val(),GoBuildArgsForDarwin:u.val(),workspace:c.val(),password:f.val(),email:g.val(),locale:p.val(),theme:v.val(),editorFontFamily:m.val(),editorFontSize:h.val(),editorLineHeight:b.val(),editorTheme:w.val(),editorTabSize:x.val(),keymap:y.val()}),config.keymap!==y.val()&&window.location.reload(),$.ajax({type:"POST",url:config.context+"/preference",data:JSON.stringify(e),success:function(e,t,a){if(!e.succ)return!1;o.data("value",o.val()),l.data("value",l.val()),r.data("value",r.val()),s.data("value",s.val()),d.data("value",d.val()),u.data("value",u.val()),c.data("value",c.val()),f.data("value",f.val()),g.data("value",g.val()),p.data("value",p.val()),v.data("value",v.val()),m.data("value",m.val()),h.data("value",h.val()),b.data("value",b.val()),w.data("value",w.val()),x.data("value",x.val()),y.data("value",y.val()),config.keymap=y.val(),$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0),$("#themesLink").attr("href",config.staticServer+"/static/css/themes/"+v.val()+".css"),config.editorTheme=w.val();for(var n=0,i=editors.data.length;n$(".content").height()&&(o=o-r.height()-25),r.css({top:o+"px",left:e.clientX+"px",display:"block"}).show(),a.hide()}else{wide.curNode.removable?a.find(".remove").removeClass("disabled"):a.find(".remove").addClass("disabled"),-1===wide.curNode.path.indexOf("zip",wide.curNode.path.length-"zip".length)?a.find(".decompress").hide():a.find(".decompress").show(),-1===wide.curNode.path.indexOf("go",wide.curNode.path.length-"go".length)?a.find(".linux64").hide():a.find(".linux64").show();var o=e.clientY-10;a.height()+o>$(".content").height()&&(o=o-a.height()-25),a.css({top:o+"px",left:e.clientX+"px",display:"block"}).show(),r.hide(),menu.disabled(["import","git-clone"])}$("#files").focus()}},onClick:function(e,i,t,o){t&&(wide.curNode=t,tree.fileTree.selectNode(t),menu.undisabled(["import","export","git-clone"]),tree.isDir()||menu.disabled(["import","git-clone"]),$("#files").focus())}}};tree.fileTree=$.fn.zTree.init($("#files"),i,e.data.children),session.restore()}}}),this._initSearch(),this._initRename()},openFile:function(o,e){wide.curNode=o;for(var r=e,i=0,t=editors.data.length;i input:eq(0)").keyup(function(e){var i=$(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");13!==e.which||i.prop("disabled")||i.click(),""===$.trim($(this).val())?i.prop("disabled",!0):i.prop("disabled",!1)}),$("#dialogSearchForm > input:eq(1)").keyup(function(e){var i=$(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");13!==e.which||i.prop("disabled")||i.click()}),$("#dialogSearchForm").dialog({modal:!0,height:80,width:260,title:config.label.search,okText:config.label.search,cancelText:config.label.cancel,afterOpen:function(){$("#dialogSearchForm > input:eq(0)").val("").focus(),$("#dialogSearchForm > input:eq(1)").val(""),$("#dialogSearchForm").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var i=newWideRequest();wide.curNode?i.dir=wide.curNode.path:i.dir="",i.text=$("#dialogSearchForm > input:eq(0)").val(),i.extension=$("#dialogSearchForm > input:eq(1)").val(),$.ajax({type:"POST",url:"/file/search/text",data:JSON.stringify(i),dataType:"json",success:function(e){e.succ&&($("#dialogSearchForm").dialog("close"),editors.appendSearch(e.data,"founds",i.text))}})}})},_initRename:function(){$("#dialogRenamePrompt").dialog({modal:!0,height:52,width:260,title:config.label.rename,okText:config.label.rename,cancelText:config.label.cancel,afterOpen:function(){$("#dialogRenamePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0),$("#dialogRenamePrompt > input").val(wide.curNode.name).select().focus()},ok:function(){var e=$("#dialogRenamePrompt > input").val(),i=newWideRequest();i.oldPath=wide.curNode.path,i.newPath=wide.curNode.path.substring(0,wide.curNode.path.lastIndexOf("/")+1)+e,$.ajax({type:"POST",url:"/file/rename",data:JSON.stringify(i),dataType:"json",success:function(e){if(!e.succ)return $("#dialogRenamePrompt").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogRenamePrompt").dialog("close")}})}})}}; +var wide={curNode:void 0,curEditor:void 0,curProcessId:void 0,refreshOutline:function(){if(!wide.curEditor||wide.curEditor&&"go"!==wide.curEditor.doc.getMode().name)return $("#outline").html(""),!1;var e=newWideRequest();e.code=wide.curEditor.getValue(),$.ajax({type:"POST",async:!1,url:"/outline",data:JSON.stringify(e),dataType:"json",success:function(e){if(e.succ){for(var t=e.data,o='
      ',i=["constDecls","varDecls","funcDecls","structDecls","interfaceDecls","typeDecls"],a=0,l=i.length;a '+c.Name+""}$("#outline").html(o+"
    "),$("#outline li").dblclick(function(){var e=$(this),t=CodeMirror.Pos(e.data("line"),e.data("ch")),o=wide.curEditor;o.setCursor(t);var i=Math.floor(o.getScrollInfo().clientHeight/o.defaultTextHeight()/2),a=o.cursorCoords({line:t.line-i,ch:0},"local");o.scrollTo(0,a.top),o.focus()})}}})},_initDialog:function(){$(".dialog-prompt > input").keyup(function(e){var t=$(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");13!==e.which||t.prop("disabled")||t.click(),""===$.trim($(this).val())?t.prop("disabled",!0):t.prop("disabled",!1)}),$("#dialogAlert").dialog({modal:!0,height:40,width:350,title:config.label.tip,hiddenOk:!0,cancelText:config.label.confirm,afterOpen:function(e){$("#dialogAlert").html(e)}}),$("#dialogRemoveConfirm").dialog({modal:!0,height:36,width:260,title:config.label.delete,okText:config.label.delete,cancelText:config.label.cancel,afterOpen:function(){$("#dialogRemoveConfirm > b").html('"'+wide.curNode.name+'"')},ok:function(){var e=newWideRequest();e.path=wide.curNode.path,$.ajax({type:"POST",url:"/file/remove",data:JSON.stringify(e),dataType:"json",success:function(e){if(!e.succ)return $("#dialogRemoveConfirm").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogRemoveConfirm").dialog("close")}})}}),$("#dialogNewFilePrompt").dialog({modal:!0,height:52,width:260,title:config.label.create_file,okText:config.label.create,cancelText:config.label.cancel,afterOpen:function(){$("#dialogNewFilePrompt > input").val("").focus(),$("#dialogNewFilePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var t=newWideRequest(),e=$("#dialogNewFilePrompt > input").val();t.path=wide.curNode.path+"/"+e,t.fileType="f",$.ajax({type:"POST",url:"/file/new",data:JSON.stringify(t),dataType:"json",success:function(e){if(!e.succ)return $("#dialogNewFilePrompt").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogNewFilePrompt").dialog("close"),setTimeout(function(){var e=tree.getTIdByPath(t.path);tree.openFile(tree.fileTree.getNodeByTId(e)),tree.fileTree.selectNode(wide.curNode)},100)}})}}),$("#dialogNewDirPrompt").dialog({modal:!0,height:52,width:260,title:config.label.create_dir,okText:config.label.create,cancelText:config.label.cancel,afterOpen:function(){$("#dialogNewDirPrompt > input").val("").focus(),$("#dialogNewDirPrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var e=$("#dialogNewDirPrompt > input").val(),t=newWideRequest();t.path=wide.curNode.path+"/"+e,t.fileType="d",$.ajax({type:"POST",url:"/file/new",data:JSON.stringify(t),dataType:"json",success:function(e){if(!e.succ)return $("#dialogNewDirPrompt").dialog("close"),bottomGroup.tabs.setCurrent("notification"),windows.flowBottom(),$(".bottom-window-group .notification").focus(),!1;$("#dialogNewDirPrompt").dialog("close")}})}}),$("#dialogGoFilePrompt").dialog({modal:!0,height:320,width:660,title:config.label.goto_file,okText:config.label.go,cancelText:config.label.cancel,afterInit:function(){$("#dialogGoFilePrompt").on("dblclick","li",function(){var e=tree.getTIdByPath($(this).find(".ft-small").text());tree.openFile(tree.fileTree.getNodeByTId(e)),tree.fileTree.selectNode(wide.curNode),$("#dialogGoFilePrompt").dialog("close"),wide.curEditor.focus()}),$("#dialogGoFilePrompt").on("click","li",function(){var e=$("#dialogGoFilePrompt > .list");e.find("li").removeClass("selected"),e.data("index",$(this).data("index")),$(this).addClass("selected")}),hotkeys.bindList($("#dialogGoFilePrompt > input"),$("#dialogGoFilePrompt > .list"),function(e){var t=tree.getTIdByPath(e.find(".ft-small").text());tree.openFile(tree.fileTree.getNodeByTId(t)),tree.fileTree.selectNode(wide.curNode),$("#dialogGoFilePrompt").dialog("close"),wide.curEditor.focus()}),$("#dialogGoFilePrompt > input").bind("input",function(){var e=$("#dialogGoFilePrompt > input").val(),t=newWideRequest();t.path="",t.name="*"+e+"*",wide.curNode&&(t.path=wide.curNode.path),$.ajax({type:"POST",url:"/file/find/name",data:JSON.stringify(t),dataType:"json",success:function(e){if(e.succ){for(var t=e.data,o="",i=0,a=t.length;i'+n+'    '+l+"":'
  • '+n+'    '+l+"
  • "}$("#dialogGoFilePrompt > ul").html(o)}}})})},afterOpen:function(){$("#dialogGoFilePrompt > input").val("").focus(),$("#dialogGoFilePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0),$("#dialogGoFilePrompt .list").html("").data("index",0)},ok:function(){var e=tree.getTIdByPath($("#dialogGoFilePrompt .selected .ft-small").text());tree.openFile(tree.fileTree.getNodeByTId(e)),tree.fileTree.selectNode(wide.curNode),$("#dialogGoFilePrompt").dialog("close"),wide.curEditor.focus()}}),$("#dialogGoLinePrompt").dialog({modal:!0,height:52,width:260,title:config.label.goto_line,okText:config.label.go,cancelText:config.label.cancel,afterOpen:function(){$("#dialogGoLinePrompt > input").val("").focus(),$("#dialogGoLinePrompt").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var e=parseInt($("#dialogGoLinePrompt > input").val())-1;$("#dialogGoLinePrompt").dialog("close");var t=wide.curEditor,o=t.getCursor();t.setCursor(CodeMirror.Pos(e,o.ch));var i=Math.floor(t.getScrollInfo().clientHeight/t.defaultTextHeight()/2),a=t.cursorCoords({line:e-i,ch:o.ch},"local");t.scrollTo(0,a.top),t.focus()}})},_initWS:function(){var e=new ReconnectingWebSocket(config.channel+"/output/ws?sid="+config.wideSessionId);e.onopen=function(){console.log("[output onopen] connected")},e.onmessage=function(e){console.log("[output onmessage]"+e.data);var t=JSON.parse(e.data);(goLintFound&&(goLintFound=[]),"run"===t.nextCmd)&&((s=newWideRequest()).executable=t.executable,$.ajax({type:"POST",url:"/run",data:JSON.stringify(s),dataType:"json"}));switch(t.cmd){case"run":var o=$(".bottom-window-group .output > div").html();wide.curProcessId&&""!==o?bottomGroup.fillOutput(o.replace(/<\/pre>$/g,t.output+"")):bottomGroup.fillOutput(o+"
    "+t.output+"
    "),wide.curProcessId=t.pid;break;case"run-done":bottomGroup.fillOutput($(".bottom-window-group .output > div").html().replace(/<\/pre>$/g,t.output+"")),wide.curProcessId=void 0,$("#buildRun").removeClass("ico-stop").addClass("ico-buildrun").attr("title",config.label.build_n_run);break;case"start-build":case"start-test":case"start-vet":case"start-install":case"start-get":bottomGroup.fillOutput(t.output);break;case"go test":case"go vet":case"go install":case"go get":bottomGroup.fillOutput($(".bottom-window-group .output > div").html()+t.output);break;case"git clone":bottomGroup.fillOutput($(".bottom-window-group .output > div").html()+t.output),tree.fileTree.reAsyncChildNodes(wide.curNode,"refresh",!1);break;case"build":case"cross-build":if(bottomGroup.fillOutput($(".bottom-window-group .output > div").html()+t.output),t.lints){for(var i={},a=0;a ul > li").unbind().removeClass("selected"),menu.subMenu())}),window.onbeforeunload=function(){if(0 div").each(function(){var e=$(this).find("span:eq(0)");e.attr("title")===t&&e.removeClass("changed")})}})},saveFile:function(){var e=editors.getCurrentPath();if(!e)return!1;var t=wide.curEditor;if(t.doc.isClean())return!1;if("text/x-go"===t.getOption("mode")){wide.gofmt(e,wide.curEditor);var o=newWideRequest();return o.file=e,o.code=t.getValue(),o.nextCmd="",$.ajax({type:"POST",url:"/build",data:JSON.stringify(o),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}}),void wide.refreshOutline()}wide._save(e,wide.curEditor)},stop:function(){if($("#buildRun").hasClass("ico-buildrun"))return menu.run(),!1;if(!wide.curProcessId)return!1;var e=newWideRequest();e.pid=wide.curProcessId,$.ajax({type:"POST",url:"/stop",data:JSON.stringify(e),dataType:"json",success:function(e){$("#buildRun").removeClass("ico-stop").addClass("ico-buildrun").attr("title",config.label.build_n_run)}})},gofmt:function(t,o){var i=o.getCursor(),a=o.getScrollInfo(),e=newWideRequest();e.file=t,e.code=o.getValue(),e.cursorLine=i.line,e.cursorCh=i.ch,$.ajax({async:!1,type:"POST",url:"/go/fmt",data:JSON.stringify(e),dataType:"json",success:function(e){e.succ&&(o.setValue(e.data.code),o.setCursor(i),o.scrollTo(null,a.top),wide._save(t,o))}})},fmt:function(e,t){var o=t.getOption("mode"),i=t.getCursor(),a=t.getScrollInfo(),l=newWideRequest();l.file=e,l.code=t.getValue(),l.cursorLine=i.line,l.cursorCh=i.ch;var n=null;switch(o){case"text/x-go":$.ajax({async:!1,type:"POST",url:"/go/fmt",data:JSON.stringify(l),dataType:"json",success:function(e){e.succ&&(n=e.data.code)}});break;case"text/html":n=html_beautify(t.getValue());break;case"text/javascript":case"application/json":n=js_beautify(t.getValue());break;case"text/css":n=css_beautify(t.getValue())}n&&(t.setValue(n),t.setCursor(i),t.scrollTo(null,a.top),wide._save(e,t))},getClassBySuffix:function(e){var t="ico-ztree-other ";switch(e){case"html":case"htm":t="ico-ztree-html ";break;case"go":t="ico-ztree-go ";break;case"css":t="ico-ztree-css ";break;case"txt":t="ico-ztree-text ";break;case"sql":t="ico-ztree-sql ";break;case"properties":t="ico-ztree-pro ";break;case"md":t="ico-ztree-md ";break;case"json":t="ico-ztree-js ";break;case"xml":t="ico-ztree-xml ";break;case"jpg":case"jpeg":case"bmp":case"gif":case"png":case"svg":case"ico":t="ico-ztree-img "}return t}};$(document).ready(function(){wide.init(),tree.init(),menu.init(),hotkeys.init(),session.init(),notification.init(),editors.init(),windows.init(),bottomGroup.init()}); +var session={init:function(){this._initWS();var s=function(e){var t="normal";return e.isClosed?t="min":e.size>=$("body").width()&&(t="max"),t};setInterval(function(){var e,t=newWideRequest(),o=[],n=editors.getCurrentId()?editors.getCurrentPath():"";editors.tabs.obj._$tabs.find("div").each(function(){var e=$(this);e.find("span:eq(0)").attr("title")!==config.label.start_page&&o.push(e.find("span:eq(0)").attr("title"))}),e=tree.getOpenPaths(),t.currentFile=n,t.fileTree=e,t.files=o,t.layout={side:{size:windows.outerLayout.west.state.size,state:s(windows.outerLayout.west.state)},sideRight:{size:windows.innerLayout.east.state.size,state:s(windows.innerLayout.east.state)},bottom:{size:windows.innerLayout.south.state.size,state:s(windows.innerLayout.south.state)}},$.ajax({type:"POST",url:"/session/save",data:JSON.stringify(t),dataType:"json",success:function(e){}})},3e4)},restore:function(){if(config.latestSessionContent){for(var e=config.latestSessionContent.fileTree,t=config.latestSessionContent.files,o=config.latestSessionContent.currentFile,n="",s=[],r=tree.fileTree.transformToArray(tree.fileTree.getNodes()),i=0,a=r.length;i'+("Connected to server [sid="+config.wideSessionId+"], "+function(e,t){var o=new Date(e),n={"M+":o.getMonth()+1,"d+":o.getDate(),"h+":o.getHours(),"m+":o.getMinutes(),"s+":o.getSeconds(),"q+":Math.floor((o.getMonth()+3)/3),S:o.getMilliseconds()};for(var s in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(o.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?n[s]:("00"+n[s]).substr((""+n[s]).length)));return t}((new Date).getTime(),"yyyy-MM-dd hh:mm:ss"))+''+e+"",$(".bottom-window-group .notification > table").append(t)},e.onmessage=function(e){var t=JSON.parse(e.data);switch(t.cmd){case"create-file":var o=tree.fileTree.getNodeByTId(tree.getTIdByPath(t.dir)),n=t.path.replace(t.dir+"/",""),s=CodeMirror.findModeByFileName(n),r=wide.getClassBySuffix(n.split(".")[1]);t.type&&"f"===t.type?tree.fileTree.addNodes(o,[{id:t.path,name:n,iconSkin:r,path:t.path,mode:s,removable:!0,creatable:!0}]):tree.fileTree.addNodes(o,[{id:t.path,name:n,iconSkin:"ico-ztree-dir ",path:t.path,removable:!0,creatable:!0,isParent:!0}]);break;case"remove-file":case"rename-file":o=tree.fileTree.getNodeByTId(tree.getTIdByPath(t.path));tree.fileTree.removeNode(o);for(var i=tree.fileTree.transformToArray(o),a=0,d=i.length;a'+("Disconnected from server, trying to reconnect it [sid="+config.wideSessionId+"]")+''+t+"",$(".bottom-window-group .notification > table").append(o),$(".notification-count").show()},e.onerror=function(e){console.log("[session onerror]")}}}; +var menu={init:function(){this.subMenu(),this._initPreference(),this._initAbout(),this._initShare(),$(".menu .frame li").click(function(){$(".menu > ul > li").unbind().removeClass("selected"),menu.subMenu()})},_initShare:function(){$(".menu .ico-share").hover(function(){$(".menu .share-panel").show()}),$(".share-panel .font-ico").click(function(){var e=$(this).attr("class").split("-")[2],t="https://wide.b3log.org",a="https://wide.b3log.org/static/images/wide-logo.png",i={};i.email="mailto:?subject="+$("title").text()+"&body="+$("meta[name=description]").attr("content")+" "+t;var n=encodeURIComponent($("meta[name=description]").attr("content")+" "+t+" #golang");i.twitter="https://twitter.com/intent/tweet?status="+n,i.facebook="https://www.facebook.com/sharer/sharer.php?u="+t,i.googleplus="https://plus.google.com/share?url="+t;var o=encodeURIComponent($("title").text()+". \n"+$("meta[name=description]").attr("content")+" #golang#");i.weibo="http://v.t.sina.com.cn/share/share.php?title="+o+"&url="+t+"&pic="+a,i.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+t+"&sharesource=qzone&title="+o+"&pics="+a,window.open(i[e],"_blank","top=100,left=200,width=648,height=618")})},_initAbout:function(){$("#dialogAbout").load("/about",function(){$("#dialogAbout").dialog({modal:!0,title:config.label.about,hideFooter:!0,afterOpen:function(){$.ajax({url:"https://rhythm.b3log.org/version/wide/latest",type:"GET",dataType:"jsonp",jsonp:"callback",success:function(e,t){$("#dialogAbout .version").text()===e.wideVersion?$(".upgrade").text(config.label.uptodate):$(".upgrade").html(config.label.new_version_available+config.label.colon+""+e.wideVersion+"")}})}})})},disabled:function(e){for(var t=0,a=e.length;t ul > li").click(function(e){1!==$(e.target).closest(".frame").length&&($(this).find(".frame").show(),$(".menu > ul > li").removeClass("selected"),$(this).addClass("selected"),$(".menu > ul > li").unbind(),$(".menu > ul > li").mouseover(function(){1!==$(e.target).closest(".frame").length&&($(".menu .frame").hide(),$(this).find(".frame").show(),$(".menu > ul > li").removeClass("selected"),$(this).addClass("selected"))}))})},openPreference:function(){$("#dialogPreference").dialog("open")},saveAllFiles:function(){if($(".menu li.save-all").hasClass("disabled"))return!1;for(var e=0,t=editors.data.length;e div").each(function(e){0!==e&&t.push($(this).data("index"))}),$("#dialogCloseEditor").data("removeData",t),$(".edit-panel .tabs .ico-close:eq(0)").click()},exit:function(){var e=newWideRequest();$.ajax({type:"POST",url:"/logout",data:JSON.stringify(e),dataType:"json",success:function(e){e.succ&&(window.location.href="/login")}})},openAbout:function(){$("#dialogAbout").dialog("open")},goget:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-get").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:"/go/get",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},goinstall:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-install").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:"/go/install",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},test:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-test").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:"/go/test",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},govet:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.go-vet").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,$.ajax({type:"POST",url:"/go/vet",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},run:function(){if(menu.saveAllFiles(),$("#buildRun").hasClass("ico-stop"))return wide.stop(),!1;var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.run").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,t.code=wide.curEditor.getValue(),t.nextCmd="run",$.ajax({type:"POST",url:"/build",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput(),$("#buildRun").addClass("ico-stop").removeClass("ico-buildrun").attr("title",config.label.stop)},success:function(e){}})},build:function(){menu.saveAllFiles();var e=editors.getCurrentPath();if(!e)return!1;if($(".menu li.build").hasClass("disabled"))return!1;var t=newWideRequest();t.file=e,t.code=wide.curEditor.getValue(),t.nextCmd="",$.ajax({type:"POST",url:"/build",data:JSON.stringify(t),dataType:"json",beforeSend:function(){bottomGroup.resetOutput()},success:function(e){}})},_initPreference:function(){$("#dialogPreference").load("/preference",function(){$("#dialogPreference input").keyup(function(){var t=!1,a=[],e="";$("#dialogPreference input").each(function(){var e=$(this);e.val()!=e.data("value")&&(t=!0),""===$.trim(e.val())&&a.push(e)});var i=$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)");if(t?i.prop("disabled",!1):i.prop("disabled",!0),0===a.length)$("#dialogPreference").find(".tip").html(""),i.prop("disabled",!1);else{for(var n=0,o=a.length;n div[data-index="'+l+'"]').text()+"] -> ["+r.substr(0,r.length-1)+"]: "+config.label.no_empty+"
    "}$("#dialogPreference").find(".tip").html(e),i.prop("disabled",!0)}}),$("#dialogPreference select").on("change",function(){var e=!1;$("#dialogPreference select").each(function(){$(this).val()!==$(this).data("value")&&(e=!0)});var t=$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)");e?t.prop("disabled",!1):t.prop("disabled",!0)}),$("#dialogPreference").dialog({modal:!0,height:280,width:800,title:config.label.preference,okText:config.label.apply,cancelText:config.label.cancel,afterOpen:function(){$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0)},ok:function(){var e=newWideRequest(),t=$("#dialogPreference"),o=t.find("input[name=fontFamily]"),l=t.find("input[name=fontSize]"),r=t.find("select[name=goFmt]"),s=t.find("input[name=GoBuildArgsForLinux]"),d=t.find("input[name=GoBuildArgsForWindows]"),u=t.find("input[name=GoBuildArgsForDarwin]"),c=t.find("input[name=workspace]"),f=t.find("input[name=password]"),p=t.find("input[name=email]"),g=t.find("select[name=locale]"),v=t.find("select[name=theme]"),m=t.find("input[name=editorFontFamily]"),h=t.find("input[name=editorFontSize]"),b=t.find("input[name=editorLineHeight]"),w=t.find("select[name=editorTheme]"),y=t.find("input[name=editorTabSize]"),P=t.find("select[name=keymap]");$.extend(e,{fontFamily:o.val(),fontSize:l.val(),goFmt:r.val(),GoBuildArgsForLinux:s.val(),GoBuildArgsForWindows:d.val(),GoBuildArgsForDarwin:u.val(),workspace:c.val(),password:f.val(),email:p.val(),locale:g.val(),theme:v.val(),editorFontFamily:m.val(),editorFontSize:h.val(),editorLineHeight:b.val(),editorTheme:w.val(),editorTabSize:y.val(),keymap:P.val()}),config.keymap!==P.val()&&window.location.reload(),$.ajax({type:"POST",url:"/preference",data:JSON.stringify(e),success:function(e,t,a){if(!e.succ)return!1;o.data("value",o.val()),l.data("value",l.val()),r.data("value",r.val()),s.data("value",s.val()),d.data("value",d.val()),u.data("value",u.val()),c.data("value",c.val()),f.data("value",f.val()),p.data("value",p.val()),g.data("value",g.val()),v.data("value",v.val()),m.data("value",m.val()),h.data("value",h.val()),b.data("value",b.val()),w.data("value",w.val()),y.data("value",y.val()),P.data("value",P.val()),config.keymap=P.val(),$("#dialogPreference").closest(".dialog-main").find(".dialog-footer > button:eq(0)").prop("disabled",!0),$("#themesLink").attr("href","/static/css/themes/"+v.val()+".css"),config.editorTheme=w.val();for(var i=0,n=editors.data.length;io.height()?40===e.which?o.scrollTop(o.scrollTop()+r.height()):o.scrollTop(r[0].offsetTop):o.scrollTop(0),38!==e.which&&40!==e.which&&13!==e.which&&void 0})},_bindOutput:function(){$(".bottom-window-group .output").keydown(function(e){var t=hotkeys.defaultKeyMap;if(e.altKey===t.clearWindow.altKey&&e.which===t.clearWindow.which)return bottomGroup.clear("output"),void e.preventDefault()})},_bindFileTree:function(){$("#files").keydown(function(e){e.preventDefault();var t=hotkeys.defaultKeyMap;if(e.ctrlKey!==t.search.ctrlKey||e.which!==t.search.which)if(e.ctrlKey!==t.rename.ctrlKey||e.which!==t.rename.which)switch(e.which){case 46:tree.removeIt();break;case 13:if(!wide.curNode)return!1;if(tree.isDir()){if(wide.curNode.open)return!1;tree.fileTree.expandNode(wide.curNode,!0,!1,!0),$("#files").focus();break}tree.openFile(wide.curNode);break;case 38:var i={};if(wide.curNode){if(wide.curNode&&wide.curNode.isFirstNode&&0===wide.curNode.level)return!1;i=wide.curNode.getPreNode(),wide.curNode.isFirstNode&&wide.curNode.getParentNode()&&(i=wide.curNode.getParentNode());var r=wide.curNode.getPreNode();r&&tree.isDir()&&r.open&&(i=tree.getCurrentNodeLastNode(r))}else i=tree.fileTree.getNodeByTId("files_1");wide.curNode=i,tree.fileTree.selectNode(i),$("#files").focus();break;case 40:i={};if(wide.curNode){if(wide.curNode&&tree.isBottomNode(wide.curNode))return!1;i=wide.curNode.getNextNode(),tree.isDir()&&wide.curNode.open&&(i=wide.curNode.children[0]);var o=tree.getNextShowNode(wide.curNode);wide.curNode.isLastNode&&0!==wide.curNode.level&&!wide.curNode.open&&o&&(i=o)}else i=tree.fileTree.getNodeByTId("files_1");i&&(wide.curNode=i,tree.fileTree.selectNode(i)),$("#files").focus();break;case 37:if(!wide.curNode)return wide.curNode=tree.fileTree.getNodeByTId("files_1"),tree.fileTree.selectNode(wide.curNode),$("#files").focus(),!1;if(!tree.isDir()||!wide.curNode.open)return!1;tree.fileTree.expandNode(wide.curNode,!1,!1,!0),$("#files").focus();break;case 39:if(!wide.curNode)return wide.curNode=tree.fileTree.getNodeByTId("files_1"),tree.fileTree.selectNode(wide.curNode),$("#files").focus(),!1;if(!tree.isDir()||wide.curNode.open)return!1;tree.fileTree.expandNode(wide.curNode,!0,!1,!0),$("#files").focus();break;case 116:if(!wide.curNode||!tree.isDir())return!1;tree.refresh(wide.curNode)}else wide.curNode.removable&&$("#dialogRenamePrompt").dialog("open");else $("#dialogSearchForm").dialog("open")})},_bindDocument:function(){var l=this.defaultKeyMap;$(document).keydown(function(e){if(e.ctrlKey===l.goEditor.ctrlKey&&e.which===l.goEditor.which)return l.goEditor.fun(),void e.preventDefault();if(e.ctrlKey===l.goFileTree.ctrlKey&&e.which===l.goFileTree.which)return l.goFileTree.fun(),void e.preventDefault();if(e.ctrlKey===l.goOutline.ctrlKey&&e.which===l.goOutline.which)return l.goOutline.fun(),void e.preventDefault();if(e.ctrlKey===l.goOutput.ctrlKey&&e.which===l.goOutput.which)return l.goOutput.fun(),void e.preventDefault();if(e.ctrlKey===l.goSearch.ctrlKey&&e.which===l.goSearch.which)return l.goSearch.fun(),void e.preventDefault();if(e.ctrlKey===l.goNotification.ctrlKey&&e.which===l.goNotification.which)return l.goNotification.fun(),void e.preventDefault();if(e.ctrlKey===l.closeCurEditor.ctrlKey&&e.which===l.closeCurEditor.which)return $(".edit-panel .tabs > div.current").find(".ico-close").click(),void e.preventDefault();if(e.ctrlKey!==l.changeEditor.ctrlKey||e.which!==l.changeEditor.which)return e.which===l.build.which?(menu.build(),void e.preventDefault()):e.which===l.buildRun.which?(menu.run(),void e.preventDefault()):void(e.ctrlKey===l.goFile.ctrlKey&&e.altKey===l.goFile.altKey&&e.shiftKey===l.goFile.shiftKey&&e.which===l.goFile.which&&$("#dialogGoFilePrompt").dialog("open"));if("notification"===document.activeElement.className||"output"===document.activeElement.className||"search"===document.activeElement.className){for(var t=["output","search","notification"],i="",r=0,o=t.length;r div").text("")},resetOutput:function(){this.clear("output"),bottomGroup.tabs.setCurrent("output"),windows.flowBottom()},_initTabs:function(){this.tabs=new Tabs({id:".bottom-window-group",clickAfter:function(t){this._$tabsPanel.find("."+t).focus()}})},fillOutput:function(t){var o=$(".bottom-window-group .output");-1!==(t=(t=t.replace(/\r/g,"")).replace(/\n/g,"
    ")).indexOf("
    ")&&(t=Autolinker.link(t)),o.find("div").html(t),o.parent().scrollTop(o[0].scrollHeight)}}; diff --git a/static/js/wide.min.js.map b/static/js/wide.min.js.map index c8526d8..755d21b 100644 --- a/static/js/wide.min.js.map +++ b/static/js/wide.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["tabs.js","dialog.js","editors.js","notification.js","tree.js","wide.js","session.js","menu.js","windows.js","hotkeys.js","bottomGroup.js"],"names":["Tabs","obj","_$tabsPanel","$","id","_$tabs","_stack","this","STACKSIZE","_init","_it","each","data","length","splice","push","extend","prototype","_that","on","event","hasClass","setCurrent","clickAfter","parent","isRemove","removeBefore","del","stopPropagation","_hasId","find","add","getCurrentId","$tabsPanel","append","title","content","after","prevId","$tabs","stack","children","remove","i","removeAfter","path","removeClass","hide","addClass","show","setAfter","tId","tree","getTIdByPath","node","fileTree","getNodeByTId","selectNode","wide","curNode","ii","editors","curEditor","editor","cursor","getCursor","setCursor","focus","refreshOutline","text","line","ch","fn","dialog","version","author","dpuuid","Date","getTime","PROP_NAME","Dialog","_defaults","styleClass","background","panel","main","footer","headerMiddle","headerBg","closeIcon","closeIconHover","_attach","target","settings","uuid","inst","_newInst","replace","_getInst","err","_destroyDialog","removeData","prependTo","unwrap","removeAttr","_getDefaults","windowH","window","height","windowW","width","dialogH","parseInt","dialogW","okText","cancelText","footerHTML","headerHTML","hideFooter","hiddenOk","dialogHTML","bgHTML","modal","document","documentElement","scrollHeight","wrap","cloneObj","clone","get","bind","_close","$buttons","undefined","ok","_bindMove","keyup","keyCode","resize","afterInit","className","mousedown","_document","getElementById","x","clientX","style","left","y","clientY","top","ondragstart","onselectstart","onselect","setCapture","captureEvents","Event","MOUSEMOVE","MOUSEUP","onmousemove","positionX","positionY","onmouseup","releaseCapture","css","close","_closeDialog","_openDialog","msg","$dialog","position","afterOpen","_updateDialog","html","defaults","key","theme","styleName","options","otherArgs","Array","slice","call","arguments","shift","apply","concat","jQuery","autocompleteMutex","tabs","getEditorByPath","click","closeOther","currentIndex","firstIndex","_removeAllMarker","removeIndex","_initClose","ZeroClipboard","button","screenX","attr","init","config","label","tip","fileName","file","confirm_save","fmt","doc","isClean","nextId","menu","disabled","cancelSelectedNode","_initCodeMirrorHotKeys","openStartPage","dateFormat","time","date","dateObj","M+","getMonth","d+","getDate","h+","getHours","m+","getMinutes","s+","getSeconds","q+","Math","floor","S","getMilliseconds","k","test","RegExp","$1","getFullYear","substr","start_page","load","context","wideSessionId","ajax","url","type","dataType","jsonp","success","textStatus","articles","listHTML","community","article","articlePermalink","articleTitle","articleCreateTime","ret","getCurrentPath","currentPath","CodeMirror","registerHelper","word","cur","curLine","getLine","start","end","charAt","request","newWideRequest","code","getValue","cursorLine","cursorCh","autocompleteHints","state","completionActive","async","JSON","stringify","autocompleteArray","displayText","name","class","substring","console","warn","markClean","setTimeout","list","from","Pos","to","commands","autocompleteAfterDot","cm","mode","getMode","Pass","token","getTokenAt","showHint","hint","go","completeSingle","autocompleteAnyWord","auto","gotoLine","doNothing","exprInfo","result","succ","cursorCoords","copyLinesDown","selectoion","listSelections","anchor","head","max","replaceToLine","replaceRange","offset","setSelection","copyLinesUp","moveLinesUp","moveLinesDown","lastLine","jumpToDecl","openFile","findUsages","appendSearch","selectIdentifier","findWordAt","extendSelection","searcHTML","toLowerCase","contents","matches","split","startIndex","endIndex","j","keyWord","search_no_match","$search","find_usages","search_text","bottomGroup","searchTab","$it","half","getScrollInfo","clientHeight","defaultTextHeight","scrollTo","windows","flowBottom","newEditor","iconSkin","undisabled","textArea","value","fromTextArea","lineNumbers","autofocus","autoCloseBrackets","matchBrackets","highlightSelectionMatches","showToken","rulers","color","column","lineStyle","styleActiveLine","editorTheme","tabSize","editorTabSize","indentUnit","indentWithTabs","foldGutter","cursorHeight","readOnly","isGOAPI","profile","extraKeys","Ctrl-\\",".","Ctrl-/","Ctrl-I","Ctrl-L","Ctrl-E","Ctrl-D","Ctrl-B","Ctrl-S","saveFile","Shift-Ctrl-S","saveAllFiles","Shift-Alt-F","Alt-F7","Shift-Alt-Enter","isMaxEditor","restoreEditor","maxEditor","Shift-Ctrl-Up","Shift-Ctrl-Down","Shift-Alt-Up","Shift-Alt-Down","Shift-Alt-J","emmetCodeMirror","$span","evt","altKey","ctrlKey","shiftKey","which","autocomplete","random","setSize","setOption","keymap","notification","_initWS","notificationWS","ReconnectingWebSocket","channel","onopen","log","onmessage","e","parse","$notification","notificationHTML","cmd","severity","message","onclose","onerror","getCurrentNodeLastNode","returnNode","open","getNextShowNode","level","getParentNode","getNextNode","isBottomNode","isLastNode","nodes","transformToArray","getNodes","getOpenPaths","paths","getAllParents","parents","parentTId","isParents","parentPath","parentNode","isDir","indexOf","newFile","it","newDir","removeIt","removable","rename","export","isSucc","crossCompile","platform","decompress","dir","reAsyncChildNodes","refresh","$dirRMenu","$fileRMenu","setting","view","showTitle","selectedMulti","enable","autoParam","callback","onDblClick","treeId","treeNode","onRightClick","creatable","display","onClick","clickFlag","zTree","session","restore","_initSearch","_initRename","tempCursor","findModeByFileName","mime","error","$okBtn","closest","prop","trim","val","search","cancel","extension","select","oldPath","newPath","lastIndexOf","curProcessId","outlineHTML","decls","maxj","Ch","Line","Name","dblclick","_initDialog","confirm","delete","create_file","create","fileType","create_dir","goto_file","$list","hotkeys","bindList","$selected","goFileHTML","icoSkin","getClassBySuffix","goto_line","outputWS","goLintFound","nextCmd","executable","fillOutput","output","pid","build_n_run","lints","files","lint","lineNo","signal","_initFooter","unbind","subMenu","onbeforeunload","oncontextmenu","_save","getOption","gofmt","beforeSend","resetOutput","stop","run","scrollInfo","setValue","formatted","html_beautify","js_beautify","css_beautify","suffix","ready","getLayoutState","paneState","isClosed","size","setInterval","filse","currentFile","layout","side","outerLayout","west","sideRight","innerLayout","east","bottom","south","latestSessionContent","nodesToOpen","jj","isOpen","l","expandNode","kk","m","mm","n","nn","c","sessionWS","addNodes","isParent","removeNode","_initPreference","_initAbout","_initShare","hover","pic","urls","email","twitterShare","encodeURIComponent","twitter","facebook","googleplus","weibo","qqz","about","wideVersion","uptodate","new_version_available","colon","wideDownload","mouseover","openPreference","closeAllFiles","exit","location","href","openAbout","goget","goinstall","govet","build","isChange","emptys","emptysTip","tabIndex","no_empty","preference","$dialogPreference","$fontFamily","$fontSize","$goFmt","$GoBuildArgsForLinux","$GoBuildArgsForWindows","$GoBuildArgsForDarwin","$workspace","$password","$email","$locale","$theme","$editorFontFamily","$editorFontSize","$editorLineHeight","$editorTheme","$editorTabSize","$keymap","fontFamily","fontSize","goFmt","GoBuildArgsForLinux","GoBuildArgsForWindows","GoBuildArgsForDarwin","workspace","password","locale","editorFontFamily","editorFontSize","editorLineHeight","reload","jqXHR","staticServer","north__paneSelector","center__paneSelector","south__paneSelector","north__size","south__size","spacing_open","north__spacing_open","south__spacing_open","fxSpeed_open","fxSpeed_close","fxSettings_close","easing","fxSettings_open","paneSelector","togglerLength_open","togglerLength_closed","togglerAlign_closed","slideTrigger_open","spacing_closed","minSize","togglerClass","togglerTip_open","min","togglerTip_closed","restore_side","resizerTip","initClosed","center","restore_outline","restore_bottom","ondrag_end","pane","refreshEditor","onresize_end","onclose_end","onopen_end","onshow_end","addCloseBtn","maxSide","maxSideRight","maxBottom","toggleEditor","restoreBottom","restoreSide","restoreSideRight","sizePane","max_editor","editorDatas","slideOpen","defaultKeyMap","goEditor","fun","goFileTree","goOutline","goOutput","goSearch","goNotification","clearWindow","changeEditor","closeCurEditor","goFile","buildRun","$source","enterFun","keydown","index","count","scrollTop","offsetTop","_bindOutput","hotKeys","clear","preventDefault","_bindFileTree","isFirstNode","getPreNode","preNode","nextShowNode","_bindDocument","activeElement","nextPath","currentId","nextTId","_initTabs","_initFrame","$path","mouseup","offsetY","$output","Autolinker","link"],"mappings":"AAsBA,IAAIA,KAAO,SAAUC,GACjBA,EAAIC,YAAcC,EAAEF,E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YAAYnK,KAAKvK,WAAW,UAC5BkV,QAAQC,cAEZ6Y,UAAW,WACP/uB,KAAKsL,KAAO,IAAI7L,KAAK,CACjBI,GAAI,uBACJmB,WAAY,SAAUnB,GAClBG,KAAKL,YAAY4B,KAAK,IAAM1B,GAAI+D,YAI5C6d,WAAY,SAAUphB,GAClB,IAAI+uB,EAAUxvB,EAAE,iCAKX,KAFLS,GADAA,EAAOA,EAAKqF,QAAQ,MAAO,KACfA,QAAQ,MAAO,UAEX8W,QAAQ,WACpBnc,EAAOgvB,WAAWC,KAAKjvB,IAG3B+uB,EAAQ7tB,KAAK,OAAO+I,KAAKjK,GACzB+uB,EAAQnuB,SAAS8sB,UAAUqB,EAAQ,GAAG9nB","file":"wide.min.js","sourcesContent":["/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file tabs.js\r\n *\r\n * @author Liyuan Li\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\nvar Tabs = function (obj) {\r\n obj._$tabsPanel = $(obj.id + \" > .tabs-panel\");\r\n obj._$tabs = $(obj.id + \" > .tabs\");\r\n obj._stack = [];\r\n\r\n this.obj = obj;\r\n this.obj.STACKSIZE = 64;\r\n\r\n this._init(obj);\r\n\r\n // DOM 元素存在时,应顺序入栈\r\n var _it = this;\r\n $(obj.id + \" > .tabs > div\").each(function () {\r\n var id = $(this).data(\"index\");\r\n if (obj._stack.length === _it.obj.STACKSIZE) {\r\n obj._stack.splice(0, 1);\r\n }\r\n if (obj._stack[obj._stack.length - 1] !== id) {\r\n _it.obj._stack.push(id);\r\n }\r\n });\r\n\r\n};\r\n\r\n$.extend(Tabs.prototype, {\r\n _init: function (obj) {\r\n var _that = this;\r\n\r\n obj._$tabs.on(\"click\", \"div\", function (event) {\r\n if ($(this).hasClass('current')) {\r\n return false;\r\n }\r\n\r\n var id = $(this).data(\"index\");\r\n _that.setCurrent(id);\r\n if (typeof (obj.clickAfter) === \"function\") {\r\n obj.clickAfter(id);\r\n }\r\n });\r\n\r\n obj._$tabs.on(\"click\", \".ico-close\", function (event) {\r\n var id = $(this).parent().data(\"index\"),\r\n isRemove = true;\r\n\r\n if (typeof obj.removeBefore === 'function') {\r\n isRemove = obj.removeBefore(id);\r\n }\r\n\r\n if (isRemove) {\r\n _that.del(id);\r\n }\r\n event.stopPropagation();\r\n });\r\n },\r\n _hasId: function (id) {\r\n var $tabs = this.obj._$tabs;\r\n if ($tabs.find('div[data-index=\"' + id + '\"]').length === 0) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n add: function (data) {\r\n // 添加当前 tab\r\n if (this.getCurrentId() === data.id) {\r\n return false;\r\n }\r\n\r\n // 当前 tab 已经存在\r\n if (this._hasId(data.id)) {\r\n this.setCurrent(data.id);\r\n return false;\r\n }\r\n\r\n var $tabsPanel = this.obj._$tabsPanel,\r\n $tabs = this.obj._$tabs;\r\n\r\n $tabs.append('
    '\r\n + data.title + '
    ');\r\n $tabsPanel.append('
    ' + data.content\r\n + '
    ');\r\n\r\n this.setCurrent(data.id);\r\n\r\n if (typeof data.after === 'function') {\r\n data.after();\r\n }\r\n },\r\n del: function (id) {\r\n var $tabsPanel = this.obj._$tabsPanel,\r\n $tabs = this.obj._$tabs,\r\n stack = this.obj._stack,\r\n prevId = null;\r\n\r\n $tabs.children(\"div[data-index='\" + id + \"']\").remove();\r\n $tabsPanel.children(\"div[data-index='\" + id + \"']\").remove();\r\n\r\n // 移除堆栈中该 id\r\n for (var i = 0; i < stack.length; i++) {\r\n if (id === stack[i]) {\r\n stack.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n\r\n prevId = stack[stack.length - 1];\r\n\r\n if (typeof this.obj.removeAfter === 'function') {\r\n this.obj.removeAfter(id, prevId);\r\n }\r\n\r\n this.setCurrent(prevId);\r\n },\r\n getCurrentId: function () {\r\n var $tabs = this.obj._$tabs;\r\n return $tabs.children(\".current\").data(\"index\");\r\n },\r\n setCurrent: function (path) {\r\n if (!path) {\r\n return false;\r\n }\r\n\r\n var $tabsPanel = this.obj._$tabsPanel,\r\n $tabs = this.obj._$tabs;\r\n\r\n var $currentTab = $tabs.children(\".current\");\r\n if ($currentTab.data(\"index\") === path) {\r\n return false;\r\n }\r\n\r\n // tab 顺序入栈,如栈满则清除\r\n var stack = this.obj._stack;\r\n if (stack.length === this.obj.STACKSIZE) {\r\n stack.splice(0, 1);\r\n }\r\n if (stack[stack.length - 1] !== path) {\r\n this.obj._stack.push(path);\r\n }\r\n\r\n $tabs.children(\"div\").removeClass(\"current\");\r\n $tabsPanel.children(\"div\").hide();\r\n\r\n $tabs.children('div[data-index=\"' + path + '\"]').addClass(\"current\");\r\n $tabsPanel.children('div[data-index=\"' + path + '\"]').show();\r\n\r\n if (typeof this.obj.setAfter === 'function') {\r\n this.obj.setAfter();\r\n }\r\n\r\n var id = this.getCurrentId();\r\n if (\"startPage\" === id) {\r\n return;\r\n }\r\n\r\n // set tree node selected\r\n var tId = tree.getTIdByPath(id);\r\n var node = tree.fileTree.getNodeByTId(tId);\r\n tree.fileTree.selectNode(node);\r\n wide.curNode = node;\r\n\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].id === id) {\r\n wide.curEditor = editors.data[i].editor;\r\n break;\r\n }\r\n }\r\n\r\n if (wide.curEditor) {\r\n var cursor = wide.curEditor.getCursor();\r\n wide.curEditor.setCursor(cursor);\r\n wide.curEditor.focus();\r\n wide.refreshOutline();\r\n\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n }\r\n }\r\n});","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file dialog.js\r\n *\r\n * @author Liyuan Li\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\n(function ($) {\r\n $.fn.extend({\r\n dialog: {\r\n version: \"0.0.1.7\",\r\n author: \"v@b3log.org\"\r\n }\r\n });\r\n\r\n var dpuuid = new Date().getTime();\r\n var PROP_NAME = 'dialog';\r\n\r\n var Dialog = function () {\r\n this._defaults = {\r\n \"styleClass\": {\r\n \"background\": \"dialog-background\",\r\n \"panel\": \"dialog-panel\",\r\n \"main\": \"dialog-main\",\r\n \"footer\": \"dialog-footer\",\r\n \"headerMiddle\": \"dialog-header-middle\",\r\n \"headerBg\": \"dialog-header-bg\",\r\n \"closeIcon\": \"dialog-close-icon\",\r\n \"closeIconHover\": \"dialog-close-icon-hover\",\r\n \"title\": \"dialog-title\"\r\n }\r\n };\r\n };\r\n\r\n $.extend(Dialog.prototype, {\r\n _attach: function (target, settings) {\r\n if (!target.id) {\r\n this.uuid++;\r\n target.id = 'dp' + this.uuid;\r\n }\r\n var inst = this._newInst($(target));\r\n\r\n inst.settings = $.extend({}, settings || {});\r\n $.data(target, PROP_NAME, inst);\r\n this._init(target);\r\n },\r\n /* Create a new instance object. */\r\n _newInst: function (target) {\r\n // escape jQuery meta chars\r\n var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\\\\\$1');\r\n return {\r\n id: id\r\n };\r\n },\r\n _getInst: function (target) {\r\n try {\r\n return $.data(target, PROP_NAME);\r\n } catch (err) {\r\n throw 'Missing instance data for this dialog';\r\n }\r\n },\r\n _destroyDialog: function (target) {\r\n var inst = $.dialog._getInst(target);\r\n var id = inst.id;\r\n $.removeData(target, PROP_NAME);\r\n\r\n $(target).prependTo(\"#\" + id + \"Wrap\").unwrap();\r\n $(target).removeAttr(\"style\");\r\n\r\n var styleClass = this._getDefaults($.dialog._defaults, inst.settings, \"styleClass\");\r\n $(\".\" + styleClass.background).remove();\r\n $(\"#\" + id + \"Dialog\").remove();\r\n },\r\n _init: function (target) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings;\r\n var windowH = $(window).height(),\r\n windowW = $(window).width();\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\"),\r\n dialogH = settings.height ? settings.height : parseInt(windowH * 0.6),\r\n dialogW = settings.width ? settings.width : parseInt(windowW * 0.6);\r\n\r\n // get settings or default value.\r\n settings.title = settings.title ? settings.title : \"\";\r\n settings.okText = settings.okText ? settings.okText : \"Ok\";\r\n settings.cancelText = settings.cancelText ? settings.cancelText : \"Cancel\";\r\n\r\n // build HTML.\r\n var footerHTML = \"\",\r\n headerHTML = \"
    \"\r\n + settings.title + \"
    \";\r\n\r\n // Sets footerHTML.\r\n if (!settings.hideFooter) {\r\n if (!settings.hiddenOk) {\r\n footerHTML = \"\";\r\n }\r\n footerHTML += \"\";\r\n }\r\n\r\n var dialogHTML = \"
    \" + headerHTML\r\n + \"
    \"\r\n + footerHTML + \"
    \";\r\n\r\n var bgHTML = \"\";\r\n if (settings.modal && $(\".\" + styleClass.background).length === 0) {\r\n var bgHeight = windowH < document.documentElement.scrollHeight\r\n ? document.documentElement.scrollHeight : windowH;\r\n bgHTML = \"
    \";\r\n }\r\n\r\n // Package dialog.\r\n $(\"#\" + id).wrap(\"
    \");\r\n var cloneObj = $(target).clone(true);\r\n $(target).remove();\r\n $('body').append(bgHTML + dialogHTML);\r\n $($(\"#\" + id + \"Dialog .\" + styleClass.main + \" div\").get(0)).append(cloneObj);\r\n $(cloneObj).show();\r\n\r\n // Bind event.\r\n $(\"#\" + id + \"Dialog .\" + styleClass.closeIcon).bind(\"click\", function () {\r\n $.dialog._close(id, settings);\r\n });\r\n\r\n var $buttons = $(\"#\" + id + \"Dialog .\" + styleClass.footer + \" button\");\r\n $($buttons.get(1)).bind(\"click\", function () {\r\n $.dialog._close(id, settings);\r\n });\r\n\r\n $($buttons.get(0)).bind(\"click\", function () {\r\n if (settings.ok === undefined || settings.ok()) {\r\n $.dialog._close(id, settings);\r\n }\r\n });\r\n\r\n this._bindMove(id, styleClass.headerBg, dialogH, dialogW);\r\n\r\n // esc exit\r\n $(window).keyup(function (event) {\r\n if (event.keyCode === 27) {\r\n $.dialog._close(id, settings);\r\n }\r\n });\r\n\r\n $(window).resize(function () {\r\n var height = $(\"body\").height() > $(window).height() ? $(\"body\").height() : $(window).height();\r\n $(\".dialog-background\").height(height);\r\n });\r\n\r\n if (typeof settings.afterInit === \"function\") {\r\n settings.afterInit();\r\n }\r\n },\r\n _bindMove: function (id, className) {\r\n $(\"#\" + id + \"Dialog .\" + className).mousedown(function (event) {\r\n var _document = document;\r\n if (!event) {\r\n event = window.event;\r\n }\r\n var dialog = document.getElementById(id + \"Dialog\");\r\n var x = event.clientX - parseInt(dialog.style.left),\r\n y = event.clientY - parseInt(dialog.style.top);\r\n _document.ondragstart = \"return false;\";\r\n _document.onselectstart = \"return false;\";\r\n _document.onselect = \"document.selection.empty();\";\r\n\r\n if (this.setCapture) {\r\n this.setCapture();\r\n } else if (window.captureEvents) {\r\n window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);\r\n }\r\n\r\n _document.onmousemove = function (event) {\r\n if (!event) {\r\n event = window.event;\r\n }\r\n var positionX = event.clientX - x,\r\n positionY = event.clientY - y;\r\n if (positionX < 0) {\r\n positionX = 0;\r\n }\r\n if (positionX > $(window).width() - $(dialog).width()) {\r\n positionX = $(window).width() - $(dialog).width();\r\n }\r\n if (positionY > $(window).height() - $(dialog).height()) {\r\n positionY = $(window).height() - $(dialog).height();\r\n }\r\n if (positionY < 0) {\r\n positionY = 0;\r\n }\r\n dialog.style.left = positionX + \"px\";\r\n dialog.style.top = positionY + \"px\";\r\n };\r\n\r\n _document.onmouseup = function () {\r\n if (this.releaseCapture) {\r\n this.releaseCapture();\r\n } else if (window.captureEvents) {\r\n window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);\r\n }\r\n _document.onmousemove = null;\r\n _document.onmouseup = null;\r\n _document.ondragstart = null;\r\n _document.onselectstart = null;\r\n _document.onselect = null;\r\n };\r\n });\r\n },\r\n _close: function (id, settings) {\r\n if ($(\"#\" + id + \"Dialog\").css(\"display\") === \"none\") {\r\n return;\r\n }\r\n if (settings.close === undefined || settings.close()) {\r\n $(\"#\" + id + \"Dialog\").hide();\r\n if (settings.modal) {\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\r\n $(\".\" + styleClass.background).hide();\r\n }\r\n }\r\n },\r\n _closeDialog: function (target) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings;\r\n $.dialog._close(id, settings);\r\n },\r\n _openDialog: function (target, msg) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings,\r\n top = \"\", left = \"\",\r\n $dialog = $(\"#\" + id + \"Dialog\"),\r\n windowH = $(window).height(),\r\n windowW = $(window).width(),\r\n dialogH = settings.height ? settings.height : parseInt(windowH * 0.6),\r\n dialogW = settings.width ? settings.width : parseInt(windowW * 0.6);\r\n\r\n // Sets position.\r\n if (settings.position) {\r\n top = settings.position.top;\r\n left = settings.position.left;\r\n } else {\r\n // 20(footer) + 23(header)\r\n top = parseInt((windowH - dialogH - 43) / 2);\r\n if (top < 0) {\r\n top = 0;\r\n }\r\n left = parseInt((windowW - dialogW) / 2);\r\n }\r\n $dialog.css({\r\n \"top\": top + \"px\",\r\n \"left\": left + \"px\"\r\n }).show();\r\n\r\n if (settings.modal) {\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\r\n $(\".\" + styleClass.background).show();\r\n }\r\n\r\n if (typeof settings.afterOpen === \"function\") {\r\n settings.afterOpen(msg);\r\n }\r\n\r\n $(\"#\" + id + \"Dialog .dialog-footer button:eq(0)\").focus();\r\n },\r\n _updateDialog: function (target, data) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings;\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\r\n $.extend(settings, data);\r\n var $dialog = $(\"#\" + id + \"Dialog\");\r\n if (data.position) {\r\n $dialog.css({\r\n \"top\": data.position.top,\r\n \"left\": data.position.left\r\n });\r\n }\r\n\r\n if (data.width) {\r\n $dialog.width(data.width + 26);\r\n $dialog.find(\".\" + styleClass.main + \" div\")[0].style.width = data.width + \"px\";\r\n $dialog.find(\".\" + styleClass.headerBg).width(data.width + 18);\r\n }\r\n\r\n if (data.height) {\r\n $dialog.find(\".\" + styleClass.main + \" div\")[0].style.height = data.height + \"px\";\r\n }\r\n\r\n if (data.title) {\r\n $dialog.find(\".\" + styleClass.title).html(data.title);\r\n }\r\n\r\n if (data.modal !== undefined) {\r\n if (data.modal) {\r\n $(\".\" + styleClass.background).show();\r\n } else {\r\n $(\".\" + styleClass.background).hide();\r\n }\r\n }\r\n\r\n if (data.hideFooter !== undefined) {\r\n if (data.hideFooter) {\r\n $dialog.find(\".\" + styleClass.footer).hide();\r\n } else {\r\n $dialog.find(\".\" + styleClass.footer).show();\r\n }\r\n }\r\n\r\n },\r\n _getDefaults: function (defaults, settings, key) {\r\n if (key === \"styleClass\") {\r\n if (settings.theme === \"default\" || settings.theme === undefined) {\r\n return defaults.styleClass;\r\n }\r\n settings.styleClass = {};\r\n for (var styleName in defaults[key]) {\r\n settings.styleClass[styleName] = settings.theme + \"-\" + defaults.styleClass[styleName];\r\n }\r\n } else if (key === \"height\" || key === \"width\") {\r\n if (settings[key] === null || settings[key] === undefined) {\r\n return \"auto\";\r\n } else {\r\n return settings[key] + \"px\";\r\n }\r\n } else {\r\n if (settings[key] === null || settings[key] === undefined) {\r\n return defaults[key];\r\n }\r\n }\r\n return settings[key];\r\n }\r\n });\r\n\r\n $.fn.dialog = function (options) {\r\n var otherArgs = Array.prototype.slice.call(arguments);\r\n\r\n if (typeof options === 'string') {\r\n otherArgs.shift();\r\n return $.dialog['_' + options + 'Dialog'].apply($.dialog, [this[0]].concat(otherArgs));\r\n }\r\n return this.each(function () {\r\n $.dialog._attach(this, options);\r\n });\r\n };\r\n\r\n $.dialog = new Dialog();\r\n\r\n // Add another global to avoid noConflict issues with inline event handlers\r\n window['DP_jQuery_' + dpuuid] = $;\r\n})(jQuery);","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file editor.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.1.1.0, Jan 12, 2016\r\n */\r\nvar editors = {\r\n autocompleteMutex: false,\r\n data: [],\r\n tabs: {},\r\n getEditorByPath: function (path) {\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].editor.options.path === path) {\r\n return editors.data[i].editor;\r\n }\r\n }\r\n },\r\n close: function () {\r\n $('.edit-panel .tabs > div[data-index=\"' + $('.edit-panel .frame').data('index') + ']').find('.ico-close').click();\r\n },\r\n closeOther: function () {\r\n var currentIndex = $(\".edit-panel .frame\").data(\"index\");\r\n\r\n // 设置全部关闭标识\r\n var removeData = [];\r\n $(\".edit-panel .tabs > div\").each(function (i) {\r\n if (currentIndex !== $(this).data(\"index\")) {\r\n removeData.push($(this).data(\"index\"));\r\n }\r\n });\r\n if (removeData.length === 0) {\r\n return false;\r\n }\r\n var firstIndex = removeData.splice(0, 1);\r\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\r\n // 开始关闭\r\n $('.edit-panel .tabs > div[data-index=\"' + firstIndex + '\"]').find(\".ico-close\").click();\r\n },\r\n _removeAllMarker: function () {\r\n var removeData = $(\"#dialogCloseEditor\").data(\"removeData\");\r\n if (removeData && removeData.length > 0) {\r\n var removeIndex = removeData.splice(0, 1);\r\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\r\n $('.edit-panel .tabs > div[data-index=\"' + removeIndex + '\"] .ico-close').click();\r\n }\r\n if (wide.curEditor) {\r\n wide.curEditor.focus();\r\n }\r\n },\r\n _initClose: function () {\r\n new ZeroClipboard($(\"#copyFilePath\"));\r\n\r\n // 关闭、关闭其他、关闭所有\r\n $(\".edit-panel\").on(\"mouseup\", '.tabs > div', function (event) {\r\n event.stopPropagation();\r\n\r\n if (event.button === 0) { // 左键\r\n $(\".edit-panel .frame\").hide();\r\n return false;\r\n }\r\n\r\n // event.button === 2 右键\r\n var left = event.screenX;\r\n if ($(\".side\").css(\"left\") === \"auto\" || $(\".side\").css(\"left\") === \"0px\") {\r\n left = event.screenX - $(\".side\").width();\r\n }\r\n $(\".edit-panel .frame\").show().css({\r\n \"left\": left + \"px\",\r\n \"top\": \"21px\"\r\n }).data('index', $(this).data(\"index\"));\r\n\r\n $(\"#copyFilePath\").attr('data-clipboard-text', $(this).find(\"span:eq(0)\").attr(\"title\"));\r\n return false;\r\n });\r\n },\r\n init: function () {\r\n $(\"#dialogCloseEditor\").dialog({\r\n \"modal\": true,\r\n \"height\": 90,\r\n \"width\": 260,\r\n \"title\": config.label.tip,\r\n \"hideFooter\": true,\r\n \"afterOpen\": function (fileName) {\r\n $(\"#dialogCloseEditor > div:eq(0)\").html(config.label.file\r\n + ' ' + fileName + '. ' + config.label.confirm_save + '?');\r\n $(\"#dialogCloseEditor button:eq(0)\").focus();\r\n },\r\n \"afterInit\": function () {\r\n $(\"#dialogCloseEditor button.save\").click(function () {\r\n var i = $(\"#dialogCloseEditor\").data(\"index\");\r\n wide.fmt(editors.data[i].id, editors.data[i].editor);\r\n editors.tabs.del(editors.data[i].id);\r\n $(\"#dialogCloseEditor\").dialog(\"close\");\r\n editors._removeAllMarker();\r\n });\r\n\r\n $(\"#dialogCloseEditor button.discard\").click(function () {\r\n var i = $(\"#dialogCloseEditor\").data(\"index\");\r\n editors.tabs.del(editors.data[i].id);\r\n $(\"#dialogCloseEditor\").dialog(\"close\");\r\n editors._removeAllMarker();\r\n });\r\n\r\n $(\"#dialogCloseEditor button.cancel\").click(function (event) {\r\n $(\"#dialogCloseEditor\").dialog(\"close\");\r\n editors._removeAllMarker();\r\n });\r\n }\r\n });\r\n\r\n editors.tabs = new Tabs({\r\n id: \".edit-panel\",\r\n setAfter: function () {\r\n if (wide.curEditor) {\r\n wide.curEditor.focus();\r\n }\r\n },\r\n clickAfter: function (id) {\r\n if (id === 'startPage') {\r\n wide.curEditor = undefined;\r\n $(\".footer .cursor\").text('');\r\n wide.refreshOutline();\r\n \r\n return false;\r\n }\r\n },\r\n removeBefore: function (id) {\r\n if (id === 'startPage') { // 当前关闭的 tab 是起始页\r\n editors._removeAllMarker();\r\n return true;\r\n }\r\n\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].id === id) {\r\n if (editors.data[i].editor.doc.isClean()) {\r\n editors._removeAllMarker();\r\n return true;\r\n } else {\r\n $(\"#dialogCloseEditor\").dialog(\"open\", $('.edit-panel .tabs > div[data-index=\"'\r\n + editors.data[i].id + '\"] > span:eq(0)').text());\r\n $(\"#dialogCloseEditor\").data(\"index\", i);\r\n return false;\r\n }\r\n\r\n break;\r\n }\r\n }\r\n },\r\n removeAfter: function (id, nextId) {\r\n if ($(\".edit-panel .tabs > div\").length === 0) {\r\n // 全部 tab 都关闭时才 disables 菜单中“全部关闭”的按钮\r\n menu.disabled(['close-all']);\r\n }\r\n\r\n // 移除编辑器\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].id === id) {\r\n editors.data.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n if (editors.data.length === 0) { // 起始页可能存在,所以用编辑器数据判断\r\n menu.disabled(['save-all', 'build', 'run', 'go-test', 'go-vet', 'go-get', 'go-install',\r\n 'find', 'find-next', 'find-previous', 'replace', 'replace-all',\r\n 'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment',\r\n 'edit']);\r\n\r\n // remove selected tree node\r\n tree.fileTree.cancelSelectedNode();\r\n wide.curNode = undefined;\r\n wide.curEditor = undefined;\r\n wide.refreshOutline();\r\n $(\".footer .cursor\").text('');\r\n return false;\r\n }\r\n\r\n if (!nextId) {\r\n // 编辑器区域不存在打开的 Tab\r\n // remove selected tree node\r\n tree.fileTree.cancelSelectedNode();\r\n wide.curNode = undefined;\r\n wide.curEditor = undefined;\r\n wide.refreshOutline();\r\n $(\".footer .cursor\").text('');\r\n return false;\r\n }\r\n\r\n if (nextId === editors.tabs.getCurrentId()) {\r\n // 关闭的不是当前编辑器\r\n return false;\r\n }\r\n }\r\n });\r\n\r\n this._initCodeMirrorHotKeys();\r\n this.openStartPage();\r\n this._initClose();\r\n },\r\n openStartPage: function () {\r\n wide.curEditor = undefined;\r\n wide.refreshOutline();\r\n $(\".footer .cursor\").text('');\r\n\r\n var dateFormat = function (time, fmt) {\r\n var date = new Date(time);\r\n var dateObj = {\r\n \"M+\": date.getMonth() + 1, //月份 \r\n \"d+\": date.getDate(), //日 \r\n \"h+\": date.getHours(), //小时 \r\n \"m+\": date.getMinutes(), //分 \r\n \"s+\": date.getSeconds(), //秒 \r\n \"q+\": Math.floor((date.getMonth() + 3) / 3), //季度 \r\n \"S\": date.getMilliseconds() //毫秒 \r\n };\r\n if (/(y+)/.test(fmt))\r\n fmt = fmt.replace(RegExp.$1, (date.getFullYear() + \"\").substr(4 - RegExp.$1.length));\r\n for (var k in dateObj)\r\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\r\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1)\r\n ? (dateObj[k]) : ((\"00\" + dateObj[k]).substr((\"\" + dateObj[k]).length)));\r\n }\r\n return fmt;\r\n };\r\n\r\n editors.tabs.add({\r\n id: \"startPage\",\r\n title: ' ' + config.label.start_page + '',\r\n content: '
    ',\r\n after: function () {\r\n $(\"#startPage\").load(config.context + '/start?sid=' + config.wideSessionId);\r\n $.ajax({\r\n url: \"https://hacpai.com/apis/articles?tags=wide,golang&p=1&size=20\",\r\n type: \"GET\",\r\n dataType: \"jsonp\",\r\n jsonp: \"callback\",\r\n success: function (data, textStatus) {\r\n var articles = data.articles;\r\n if (0 === articles.length) {\r\n return;\r\n }\r\n\r\n // 按 size = 20 取,但只保留最多 9 篇\r\n var length = articles.length;\r\n if (length > 9) {\r\n length = 9;\r\n }\r\n\r\n var listHTML = \"\");\r\n }\r\n });\r\n }\r\n });\r\n },\r\n getCurrentId: function () {\r\n var ret = editors.tabs.getCurrentId();\r\n if (ret === 'startPage') {\r\n ret = null;\r\n }\r\n \r\n return ret;\r\n },\r\n getCurrentPath: function () {\r\n var currentPath = $(\".edit-panel .tabs .current span:eq(0)\").attr(\"title\");\r\n if (currentPath === config.label.start_page) {\r\n currentPath = null;\r\n }\r\n return currentPath;\r\n },\r\n _initCodeMirrorHotKeys: function () {\r\n CodeMirror.registerHelper(\"hint\", \"go\", function (editor) {\r\n editor = wide.curEditor; // 使用当前编辑器覆盖实参,因为异步调用的原因,实参不一定正确\r\n var word = /[\\w$]+/;\r\n\r\n var cur = editor.getCursor(), curLine = editor.getLine(cur.line);\r\n\r\n var start = cur.ch, end = start;\r\n while (end < curLine.length && word.test(curLine.charAt(end))) {\r\n ++end;\r\n }\r\n while (start && word.test(curLine.charAt(start - 1))) {\r\n --start;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = editor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n var autocompleteHints = [];\r\n\r\n if (editors.autocompleteMutex && editor.state.completionActive) {\r\n return;\r\n }\r\n\r\n editors.autocompleteMutex = true;\r\n\r\n $.ajax({\r\n async: false, // 同步执行\r\n type: 'POST',\r\n url: config.context + '/autocomplete',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (data) {\r\n var autocompleteArray = data[1];\r\n\r\n if (autocompleteArray) {\r\n for (var i = 0; i < autocompleteArray.length; i++) {\r\n var displayText = '',\r\n text = autocompleteArray[i].name;\r\n\r\n switch (autocompleteArray[i].class) {\r\n case \"type\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"const\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"var\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"package\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"func\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ''\r\n + autocompleteArray[i].type.substring(4) + '';\r\n text += '()';\r\n break;\r\n default:\r\n console.warn(\"Can't handle autocomplete [\" + autocompleteArray[i].class + \"]\");\r\n break;\r\n }\r\n\r\n autocompleteHints[i] = {\r\n displayText: displayText,\r\n text: text\r\n };\r\n }\r\n }\r\n\r\n editor.doc.markClean();\r\n $(\".edit-panel .tabs .current > span:eq(0)\").removeClass(\"changed\");\r\n }\r\n });\r\n\r\n setTimeout(function () {\r\n editors.autocompleteMutex = false;\r\n }, 20);\r\n\r\n return {list: autocompleteHints, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};\r\n });\r\n\r\n CodeMirror.commands.autocompleteAfterDot = function (cm) {\r\n var mode = cm.getMode();\r\n if (mode && \"go\" !== mode.name) {\r\n return CodeMirror.Pass;\r\n }\r\n\r\n var token = cm.getTokenAt(cm.getCursor());\r\n\r\n if (\"comment\" === token.type || \"string\" === token.type) {\r\n return CodeMirror.Pass;\r\n }\r\n\r\n setTimeout(function () {\r\n if (!cm.state.completionActive) {\r\n cm.showHint({hint: CodeMirror.hint.go, completeSingle: false});\r\n }\r\n }, 50);\r\n\r\n return CodeMirror.Pass;\r\n };\r\n\r\n CodeMirror.commands.autocompleteAnyWord = function (cm) {\r\n cm.showHint({hint: CodeMirror.hint.auto});\r\n };\r\n\r\n CodeMirror.commands.gotoLine = function (cm) {\r\n $(\"#dialogGoLinePrompt\").dialog(\"open\");\r\n };\r\n\r\n // 用于覆盖 cm 默认绑定的某些快捷键功能.\r\n CodeMirror.commands.doNothing = function (cm) {\r\n };\r\n\r\n CodeMirror.commands.exprInfo = function (cm) {\r\n var cur = wide.curEditor.getCursor();\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = wide.curEditor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/exprinfo',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n \r\n var position = wide.curEditor.cursorCoords();\r\n $(\"body\").append('
    ' + result.data + '
    ');\r\n }\r\n });\r\n };\r\n\r\n CodeMirror.commands.copyLinesDown = function (cm) {\r\n var content = '',\r\n selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n for (var i = from.line, max = to.line; i <= max; i++) {\r\n if (to.ch !== 0 || i !== max) { // 下一行选中为0时,不应添加内容\r\n content += '\\n' + cm.getLine(i);\r\n }\r\n }\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n cm.replaceRange(content, CodeMirror.Pos(replaceToLine));\r\n\r\n var offset = replaceToLine - from.line + 1;\r\n cm.setSelection(CodeMirror.Pos(from.line + offset, from.ch),\r\n CodeMirror.Pos(to.line + offset, to.ch));\r\n };\r\n\r\n CodeMirror.commands.copyLinesUp = function (cm) {\r\n var content = '',\r\n selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n for (var i = from.line, max = to.line; i <= max; i++) {\r\n if (to.ch !== 0 || i !== max) { // 下一行选中为0时,不应添加内容\r\n content += '\\n' + cm.getLine(i);\r\n }\r\n }\r\n\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n cm.replaceRange(content, CodeMirror.Pos(replaceToLine));\r\n\r\n cm.setSelection(CodeMirror.Pos(from.line, from.ch),\r\n CodeMirror.Pos(to.line, to.ch));\r\n };\r\n\r\n CodeMirror.commands.moveLinesUp = function (cm) {\r\n var selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n if (from.line === 0) {\r\n return false;\r\n }\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n cm.replaceRange('\\n' + cm.getLine(from.line - 1), CodeMirror.Pos(replaceToLine));\r\n if (from.line === 1) {\r\n // 移除第一行的换行\r\n cm.replaceRange('', CodeMirror.Pos(0, 0),\r\n CodeMirror.Pos(1, 0));\r\n } else {\r\n cm.replaceRange('', CodeMirror.Pos(from.line - 2, cm.getLine(from.line - 2).length),\r\n CodeMirror.Pos(from.line - 1, cm.getLine(from.line - 1).length));\r\n }\r\n\r\n cm.setSelection(CodeMirror.Pos(from.line - 1, from.ch),\r\n CodeMirror.Pos(to.line - 1, to.ch));\r\n };\r\n\r\n CodeMirror.commands.moveLinesDown = function (cm) {\r\n var selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n if (to.line === cm.lastLine()) {\r\n return false;\r\n }\r\n\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n // 把选中的下一行添加到选中区域的上一行\r\n if (from.line === 0) {\r\n cm.replaceRange(cm.getLine(replaceToLine + 1) + '\\n', CodeMirror.Pos(0, 0));\r\n } else {\r\n cm.replaceRange('\\n' + cm.getLine(replaceToLine + 1), CodeMirror.Pos(from.line - 1));\r\n }\r\n // 删除选中的下一行\r\n cm.replaceRange('', CodeMirror.Pos(replaceToLine + 1, cm.getLine(replaceToLine + 1).length),\r\n CodeMirror.Pos(replaceToLine + 2, cm.getLine(replaceToLine + 2).length));\r\n\r\n cm.setSelection(CodeMirror.Pos(from.line + 1, from.ch),\r\n CodeMirror.Pos(to.line + 1, to.ch));\r\n };\r\n\r\n CodeMirror.commands.jumpToDecl = function (cm) {\r\n var cur = wide.curEditor.getCursor();\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = wide.curEditor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/find/decl',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n \r\n var data = result.data;\r\n\r\n var tId = tree.getTIdByPath(data.path);\r\n wide.curNode = tree.fileTree.getNodeByTId(tId);\r\n tree.fileTree.selectNode(wide.curNode);\r\n\r\n tree.openFile(wide.curNode, CodeMirror.Pos(data.cursorLine - 1, data.cursorCh - 1));\r\n }\r\n });\r\n };\r\n\r\n CodeMirror.commands.findUsages = function (cm) {\r\n var cur = wide.curEditor.getCursor();\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = wide.curEditor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/find/usages',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n editors.appendSearch(result.data, 'usages', '');\r\n }\r\n });\r\n };\r\n\r\n CodeMirror.commands.selectIdentifier = function (cm) {\r\n var cur = cm.getCursor();\r\n var word = cm.findWordAt(cur);\r\n cm.extendSelection(word.anchor, word.head);\r\n };\r\n },\r\n appendSearch: function (data, type, key) {\r\n var searcHTML = '
      ',\r\n key = key.toLowerCase();\r\n\r\n for (var i = 0, ii = data.length; i < ii; i++) {\r\n var contents = '',\r\n lowerCaseContents = data[i].contents[0].toLowerCase(),\r\n matches = lowerCaseContents.split(key),\r\n startIndex = 0,\r\n endIndex = 0;\r\n for (var j = 0, max = matches.length; j < max; j++) {\r\n startIndex = endIndex + matches[j].length;\r\n endIndex = startIndex + key.length;\r\n var keyWord = data[i].contents[0].substring(startIndex, endIndex);\r\n if (keyWord !== '') {\r\n keyWord = '' + keyWord + '';\r\n }\r\n contents += data[i].contents[0].substring(startIndex - matches[j].length, startIndex) + keyWord;\r\n }\r\n\r\n searcHTML += '
    • '\r\n + contents + \"    \" + data[i].path\r\n + ' (' + data[i].line + ':'\r\n + data[i].ch + ')
    • ';\r\n }\r\n\r\n if (data.length === 0) {\r\n searcHTML += '
    • ' + config.label.search_no_match + '
    • ';\r\n }\r\n searcHTML += '
    ';\r\n\r\n var $search = $('.bottom-window-group .search'),\r\n title = config.label.find_usages;\r\n if (type === \"founds\") {\r\n title = config.label.search_text;\r\n }\r\n if ($search.find(\"ul\").length === 0) {\r\n bottomGroup.searchTab = new Tabs({\r\n id: \".bottom-window-group .search\",\r\n removeAfter: function (id, prevId) {\r\n if ($search.find(\"ul\").length === 1) {\r\n $search.find(\".tabs\").hide();\r\n }\r\n }\r\n });\r\n\r\n $search.on(\"click\", \"li\", function () {\r\n $search.find(\"li\").removeClass(\"selected\");\r\n $(this).addClass(\"selected\");\r\n });\r\n\r\n $search.on(\"dblclick\", \"li\", function () {\r\n var $it = $(this),\r\n tId = tree.getTIdByPath($it.attr(\"title\"));\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n\r\n var line = $it.find(\".position\").data(\"line\") - 1;\r\n var cursor = CodeMirror.Pos(line, $it.find(\".position\").data(\"ch\") - 1);\r\n\r\n\r\n var editor = wide.curEditor;\r\n editor.setCursor(cursor);\r\n\r\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\r\n var cursorCoords = editor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\r\n editor.scrollTo(0, cursorCoords.top);\r\n\r\n wide.curEditor.focus();\r\n });\r\n\r\n $search.find(\".tabs-panel > div\").append(searcHTML);\r\n\r\n $search.find(\".tabs .first\").text(title);\r\n } else {\r\n $search.find(\".tabs\").show();\r\n bottomGroup.searchTab.add({\r\n \"id\": \"search\" + (new Date()).getTime(),\r\n \"title\": title,\r\n \"content\": searcHTML\r\n });\r\n }\r\n\r\n // focus\r\n bottomGroup.tabs.setCurrent(\"search\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .search\").focus();\r\n },\r\n // 新建一个编辑器 Tab,如果已经存在 Tab 则切换到该 Tab.\r\n newEditor: function (data, cursor) {\r\n var id = wide.curNode.id;\r\n\r\n editors.tabs.add({\r\n id: id,\r\n title: '' + wide.curNode.name + '',\r\n content: ''\r\n });\r\n\r\n menu.undisabled(['save-all', 'close-all', 'build', 'run', 'go-test', 'go-vet', 'go-get', 'go-install',\r\n 'find', 'find-next', 'find-previous', 'replace', 'replace-all',\r\n 'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment',\r\n 'edit']);\r\n\r\n var textArea = document.getElementById(\"editor\" + id);\r\n textArea.value = data.content;\r\n\r\n var editor = CodeMirror.fromTextArea(textArea, {\r\n lineNumbers: true,\r\n autofocus: true,\r\n autoCloseBrackets: true,\r\n matchBrackets: true,\r\n highlightSelectionMatches: {showToken: /\\w/},\r\n rulers: [{color: \"#ccc\", column: 120, lineStyle: \"dashed\"}],\r\n styleActiveLine: true,\r\n theme: config.editorTheme,\r\n tabSize: config.editorTabSize,\r\n indentUnit: 4,\r\n indentWithTabs: true,\r\n foldGutter: true,\r\n cursorHeight: 1,\r\n path: data.path,\r\n readOnly: wide.curNode.isGOAPI,\r\n profile: 'xhtml', // define Emmet output profile\r\n extraKeys: {\r\n \"Ctrl-\\\\\": \"autocompleteAnyWord\",\r\n \".\": \"autocompleteAfterDot\",\r\n \"Ctrl-/\": 'toggleComment',\r\n \"Ctrl-I\": \"exprInfo\",\r\n \"Ctrl-L\": \"gotoLine\",\r\n \"Ctrl-E\": \"deleteLine\",\r\n \"Ctrl-D\": \"doNothing\", // 取消默认的 deleteLine\r\n \"Ctrl-B\": \"jumpToDecl\",\r\n \"Ctrl-S\": function () {\r\n wide.saveFile();\r\n },\r\n \"Shift-Ctrl-S\": function () {\r\n menu.saveAllFiles();\r\n },\r\n \"Shift-Alt-F\": function () {\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n wide.fmt(currentPath, wide.curEditor);\r\n },\r\n \"Alt-F7\": \"findUsages\",\r\n \"Shift-Alt-Enter\": function () {\r\n if (windows.isMaxEditor) {\r\n windows.restoreEditor();\r\n } else {\r\n windows.maxEditor();\r\n }\r\n },\r\n \"Shift-Ctrl-Up\": \"copyLinesUp\",\r\n \"Shift-Ctrl-Down\": \"copyLinesDown\",\r\n \"Shift-Alt-Up\": \"moveLinesUp\",\r\n \"Shift-Alt-Down\": \"moveLinesDown\",\r\n \"Shift-Alt-J\": \"selectIdentifier\"\r\n }\r\n });\r\n\r\n if (\"text/html\" === data.mode) {\r\n emmetCodeMirror(editor);\r\n }\r\n\r\n editor.on('cursorActivity', function (cm) {\r\n $(\".edit-exprinfo\").remove();\r\n var cursor = cm.getCursor();\r\n\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n });\r\n\r\n editor.on('blur', function (cm) {\r\n $(\".edit-exprinfo\").remove();\r\n });\r\n\r\n editor.on('changes', function (cm) {\r\n if (cm.doc.isClean()) { // no modification\r\n $(\".edit-panel .tabs > div\").each(function () {\r\n var $span = $(this).find(\"span:eq(0)\");\r\n if ($span.attr(\"title\") === cm.options.path) {\r\n $span.removeClass(\"changed\");\r\n }\r\n });\r\n\r\n return;\r\n }\r\n\r\n // changed\r\n\r\n $(\".edit-panel .tabs > div\").each(function () {\r\n var $span = $(this).find(\"span:eq(0)\");\r\n if ($span.attr(\"title\") === cm.options.path) {\r\n $span.addClass(\"changed\");\r\n }\r\n });\r\n });\r\n\r\n editor.on('keydown', function (cm, evt) {\r\n if (evt.altKey || evt.ctrlKey || evt.shiftKey) {\r\n return;\r\n }\r\n\r\n var k = evt.which;\r\n\r\n if (k < 48) {\r\n return;\r\n }\r\n\r\n // hit [0-9]\r\n\r\n if (k > 57 && k < 65) {\r\n return;\r\n }\r\n\r\n // hit [a-z]\r\n\r\n if (k > 90) {\r\n return;\r\n }\r\n\r\n if (config.autocomplete) {\r\n if (0.5 <= Math.random()) {\r\n CodeMirror.commands.autocompleteAfterDot(cm);\r\n }\r\n }\r\n });\r\n\r\n editor.setSize('100%', $(\".edit-panel\").height() - $(\".edit-panel .tabs\").height());\r\n editor.setOption(\"mode\", data.mode);\r\n editor.setOption(\"gutters\", [\"CodeMirror-lint-markers\", \"CodeMirror-foldgutter\"]);\r\n\r\n if (\"wide\" !== config.keymap) {\r\n editor.setOption(\"keyMap\", config.keymap);\r\n }\r\n\r\n if (\"text/x-go\" === data.mode || \"application/json\" === data.mode) {\r\n editor.setOption(\"lint\", true);\r\n }\r\n\r\n if (\"application/xml\" === data.mode || \"text/html\" === data.mode) {\r\n editor.setOption(\"autoCloseTags\", true);\r\n }\r\n\r\n wide.curEditor = editor;\r\n editors.data.push({\r\n \"editor\": editor,\r\n \"id\": id\r\n });\r\n\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n\r\n var half = Math.floor(wide.curEditor.getScrollInfo().clientHeight / wide.curEditor.defaultTextHeight() / 2);\r\n var cursorCoords = wide.curEditor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\r\n wide.curEditor.scrollTo(0, cursorCoords.top);\r\n\r\n editor.setCursor(cursor);\r\n editor.focus();\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file notification.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\nvar notification = {\r\n init: function () {\r\n $(\".notification-count\").click(function () {\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n $(\".bottom-window-group .notification\").focus();\r\n $(this).hide();\r\n });\r\n\r\n this._initWS();\r\n },\r\n _initWS: function () {\r\n var notificationWS = new ReconnectingWebSocket(config.channel + '/notification/ws?sid=' + config.wideSessionId);\r\n\r\n notificationWS.onopen = function () {\r\n console.log('[notification onopen] connected');\r\n };\r\n\r\n notificationWS.onmessage = function (e) {\r\n var data = JSON.parse(e.data),\r\n $notification = $('.bottom-window-group .notification > table'),\r\n notificationHTML = '';\r\n \r\n if (data.cmd && \"init-notification\" === data.cmd) {\r\n console.log('[notification onmessage]' + e.data);\r\n \r\n return;\r\n }\r\n\r\n notificationHTML += '' + data.severity\r\n + '' + data.message\r\n + '' + data.type + '';\r\n $notification.append(notificationHTML);\r\n\r\n $(\".notification-count\").show();\r\n };\r\n\r\n notificationWS.onclose = function (e) {\r\n console.log('[notification onclose] disconnected (' + e.code + ')');\r\n };\r\n\r\n notificationWS.onerror = function (e) {\r\n console.log('[notification onerror]');\r\n };\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file tree.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.1.1, Dec 15, 2015\r\n */\r\nvar tree = {\r\n fileTree: undefined,\r\n // 递归获取当前节点展开中的最后一个节点\r\n getCurrentNodeLastNode: function (node) {\r\n var returnNode = node.children[node.children.length - 1];\r\n if (returnNode.open) {\r\n return tree.getCurrentNodeLastNode(returnNode);\r\n } else {\r\n return returnNode;\r\n }\r\n },\r\n // 按照树展现获取下一个节点\r\n getNextShowNode: function (node) {\r\n if (node.level !== 0) {\r\n if (node.getParentNode().getNextNode()) {\r\n return node.getParentNode().getNextNode();\r\n } else {\r\n return tree.getNextShowNode(node.getParentNode());\r\n }\r\n } else {\r\n return node.getNextNode();\r\n }\r\n },\r\n isBottomNode: function (node) {\r\n if (node.open) {\r\n return false;\r\n }\r\n\r\n if (node.getParentNode()) {\r\n if (node.getParentNode().isLastNode) {\r\n return tree.isBottomNode(node.getParentNode());\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n if (node.isLastNode) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n },\r\n getTIdByPath: function (path) {\r\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n if (nodes[i].path === path) {\r\n return nodes[i].tId;\r\n }\r\n }\r\n\r\n return undefined;\r\n },\r\n getOpenPaths: function () {\r\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes()),\r\n paths = [];\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n if (nodes[i].open) {\r\n paths.push(nodes[i].path);\r\n }\r\n }\r\n\r\n return paths;\r\n },\r\n getAllParents: function (node, parents) {\r\n if (!parents) {\r\n parents = [];\r\n }\r\n\r\n if (!node || !node.parentTId) {\r\n return parents;\r\n } else {\r\n parents.push(node.getParentNode());\r\n return tree.getAllParents(node.getParentNode(), parents);\r\n }\r\n },\r\n isParents: function (tId, parentPath) {\r\n var node = tree.fileTree.getNodeByTId(tId);\r\n if (!node || !node.parentTId) {\r\n return false;\r\n } else {\r\n var parentNode = tree.fileTree.getNodeByTId(node.parentTId);\r\n if (node.path === parentPath) {\r\n return true;\r\n } else {\r\n return tree.isParents(parentNode.tId, parentPath);\r\n }\r\n }\r\n },\r\n isDir: function () {\r\n if (wide.curNode.iconSkin.indexOf(\"ico-ztree-dir\") === 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n newFile: function (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewFilePrompt\").dialog(\"open\");\r\n },\r\n newDir: function (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewDirPrompt\").dialog(\"open\");\r\n },\r\n removeIt: function (it) {\r\n if (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n } else {\r\n if (!wide.curNode.removable) {\r\n return false;\r\n }\r\n }\r\n\r\n $(\"#dialogRemoveConfirm\").dialog(\"open\");\r\n },\r\n rename: function (it) {\r\n if (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n }\r\n\r\n $(\"#dialogRenamePrompt\").dialog(\"open\");\r\n },\r\n export: function () {\r\n var request = newWideRequest(),\r\n isSucc = false;\r\n request.path = wide.curNode.path;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: config.context + '/file/zip/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n\r\n isSucc = true;\r\n }\r\n });\r\n\r\n if (isSucc) {\r\n window.open(config.context + '/file/zip?path=' + wide.curNode.path + \".zip\");\r\n }\r\n },\r\n crossCompile: function (platform) {\r\n var request = newWideRequest();\r\n request.path = wide.curNode.path;\r\n request.platform = platform;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: config.context + '/cross',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n }\r\n });\r\n },\r\n decompress: function () {\r\n var request = newWideRequest();\r\n request.path = wide.curNode.path;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: config.context + '/file/decompress',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n\r\n var dir = wide.curNode.getParentNode();\r\n tree.fileTree.reAsyncChildNodes(dir, \"refresh\");\r\n }\r\n });\r\n },\r\n refresh: function (it) {\r\n if (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n }\r\n\r\n tree.fileTree.reAsyncChildNodes(wide.curNode, \"refresh\", true);\r\n },\r\n init: function () {\r\n $(\"#file\").click(function () {\r\n $(this).focus();\r\n });\r\n\r\n var request = newWideRequest();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/files',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n var $dirRMenu = $(\"#dirRMenu\");\r\n var $fileRMenu = $(\"#fileRMenu\");\r\n var setting = {\r\n data: {\r\n key: {\r\n title: \"path\"\r\n }\r\n },\r\n view: {\r\n showTitle: true,\r\n selectedMulti: false\r\n },\r\n async: {\r\n enable: true,\r\n url: config.context + \"/file/refresh\",\r\n autoParam: [\"path\"]\r\n },\r\n callback: {\r\n onDblClick: function (event, treeId, treeNode) {\r\n if (treeNode) {\r\n tree.openFile(treeNode);\r\n }\r\n },\r\n onRightClick: function (event, treeId, treeNode) {\r\n if (treeNode && !treeNode.isGOAPI) {\r\n menu.undisabled(['import', 'export', 'git-clone']);\r\n\r\n wide.curNode = treeNode;\r\n tree.fileTree.selectNode(treeNode);\r\n\r\n if (!tree.isDir()) { // if right click on a file\r\n if (wide.curNode.removable) {\r\n $fileRMenu.find(\".remove\").removeClass(\"disabled\");\r\n } else {\r\n $fileRMenu.find(\".remove\").addClass(\"disabled\");\r\n }\r\n\r\n if (-1 === wide.curNode.path.indexOf(\"zip\", wide.curNode.path.length - \"zip\".length)) { // !path.endsWith(\"zip\")\r\n $fileRMenu.find(\".decompress\").hide();\r\n } else {\r\n $fileRMenu.find(\".decompress\").show();\r\n }\r\n\r\n if (-1 === wide.curNode.path.indexOf(\"go\", wide.curNode.path.length - \"go\".length)) { // !path.endsWith(\"go\")\r\n $fileRMenu.find(\".linux64\").hide();\r\n } else {\r\n $fileRMenu.find(\".linux64\").show();\r\n }\r\n\r\n var top = event.clientY - 10;\r\n if ($fileRMenu.height() + top > $('.content').height()) {\r\n top = top - $fileRMenu.height() - 25;\r\n }\r\n $fileRMenu.css({\r\n \"top\": top + \"px\",\r\n \"left\": event.clientX + \"px\",\r\n \"display\": \"block\"\r\n }).show();\r\n\r\n $dirRMenu.hide();\r\n\r\n menu.disabled(['import', 'git-clone']);\r\n } else { // 右击了目录\r\n if (wide.curNode.removable) {\r\n $dirRMenu.find(\".remove\").removeClass(\"disabled\");\r\n } else {\r\n $dirRMenu.find(\".remove\").addClass(\"disabled\");\r\n }\r\n\r\n if (wide.curNode.creatable) {\r\n $dirRMenu.find(\".create\").removeClass(\"disabled\");\r\n } else {\r\n $dirRMenu.find(\".create\").addClass(\"disabled\");\r\n }\r\n\r\n var top = event.clientY - 10;\r\n if ($dirRMenu.height() + top > $('.content').height()) {\r\n top = top - $dirRMenu.height() - 25;\r\n }\r\n\r\n $dirRMenu.css({\r\n \"top\": top + \"px\",\r\n \"left\": event.clientX + \"px\",\r\n \"display\": \"block\"\r\n }).show();\r\n\r\n $fileRMenu.hide();\r\n }\r\n $(\"#files\").focus();\r\n }\r\n },\r\n onClick: function (event, treeId, treeNode, clickFlag) {\r\n if (treeNode) {\r\n wide.curNode = treeNode;\r\n tree.fileTree.selectNode(treeNode);\r\n\r\n menu.undisabled(['import', 'export', 'git-clone']);\r\n if (!tree.isDir()) {\r\n menu.disabled(['import', 'git-clone']);\r\n }\r\n\r\n $(\"#files\").focus();\r\n }\r\n }\r\n }\r\n };\r\n tree.fileTree = $.fn.zTree.init($(\"#files\"), setting, result.data.children);\r\n\r\n session.restore();\r\n }\r\n }\r\n });\r\n\r\n this._initSearch();\r\n this._initRename();\r\n },\r\n openFile: function (treeNode, cursor) {\r\n wide.curNode = treeNode;\r\n var tempCursor = cursor;\r\n\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n // 该节点文件已经打开\r\n if (editors.data[i].id === treeNode.path) {\r\n editors.tabs.setCurrent(treeNode.path);\r\n wide.curEditor = editors.data[i].editor;\r\n\r\n if (!tempCursor) {\r\n tempCursor = wide.curEditor.getCursor();\r\n }\r\n $(\".footer .cursor\").text('| ' + (tempCursor.line + 1) + ':' + (tempCursor.ch + 1) + ' |');\r\n\r\n wide.curEditor.setCursor(tempCursor);\r\n var half = Math.floor(wide.curEditor.getScrollInfo().clientHeight / wide.curEditor.defaultTextHeight() / 2);\r\n var cursorCoords = wide.curEditor.cursorCoords({line: tempCursor.line - half, ch: 0}, \"local\");\r\n wide.curEditor.scrollTo(0, cursorCoords.top);\r\n wide.curEditor.focus();\r\n\r\n wide.refreshOutline();\r\n return false;\r\n }\r\n }\r\n\r\n if (!tree.isDir()) {\r\n var request = newWideRequest();\r\n request.path = treeNode.path;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: config.context + '/file',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n\r\n var data = result.data;\r\n\r\n if (!data.mode) {\r\n var mode = CodeMirror.findModeByFileName(treeNode.path);\r\n if (mode) {\r\n data.mode = mode.mime;\r\n } else {\r\n data.mode = 'text/plain';\r\n }\r\n }\r\n\r\n if (!data.mode) {\r\n console.error(\"Can't find mode by file name [\" + treeNode.path + \"]\");\r\n }\r\n\r\n if (\"img\" === data.mode) { // 是图片文件的话新建 tab 打开\r\n // 最好是开 tab,但这个最终取决于浏览器设置\r\n var w = window.open(config.context + data.path);\r\n return false;\r\n }\r\n\r\n if (!tempCursor) {\r\n tempCursor = CodeMirror.Pos(0, 0);\r\n }\r\n\r\n editors.newEditor(data, tempCursor);\r\n\r\n wide.refreshOutline();\r\n }\r\n });\r\n }\r\n },\r\n _initSearch: function () {\r\n $(\"#dialogSearchForm > input:eq(0)\").keyup(function (event) {\r\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\r\n $okBtn.click();\r\n }\r\n\r\n if ($.trim($(this).val()) === \"\") {\r\n $okBtn.prop(\"disabled\", true);\r\n } else {\r\n $okBtn.prop(\"disabled\", false);\r\n }\r\n });\r\n\r\n $(\"#dialogSearchForm > input:eq(1)\").keyup(function (event) {\r\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\r\n $okBtn.click();\r\n }\r\n });\r\n\r\n $(\"#dialogSearchForm\").dialog({\r\n \"modal\": true,\r\n \"height\": 80,\r\n \"width\": 260,\r\n \"title\": config.label.search,\r\n \"okText\": config.label.search,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogSearchForm > input:eq(0)\").val('').focus();\r\n $(\"#dialogSearchForm > input:eq(1)\").val('');\r\n $(\"#dialogSearchForm\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest();\r\n\r\n if (!wide.curNode) {\r\n request.dir = \"\";\r\n } else {\r\n request.dir = wide.curNode.path;\r\n }\r\n\r\n request.text = $(\"#dialogSearchForm > input:eq(0)\").val();\r\n request.extension = $(\"#dialogSearchForm > input:eq(1)\").val();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/file/search/text',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n $(\"#dialogSearchForm\").dialog(\"close\");\r\n editors.appendSearch(result.data, 'founds', request.text);\r\n }\r\n });\r\n }\r\n });\r\n },\r\n _initRename: function () {\r\n $(\"#dialogRenamePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.rename,\r\n \"okText\": config.label.rename,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogRenamePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n $(\"#dialogRenamePrompt > input\").val(wide.curNode.name).select().focus();\r\n },\r\n \"ok\": function () {\r\n var name = $(\"#dialogRenamePrompt > input\").val(),\r\n request = newWideRequest();\r\n\r\n request.oldPath = wide.curNode.path;\r\n request.newPath = wide.curNode.path.substring(0, wide.curNode.path.lastIndexOf(\"/\") + 1) + name;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/file/rename',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogRenamePrompt\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogRenamePrompt\").dialog(\"close\");\r\n }\r\n });\r\n }\r\n });\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file wide.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\nvar wide = {\r\n curNode: undefined,\r\n curEditor: undefined,\r\n curProcessId: undefined, // curent running process id (pid)\r\n refreshOutline: function () {\r\n if (!wide.curEditor ||\r\n (wide.curEditor && wide.curEditor.doc.getMode().name !== \"go\")) {\r\n $(\"#outline\").html('');\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.code = wide.curEditor.getValue();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n async: false,\r\n url: config.context + '/outline',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n var data = result.data;\r\n\r\n var outlineHTML = '
      ',\r\n decls = ['constDecls', 'varDecls', 'funcDecls',\r\n 'structDecls', 'interfaceDecls', 'typeDecls'];\r\n\r\n for (var i = 0, max = decls.length; i < max; i++) {\r\n var key = decls[i];\r\n for (var j = 0, maxj = data[key].length; j < maxj; j++) {\r\n var obj = data[key][j];\r\n outlineHTML += '
    • ' + obj.Name + '
    • ';\r\n }\r\n }\r\n $(\"#outline\").html(outlineHTML + '
    ');\r\n\r\n $(\"#outline li\").dblclick(function () {\r\n var $it = $(this),\r\n cursor = CodeMirror.Pos($it.data('line'), $it.data(\"ch\"));\r\n\r\n var editor = wide.curEditor;\r\n editor.setCursor(cursor);\r\n\r\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\r\n var cursorCoords = editor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\r\n editor.scrollTo(0, cursorCoords.top);\r\n\r\n editor.focus();\r\n });\r\n }\r\n });\r\n },\r\n _initDialog: function () {\r\n $(\".dialog-prompt > input\").keyup(function (event) {\r\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\r\n $okBtn.click();\r\n }\r\n\r\n if ($.trim($(this).val()) === \"\") {\r\n $okBtn.prop(\"disabled\", true);\r\n } else {\r\n $okBtn.prop(\"disabled\", false);\r\n }\r\n });\r\n\r\n $(\"#dialogAlert\").dialog({\r\n \"modal\": true,\r\n \"height\": 40,\r\n \"width\": 350,\r\n \"title\": config.label.tip,\r\n \"hiddenOk\": true,\r\n \"cancelText\": config.label.confirm,\r\n \"afterOpen\": function (msg) {\r\n $(\"#dialogAlert\").html(msg);\r\n }\r\n });\r\n\r\n $(\"#dialogRemoveConfirm\").dialog({\r\n \"modal\": true,\r\n \"height\": 36,\r\n \"width\": 260,\r\n \"title\": config.label.delete,\r\n \"okText\": config.label.delete,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogRemoveConfirm > b\").html('\"' + wide.curNode.name + '\"');\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest();\r\n request.path = wide.curNode.path;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/file/remove',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogRemoveConfirm\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogRemoveConfirm\").dialog(\"close\");\r\n }\r\n });\r\n }\r\n });\r\n\r\n $(\"#dialogNewFilePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.create_file,\r\n \"okText\": config.label.create,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogNewFilePrompt > input\").val('').focus();\r\n $(\"#dialogNewFilePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest(),\r\n name = $(\"#dialogNewFilePrompt > input\").val();\r\n\r\n request.path = wide.curNode.path + \"/\" + name;\r\n request.fileType = \"f\";\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/file/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogNewFilePrompt\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewFilePrompt\").dialog(\"close\");\r\n\r\n setTimeout(function () { // Delay, waiting the file change notified and then open it\r\n var tId = tree.getTIdByPath(request.path);\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n }, 100);\r\n }\r\n });\r\n }\r\n });\r\n\r\n $(\"#dialogNewDirPrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.create_dir,\r\n \"okText\": config.label.create,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogNewDirPrompt > input\").val('').focus();\r\n $(\"#dialogNewDirPrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var name = $(\"#dialogNewDirPrompt > input\").val(),\r\n request = newWideRequest();\r\n\r\n request.path = wide.curNode.path + \"/\" + name;\r\n request.fileType = \"d\";\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/file/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogNewDirPrompt\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewDirPrompt\").dialog(\"close\");\r\n }\r\n });\r\n }\r\n });\r\n\r\n $(\"#dialogGoFilePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 320,\r\n \"width\": 660,\r\n \"title\": config.label.goto_file,\r\n \"okText\": config.label.go,\r\n \"cancelText\": config.label.cancel,\r\n \"afterInit\": function () {\r\n $(\"#dialogGoFilePrompt\").on(\"dblclick\", \"li\", function () {\r\n var tId = tree.getTIdByPath($(this).find(\".ft-small\").text());\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\r\n wide.curEditor.focus();\r\n });\r\n\r\n $(\"#dialogGoFilePrompt\").on(\"click\", \"li\", function () {\r\n var $list = $(\"#dialogGoFilePrompt > .list\");\r\n $list.find(\"li\").removeClass(\"selected\");\r\n $list.data(\"index\", $(this).data(\"index\"));\r\n $(this).addClass(\"selected\");\r\n });\r\n\r\n hotkeys.bindList($(\"#dialogGoFilePrompt > input\"), $(\"#dialogGoFilePrompt > .list\"), function ($selected) {\r\n var tId = tree.getTIdByPath($selected.find(\".ft-small\").text());\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\r\n wide.curEditor.focus();\r\n });\r\n\r\n $(\"#dialogGoFilePrompt > input\").bind(\"input\", function () {\r\n var name = $(\"#dialogGoFilePrompt > input\").val();\r\n\r\n var request = newWideRequest();\r\n request.path = '';\r\n request.name = '*' + name + '*';\r\n if (wide.curNode) {\r\n request.path = wide.curNode.path;\r\n }\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/file/find/name',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n var data = result.data;\r\n\r\n var goFileHTML = '';\r\n for (var i = 0, max = data.length; i < max; i++) {\r\n var path = data[i].path,\r\n name = path.substr(path.lastIndexOf(\"/\") + 1),\r\n icoSkin = wide.getClassBySuffix(name.split(\".\")[1]);\r\n if (i === 0) {\r\n goFileHTML += '
  • '\r\n + name + '    '\r\n + path + '
  • ';\r\n } else {\r\n goFileHTML += '
  • '\r\n + name + '    '\r\n + path + '
  • ';\r\n }\r\n }\r\n\r\n $(\"#dialogGoFilePrompt > ul\").html(goFileHTML);\r\n }\r\n });\r\n });\r\n },\r\n \"afterOpen\": function () {\r\n $(\"#dialogGoFilePrompt > input\").val('').focus();\r\n $(\"#dialogGoFilePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n $(\"#dialogGoFilePrompt .list\").html('').data(\"index\", 0);\r\n },\r\n \"ok\": function () {\r\n var tId = tree.getTIdByPath($(\"#dialogGoFilePrompt .selected .ft-small\").text());\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\r\n wide.curEditor.focus();\r\n }\r\n });\r\n\r\n $(\"#dialogGoLinePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.goto_line,\r\n \"okText\": config.label.go,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogGoLinePrompt > input\").val('').focus();\r\n $(\"#dialogGoLinePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var line = parseInt($(\"#dialogGoLinePrompt > input\").val()) - 1;\r\n $(\"#dialogGoLinePrompt\").dialog(\"close\");\r\n\r\n var editor = wide.curEditor;\r\n var cursor = editor.getCursor();\r\n\r\n editor.setCursor(CodeMirror.Pos(line, cursor.ch));\r\n\r\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\r\n var cursorCoords = editor.cursorCoords({line: line - half, ch: cursor.ch}, \"local\");\r\n editor.scrollTo(0, cursorCoords.top);\r\n\r\n editor.focus();\r\n }\r\n });\r\n },\r\n _initWS: function () {\r\n var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);\r\n outputWS.onopen = function () {\r\n console.log('[output onopen] connected');\r\n };\r\n\r\n outputWS.onmessage = function (e) {\r\n console.log('[output onmessage]' + e.data);\r\n var data = JSON.parse(e.data);\r\n\r\n if (goLintFound) {\r\n goLintFound = [];\r\n }\r\n\r\n if ('run' === data.nextCmd) {\r\n var request = newWideRequest();\r\n request.executable = data.executable;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/run',\r\n data: JSON.stringify(request),\r\n dataType: \"json\"\r\n });\r\n }\r\n\r\n switch (data.cmd) {\r\n case 'run':\r\n var content = $('.bottom-window-group .output > div').html();\r\n if (!wide.curProcessId || '' === content) {\r\n bottomGroup.fillOutput(content + '
    ' + data.output + '
    ');\r\n } else {\r\n bottomGroup.fillOutput(content.replace(/<\\/pre>$/g, data.output + ''));\r\n }\r\n\r\n wide.curProcessId = data.pid;\r\n\r\n break;\r\n case 'run-done':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html().replace(/<\\/pre>$/g, data.output + ''));\r\n\r\n wide.curProcessId = undefined;\r\n $(\"#buildRun\").removeClass(\"ico-stop\")\r\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\r\n\r\n break;\r\n case 'start-build':\r\n case 'start-test':\r\n case 'start-vet':\r\n case 'start-install':\r\n case 'start-get':\r\n bottomGroup.fillOutput(data.output);\r\n\r\n break;\r\n case 'go test':\r\n case 'go vet':\r\n case 'go install':\r\n case 'go get':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\r\n\r\n break;\r\n case 'git clone':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\r\n tree.fileTree.reAsyncChildNodes(wide.curNode, \"refresh\", false);\r\n\r\n break;\r\n case 'build':\r\n case 'cross-build':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\r\n\r\n if (data.lints) { // has build error\r\n var files = {};\r\n\r\n for (var i = 0; i < data.lints.length; i++) {\r\n var lint = data.lints[i];\r\n\r\n goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),\r\n to: CodeMirror.Pos(lint.lineNo, 0),\r\n message: lint.msg, severity: lint.severity});\r\n\r\n files[lint.file] = lint.file;\r\n }\r\n\r\n $(\"#buildRun\").removeClass(\"ico-stop\")\r\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\r\n\r\n // trigger gutter lint\r\n for (var path in files) {\r\n var editor = editors.getEditorByPath(path);\r\n CodeMirror.signal(editor, \"change\", editor);\r\n }\r\n } else {\r\n if ('cross-build' === data.cmd) {\r\n var request = newWideRequest(),\r\n path = null;\r\n request.path = data.executable;\r\n request.name = data.name;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: config.context + '/file/zip/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n\r\n path = result.data;\r\n }\r\n });\r\n\r\n if (path) {\r\n window.open(config.context + '/file/zip?path=' + path + \".zip\");\r\n }\r\n }\r\n }\r\n\r\n break;\r\n }\r\n };\r\n outputWS.onclose = function (e) {\r\n console.log('[output onclose] disconnected (' + e.code + ')');\r\n };\r\n outputWS.onerror = function (e) {\r\n console.log('[output onerror]');\r\n };\r\n },\r\n _initFooter: function () {\r\n $(\".footer .cursor\").dblclick(function () {\r\n $(\"#dialogGoLinePrompt\").dialog(\"open\");\r\n });\r\n },\r\n init: function () {\r\n this._initFooter();\r\n\r\n this._initWS();\r\n\r\n // 点击隐藏弹出层\r\n $(\"body\").bind(\"mouseup\", function (event) {\r\n // MAC 右键文件树失效\r\n if (event.which === 3) {\r\n return false;\r\n }\r\n\r\n $(\".frame\").hide();\r\n\r\n if (!($(event.target).closest(\".frame\").length === 1 || event.target.className === \"frame\")) {\r\n $(\".menu > ul > li\").unbind().removeClass(\"selected\");\r\n menu.subMenu();\r\n }\r\n });\r\n\r\n // 刷新提示\r\n window.onbeforeunload = function () {\r\n if (editors.data.length > 0) {\r\n return config.label.confirm_save;\r\n }\r\n };\r\n\r\n // 禁止鼠标右键菜单\r\n document.oncontextmenu = function () {\r\n return false;\r\n };\r\n\r\n this._initDialog();\r\n },\r\n _save: function (path, editor) {\r\n if (!path) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/file/save',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n // reset the save state\r\n editor.doc.markClean();\r\n $(\".edit-panel .tabs > div\").each(function () {\r\n var $span = $(this).find(\"span:eq(0)\");\r\n if ($span.attr(\"title\") === path) {\r\n $span.removeClass(\"changed\");\r\n }\r\n });\r\n }\r\n });\r\n },\r\n saveFile: function () {\r\n var path = editors.getCurrentPath();\r\n if (!path) {\r\n return false;\r\n }\r\n\r\n var editor = wide.curEditor;\r\n if (editor.doc.isClean()) { // no modification\r\n return false;\r\n }\r\n\r\n if (\"text/x-go\" === editor.getOption(\"mode\")) {\r\n wide.gofmt(path, wide.curEditor); // go fmt will save\r\n\r\n // build the file at once\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n request.nextCmd = \"\"; // build only, no following operation\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/build',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n\r\n // refresh outline\r\n wide.refreshOutline();\r\n\r\n return;\r\n }\r\n\r\n wide._save(path, wide.curEditor);\r\n },\r\n stop: function () {\r\n if ($(\"#buildRun\").hasClass(\"ico-buildrun\")) {\r\n menu.run();\r\n return false;\r\n }\r\n\r\n if (!wide.curProcessId) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.pid = wide.curProcessId;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/stop',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n $(\"#buildRun\").removeClass(\"ico-stop\")\r\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\r\n }\r\n });\r\n },\r\n gofmt: function (path, editor) {\r\n var cursor = editor.getCursor();\r\n var scrollInfo = editor.getScrollInfo();\r\n\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n request.cursorLine = cursor.line;\r\n request.cursorCh = cursor.ch;\r\n\r\n $.ajax({\r\n async: false, // sync\r\n type: 'POST',\r\n url: config.context + '/go/fmt',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n editor.setValue(result.data.code);\r\n editor.setCursor(cursor);\r\n editor.scrollTo(null, scrollInfo.top);\r\n\r\n wide._save(path, editor);\r\n }\r\n }\r\n });\r\n },\r\n fmt: function (path, editor) {\r\n var mode = editor.getOption(\"mode\");\r\n\r\n var cursor = editor.getCursor();\r\n var scrollInfo = editor.getScrollInfo();\r\n\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n request.cursorLine = cursor.line;\r\n request.cursorCh = cursor.ch;\r\n\r\n var formatted = null;\r\n\r\n switch (mode) {\r\n case \"text/x-go\":\r\n $.ajax({\r\n async: false, // sync\r\n type: 'POST',\r\n url: config.context + '/go/fmt',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n formatted = result.data.code;\r\n }\r\n }\r\n });\r\n\r\n break;\r\n case \"text/html\":\r\n formatted = html_beautify(editor.getValue());\r\n break;\r\n case \"text/javascript\":\r\n case \"application/json\":\r\n formatted = js_beautify(editor.getValue());\r\n break;\r\n case \"text/css\":\r\n formatted = css_beautify(editor.getValue());\r\n break;\r\n default :\r\n break;\r\n }\r\n\r\n if (formatted) {\r\n editor.setValue(formatted);\r\n editor.setCursor(cursor);\r\n editor.scrollTo(null, scrollInfo.top);\r\n\r\n wide._save(path, editor);\r\n }\r\n },\r\n getClassBySuffix: function (suffix) {\r\n var iconSkin = \"ico-ztree-other \";\r\n switch (suffix) {\r\n case \"html\":\r\n case \"htm\":\r\n iconSkin = \"ico-ztree-html \";\r\n break;\r\n case \"go\":\r\n iconSkin = \"ico-ztree-go \";\r\n break;\r\n case \"css\":\r\n iconSkin = \"ico-ztree-css \";\r\n break;\r\n case \"txt\":\r\n iconSkin = \"ico-ztree-text \";\r\n break;\r\n case \"sql\":\r\n iconSkin = \"ico-ztree-sql \";\r\n break;\r\n case \"properties\":\r\n iconSkin = \"ico-ztree-pro \";\r\n break;\r\n case \"md\":\r\n iconSkin = \"ico-ztree-md \";\r\n break;\r\n case \"js\", \"json\":\r\n iconSkin = \"ico-ztree-js \";\r\n break;\r\n case \"xml\":\r\n iconSkin = \"ico-ztree-xml \";\r\n break;\r\n case \"jpg\":\r\n case \"jpeg\":\r\n case \"bmp\":\r\n case \"gif\":\r\n case \"png\":\r\n case \"svg\":\r\n case \"ico\":\r\n iconSkin = \"ico-ztree-img \";\r\n break;\r\n }\r\n\r\n return iconSkin;\r\n }\r\n};\r\n\r\n$(document).ready(function () {\r\n wide.init();\r\n tree.init();\r\n menu.init();\r\n hotkeys.init();\r\n session.init();\r\n notification.init();\r\n editors.init();\r\n windows.init();\r\n bottomGroup.init();\r\n});\r\n","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file session.js\r\n *\r\n * @author Liyuan Li\r\n * @version 1.1.0.1, Dec 8, 2015\r\n */\r\nvar session = {\r\n init: function () {\r\n this._initWS();\r\n\r\n var getLayoutState = function (paneState) {\r\n var state = 'normal';\r\n if (paneState.isClosed) {\r\n state = 'min';\r\n } else if (paneState.size >= $('body').width()) {\r\n state = 'max';\r\n }\r\n\r\n return state;\r\n };\r\n\r\n // save session content every 30 seconds\r\n setInterval(function () {\r\n var request = newWideRequest(),\r\n filse = [],\r\n fileTree = [],\r\n currentId = editors.getCurrentId(),\r\n currentFile = currentId ? editors.getCurrentPath() : \"\";\r\n\r\n editors.tabs.obj._$tabs.find(\"div\").each(function () {\r\n var $it = $(this);\r\n if ($it.find(\"span:eq(0)\").attr(\"title\") !== config.label.start_page) {\r\n filse.push($it.find(\"span:eq(0)\").attr(\"title\"));\r\n }\r\n });\r\n\r\n fileTree = tree.getOpenPaths();\r\n\r\n request.currentFile = currentFile; // current editor file\r\n request.fileTree = fileTree; // file tree expansion state\r\n request.files = filse; // editor tabs\r\n\r\n\r\n request.layout = {\r\n \"side\": {\r\n \"size\": windows.outerLayout.west.state.size,\r\n \"state\": getLayoutState(windows.outerLayout.west.state)\r\n },\r\n \"sideRight\": {\r\n \"size\": windows.innerLayout.east.state.size,\r\n \"state\": getLayoutState(windows.innerLayout.east.state)\r\n },\r\n \"bottom\": {\r\n \"size\": windows.innerLayout.south.state.size,\r\n \"state\": getLayoutState(windows.innerLayout.south.state)\r\n }\r\n };\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/session/save',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n }\r\n });\r\n }, 30000);\r\n },\r\n restore: function () {\r\n if (!config.latestSessionContent) {\r\n return;\r\n }\r\n\r\n var fileTree = config.latestSessionContent.fileTree,\r\n files = config.latestSessionContent.files,\r\n currentFile = config.latestSessionContent.currentFile,\r\n id = \"\",\r\n nodesToOpen = [];\r\n\r\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());\r\n\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n // expand tree\r\n for (var j = 0, jj = fileTree.length; j < jj; j++) {\r\n if (nodes[i].path === fileTree[j]) {\r\n // expand this node only if its parents are open\r\n var parents = tree.getAllParents(tree.fileTree.getNodeByTId(nodes[i].tId)),\r\n isOpen = true;\r\n for (var l = 0, max = parents.length; l < max; l++) {\r\n if (parents[l].open === false) {\r\n isOpen = false;\r\n }\r\n }\r\n if (isOpen) {\r\n tree.fileTree.expandNode(nodes[i], true, false, true);\r\n } else {\r\n // flag it is open\r\n nodes[i].open = true;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // open editors\r\n for (var k = 0, kk = files.length; k < kk; k++) {\r\n if (nodes[i].path === files[k]) {\r\n nodesToOpen.push(nodes[i]);\r\n break;\r\n }\r\n }\r\n\r\n if (nodes[i].path === currentFile) {\r\n id = nodes[i].path;\r\n\r\n // FIXME: 上面的展开是异步进行的,所以执行到这里的时候可能还没有展开完,导致定位不了可视区域\r\n tree.fileTree.selectNode(nodes[i]);\r\n wide.curNode = nodes[i];\r\n }\r\n }\r\n\r\n // handle the open sequence of editors\r\n for (var m = 0, mm = files.length; m < mm; m++) {\r\n for (var n = 0, nn = nodesToOpen.length; n < nn; n++) {\r\n if (nodesToOpen[n].path === files[m]) {\r\n tree.openFile(nodesToOpen[n]);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // set the current editor\r\n editors.tabs.setCurrent(id);\r\n for (var c = 0, max = editors.data.length; c < max; c++) {\r\n if (id === editors.data[c].id) {\r\n wide.curEditor = editors.data[c].editor;\r\n break;\r\n }\r\n } \r\n },\r\n _initWS: function () {\r\n // Used for session retention, server will release all resources of the session if this channel closed\r\n var sessionWS = new ReconnectingWebSocket(config.channel + '/session/ws?sid=' + config.wideSessionId);\r\n\r\n sessionWS.onopen = function () {\r\n console.log('[session onopen] connected');\r\n\r\n var dateFormat = function (time, fmt) {\r\n var date = new Date(time);\r\n var dateObj = {\r\n \"M+\": date.getMonth() + 1,\r\n \"d+\": date.getDate(),\r\n \"h+\": date.getHours(),\r\n \"m+\": date.getMinutes(),\r\n \"s+\": date.getSeconds(),\r\n \"q+\": Math.floor((date.getMonth() + 3) / 3),\r\n \"S\": date.getMilliseconds()\r\n };\r\n if (/(y+)/.test(fmt))\r\n fmt = fmt.replace(RegExp.$1, (date.getFullYear() + \"\").substr(4 - RegExp.$1.length));\r\n for (var k in dateObj)\r\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\r\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1)\r\n ? (dateObj[k]) : ((\"00\" + dateObj[k]).substr((\"\" + dateObj[k]).length)));\r\n }\r\n return fmt;\r\n };\r\n\r\n var data = {type: \"Network\", severity: \"INFO\",\r\n message: \"Connected to server [sid=\" + config.wideSessionId + \"], \" + dateFormat(new Date().getTime(), 'yyyy-MM-dd hh:mm:ss')},\r\n $notification = $('.bottom-window-group .notification > table'),\r\n notificationHTML = '';\r\n\r\n notificationHTML += '' + data.severity\r\n + '' + data.message\r\n + '' + data.type + '';\r\n $notification.append(notificationHTML);\r\n };\r\n\r\n sessionWS.onmessage = function (e) {\r\n var data = JSON.parse(e.data);\r\n switch (data.cmd) {\r\n case 'create-file':\r\n var node = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.dir)),\r\n name = data.path.replace(data.dir + '/', ''),\r\n mode = CodeMirror.findModeByFileName(name),\r\n iconSkin = wide.getClassBySuffix(name.split(\".\")[1]);\r\n\r\n if (data.type && data.type === 'f') {\r\n tree.fileTree.addNodes(node, [{\r\n \"id\": data.path,\r\n \"name\": name,\r\n \"iconSkin\": iconSkin,\r\n \"path\": data.path,\r\n \"mode\": mode,\r\n \"removable\": true,\r\n \"creatable\": true\r\n }]);\r\n\r\n } else {\r\n tree.fileTree.addNodes(node, [{\r\n \"id\": data.path,\r\n \"name\": name,\r\n \"iconSkin\": \"ico-ztree-dir \",\r\n \"path\": data.path,\r\n \"removable\": true,\r\n \"creatable\": true,\r\n \"isParent\": true\r\n }]);\r\n }\r\n break;\r\n case 'remove-file':\r\n case 'rename-file':\r\n var node = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.path));\r\n tree.fileTree.removeNode(node);\r\n\r\n var nodes = tree.fileTree.transformToArray(node);\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n editors.tabs.del(nodes[i].path);\r\n }\r\n\r\n break;\r\n }\r\n };\r\n sessionWS.onclose = function (e) {\r\n console.log('[session onclose] disconnected (' + e.code + ')');\r\n\r\n var data = {type: \"Network\", severity: \"ERROR\",\r\n message: \"Disconnected from server, trying to reconnect it [sid=\" + config.wideSessionId + \"]\"},\r\n $notification = $('.bottom-window-group .notification > table'),\r\n notificationHTML = '';\r\n\r\n notificationHTML += '' + data.severity\r\n + '' + data.message\r\n + '' + data.type + '';\r\n $notification.append(notificationHTML);\r\n\r\n $(\".notification-count\").show();\r\n };\r\n sessionWS.onerror = function (e) {\r\n console.log('[session onerror]');\r\n };\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file menu.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.1.3, Oct 5, 2018\r\n */\r\nvar menu = {\r\n init: function () {\r\n this.subMenu();\r\n this._initPreference();\r\n this._initAbout();\r\n this._initShare();\r\n\r\n // 点击子菜单后消失\r\n $(\".menu .frame li\").click(function () {\r\n $(\".menu > ul > li\").unbind().removeClass(\"selected\");\r\n menu.subMenu();\r\n });\r\n },\r\n _initShare: function () {\r\n $(\".menu .ico-share\").hover(function () {\r\n $(\".menu .share-panel\").show();\r\n });\r\n\r\n $(\".share-panel .font-ico\").click(function () {\r\n var key = $(this).attr('class').split('-')[2];\r\n var url = \"https://wide.b3log.org\", pic = 'https://wide.b3log.org/static/images/wide-logo.png';\r\n var urls = {};\r\n urls.email = \"mailto:?subject=\" + $('title').text()\r\n + \"&body=\" + $('meta[name=description]').attr('content') + ' ' + url;\r\n\r\n var twitterShare = encodeURIComponent($('meta[name=description]').attr('content') + \" \" + url + \" #golang\");\r\n urls.twitter = \"https://twitter.com/intent/tweet?status=\" + twitterShare;\r\n\r\n urls.facebook = \"https://www.facebook.com/sharer/sharer.php?u=\" + url;\r\n urls.googleplus = \"https://plus.google.com/share?url=\" + url;\r\n\r\n var title = encodeURIComponent($('title').text() + '. \\n' + $('meta[name=description]').attr('content')\r\n + \" #golang#\");\r\n urls.weibo = \"http://v.t.sina.com.cn/share/share.php?title=\" + title + \"&url=\" + url + \"&pic=\" + pic;\r\n urls.qqz = \"https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=\" + url + \"&sharesource=qzone&title=\" + title+ \"&pics=\" + pic;\r\n\r\n window.open(urls[key], \"_blank\", \"top=100,left=200,width=648,height=618\");\r\n });\r\n },\r\n _initAbout: function () {\r\n $(\"#dialogAbout\").load(config.context + '/about', function () {\r\n $(\"#dialogAbout\").dialog({\r\n \"modal\": true,\r\n \"title\": config.label.about,\r\n \"hideFooter\": true,\r\n \"afterOpen\": function () {\r\n $.ajax({\r\n url: \"https://rhythm.b3log.org/version/wide/latest\",\r\n type: \"GET\",\r\n dataType: \"jsonp\",\r\n jsonp: \"callback\",\r\n success: function (data, textStatus) {\r\n if ($(\"#dialogAbout .version\").text() === data.wideVersion) {\r\n $(\".upgrade\").text(config.label.uptodate);\r\n } else {\r\n $(\".upgrade\").html(config.label.new_version_available + config.label.colon\r\n + \"\" + data.wideVersion + \"\");\r\n }\r\n }\r\n });\r\n }\r\n });\r\n });\r\n },\r\n disabled: function (list) {\r\n for (var i = 0, max = list.length; i < max; i++) {\r\n $(\".menu li.\" + list[i]).addClass(\"disabled\");\r\n }\r\n },\r\n undisabled: function (list) {\r\n for (var i = 0, max = list.length; i < max; i++) {\r\n $(\".menu li.\" + list[i]).removeClass(\"disabled\");\r\n }\r\n },\r\n // 焦点不在菜单上时需点击展开子菜单,否则为鼠标移动展开\r\n subMenu: function () {\r\n $(\".menu > ul > li\").click(function (event) {\r\n if ($(event.target).closest(\".frame\").length === 1) {\r\n return;\r\n }\r\n var $it = $(this);\r\n $it.find('.frame').show();\r\n $(\".menu > ul > li\").removeClass(\"selected\");\r\n $(this).addClass(\"selected\");\r\n\r\n $(\".menu > ul > li\").unbind();\r\n\r\n $(\".menu > ul > li\").mouseover(function () {\r\n if ($(event.target).closest(\".frame\").length === 1) {\r\n return;\r\n }\r\n $(\".menu .frame\").hide();\r\n $(this).find('.frame').show();\r\n $(\".menu > ul > li\").removeClass(\"selected\");\r\n $(this).addClass(\"selected\");\r\n });\r\n });\r\n },\r\n openPreference: function () {\r\n $(\"#dialogPreference\").dialog(\"open\");\r\n },\r\n saveAllFiles: function () {\r\n if ($(\".menu li.save-all\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n var path = editors.data[i].id;\r\n var editor = editors.data[i].editor;\r\n\r\n if (\"text/x-go\" === editor.getOption(\"mode\")) {\r\n wide.fmt(path, editor);\r\n } else {\r\n wide._save(path, editor);\r\n }\r\n }\r\n },\r\n closeAllFiles: function () {\r\n if ($(\".menu li.close-all\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n // 设置全部关闭标识\r\n var removeData = [];\r\n $(\".edit-panel .tabs > div\").each(function (i) {\r\n if (i !== 0) {\r\n removeData.push($(this).data(\"index\"));\r\n }\r\n });\r\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\r\n // 开始关闭\r\n $(\".edit-panel .tabs .ico-close:eq(0)\").click();\r\n },\r\n exit: function () {\r\n var request = newWideRequest();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/logout',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n window.location.href = config.context + \"/login\";\r\n }\r\n }\r\n });\r\n },\r\n openAbout: function () {\r\n $(\"#dialogAbout\").dialog(\"open\");\r\n },\r\n goget: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-get\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/go/get',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n goinstall: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-install\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/go/install',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // go test.\r\n test: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-test\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/go/test',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // go vet.\r\n govet: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-vet\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/go/vet',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // Build & Run.\r\n run: function () {\r\n menu.saveAllFiles();\r\n\r\n if ($(\"#buildRun\").hasClass(\"ico-stop\")) {\r\n wide.stop();\r\n return false;\r\n }\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.run\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n request.code = wide.curEditor.getValue();\r\n request.nextCmd = \"run\";\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/build',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n\r\n $(\"#buildRun\").addClass(\"ico-stop\")\r\n .removeClass(\"ico-buildrun\").attr(\"title\", config.label.stop);\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // Build.\r\n build: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.build\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n request.code = wide.curEditor.getValue();\r\n request.nextCmd = \"\"; // build only, no following operation\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/build',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n _initPreference: function () {\r\n $(\"#dialogPreference\").load(config.context + '/preference', function () {\r\n $(\"#dialogPreference input\").keyup(function () {\r\n var isChange = false,\r\n emptys = [],\r\n emptysTip = '';\r\n $(\"#dialogPreference input\").each(function () {\r\n var $it = $(this);\r\n // data-value 如为数字,则不会和 value 一样转换为 String,再次不使用全等\r\n if ($it.val() != $it.data(\"value\")) {\r\n isChange = true;\r\n }\r\n\r\n if ($.trim($it.val()) === '') {\r\n emptys.push($it);\r\n }\r\n });\r\n\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (isChange) {\r\n $okBtn.prop(\"disabled\", false);\r\n } else {\r\n $okBtn.prop(\"disabled\", true);\r\n }\r\n\r\n if (emptys.length === 0) {\r\n $(\"#dialogPreference\").find(\".tip\").html(\"\");\r\n $okBtn.prop(\"disabled\", false);\r\n } else {\r\n for (var i = 0, max = emptys.length; i < max; i++) {\r\n var tabIndex = emptys[i].closest('div').data(\"index\"),\r\n text = $.trim(emptys[i].parent().text());\r\n emptysTip += '[' + $('#dialogPreference .tabs > div[data-index=\"' + tabIndex + '\"]').text()\r\n + '] -> [' + text.substr(0, text.length - 1)\r\n + ']: ' + config.label.no_empty + \"
    \";\r\n }\r\n $(\"#dialogPreference\").find(\".tip\").html(emptysTip);\r\n $okBtn.prop(\"disabled\", true);\r\n }\r\n });\r\n\r\n $(\"#dialogPreference select\").on(\"change\", function () {\r\n var isChange = false;\r\n $(\"#dialogPreference select\").each(function () {\r\n if ($(this).val() !== $(this).data(\"value\")) {\r\n isChange = true;\r\n }\r\n });\r\n\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (isChange) {\r\n $okBtn.prop(\"disabled\", false);\r\n } else {\r\n $okBtn.prop(\"disabled\", true);\r\n }\r\n });\r\n\r\n $(\"#dialogPreference\").dialog({\r\n \"modal\": true,\r\n \"height\": 280,\r\n \"width\": 800,\r\n \"title\": config.label.preference,\r\n \"okText\": config.label.apply,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n $okBtn.prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest(),\r\n $dialogPreference = $(\"#dialogPreference\"),\r\n $fontFamily = $dialogPreference.find(\"input[name=fontFamily]\"),\r\n $fontSize = $dialogPreference.find(\"input[name=fontSize]\"),\r\n $goFmt = $dialogPreference.find(\"select[name=goFmt]\"),\r\n $GoBuildArgsForLinux = $dialogPreference.find(\"input[name=GoBuildArgsForLinux]\"),\r\n $GoBuildArgsForWindows = $dialogPreference.find(\"input[name=GoBuildArgsForWindows]\"),\r\n $GoBuildArgsForDarwin = $dialogPreference.find(\"input[name=GoBuildArgsForDarwin]\"),\r\n $workspace = $dialogPreference.find(\"input[name=workspace]\"),\r\n $password = $dialogPreference.find(\"input[name=password]\"),\r\n $email = $dialogPreference.find(\"input[name=email]\"),\r\n $locale = $dialogPreference.find(\"select[name=locale]\"),\r\n $theme = $dialogPreference.find(\"select[name=theme]\"),\r\n $editorFontFamily = $dialogPreference.find(\"input[name=editorFontFamily]\"),\r\n $editorFontSize = $dialogPreference.find(\"input[name=editorFontSize]\"),\r\n $editorLineHeight = $dialogPreference.find(\"input[name=editorLineHeight]\"),\r\n $editorTheme = $dialogPreference.find(\"select[name=editorTheme]\"),\r\n $editorTabSize = $dialogPreference.find(\"input[name=editorTabSize]\"),\r\n $keymap = $dialogPreference.find(\"select[name=keymap]\");\r\n\r\n $.extend(request, {\r\n \"fontFamily\": $fontFamily.val(),\r\n \"fontSize\": $fontSize.val(),\r\n \"goFmt\": $goFmt.val(),\r\n \"GoBuildArgsForLinux\": $GoBuildArgsForLinux.val(),\r\n \"GoBuildArgsForWindows\": $GoBuildArgsForWindows.val(),\r\n \"GoBuildArgsForDarwin\": $GoBuildArgsForDarwin.val(),\r\n \"workspace\": $workspace.val(),\r\n \"password\": $password.val(),\r\n \"email\": $email.val(),\r\n \"locale\": $locale.val(),\r\n \"theme\": $theme.val(),\r\n \"editorFontFamily\": $editorFontFamily.val(),\r\n \"editorFontSize\": $editorFontSize.val(),\r\n \"editorLineHeight\": $editorLineHeight.val(),\r\n \"editorTheme\": $editorTheme.val(),\r\n \"editorTabSize\": $editorTabSize.val(),\r\n \"keymap\": $keymap.val()\r\n });\r\n\r\n if (config.keymap !== $keymap.val()) {\r\n window.location.reload();\r\n }\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: config.context + '/preference',\r\n data: JSON.stringify(request),\r\n success: function (result, textStatus, jqXHR) {\r\n if (!result.succ) {\r\n return false;\r\n }\r\n\r\n $fontFamily.data(\"value\", $fontFamily.val());\r\n $fontSize.data(\"value\", $fontSize.val());\r\n $goFmt.data(\"value\", $goFmt.val());\r\n $GoBuildArgsForLinux.data(\"value\", $GoBuildArgsForLinux.val());\r\n $GoBuildArgsForWindows.data(\"value\", $GoBuildArgsForWindows.val());\r\n $GoBuildArgsForDarwin.data(\"value\", $GoBuildArgsForDarwin.val());\r\n $workspace.data(\"value\", $workspace.val());\r\n $password.data(\"value\", $password.val());\r\n $email.data(\"value\", $email.val());\r\n $locale.data(\"value\", $locale.val());\r\n $theme.data(\"value\", $theme.val());\r\n $editorFontFamily.data(\"value\", $editorFontFamily.val());\r\n $editorFontSize.data(\"value\", $editorFontSize.val());\r\n $editorLineHeight.data(\"value\", $editorLineHeight.val());\r\n $editorTheme.data(\"value\", $editorTheme.val());\r\n $editorTabSize.data(\"value\", $editorTabSize.val());\r\n $keymap.data(\"value\", $keymap.val());\r\n\r\n // update the config\r\n config.keymap = $keymap.val();\r\n\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n $okBtn.prop(\"disabled\", true);\r\n\r\n $(\"#themesLink\").attr(\"href\", config.staticServer + '/static/css/themes/' + $theme.val() + '.css');\r\n\r\n config.editorTheme = $editorTheme.val();\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n editors.data[i].editor.setOption(\"theme\", $editorTheme.val());\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n new Tabs({\r\n id: \".preference\"\r\n });\r\n });\r\n }\r\n};\r\n","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file windows.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.1.2.2, Feb 16, 2016\r\n */\r\nvar windows = {\r\n isMaxEditor: false,\r\n outerLayout: {},\r\n innerLayout: {},\r\n init: function () {\r\n if (!config.latestSessionContent) {\r\n config.latestSessionContent = {\r\n \"fileTree\": [],\r\n \"files\": [],\r\n \"currentFile\": \"\",\r\n };\r\n }\r\n \r\n if (!config.latestSessionContent.layout) {\r\n config.latestSessionContent.layout = {\r\n \"side\": {\r\n \"size\": 200,\r\n \"state\": 'normal'\r\n },\r\n \"sideRight\": {\r\n \"size\": 200,\r\n \"state\": 'normal'\r\n },\r\n \"bottom\": {\r\n \"size\": 100,\r\n \"state\": 'normal'\r\n }\r\n };\r\n }\r\n\r\n var layout = config.latestSessionContent.layout;\r\n\r\n this.outerLayout = $('body').layout({\r\n north__paneSelector: \".menu\",\r\n center__paneSelector: \".content\",\r\n south__paneSelector: \".footer\",\r\n north__size: 22,\r\n south__size: 19,\r\n spacing_open: 2,\r\n north__spacing_open: 0,\r\n south__spacing_open: 0,\r\n defaults: {\r\n fxSpeed_open: 300,\r\n fxSpeed_close: 100,\r\n fxSettings_close: {\r\n easing: \"easeOutQuint\"\r\n },\r\n fxSettings_open: {\r\n easing: \"easeInQuint\"\r\n }\r\n },\r\n west: {\r\n size: layout.side.size,\r\n paneSelector: \".side\",\r\n togglerLength_open: 0,\r\n togglerLength_closed: 15,\r\n togglerAlign_closed: \"top\",\r\n slideTrigger_open: \"mouseover\",\r\n spacing_closed: 15,\r\n minSize: 100,\r\n togglerClass: \"ico-restore\",\r\n togglerTip_open: config.label.min,\r\n togglerTip_closed: config.label.restore_side,\r\n resizerTip: config.label.resize,\r\n initClosed: (layout.side.state === 'min')\r\n }\r\n });\r\n\r\n this.innerLayout = $('div.content').layout({\r\n spacing_open: 2,\r\n defaults: {\r\n fxSpeed_open: 300,\r\n fxSpeed_close: 100,\r\n fxSettings_close: {\r\n easing: \"easeOutQuint\"\r\n },\r\n fxSettings_open: {\r\n easing: \"easeInQuint\"\r\n }\r\n },\r\n center: {\r\n paneSelector: \".edit-panel\"\r\n },\r\n east: {\r\n size: layout.sideRight.size,\r\n paneSelector: \".side-right\",\r\n togglerLength_open: 0,\r\n togglerLength_closed: 15,\r\n togglerAlign_closed: \"top\",\r\n slideTrigger_open: \"mouseover\",\r\n spacing_closed: 15,\r\n minSize: 100,\r\n togglerClass: \"ico-restore\",\r\n togglerTip_open: config.label.min,\r\n togglerTip_closed: config.label.restore_outline,\r\n resizerTip: config.label.resize,\r\n initClosed: (layout.sideRight.state === 'min')\r\n },\r\n south: {\r\n size: layout.bottom.size,\r\n paneSelector: \".bottom-window-group\",\r\n togglerLength_open: 0,\r\n togglerLength_closed: 15,\r\n togglerAlign_closed: \"top\",\r\n slideTrigger_open: \"mouseover\",\r\n spacing_closed: 16,\r\n minSize: 100,\r\n togglerClass: \"ico-restore\",\r\n togglerTip_open: config.label.min,\r\n togglerTip_closed: config.label.restore_bottom,\r\n resizerTip: config.label.resize,\r\n initClosed: (layout.bottom.state === 'min'),\r\n ondrag_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'drag');\r\n },\r\n onresize_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'resize');\r\n },\r\n onclose_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'close');\r\n },\r\n onopen_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'open');\r\n },\r\n onshow_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'show');\r\n }\r\n }\r\n });\r\n\r\n this.outerLayout.addCloseBtn(\".side .ico-min\", \"west\");\r\n this.innerLayout.addCloseBtn(\".side-right .ico-min\", \"east\");\r\n this.innerLayout.addCloseBtn(\".bottom-window-group .ico-min\", \"south\");\r\n\r\n if (layout.side.state === 'max') {\r\n windows.maxSide();\r\n }\r\n if (layout.sideRight.state === 'max') {\r\n windows.maxSideRight();\r\n }\r\n if (layout.bottom.state === 'max') {\r\n windows.maxBottom();\r\n }\r\n\r\n $(\".toolbars .ico-max\").click(function () {\r\n windows.toggleEditor();\r\n });\r\n\r\n $(\".edit-panel .tabs\").on(\"dblclick\", function () {\r\n windows.toggleEditor();\r\n });\r\n\r\n $(\".bottom-window-group .tabs\").dblclick(function () {\r\n var $it = $(\".bottom-window-group\");\r\n if ($it.hasClass(\"bottom-window-group-max\")) {\r\n windows.restoreBottom();\r\n } else {\r\n windows.maxBottom($it);\r\n }\r\n });\r\n\r\n $(\".side .tabs\").dblclick(function () {\r\n var $it = $(\".side\");\r\n if ($it.hasClass(\"side-max\")) {\r\n windows.restoreSide();\r\n } else {\r\n windows.restoreSide($it);\r\n }\r\n });\r\n\r\n $(\".side-right .tabs\").dblclick(function () {\r\n var $it = $(\".side-right\");\r\n if ($it.hasClass(\"side-right-max\")) {\r\n windows.restoreSideRight();\r\n } else {\r\n windows.maxSideRight($it);\r\n }\r\n });\r\n\r\n $('.bottom-window-group .search').height($('.bottom-window-group .tabs-panel').height());\r\n $(window).resize(function () {\r\n windows.refreshEditor($('.bottom-window-group'));\r\n });\r\n\r\n },\r\n maxEditor: function () {\r\n var $it = $(\".toolbars .font-ico\");\r\n windows.outerLayout.close('west');\r\n windows.innerLayout.close('south');\r\n windows.innerLayout.close('east');\r\n $it.removeClass('ico-max').addClass('ico-restore').attr('title', config.label.min);\r\n windows.isMaxEditor = true;\r\n },\r\n maxBottom: function ($it) {\r\n $it.data('height', $it.height()).addClass(\"bottom-window-group-max\").find('.ico-min').hide();\r\n windows.outerLayout.hide('west');\r\n windows.innerLayout.hide('east');\r\n windows.innerLayout.sizePane('south', $('.content').height());\r\n },\r\n maxSide: function ($it) {\r\n $it.data('width', $it.width()).addClass(\"side-max\").find('.ico-min').hide();\r\n $('.content').hide();\r\n windows.outerLayout.sizePane('west', $('body').width());\r\n },\r\n maxSideRight: function ($it) {\r\n $it.addClass(\"side-right-max\").data('width', $it.width()).find('.ico-min').hide();\r\n windows.outerLayout.hide('west');\r\n windows.innerLayout.hide('south');\r\n windows.innerLayout.sizePane('east', $('body').width());\r\n },\r\n toggleEditor: function () {\r\n var $it = $(\".toolbars .font-ico\");\r\n if ($it.hasClass('ico-restore')) {\r\n windows.restoreEditor();\r\n } else {\r\n windows.maxEditor();\r\n }\r\n },\r\n restoreBottom: function () {\r\n var $it = $(\".bottom-window-group\");\r\n $it.removeClass(\"bottom-window-group-max\").find('.ico-min').show();\r\n windows.outerLayout.show('west');\r\n windows.innerLayout.show('east');\r\n windows.innerLayout.sizePane('south', $it.data('height'));\r\n },\r\n restoreSide: function () {\r\n var $it = $(\".side\");\r\n $it.removeClass(\"side-max\").find('.ico-min').show();\r\n $('.content').show();\r\n windows.outerLayout.sizePane('west', $it.data('width'));\r\n },\r\n restoreSideRight: function () {\r\n var $it = $(\".side-right\");\r\n $it.removeClass(\"side-right-max\").find('.ico-min').show();\r\n windows.outerLayout.show('west');\r\n windows.innerLayout.show('south');\r\n windows.innerLayout.sizePane('east', $it.data('width'));\r\n },\r\n restoreEditor: function () {\r\n windows.outerLayout.open('west');\r\n windows.innerLayout.open('south');\r\n windows.innerLayout.open('east');\r\n windows.isMaxEditor = false;\r\n $(\".toolbars .font-ico\").addClass('ico-max').removeClass('ico-restore').attr('title', config.label.max_editor);\r\n },\r\n refreshEditor: function (pane, type) {\r\n var editorDatas = editors.data,\r\n height = $('.content').height() - pane.height() - 24;\r\n switch (type) {\r\n case 'close':\r\n height = $('.content').height() - 40;\r\n break;\r\n default:\r\n break;\r\n }\r\n for (var i = 0, ii = editorDatas.length; i < ii; i++) {\r\n editorDatas[i].editor.setSize(\"100%\", height);\r\n }\r\n\r\n $('.bottom-window-group .search').height($('.bottom-window-group .tabs-panel').height());\r\n },\r\n flowBottom: function () {\r\n if (windows.innerLayout.south.state.isClosed) {\r\n windows.innerLayout.slideOpen('south');\r\n }\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file hotkeys.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.0.2, Dec 15, 2015\r\n */\r\nvar hotkeys = {\r\n defaultKeyMap: {\r\n // Ctrl-0\r\n goEditor: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 48,\r\n fun: function () {\r\n if (wide.curEditor) {\r\n wide.curEditor.focus();\r\n }\r\n }\r\n },\r\n // Ctrl-1\r\n goFileTree: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 49,\r\n fun: function () {\r\n // 有些元素需设置 tabindex 为 -1 时才可以 focus\r\n if (windows.outerLayout.west.state.isClosed) {\r\n windows.outerLayout.slideOpen('west');\r\n }\r\n $(\"#files\").focus();\r\n }\r\n },\r\n // Ctrl-2\r\n goOutline: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 50,\r\n fun: function () {\r\n if (windows.innerLayout.east.state.isClosed) {\r\n windows.innerLayout.slideOpen('east');\r\n }\r\n\r\n $(\"#outline\").focus();\r\n }\r\n },\r\n // Ctrl-4\r\n goOutput: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 52,\r\n fun: function () {\r\n bottomGroup.tabs.setCurrent(\"output\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .output\").focus();\r\n }\r\n },\r\n // Ctrl-5\r\n goSearch: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 53,\r\n fun: function () {\r\n bottomGroup.tabs.setCurrent(\"search\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .search\").focus();\r\n }\r\n },\r\n // Ctrl-6\r\n goNotification: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 54,\r\n fun: function () {\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n }\r\n },\r\n // Alt-C\r\n clearWindow: {\r\n ctrlKey: false,\r\n altKey: true,\r\n shiftKey: false,\r\n which: 67\r\n },\r\n // Ctrl-D 窗口组切换 \r\n changeEditor: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 68\r\n },\r\n // Ctrl-F search \r\n search: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 70\r\n },\r\n // Ctrl-Q close current editor \r\n closeCurEditor: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 81\r\n },\r\n // Ctrl-R\r\n rename: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 82\r\n },\r\n // Shift-Alt-O 跳转到文件\r\n goFile: {\r\n ctrlKey: false,\r\n altKey: true,\r\n shiftKey: true,\r\n which: 79\r\n },\r\n // F5 Build\r\n build: {\r\n ctrlKey: false,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 116\r\n },\r\n // F6 Build & Run\r\n buildRun: {\r\n ctrlKey: false,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 117\r\n }\r\n },\r\n bindList: function ($source, $list, enterFun) {\r\n $list.data(\"index\", 0);\r\n $source.keydown(function (event) {\r\n var index = $list.data(\"index\"),\r\n count = $list.find(\"li\").length;\r\n\r\n if (count === 0) {\r\n return true;\r\n }\r\n\r\n if (event.which === 38) { // up\r\n index--;\r\n if (index < 0) {\r\n index = count - 1;\r\n }\r\n }\r\n\r\n if (event.which === 40) { // down\r\n index++;\r\n if (index > count - 1) {\r\n index = 0;\r\n }\r\n }\r\n\r\n var $selected = $list.find(\"li:eq(\" + index + \")\");\r\n\r\n if (event.which === 13) { // enter\r\n enterFun($selected);\r\n }\r\n\r\n $list.find(\"li\").removeClass(\"selected\");\r\n $list.data(\"index\", index);\r\n $selected.addClass(\"selected\");\r\n\r\n if (index === 0) {\r\n $list.scrollTop(0);\r\n } else {\r\n if ($selected[0].offsetTop + $list.scrollTop() > $list.height()) {\r\n if (event.which === 40) {\r\n $list.scrollTop($list.scrollTop() + $selected.height());\r\n } else {\r\n $list.scrollTop($selected[0].offsetTop);\r\n }\r\n } else {\r\n $list.scrollTop(0);\r\n }\r\n }\r\n\r\n // 阻止上下键改变光标位置\r\n if (event.which === 38 || event.which === 40 || event.which === 13) {\r\n return false;\r\n }\r\n });\r\n },\r\n _bindOutput: function () {\r\n $(\".bottom-window-group .output\").keydown(function (event) {\r\n var hotKeys = hotkeys.defaultKeyMap;\r\n if (event.altKey === hotKeys.clearWindow.altKey\r\n && event.which === hotKeys.clearWindow.which) { // Alt-C clear output\r\n bottomGroup.clear('output');\r\n\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n });\r\n },\r\n _bindFileTree: function () {\r\n $(\"#files\").keydown(function (event) {\r\n event.preventDefault();\r\n\r\n var hotKeys = hotkeys.defaultKeyMap;\r\n if (event.ctrlKey === hotKeys.search.ctrlKey\r\n && event.which === hotKeys.search.which) { // Ctrl-F 搜索\r\n $(\"#dialogSearchForm\").dialog(\"open\");\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.rename.ctrlKey\r\n && event.which === hotKeys.rename.which) { // Ctrl-R 重命名\r\n if (wide.curNode.removable) {\r\n $(\"#dialogRenamePrompt\").dialog(\"open\");\r\n }\r\n return;\r\n }\r\n\r\n switch (event.which) {\r\n case 46: // delete\r\n tree.removeIt();\r\n break;\r\n case 13: // enter\r\n if (!wide.curNode) {\r\n return false;\r\n }\r\n\r\n if (tree.isDir()) {\r\n if (wide.curNode.open) {\r\n return false;\r\n }\r\n\r\n tree.fileTree.expandNode(wide.curNode, true, false, true);\r\n $(\"#files\").focus();\r\n\r\n break;\r\n }\r\n\r\n tree.openFile(wide.curNode);\r\n\r\n break;\r\n case 38: // up\r\n var node = {};\r\n\r\n if (!wide.curNode) { // select the first one if no node been selected\r\n node = tree.fileTree.getNodeByTId(\"files_1\");\r\n } else {\r\n if (wide.curNode && wide.curNode.isFirstNode && wide.curNode.level === 0) {\r\n return false;\r\n }\r\n\r\n node = wide.curNode.getPreNode();\r\n if (wide.curNode.isFirstNode && wide.curNode.getParentNode()) {\r\n node = wide.curNode.getParentNode();\r\n }\r\n\r\n var preNode = wide.curNode.getPreNode();\r\n if (preNode && tree.isDir() && preNode.open) {\r\n node = tree.getCurrentNodeLastNode(preNode);\r\n }\r\n }\r\n\r\n wide.curNode = node;\r\n tree.fileTree.selectNode(node);\r\n $(\"#files\").focus();\r\n break;\r\n case 40: // down\r\n var node = {};\r\n\r\n if (!wide.curNode) { // select the first one if no node been selected \r\n node = tree.fileTree.getNodeByTId(\"files_1\");\r\n } else {\r\n if (wide.curNode && tree.isBottomNode(wide.curNode)) {\r\n return false;\r\n }\r\n\r\n node = wide.curNode.getNextNode();\r\n if (tree.isDir() && wide.curNode.open) {\r\n node = wide.curNode.children[0];\r\n }\r\n\r\n var nextShowNode = tree.getNextShowNode(wide.curNode);\r\n if (wide.curNode.isLastNode && wide.curNode.level !== 0 && !wide.curNode.open && nextShowNode) {\r\n node = nextShowNode;\r\n }\r\n }\r\n\r\n if (node) {\r\n wide.curNode = node;\r\n tree.fileTree.selectNode(node);\r\n }\r\n\r\n $(\"#files\").focus();\r\n break;\r\n case 37: // left\r\n if (!wide.curNode) {\r\n wide.curNode = tree.fileTree.getNodeByTId(\"files_1\");\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#files\").focus();\r\n return false;\r\n }\r\n\r\n if (!tree.isDir() || !wide.curNode.open) {\r\n return false;\r\n }\r\n\r\n tree.fileTree.expandNode(wide.curNode, false, false, true);\r\n $(\"#files\").focus();\r\n break;\r\n case 39: // right\r\n if (!wide.curNode) {\r\n wide.curNode = tree.fileTree.getNodeByTId(\"files_1\");\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#files\").focus();\r\n return false;\r\n }\r\n\r\n if (!tree.isDir() || wide.curNode.open) {\r\n return false;\r\n }\r\n\r\n tree.fileTree.expandNode(wide.curNode, true, false, true);\r\n $(\"#files\").focus();\r\n\r\n break;\r\n case 116: // F5\r\n if (!wide.curNode || !tree.isDir()) {\r\n return false;\r\n }\r\n\r\n tree.refresh(wide.curNode);\r\n\r\n break;\r\n }\r\n });\r\n },\r\n _bindDocument: function () {\r\n var hotKeys = this.defaultKeyMap;\r\n $(document).keydown(function (event) {\r\n if (event.ctrlKey === hotKeys.goEditor.ctrlKey\r\n && event.which === hotKeys.goEditor.which) { // Ctrl-0 焦点切换到当前编辑器\r\n hotKeys.goEditor.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goFileTree.ctrlKey\r\n && event.which === hotKeys.goFileTree.which) { // Ctrl-1 焦点切换到文件树\r\n hotKeys.goFileTree.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goOutline.ctrlKey\r\n && event.which === hotKeys.goOutline.which) { // Ctrl-2 焦点切换到大纲\r\n hotKeys.goOutline.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goOutput.ctrlKey\r\n && event.which === hotKeys.goOutput.which) { // Ctrl-4 焦点切换到输出窗口 \r\n hotKeys.goOutput.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goSearch.ctrlKey\r\n && event.which === hotKeys.goSearch.which) { // Ctrl-5 焦点切换到搜索窗口 \r\n hotKeys.goSearch.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goNotification.ctrlKey\r\n && event.which === hotKeys.goNotification.which) { // Ctrl-6 焦点切换到通知窗口 \r\n hotKeys.goNotification.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.closeCurEditor.ctrlKey\r\n && event.which === hotKeys.closeCurEditor.which) { // Ctrl-Q 关闭当前编辑器 \r\n $(\".edit-panel .tabs > div.current\").find(\".ico-close\").click();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.changeEditor.ctrlKey\r\n && event.which === hotKeys.changeEditor.which) { // Ctrl-D 窗口组切换\r\n if (document.activeElement.className === \"notification\"\r\n || document.activeElement.className === \"output\"\r\n || document.activeElement.className === \"search\") {\r\n // 焦点在底部窗口组时,对底部进行切换\r\n var tabs = [\"output\", \"search\", \"notification\"],\r\n nextPath = \"\";\r\n for (var i = 0, ii = tabs.length; i < ii; i++) {\r\n if (bottomGroup.tabs.getCurrentId() === tabs[i]) {\r\n if (i < ii - 1) {\r\n nextPath = tabs[i + 1];\r\n } else {\r\n nextPath = tabs[0];\r\n }\r\n break;\r\n }\r\n }\r\n bottomGroup.tabs.setCurrent(nextPath);\r\n $(\".bottom-window-group .\" + nextPath).focus();\r\n\r\n event.preventDefault();\r\n\r\n return false;\r\n }\r\n\r\n if (editors.data.length > 1) {\r\n var nextPath = \"\";\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n var currentId = editors.getCurrentId();\r\n if (currentId) {\r\n if (currentId === editors.data[i].id) {\r\n if (i < ii - 1) {\r\n nextPath = editors.data[i + 1].id;\r\n wide.curEditor = editors.data[i + 1].editor;\r\n } else {\r\n nextPath = editors.data[0].id;\r\n wide.curEditor = editors.data[0].editor;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n editors.tabs.setCurrent(nextPath);\r\n var nextTId = tree.getTIdByPath(nextPath);\r\n wide.curNode = tree.fileTree.getNodeByTId(nextTId);\r\n\r\n tree.fileTree.selectNode(wide.curNode);\r\n wide.refreshOutline();\r\n var cursor = wide.curEditor.getCursor();\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n wide.curEditor.focus();\r\n }\r\n\r\n event.preventDefault();\r\n\r\n return false;\r\n }\r\n\r\n if (event.which === hotKeys.build.which) { // F5 Build\r\n menu.build();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.which === hotKeys.buildRun.which) { // F6 Build & Run\r\n menu.run();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goFile.ctrlKey\r\n && event.altKey === hotKeys.goFile.altKey\r\n && event.shiftKey === hotKeys.goFile.shiftKey\r\n && event.which === hotKeys.goFile.which) { // Shift-Alt-O 跳转到文件\r\n $(\"#dialogGoFilePrompt\").dialog(\"open\");\r\n }\r\n });\r\n },\r\n init: function () {\r\n this._bindFileTree();\r\n this._bindOutput();\r\n this._bindDocument();\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file bottomGroup.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.1.1.1, Mar 15, 2017\r\n */\r\nvar bottomGroup = {\r\n tabs: undefined,\r\n searchTab: undefined,\r\n init: function () {\r\n this._initTabs();\r\n this._initFrame();\r\n\r\n $('.bottom-window-group .output').click(function () {\r\n $(this).focus();\r\n });\r\n\r\n $('.bottom-window-group .output').on('click', '.path', function (event) {\r\n var $path = $(this),\r\n tId = tree.getTIdByPath($path.data(\"path\"));\r\n tree.openFile(tree.fileTree.getNodeByTId(tId),\r\n CodeMirror.Pos($path.data(\"line\") - 1, $path.data(\"column\") - 1));\r\n event.preventDefault();\r\n return false;\r\n });\r\n },\r\n _initFrame: function () {\r\n $(\".bottom-window-group .output\").parent().mouseup(function (event) {\r\n event.stopPropagation();\r\n\r\n if (event.button === 0) { // 左键\r\n $(\".bottom-window-group .frame\").hide();\r\n return;\r\n }\r\n\r\n // event.button === 2 右键\r\n var left = event.screenX,\r\n $it = $(this);\r\n if ($(\".side\").css(\"left\") === \"auto\" || $(\".side\").css(\"left\") === \"0px\") {\r\n left = event.screenX - $(\".side\").width();\r\n }\r\n $(\".bottom-window-group .frame\").show().css({\r\n \"left\": left + \"px\",\r\n \"top\": (event.offsetY + event.target.offsetTop - $it.scrollTop() - 10) + \"px\"\r\n });\r\n return;\r\n });\r\n },\r\n clear: function (id) {\r\n $('.bottom-window-group .' + id + ' > div').text('');\r\n },\r\n resetOutput: function () {\r\n this.clear('output');\r\n bottomGroup.tabs.setCurrent(\"output\");\r\n windows.flowBottom();\r\n },\r\n _initTabs: function () {\r\n this.tabs = new Tabs({\r\n id: \".bottom-window-group\",\r\n clickAfter: function (id) {\r\n this._$tabsPanel.find(\".\" + id).focus();\r\n }\r\n });\r\n },\r\n fillOutput: function (data) {\r\n var $output = $('.bottom-window-group .output');\r\n\r\n data = data.replace(/\\r/g, '');\r\n data = data.replace(/\\n/g, '
    ');\r\n\r\n if (-1 !== data.indexOf(\"
    \")) {\r\n data = Autolinker.link(data);\r\n }\r\n\r\n $output.find(\"div\").html(data);\r\n $output.parent().scrollTop($output[0].scrollHeight);\r\n }\r\n};\r\n"]} \ No newline at end of file +{"version":3,"sources":["tabs.js","dialog.js","editors.js","notification.js","tree.js","wide.js","session.js","menu.js","windows.js","hotkeys.js","bottomGroup.js"],"names":["Tabs","obj","_$tabsPanel","$","id","_$tabs","_stack","this","STACKSIZE","_init","_it","each","data","length","splice","push","extend","prototype","_that","on","event","hasClass","setCurrent","clickAfter","parent","isRemove","removeBefore","del","stopPropagation","_hasId","find","add","getCurrentId","$tabsPanel","append","title","content","after","prevId","$tabs","stack","children","remove","i","removeAfter","path","removeClass","hide","addClass","show","setAfter","tId","tree","getTIdByPath","node","fileTree","getNodeByTId","selectNode","wide","curNode","ii","editors","curEditor","editor","cursor","getCursor","setCursor","focus","refreshOutline","text","line","ch","fn","dialog","version","author","dpuuid","Date","getTime","PROP_NAME","Dialog","_defaults","styleClass","background","panel","main","footer","headerMiddle","headerBg","closeIcon","closeIconHover","_attach","target","settings","uuid","inst","_newInst","replace","_getInst","err","_destroyDialog","removeData","prependTo","unwrap","removeAttr","_getDefaults","windowH","window","height","windowW","width","dialogH","parseInt","dialogW","okText","cancelText","footerHTML","headerHTML","hideFooter","hiddenOk","dialogHTML","bgHTML","modal","document","documentElement","scrollHeight","wrap","cloneObj","clone","get","bind","_close","$buttons","undefined","ok","_bindMove","keyup","keyCode","resize","afterInit","className","mousedown","_document","getElementById","x","clientX","style","left","y","clientY","top","ondragstart","onselectstart","onselect","setCapture","captureEvents","Event","MOUSEMOVE","MOUSEUP","onmousemove","positionX","positionY","onmouseup","releaseCapture","css","close","_closeDialog","_openDialog","msg","$dialog","position","afterOpen","_updateDialog","html","defaults","key","theme","styleName","options","otherArgs","Array","slice","call","arguments","shift","apply","concat","jQuery","autocompleteMutex","tabs","getEditorByPath","click","closeOther","currentIndex","firstIndex","_removeAllMarker","removeIndex","_initClose","ZeroClipboard","button","screenX","attr","init","config","label","tip","fileName","file","confirm_save","fmt","doc","isClean","nextId","menu","disabled","cancelSelectedNode","_initCodeMirrorHotKeys","openStartPage","dateFormat","time","date","dateObj","M+","getMonth","d+","getDate","h+","getHours","m+","getMinutes","s+","getSeconds","q+","Math","floor","S","getMilliseconds","k","test","RegExp","$1","getFullYear","substr","start_page","load","wideSessionId","ajax","url","type","dataType","jsonp","success","textStatus","articles","listHTML","community","article","articlePermalink","articleTitle","articleCreateTime","ret","getCurrentPath","currentPath","CodeMirror","registerHelper","word","cur","curLine","getLine","start","end","charAt","request","newWideRequest","code","getValue","cursorLine","cursorCh","autocompleteHints","state","completionActive","async","JSON","stringify","autocompleteArray","displayText","name","class","substring","console","warn","markClean","setTimeout","list","from","Pos","to","commands","autocompleteAfterDot","cm","mode","getMode","Pass","token","getTokenAt","showHint","hint","go","completeSingle","autocompleteAnyWord","auto","gotoLine","doNothing","exprInfo","result","succ","cursorCoords","copyLinesDown","selectoion","listSelections","anchor","head","max","replaceToLine","replaceRange","offset","setSelection","copyLinesUp","moveLinesUp","moveLinesDown","lastLine","jumpToDecl","openFile","findUsages","appendSearch","selectIdentifier","findWordAt","extendSelection","searcHTML","toLowerCase","contents","matches","split","startIndex","endIndex","j","keyWord","search_no_match","$search","find_usages","search_text","bottomGroup","searchTab","$it","half","getScrollInfo","clientHeight","defaultTextHeight","scrollTo","windows","flowBottom","newEditor","iconSkin","undisabled","textArea","value","fromTextArea","lineNumbers","autofocus","autoCloseBrackets","matchBrackets","highlightSelectionMatches","showToken","rulers","color","column","lineStyle","styleActiveLine","editorTheme","tabSize","editorTabSize","indentUnit","indentWithTabs","foldGutter","cursorHeight","readOnly","isGOAPI","profile","extraKeys","Ctrl-\\",".","Ctrl-/","Ctrl-I","Ctrl-L","Ctrl-E","Ctrl-D","Ctrl-B","Ctrl-S","saveFile","Shift-Ctrl-S","saveAllFiles","Shift-Alt-F","Alt-F7","Shift-Alt-Enter","isMaxEditor","restoreEditor","maxEditor","Shift-Ctrl-Up","Shift-Ctrl-Down","Shift-Alt-Up","Shift-Alt-Down","Shift-Alt-J","emmetCodeMirror","$span","evt","altKey","ctrlKey","shiftKey","which","autocomplete","random","setSize","setOption","keymap","notification","_initWS","notificationWS","ReconnectingWebSocket","channel","onopen","log","onmessage","e","parse","$notification","notificationHTML","cmd","severity","message","onclose","onerror","getCurrentNodeLastNode","returnNode","open","getNextShowNode","level","getParentNode","getNextNode","isBottomNode","isLastNode","nodes","transformToArray","getNodes","getOpenPaths","paths","getAllParents","parents","parentTId","isParents","parentPath","parentNode","isDir","indexOf","newFile","it","newDir","removeIt","removable","rename","export","isSucc","crossCompile","platform","refresh","reAsyncChildNodes","$dirRMenu","$fileRMenu","setting","view","showTitle","selectedMulti","enable","autoParam","callback","onDblClick","treeId","treeNode","onRightClick","creatable","display","onClick","clickFlag","zTree","session","restore","_initSearch","_initRename","tempCursor","findModeByFileName","mime","error","$okBtn","closest","prop","trim","val","search","cancel","dir","extension","select","oldPath","newPath","lastIndexOf","curProcessId","outlineHTML","decls","maxj","Ch","Line","Name","dblclick","_initDialog","confirm","delete","create_file","create","fileType","create_dir","goto_file","$list","hotkeys","bindList","$selected","goFileHTML","icoSkin","getClassBySuffix","goto_line","outputWS","goLintFound","nextCmd","executable","fillOutput","output","pid","build_n_run","lints","files","lint","lineNo","signal","_initFooter","unbind","subMenu","onbeforeunload","oncontextmenu","_save","getOption","gofmt","beforeSend","resetOutput","stop","run","scrollInfo","setValue","formatted","html_beautify","js_beautify","css_beautify","suffix","ready","getLayoutState","paneState","isClosed","size","setInterval","filse","currentFile","layout","side","outerLayout","west","sideRight","innerLayout","east","bottom","south","latestSessionContent","nodesToOpen","jj","isOpen","l","expandNode","kk","m","mm","n","nn","c","sessionWS","addNodes","isParent","removeNode","_initPreference","_initAbout","_initShare","hover","pic","urls","email","twitterShare","encodeURIComponent","twitter","facebook","googleplus","weibo","qqz","about","wideVersion","uptodate","new_version_available","colon","wideDownload","mouseover","openPreference","closeAllFiles","exit","location","href","openAbout","goget","goinstall","govet","build","isChange","emptys","emptysTip","tabIndex","no_empty","preference","$dialogPreference","$fontFamily","$fontSize","$goFmt","$GoBuildArgsForLinux","$GoBuildArgsForWindows","$GoBuildArgsForDarwin","$workspace","$password","$email","$locale","$theme","$editorFontFamily","$editorFontSize","$editorLineHeight","$editorTheme","$editorTabSize","$keymap","fontFamily","fontSize","goFmt","GoBuildArgsForLinux","GoBuildArgsForWindows","GoBuildArgsForDarwin","workspace","password","locale","editorFontFamily","editorFontSize","editorLineHeight","reload","jqXHR","north__paneSelector","center__paneSelector","south__paneSelector","north__size","south__size","spacing_open","north__spacing_open","south__spacing_open","fxSpeed_open","fxSpeed_close","fxSettings_close","easing","fxSettings_open","paneSelector","togglerLength_open","togglerLength_closed","togglerAlign_closed","slideTrigger_open","spacing_closed","minSize","togglerClass","togglerTip_open","min","togglerTip_closed","restore_side","resizerTip","initClosed","center","restore_outline","restore_bottom","ondrag_end","pane","refreshEditor","onresize_end","onclose_end","onopen_end","onshow_end","addCloseBtn","maxSide","maxSideRight","maxBottom","toggleEditor","restoreBottom","restoreSide","restoreSideRight","sizePane","max_editor","editorDatas","slideOpen","defaultKeyMap","goEditor","fun","goFileTree","goOutline","goOutput","goSearch","goNotification","clearWindow","changeEditor","closeCurEditor","goFile","buildRun","$source","enterFun","keydown","index","count","scrollTop","offsetTop","_bindOutput","hotKeys","clear","preventDefault","_bindFileTree","isFirstNode","getPreNode","preNode","nextShowNode","_bindDocument","activeElement","nextPath","currentId","nextTId","_initTabs","_initFrame","$path","mouseup","offsetY","$output","Autolinker","link"],"mappings":"AAsBA,IAAIA,KAAO,SAAUC,GACjBA,EAAIC,YAAcC,EAAEF,EAAIG,GAAK,kBAC7BH,EAAII,OAASF,EAAEF,EAAIG,GAAK,YACxBH,EAAIK,OAAS,GAEbC,KAAKN,IAAMA,EACXM,KAAKN,IAAIO,UAAY,GAErBD,KAAKE,MAAMR,GAGX,IAAIS,EAAMH,KACVJ,EAAEF,EAAIG,GAAK,kBAAkBO,KAAK,WAC9B,IAAIP,EAAKD,EAAEI,MAAMK,KAAK,SAClBX,EAAIK,OAAOO,SAAWH,EAAIT,IAAIO,WAC9BP,EAAIK,OAAOQ,OAAO,EAAG,GAErBb,EAAIK,OAAOL,EAAIK,OAAOO,OAAS,KAAOT,GACtCM,EAAIT,IAAIK,OAAOS,KAAKX,MAMhCD,EAAEa,OAAOhB,KAAKiB,UAAW,CACrBR,MAAO,SAAUR,GACb,IAAIiB,EAAQX,KAEZN,EAAII,OAAOc,GAAG,QAAS,MAAO,SAAUC,GACpC,GAAIjB,EAAEI,MAAMc,SAAS,WACjB,OAAO,EAGX,IAAIjB,EAAKD,EAAEI,MAAMK,KAAK,SACtBM,EAAMI,WAAWlB,GACe,mBAApBH,EAAc,YACtBA,EAAIsB,WAAWnB,KAIvBH,EAAII,OAAOc,GAAG,QAAS,aAAc,SAAUC,GAC3C,IAAIhB,EAAKD,EAAEI,MAAMiB,SAASZ,KA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,EAAE,gCAAgCqB,SAAS8tB,QAAQ,SAAUluB,GAGzD,GAFAA,EAAMQ,kBAEe,IAAjBR,EAAMmL,OAAV,CAMA,IAAIpD,EAAO/H,EAAMoL,QACTyJ,EAAM9V,EAAEI,MACe,SAA3BJ,EAAE,SAASiK,IAAI,SAAiD,QAA3BjK,EAAE,SAASiK,IAAI,UACpDjB,EAAO/H,EAAMoL,QAAUrM,EAAE,SAAS2G,SAEtC3G,EAAE,+BAA+B8C,OAAOmH,IAAI,CACxCjB,KAAQA,EAAO,KACfG,IAAQlI,EAAMmuB,QAAUnuB,EAAMwE,OAAOwoB,UAAYnY,EAAIkY,YAAc,GAAM,YAZzEhuB,EAAE,+BAA+B4C,UAiB7CwrB,MAAO,SAAUnuB,GACbD,EAAE,yBAA2BC,EAAK,UAAUiE,KAAK,KAErD2e,YAAa,WACTziB,KAAKguB,MAAM,UACXxY,YAAYlK,KAAKvK,WAAW,UAC5BiV,QAAQC,cAEZ2Y,UAAW,WACP5uB,KAAKsL,KAAO,IAAI7L,KAAK,CACjBI,GAAI,uBACJmB,WAAY,SAAUnB,GAClBG,KAAKL,YAAY4B,KAAK,IAAM1B,GAAI+D,YAI5C2d,WAAY,SAAUlhB,GAClB,IAAI4uB,EAAUrvB,EAAE,iCAKX,KAFLS,GADAA,EAAOA,EAAKqF,QAAQ,MAAO,KACfA,QAAQ,MAAO,UAEX6W,QAAQ,WACpBlc,EAAO6uB,WAAWC,KAAK9uB,IAG3B4uB,EAAQ1tB,KAAK,OAAO+I,KAAKjK,GACzB4uB,EAAQhuB,SAAS2sB,UAAUqB,EAAQ,GAAG3nB","file":"wide.min.js","sourcesContent":["/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file tabs.js\r\n *\r\n * @author Liyuan Li\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\nvar Tabs = function (obj) {\r\n obj._$tabsPanel = $(obj.id + \" > .tabs-panel\");\r\n obj._$tabs = $(obj.id + \" > .tabs\");\r\n obj._stack = [];\r\n\r\n this.obj = obj;\r\n this.obj.STACKSIZE = 64;\r\n\r\n this._init(obj);\r\n\r\n // DOM 元素存在时,应顺序入栈\r\n var _it = this;\r\n $(obj.id + \" > .tabs > div\").each(function () {\r\n var id = $(this).data(\"index\");\r\n if (obj._stack.length === _it.obj.STACKSIZE) {\r\n obj._stack.splice(0, 1);\r\n }\r\n if (obj._stack[obj._stack.length - 1] !== id) {\r\n _it.obj._stack.push(id);\r\n }\r\n });\r\n\r\n};\r\n\r\n$.extend(Tabs.prototype, {\r\n _init: function (obj) {\r\n var _that = this;\r\n\r\n obj._$tabs.on(\"click\", \"div\", function (event) {\r\n if ($(this).hasClass('current')) {\r\n return false;\r\n }\r\n\r\n var id = $(this).data(\"index\");\r\n _that.setCurrent(id);\r\n if (typeof (obj.clickAfter) === \"function\") {\r\n obj.clickAfter(id);\r\n }\r\n });\r\n\r\n obj._$tabs.on(\"click\", \".ico-close\", function (event) {\r\n var id = $(this).parent().data(\"index\"),\r\n isRemove = true;\r\n\r\n if (typeof obj.removeBefore === 'function') {\r\n isRemove = obj.removeBefore(id);\r\n }\r\n\r\n if (isRemove) {\r\n _that.del(id);\r\n }\r\n event.stopPropagation();\r\n });\r\n },\r\n _hasId: function (id) {\r\n var $tabs = this.obj._$tabs;\r\n if ($tabs.find('div[data-index=\"' + id + '\"]').length === 0) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n add: function (data) {\r\n // 添加当前 tab\r\n if (this.getCurrentId() === data.id) {\r\n return false;\r\n }\r\n\r\n // 当前 tab 已经存在\r\n if (this._hasId(data.id)) {\r\n this.setCurrent(data.id);\r\n return false;\r\n }\r\n\r\n var $tabsPanel = this.obj._$tabsPanel,\r\n $tabs = this.obj._$tabs;\r\n\r\n $tabs.append('
    '\r\n + data.title + '
    ');\r\n $tabsPanel.append('
    ' + data.content\r\n + '
    ');\r\n\r\n this.setCurrent(data.id);\r\n\r\n if (typeof data.after === 'function') {\r\n data.after();\r\n }\r\n },\r\n del: function (id) {\r\n var $tabsPanel = this.obj._$tabsPanel,\r\n $tabs = this.obj._$tabs,\r\n stack = this.obj._stack,\r\n prevId = null;\r\n\r\n $tabs.children(\"div[data-index='\" + id + \"']\").remove();\r\n $tabsPanel.children(\"div[data-index='\" + id + \"']\").remove();\r\n\r\n // 移除堆栈中该 id\r\n for (var i = 0; i < stack.length; i++) {\r\n if (id === stack[i]) {\r\n stack.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n\r\n prevId = stack[stack.length - 1];\r\n\r\n if (typeof this.obj.removeAfter === 'function') {\r\n this.obj.removeAfter(id, prevId);\r\n }\r\n\r\n this.setCurrent(prevId);\r\n },\r\n getCurrentId: function () {\r\n var $tabs = this.obj._$tabs;\r\n return $tabs.children(\".current\").data(\"index\");\r\n },\r\n setCurrent: function (path) {\r\n if (!path) {\r\n return false;\r\n }\r\n\r\n var $tabsPanel = this.obj._$tabsPanel,\r\n $tabs = this.obj._$tabs;\r\n\r\n var $currentTab = $tabs.children(\".current\");\r\n if ($currentTab.data(\"index\") === path) {\r\n return false;\r\n }\r\n\r\n // tab 顺序入栈,如栈满则清除\r\n var stack = this.obj._stack;\r\n if (stack.length === this.obj.STACKSIZE) {\r\n stack.splice(0, 1);\r\n }\r\n if (stack[stack.length - 1] !== path) {\r\n this.obj._stack.push(path);\r\n }\r\n\r\n $tabs.children(\"div\").removeClass(\"current\");\r\n $tabsPanel.children(\"div\").hide();\r\n\r\n $tabs.children('div[data-index=\"' + path + '\"]').addClass(\"current\");\r\n $tabsPanel.children('div[data-index=\"' + path + '\"]').show();\r\n\r\n if (typeof this.obj.setAfter === 'function') {\r\n this.obj.setAfter();\r\n }\r\n\r\n var id = this.getCurrentId();\r\n if (\"startPage\" === id) {\r\n return;\r\n }\r\n\r\n // set tree node selected\r\n var tId = tree.getTIdByPath(id);\r\n var node = tree.fileTree.getNodeByTId(tId);\r\n tree.fileTree.selectNode(node);\r\n wide.curNode = node;\r\n\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].id === id) {\r\n wide.curEditor = editors.data[i].editor;\r\n break;\r\n }\r\n }\r\n\r\n if (wide.curEditor) {\r\n var cursor = wide.curEditor.getCursor();\r\n wide.curEditor.setCursor(cursor);\r\n wide.curEditor.focus();\r\n wide.refreshOutline();\r\n\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n }\r\n }\r\n});","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file dialog.js\r\n *\r\n * @author Liyuan Li\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\n(function ($) {\r\n $.fn.extend({\r\n dialog: {\r\n version: \"0.0.1.7\",\r\n author: \"v@b3log.org\"\r\n }\r\n });\r\n\r\n var dpuuid = new Date().getTime();\r\n var PROP_NAME = 'dialog';\r\n\r\n var Dialog = function () {\r\n this._defaults = {\r\n \"styleClass\": {\r\n \"background\": \"dialog-background\",\r\n \"panel\": \"dialog-panel\",\r\n \"main\": \"dialog-main\",\r\n \"footer\": \"dialog-footer\",\r\n \"headerMiddle\": \"dialog-header-middle\",\r\n \"headerBg\": \"dialog-header-bg\",\r\n \"closeIcon\": \"dialog-close-icon\",\r\n \"closeIconHover\": \"dialog-close-icon-hover\",\r\n \"title\": \"dialog-title\"\r\n }\r\n };\r\n };\r\n\r\n $.extend(Dialog.prototype, {\r\n _attach: function (target, settings) {\r\n if (!target.id) {\r\n this.uuid++;\r\n target.id = 'dp' + this.uuid;\r\n }\r\n var inst = this._newInst($(target));\r\n\r\n inst.settings = $.extend({}, settings || {});\r\n $.data(target, PROP_NAME, inst);\r\n this._init(target);\r\n },\r\n /* Create a new instance object. */\r\n _newInst: function (target) {\r\n // escape jQuery meta chars\r\n var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\\\\\$1');\r\n return {\r\n id: id\r\n };\r\n },\r\n _getInst: function (target) {\r\n try {\r\n return $.data(target, PROP_NAME);\r\n } catch (err) {\r\n throw 'Missing instance data for this dialog';\r\n }\r\n },\r\n _destroyDialog: function (target) {\r\n var inst = $.dialog._getInst(target);\r\n var id = inst.id;\r\n $.removeData(target, PROP_NAME);\r\n\r\n $(target).prependTo(\"#\" + id + \"Wrap\").unwrap();\r\n $(target).removeAttr(\"style\");\r\n\r\n var styleClass = this._getDefaults($.dialog._defaults, inst.settings, \"styleClass\");\r\n $(\".\" + styleClass.background).remove();\r\n $(\"#\" + id + \"Dialog\").remove();\r\n },\r\n _init: function (target) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings;\r\n var windowH = $(window).height(),\r\n windowW = $(window).width();\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\"),\r\n dialogH = settings.height ? settings.height : parseInt(windowH * 0.6),\r\n dialogW = settings.width ? settings.width : parseInt(windowW * 0.6);\r\n\r\n // get settings or default value.\r\n settings.title = settings.title ? settings.title : \"\";\r\n settings.okText = settings.okText ? settings.okText : \"Ok\";\r\n settings.cancelText = settings.cancelText ? settings.cancelText : \"Cancel\";\r\n\r\n // build HTML.\r\n var footerHTML = \"\",\r\n headerHTML = \"
    \"\r\n + settings.title + \"
    \";\r\n\r\n // Sets footerHTML.\r\n if (!settings.hideFooter) {\r\n if (!settings.hiddenOk) {\r\n footerHTML = \"\";\r\n }\r\n footerHTML += \"\";\r\n }\r\n\r\n var dialogHTML = \"
    \" + headerHTML\r\n + \"
    \"\r\n + footerHTML + \"
    \";\r\n\r\n var bgHTML = \"\";\r\n if (settings.modal && $(\".\" + styleClass.background).length === 0) {\r\n var bgHeight = windowH < document.documentElement.scrollHeight\r\n ? document.documentElement.scrollHeight : windowH;\r\n bgHTML = \"
    \";\r\n }\r\n\r\n // Package dialog.\r\n $(\"#\" + id).wrap(\"
    \");\r\n var cloneObj = $(target).clone(true);\r\n $(target).remove();\r\n $('body').append(bgHTML + dialogHTML);\r\n $($(\"#\" + id + \"Dialog .\" + styleClass.main + \" div\").get(0)).append(cloneObj);\r\n $(cloneObj).show();\r\n\r\n // Bind event.\r\n $(\"#\" + id + \"Dialog .\" + styleClass.closeIcon).bind(\"click\", function () {\r\n $.dialog._close(id, settings);\r\n });\r\n\r\n var $buttons = $(\"#\" + id + \"Dialog .\" + styleClass.footer + \" button\");\r\n $($buttons.get(1)).bind(\"click\", function () {\r\n $.dialog._close(id, settings);\r\n });\r\n\r\n $($buttons.get(0)).bind(\"click\", function () {\r\n if (settings.ok === undefined || settings.ok()) {\r\n $.dialog._close(id, settings);\r\n }\r\n });\r\n\r\n this._bindMove(id, styleClass.headerBg, dialogH, dialogW);\r\n\r\n // esc exit\r\n $(window).keyup(function (event) {\r\n if (event.keyCode === 27) {\r\n $.dialog._close(id, settings);\r\n }\r\n });\r\n\r\n $(window).resize(function () {\r\n var height = $(\"body\").height() > $(window).height() ? $(\"body\").height() : $(window).height();\r\n $(\".dialog-background\").height(height);\r\n });\r\n\r\n if (typeof settings.afterInit === \"function\") {\r\n settings.afterInit();\r\n }\r\n },\r\n _bindMove: function (id, className) {\r\n $(\"#\" + id + \"Dialog .\" + className).mousedown(function (event) {\r\n var _document = document;\r\n if (!event) {\r\n event = window.event;\r\n }\r\n var dialog = document.getElementById(id + \"Dialog\");\r\n var x = event.clientX - parseInt(dialog.style.left),\r\n y = event.clientY - parseInt(dialog.style.top);\r\n _document.ondragstart = \"return false;\";\r\n _document.onselectstart = \"return false;\";\r\n _document.onselect = \"document.selection.empty();\";\r\n\r\n if (this.setCapture) {\r\n this.setCapture();\r\n } else if (window.captureEvents) {\r\n window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);\r\n }\r\n\r\n _document.onmousemove = function (event) {\r\n if (!event) {\r\n event = window.event;\r\n }\r\n var positionX = event.clientX - x,\r\n positionY = event.clientY - y;\r\n if (positionX < 0) {\r\n positionX = 0;\r\n }\r\n if (positionX > $(window).width() - $(dialog).width()) {\r\n positionX = $(window).width() - $(dialog).width();\r\n }\r\n if (positionY > $(window).height() - $(dialog).height()) {\r\n positionY = $(window).height() - $(dialog).height();\r\n }\r\n if (positionY < 0) {\r\n positionY = 0;\r\n }\r\n dialog.style.left = positionX + \"px\";\r\n dialog.style.top = positionY + \"px\";\r\n };\r\n\r\n _document.onmouseup = function () {\r\n if (this.releaseCapture) {\r\n this.releaseCapture();\r\n } else if (window.captureEvents) {\r\n window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);\r\n }\r\n _document.onmousemove = null;\r\n _document.onmouseup = null;\r\n _document.ondragstart = null;\r\n _document.onselectstart = null;\r\n _document.onselect = null;\r\n };\r\n });\r\n },\r\n _close: function (id, settings) {\r\n if ($(\"#\" + id + \"Dialog\").css(\"display\") === \"none\") {\r\n return;\r\n }\r\n if (settings.close === undefined || settings.close()) {\r\n $(\"#\" + id + \"Dialog\").hide();\r\n if (settings.modal) {\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\r\n $(\".\" + styleClass.background).hide();\r\n }\r\n }\r\n },\r\n _closeDialog: function (target) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings;\r\n $.dialog._close(id, settings);\r\n },\r\n _openDialog: function (target, msg) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings,\r\n top = \"\", left = \"\",\r\n $dialog = $(\"#\" + id + \"Dialog\"),\r\n windowH = $(window).height(),\r\n windowW = $(window).width(),\r\n dialogH = settings.height ? settings.height : parseInt(windowH * 0.6),\r\n dialogW = settings.width ? settings.width : parseInt(windowW * 0.6);\r\n\r\n // Sets position.\r\n if (settings.position) {\r\n top = settings.position.top;\r\n left = settings.position.left;\r\n } else {\r\n // 20(footer) + 23(header)\r\n top = parseInt((windowH - dialogH - 43) / 2);\r\n if (top < 0) {\r\n top = 0;\r\n }\r\n left = parseInt((windowW - dialogW) / 2);\r\n }\r\n $dialog.css({\r\n \"top\": top + \"px\",\r\n \"left\": left + \"px\"\r\n }).show();\r\n\r\n if (settings.modal) {\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\r\n $(\".\" + styleClass.background).show();\r\n }\r\n\r\n if (typeof settings.afterOpen === \"function\") {\r\n settings.afterOpen(msg);\r\n }\r\n\r\n $(\"#\" + id + \"Dialog .dialog-footer button:eq(0)\").focus();\r\n },\r\n _updateDialog: function (target, data) {\r\n var inst = this._getInst(target);\r\n var id = inst.id,\r\n settings = inst.settings;\r\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\r\n $.extend(settings, data);\r\n var $dialog = $(\"#\" + id + \"Dialog\");\r\n if (data.position) {\r\n $dialog.css({\r\n \"top\": data.position.top,\r\n \"left\": data.position.left\r\n });\r\n }\r\n\r\n if (data.width) {\r\n $dialog.width(data.width + 26);\r\n $dialog.find(\".\" + styleClass.main + \" div\")[0].style.width = data.width + \"px\";\r\n $dialog.find(\".\" + styleClass.headerBg).width(data.width + 18);\r\n }\r\n\r\n if (data.height) {\r\n $dialog.find(\".\" + styleClass.main + \" div\")[0].style.height = data.height + \"px\";\r\n }\r\n\r\n if (data.title) {\r\n $dialog.find(\".\" + styleClass.title).html(data.title);\r\n }\r\n\r\n if (data.modal !== undefined) {\r\n if (data.modal) {\r\n $(\".\" + styleClass.background).show();\r\n } else {\r\n $(\".\" + styleClass.background).hide();\r\n }\r\n }\r\n\r\n if (data.hideFooter !== undefined) {\r\n if (data.hideFooter) {\r\n $dialog.find(\".\" + styleClass.footer).hide();\r\n } else {\r\n $dialog.find(\".\" + styleClass.footer).show();\r\n }\r\n }\r\n\r\n },\r\n _getDefaults: function (defaults, settings, key) {\r\n if (key === \"styleClass\") {\r\n if (settings.theme === \"default\" || settings.theme === undefined) {\r\n return defaults.styleClass;\r\n }\r\n settings.styleClass = {};\r\n for (var styleName in defaults[key]) {\r\n settings.styleClass[styleName] = settings.theme + \"-\" + defaults.styleClass[styleName];\r\n }\r\n } else if (key === \"height\" || key === \"width\") {\r\n if (settings[key] === null || settings[key] === undefined) {\r\n return \"auto\";\r\n } else {\r\n return settings[key] + \"px\";\r\n }\r\n } else {\r\n if (settings[key] === null || settings[key] === undefined) {\r\n return defaults[key];\r\n }\r\n }\r\n return settings[key];\r\n }\r\n });\r\n\r\n $.fn.dialog = function (options) {\r\n var otherArgs = Array.prototype.slice.call(arguments);\r\n\r\n if (typeof options === 'string') {\r\n otherArgs.shift();\r\n return $.dialog['_' + options + 'Dialog'].apply($.dialog, [this[0]].concat(otherArgs));\r\n }\r\n return this.each(function () {\r\n $.dialog._attach(this, options);\r\n });\r\n };\r\n\r\n $.dialog = new Dialog();\r\n\r\n // Add another global to avoid noConflict issues with inline event handlers\r\n window['DP_jQuery_' + dpuuid] = $;\r\n})(jQuery);","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file editor.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.1.1.0, Jan 12, 2016\r\n */\r\nvar editors = {\r\n autocompleteMutex: false,\r\n data: [],\r\n tabs: {},\r\n getEditorByPath: function (path) {\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].editor.options.path === path) {\r\n return editors.data[i].editor;\r\n }\r\n }\r\n },\r\n close: function () {\r\n $('.edit-panel .tabs > div[data-index=\"' + $('.edit-panel .frame').data('index') + ']').find('.ico-close').click();\r\n },\r\n closeOther: function () {\r\n var currentIndex = $(\".edit-panel .frame\").data(\"index\");\r\n\r\n // 设置全部关闭标识\r\n var removeData = [];\r\n $(\".edit-panel .tabs > div\").each(function (i) {\r\n if (currentIndex !== $(this).data(\"index\")) {\r\n removeData.push($(this).data(\"index\"));\r\n }\r\n });\r\n if (removeData.length === 0) {\r\n return false;\r\n }\r\n var firstIndex = removeData.splice(0, 1);\r\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\r\n // 开始关闭\r\n $('.edit-panel .tabs > div[data-index=\"' + firstIndex + '\"]').find(\".ico-close\").click();\r\n },\r\n _removeAllMarker: function () {\r\n var removeData = $(\"#dialogCloseEditor\").data(\"removeData\");\r\n if (removeData && removeData.length > 0) {\r\n var removeIndex = removeData.splice(0, 1);\r\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\r\n $('.edit-panel .tabs > div[data-index=\"' + removeIndex + '\"] .ico-close').click();\r\n }\r\n if (wide.curEditor) {\r\n wide.curEditor.focus();\r\n }\r\n },\r\n _initClose: function () {\r\n new ZeroClipboard($(\"#copyFilePath\"));\r\n\r\n // 关闭、关闭其他、关闭所有\r\n $(\".edit-panel\").on(\"mouseup\", '.tabs > div', function (event) {\r\n event.stopPropagation();\r\n\r\n if (event.button === 0) { // 左键\r\n $(\".edit-panel .frame\").hide();\r\n return false;\r\n }\r\n\r\n // event.button === 2 右键\r\n var left = event.screenX;\r\n if ($(\".side\").css(\"left\") === \"auto\" || $(\".side\").css(\"left\") === \"0px\") {\r\n left = event.screenX - $(\".side\").width();\r\n }\r\n $(\".edit-panel .frame\").show().css({\r\n \"left\": left + \"px\",\r\n \"top\": \"21px\"\r\n }).data('index', $(this).data(\"index\"));\r\n\r\n $(\"#copyFilePath\").attr('data-clipboard-text', $(this).find(\"span:eq(0)\").attr(\"title\"));\r\n return false;\r\n });\r\n },\r\n init: function () {\r\n $(\"#dialogCloseEditor\").dialog({\r\n \"modal\": true,\r\n \"height\": 90,\r\n \"width\": 260,\r\n \"title\": config.label.tip,\r\n \"hideFooter\": true,\r\n \"afterOpen\": function (fileName) {\r\n $(\"#dialogCloseEditor > div:eq(0)\").html(config.label.file\r\n + ' ' + fileName + '. ' + config.label.confirm_save + '?');\r\n $(\"#dialogCloseEditor button:eq(0)\").focus();\r\n },\r\n \"afterInit\": function () {\r\n $(\"#dialogCloseEditor button.save\").click(function () {\r\n var i = $(\"#dialogCloseEditor\").data(\"index\");\r\n wide.fmt(editors.data[i].id, editors.data[i].editor);\r\n editors.tabs.del(editors.data[i].id);\r\n $(\"#dialogCloseEditor\").dialog(\"close\");\r\n editors._removeAllMarker();\r\n });\r\n\r\n $(\"#dialogCloseEditor button.discard\").click(function () {\r\n var i = $(\"#dialogCloseEditor\").data(\"index\");\r\n editors.tabs.del(editors.data[i].id);\r\n $(\"#dialogCloseEditor\").dialog(\"close\");\r\n editors._removeAllMarker();\r\n });\r\n\r\n $(\"#dialogCloseEditor button.cancel\").click(function (event) {\r\n $(\"#dialogCloseEditor\").dialog(\"close\");\r\n editors._removeAllMarker();\r\n });\r\n }\r\n });\r\n\r\n editors.tabs = new Tabs({\r\n id: \".edit-panel\",\r\n setAfter: function () {\r\n if (wide.curEditor) {\r\n wide.curEditor.focus();\r\n }\r\n },\r\n clickAfter: function (id) {\r\n if (id === 'startPage') {\r\n wide.curEditor = undefined;\r\n $(\".footer .cursor\").text('');\r\n wide.refreshOutline();\r\n \r\n return false;\r\n }\r\n },\r\n removeBefore: function (id) {\r\n if (id === 'startPage') { // 当前关闭的 tab 是起始页\r\n editors._removeAllMarker();\r\n return true;\r\n }\r\n\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].id === id) {\r\n if (editors.data[i].editor.doc.isClean()) {\r\n editors._removeAllMarker();\r\n return true;\r\n } else {\r\n $(\"#dialogCloseEditor\").dialog(\"open\", $('.edit-panel .tabs > div[data-index=\"'\r\n + editors.data[i].id + '\"] > span:eq(0)').text());\r\n $(\"#dialogCloseEditor\").data(\"index\", i);\r\n return false;\r\n }\r\n\r\n break;\r\n }\r\n }\r\n },\r\n removeAfter: function (id, nextId) {\r\n if ($(\".edit-panel .tabs > div\").length === 0) {\r\n // 全部 tab 都关闭时才 disables 菜单中“全部关闭”的按钮\r\n menu.disabled(['close-all']);\r\n }\r\n\r\n // 移除编辑器\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n if (editors.data[i].id === id) {\r\n editors.data.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n if (editors.data.length === 0) { // 起始页可能存在,所以用编辑器数据判断\r\n menu.disabled(['save-all', 'build', 'run', 'go-test', 'go-vet', 'go-get', 'go-install',\r\n 'find', 'find-next', 'find-previous', 'replace', 'replace-all',\r\n 'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment',\r\n 'edit']);\r\n\r\n // remove selected tree node\r\n tree.fileTree.cancelSelectedNode();\r\n wide.curNode = undefined;\r\n wide.curEditor = undefined;\r\n wide.refreshOutline();\r\n $(\".footer .cursor\").text('');\r\n return false;\r\n }\r\n\r\n if (!nextId) {\r\n // 编辑器区域不存在打开的 Tab\r\n // remove selected tree node\r\n tree.fileTree.cancelSelectedNode();\r\n wide.curNode = undefined;\r\n wide.curEditor = undefined;\r\n wide.refreshOutline();\r\n $(\".footer .cursor\").text('');\r\n return false;\r\n }\r\n\r\n if (nextId === editors.tabs.getCurrentId()) {\r\n // 关闭的不是当前编辑器\r\n return false;\r\n }\r\n }\r\n });\r\n\r\n this._initCodeMirrorHotKeys();\r\n this.openStartPage();\r\n this._initClose();\r\n },\r\n openStartPage: function () {\r\n wide.curEditor = undefined;\r\n wide.refreshOutline();\r\n $(\".footer .cursor\").text('');\r\n\r\n var dateFormat = function (time, fmt) {\r\n var date = new Date(time);\r\n var dateObj = {\r\n \"M+\": date.getMonth() + 1, //月份 \r\n \"d+\": date.getDate(), //日 \r\n \"h+\": date.getHours(), //小时 \r\n \"m+\": date.getMinutes(), //分 \r\n \"s+\": date.getSeconds(), //秒 \r\n \"q+\": Math.floor((date.getMonth() + 3) / 3), //季度 \r\n \"S\": date.getMilliseconds() //毫秒 \r\n };\r\n if (/(y+)/.test(fmt))\r\n fmt = fmt.replace(RegExp.$1, (date.getFullYear() + \"\").substr(4 - RegExp.$1.length));\r\n for (var k in dateObj)\r\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\r\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1)\r\n ? (dateObj[k]) : ((\"00\" + dateObj[k]).substr((\"\" + dateObj[k]).length)));\r\n }\r\n return fmt;\r\n };\r\n\r\n editors.tabs.add({\r\n id: \"startPage\",\r\n title: ' ' + config.label.start_page + '',\r\n content: '
    ',\r\n after: function () {\r\n $(\"#startPage\").load('/start?sid=' + config.wideSessionId);\r\n $.ajax({\r\n url: \"https://hacpai.com/apis/articles?tags=wide,golang&p=1&size=20\",\r\n type: \"GET\",\r\n dataType: \"jsonp\",\r\n jsonp: \"callback\",\r\n success: function (data, textStatus) {\r\n var articles = data.articles;\r\n if (0 === articles.length) {\r\n return;\r\n }\r\n\r\n // 按 size = 20 取,但只保留最多 9 篇\r\n var length = articles.length;\r\n if (length > 9) {\r\n length = 9;\r\n }\r\n\r\n var listHTML = \"\");\r\n }\r\n });\r\n }\r\n });\r\n },\r\n getCurrentId: function () {\r\n var ret = editors.tabs.getCurrentId();\r\n if (ret === 'startPage') {\r\n ret = null;\r\n }\r\n \r\n return ret;\r\n },\r\n getCurrentPath: function () {\r\n var currentPath = $(\".edit-panel .tabs .current span:eq(0)\").attr(\"title\");\r\n if (currentPath === config.label.start_page) {\r\n currentPath = null;\r\n }\r\n return currentPath;\r\n },\r\n _initCodeMirrorHotKeys: function () {\r\n CodeMirror.registerHelper(\"hint\", \"go\", function (editor) {\r\n editor = wide.curEditor; // 使用当前编辑器覆盖实参,因为异步调用的原因,实参不一定正确\r\n var word = /[\\w$]+/;\r\n\r\n var cur = editor.getCursor(), curLine = editor.getLine(cur.line);\r\n\r\n var start = cur.ch, end = start;\r\n while (end < curLine.length && word.test(curLine.charAt(end))) {\r\n ++end;\r\n }\r\n while (start && word.test(curLine.charAt(start - 1))) {\r\n --start;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = editor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n var autocompleteHints = [];\r\n\r\n if (editors.autocompleteMutex && editor.state.completionActive) {\r\n return;\r\n }\r\n\r\n editors.autocompleteMutex = true;\r\n\r\n $.ajax({\r\n async: false, // 同步执行\r\n type: 'POST',\r\n url: '/autocomplete',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (data) {\r\n var autocompleteArray = data[1];\r\n\r\n if (autocompleteArray) {\r\n for (var i = 0; i < autocompleteArray.length; i++) {\r\n var displayText = '',\r\n text = autocompleteArray[i].name;\r\n\r\n switch (autocompleteArray[i].class) {\r\n case \"type\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"const\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"var\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"package\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ' '\r\n + autocompleteArray[i].type + '';\r\n break;\r\n case \"func\":\r\n displayText = ''// + autocompleteArray[i].class \r\n + '' + autocompleteArray[i].name + ''\r\n + autocompleteArray[i].type.substring(4) + '';\r\n text += '()';\r\n break;\r\n default:\r\n console.warn(\"Can't handle autocomplete [\" + autocompleteArray[i].class + \"]\");\r\n break;\r\n }\r\n\r\n autocompleteHints[i] = {\r\n displayText: displayText,\r\n text: text\r\n };\r\n }\r\n }\r\n\r\n editor.doc.markClean();\r\n $(\".edit-panel .tabs .current > span:eq(0)\").removeClass(\"changed\");\r\n }\r\n });\r\n\r\n setTimeout(function () {\r\n editors.autocompleteMutex = false;\r\n }, 20);\r\n\r\n return {list: autocompleteHints, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};\r\n });\r\n\r\n CodeMirror.commands.autocompleteAfterDot = function (cm) {\r\n var mode = cm.getMode();\r\n if (mode && \"go\" !== mode.name) {\r\n return CodeMirror.Pass;\r\n }\r\n\r\n var token = cm.getTokenAt(cm.getCursor());\r\n\r\n if (\"comment\" === token.type || \"string\" === token.type) {\r\n return CodeMirror.Pass;\r\n }\r\n\r\n setTimeout(function () {\r\n if (!cm.state.completionActive) {\r\n cm.showHint({hint: CodeMirror.hint.go, completeSingle: false});\r\n }\r\n }, 50);\r\n\r\n return CodeMirror.Pass;\r\n };\r\n\r\n CodeMirror.commands.autocompleteAnyWord = function (cm) {\r\n cm.showHint({hint: CodeMirror.hint.auto});\r\n };\r\n\r\n CodeMirror.commands.gotoLine = function (cm) {\r\n $(\"#dialogGoLinePrompt\").dialog(\"open\");\r\n };\r\n\r\n // 用于覆盖 cm 默认绑定的某些快捷键功能.\r\n CodeMirror.commands.doNothing = function (cm) {\r\n };\r\n\r\n CodeMirror.commands.exprInfo = function (cm) {\r\n var cur = wide.curEditor.getCursor();\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = wide.curEditor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/exprinfo',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n \r\n var position = wide.curEditor.cursorCoords();\r\n $(\"body\").append('
    ' + result.data + '
    ');\r\n }\r\n });\r\n };\r\n\r\n CodeMirror.commands.copyLinesDown = function (cm) {\r\n var content = '',\r\n selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n for (var i = from.line, max = to.line; i <= max; i++) {\r\n if (to.ch !== 0 || i !== max) { // 下一行选中为0时,不应添加内容\r\n content += '\\n' + cm.getLine(i);\r\n }\r\n }\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n cm.replaceRange(content, CodeMirror.Pos(replaceToLine));\r\n\r\n var offset = replaceToLine - from.line + 1;\r\n cm.setSelection(CodeMirror.Pos(from.line + offset, from.ch),\r\n CodeMirror.Pos(to.line + offset, to.ch));\r\n };\r\n\r\n CodeMirror.commands.copyLinesUp = function (cm) {\r\n var content = '',\r\n selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n for (var i = from.line, max = to.line; i <= max; i++) {\r\n if (to.ch !== 0 || i !== max) { // 下一行选中为0时,不应添加内容\r\n content += '\\n' + cm.getLine(i);\r\n }\r\n }\r\n\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n cm.replaceRange(content, CodeMirror.Pos(replaceToLine));\r\n\r\n cm.setSelection(CodeMirror.Pos(from.line, from.ch),\r\n CodeMirror.Pos(to.line, to.ch));\r\n };\r\n\r\n CodeMirror.commands.moveLinesUp = function (cm) {\r\n var selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n if (from.line === 0) {\r\n return false;\r\n }\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n cm.replaceRange('\\n' + cm.getLine(from.line - 1), CodeMirror.Pos(replaceToLine));\r\n if (from.line === 1) {\r\n // 移除第一行的换行\r\n cm.replaceRange('', CodeMirror.Pos(0, 0),\r\n CodeMirror.Pos(1, 0));\r\n } else {\r\n cm.replaceRange('', CodeMirror.Pos(from.line - 2, cm.getLine(from.line - 2).length),\r\n CodeMirror.Pos(from.line - 1, cm.getLine(from.line - 1).length));\r\n }\r\n\r\n cm.setSelection(CodeMirror.Pos(from.line - 1, from.ch),\r\n CodeMirror.Pos(to.line - 1, to.ch));\r\n };\r\n\r\n CodeMirror.commands.moveLinesDown = function (cm) {\r\n var selectoion = cm.listSelections()[0];\r\n\r\n var from = selectoion.anchor,\r\n to = selectoion.head;\r\n if (from.line > to.line) {\r\n from = selectoion.head;\r\n to = selectoion.anchor;\r\n }\r\n\r\n if (to.line === cm.lastLine()) {\r\n return false;\r\n }\r\n\r\n // 下一行选中为0时,应添加到上一行末\r\n var replaceToLine = to.line;\r\n if (to.ch === 0) {\r\n replaceToLine = to.line - 1;\r\n }\r\n // 把选中的下一行添加到选中区域的上一行\r\n if (from.line === 0) {\r\n cm.replaceRange(cm.getLine(replaceToLine + 1) + '\\n', CodeMirror.Pos(0, 0));\r\n } else {\r\n cm.replaceRange('\\n' + cm.getLine(replaceToLine + 1), CodeMirror.Pos(from.line - 1));\r\n }\r\n // 删除选中的下一行\r\n cm.replaceRange('', CodeMirror.Pos(replaceToLine + 1, cm.getLine(replaceToLine + 1).length),\r\n CodeMirror.Pos(replaceToLine + 2, cm.getLine(replaceToLine + 2).length));\r\n\r\n cm.setSelection(CodeMirror.Pos(from.line + 1, from.ch),\r\n CodeMirror.Pos(to.line + 1, to.ch));\r\n };\r\n\r\n CodeMirror.commands.jumpToDecl = function (cm) {\r\n var cur = wide.curEditor.getCursor();\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = wide.curEditor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/find/decl',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n \r\n var data = result.data;\r\n\r\n var tId = tree.getTIdByPath(data.path);\r\n wide.curNode = tree.fileTree.getNodeByTId(tId);\r\n tree.fileTree.selectNode(wide.curNode);\r\n\r\n tree.openFile(wide.curNode, CodeMirror.Pos(data.cursorLine - 1, data.cursorCh - 1));\r\n }\r\n });\r\n };\r\n\r\n CodeMirror.commands.findUsages = function (cm) {\r\n var cur = wide.curEditor.getCursor();\r\n\r\n var request = newWideRequest();\r\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\r\n request.code = wide.curEditor.getValue();\r\n request.cursorLine = cur.line;\r\n request.cursorCh = cur.ch;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/find/usages',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n editors.appendSearch(result.data, 'usages', '');\r\n }\r\n });\r\n };\r\n\r\n CodeMirror.commands.selectIdentifier = function (cm) {\r\n var cur = cm.getCursor();\r\n var word = cm.findWordAt(cur);\r\n cm.extendSelection(word.anchor, word.head);\r\n };\r\n },\r\n appendSearch: function (data, type, key) {\r\n var searcHTML = '
      ',\r\n key = key.toLowerCase();\r\n\r\n for (var i = 0, ii = data.length; i < ii; i++) {\r\n var contents = '',\r\n lowerCaseContents = data[i].contents[0].toLowerCase(),\r\n matches = lowerCaseContents.split(key),\r\n startIndex = 0,\r\n endIndex = 0;\r\n for (var j = 0, max = matches.length; j < max; j++) {\r\n startIndex = endIndex + matches[j].length;\r\n endIndex = startIndex + key.length;\r\n var keyWord = data[i].contents[0].substring(startIndex, endIndex);\r\n if (keyWord !== '') {\r\n keyWord = '' + keyWord + '';\r\n }\r\n contents += data[i].contents[0].substring(startIndex - matches[j].length, startIndex) + keyWord;\r\n }\r\n\r\n searcHTML += '
    • '\r\n + contents + \"    \" + data[i].path\r\n + ' (' + data[i].line + ':'\r\n + data[i].ch + ')
    • ';\r\n }\r\n\r\n if (data.length === 0) {\r\n searcHTML += '
    • ' + config.label.search_no_match + '
    • ';\r\n }\r\n searcHTML += '
    ';\r\n\r\n var $search = $('.bottom-window-group .search'),\r\n title = config.label.find_usages;\r\n if (type === \"founds\") {\r\n title = config.label.search_text;\r\n }\r\n if ($search.find(\"ul\").length === 0) {\r\n bottomGroup.searchTab = new Tabs({\r\n id: \".bottom-window-group .search\",\r\n removeAfter: function (id, prevId) {\r\n if ($search.find(\"ul\").length === 1) {\r\n $search.find(\".tabs\").hide();\r\n }\r\n }\r\n });\r\n\r\n $search.on(\"click\", \"li\", function () {\r\n $search.find(\"li\").removeClass(\"selected\");\r\n $(this).addClass(\"selected\");\r\n });\r\n\r\n $search.on(\"dblclick\", \"li\", function () {\r\n var $it = $(this),\r\n tId = tree.getTIdByPath($it.attr(\"title\"));\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n\r\n var line = $it.find(\".position\").data(\"line\") - 1;\r\n var cursor = CodeMirror.Pos(line, $it.find(\".position\").data(\"ch\") - 1);\r\n\r\n\r\n var editor = wide.curEditor;\r\n editor.setCursor(cursor);\r\n\r\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\r\n var cursorCoords = editor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\r\n editor.scrollTo(0, cursorCoords.top);\r\n\r\n wide.curEditor.focus();\r\n });\r\n\r\n $search.find(\".tabs-panel > div\").append(searcHTML);\r\n\r\n $search.find(\".tabs .first\").text(title);\r\n } else {\r\n $search.find(\".tabs\").show();\r\n bottomGroup.searchTab.add({\r\n \"id\": \"search\" + (new Date()).getTime(),\r\n \"title\": title,\r\n \"content\": searcHTML\r\n });\r\n }\r\n\r\n // focus\r\n bottomGroup.tabs.setCurrent(\"search\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .search\").focus();\r\n },\r\n // 新建一个编辑器 Tab,如果已经存在 Tab 则切换到该 Tab.\r\n newEditor: function (data, cursor) {\r\n var id = wide.curNode.id;\r\n\r\n editors.tabs.add({\r\n id: id,\r\n title: '' + wide.curNode.name + '',\r\n content: ''\r\n });\r\n\r\n menu.undisabled(['save-all', 'close-all', 'build', 'run', 'go-test', 'go-vet', 'go-get', 'go-install',\r\n 'find', 'find-next', 'find-previous', 'replace', 'replace-all',\r\n 'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment',\r\n 'edit']);\r\n\r\n var textArea = document.getElementById(\"editor\" + id);\r\n textArea.value = data.content;\r\n\r\n var editor = CodeMirror.fromTextArea(textArea, {\r\n lineNumbers: true,\r\n autofocus: true,\r\n autoCloseBrackets: true,\r\n matchBrackets: true,\r\n highlightSelectionMatches: {showToken: /\\w/},\r\n rulers: [{color: \"#ccc\", column: 120, lineStyle: \"dashed\"}],\r\n styleActiveLine: true,\r\n theme: config.editorTheme,\r\n tabSize: config.editorTabSize,\r\n indentUnit: 4,\r\n indentWithTabs: true,\r\n foldGutter: true,\r\n cursorHeight: 1,\r\n path: data.path,\r\n readOnly: wide.curNode.isGOAPI,\r\n profile: 'xhtml', // define Emmet output profile\r\n extraKeys: {\r\n \"Ctrl-\\\\\": \"autocompleteAnyWord\",\r\n \".\": \"autocompleteAfterDot\",\r\n \"Ctrl-/\": 'toggleComment',\r\n \"Ctrl-I\": \"exprInfo\",\r\n \"Ctrl-L\": \"gotoLine\",\r\n \"Ctrl-E\": \"deleteLine\",\r\n \"Ctrl-D\": \"doNothing\", // 取消默认的 deleteLine\r\n \"Ctrl-B\": \"jumpToDecl\",\r\n \"Ctrl-S\": function () {\r\n wide.saveFile();\r\n },\r\n \"Shift-Ctrl-S\": function () {\r\n menu.saveAllFiles();\r\n },\r\n \"Shift-Alt-F\": function () {\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n wide.fmt(currentPath, wide.curEditor);\r\n },\r\n \"Alt-F7\": \"findUsages\",\r\n \"Shift-Alt-Enter\": function () {\r\n if (windows.isMaxEditor) {\r\n windows.restoreEditor();\r\n } else {\r\n windows.maxEditor();\r\n }\r\n },\r\n \"Shift-Ctrl-Up\": \"copyLinesUp\",\r\n \"Shift-Ctrl-Down\": \"copyLinesDown\",\r\n \"Shift-Alt-Up\": \"moveLinesUp\",\r\n \"Shift-Alt-Down\": \"moveLinesDown\",\r\n \"Shift-Alt-J\": \"selectIdentifier\"\r\n }\r\n });\r\n\r\n if (\"text/html\" === data.mode) {\r\n emmetCodeMirror(editor);\r\n }\r\n\r\n editor.on('cursorActivity', function (cm) {\r\n $(\".edit-exprinfo\").remove();\r\n var cursor = cm.getCursor();\r\n\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n });\r\n\r\n editor.on('blur', function (cm) {\r\n $(\".edit-exprinfo\").remove();\r\n });\r\n\r\n editor.on('changes', function (cm) {\r\n if (cm.doc.isClean()) { // no modification\r\n $(\".edit-panel .tabs > div\").each(function () {\r\n var $span = $(this).find(\"span:eq(0)\");\r\n if ($span.attr(\"title\") === cm.options.path) {\r\n $span.removeClass(\"changed\");\r\n }\r\n });\r\n\r\n return;\r\n }\r\n\r\n // changed\r\n\r\n $(\".edit-panel .tabs > div\").each(function () {\r\n var $span = $(this).find(\"span:eq(0)\");\r\n if ($span.attr(\"title\") === cm.options.path) {\r\n $span.addClass(\"changed\");\r\n }\r\n });\r\n });\r\n\r\n editor.on('keydown', function (cm, evt) {\r\n if (evt.altKey || evt.ctrlKey || evt.shiftKey) {\r\n return;\r\n }\r\n\r\n var k = evt.which;\r\n\r\n if (k < 48) {\r\n return;\r\n }\r\n\r\n // hit [0-9]\r\n\r\n if (k > 57 && k < 65) {\r\n return;\r\n }\r\n\r\n // hit [a-z]\r\n\r\n if (k > 90) {\r\n return;\r\n }\r\n\r\n if (config.autocomplete) {\r\n if (0.5 <= Math.random()) {\r\n CodeMirror.commands.autocompleteAfterDot(cm);\r\n }\r\n }\r\n });\r\n\r\n editor.setSize('100%', $(\".edit-panel\").height() - $(\".edit-panel .tabs\").height());\r\n editor.setOption(\"mode\", data.mode);\r\n editor.setOption(\"gutters\", [\"CodeMirror-lint-markers\", \"CodeMirror-foldgutter\"]);\r\n\r\n if (\"wide\" !== config.keymap) {\r\n editor.setOption(\"keyMap\", config.keymap);\r\n }\r\n\r\n if (\"text/x-go\" === data.mode || \"application/json\" === data.mode) {\r\n editor.setOption(\"lint\", true);\r\n }\r\n\r\n if (\"application/xml\" === data.mode || \"text/html\" === data.mode) {\r\n editor.setOption(\"autoCloseTags\", true);\r\n }\r\n\r\n wide.curEditor = editor;\r\n editors.data.push({\r\n \"editor\": editor,\r\n \"id\": id\r\n });\r\n\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n\r\n var half = Math.floor(wide.curEditor.getScrollInfo().clientHeight / wide.curEditor.defaultTextHeight() / 2);\r\n var cursorCoords = wide.curEditor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\r\n wide.curEditor.scrollTo(0, cursorCoords.top);\r\n\r\n editor.setCursor(cursor);\r\n editor.focus();\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file notification.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\nvar notification = {\r\n init: function () {\r\n $(\".notification-count\").click(function () {\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n $(\".bottom-window-group .notification\").focus();\r\n $(this).hide();\r\n });\r\n\r\n this._initWS();\r\n },\r\n _initWS: function () {\r\n var notificationWS = new ReconnectingWebSocket(config.channel + '/notification/ws?sid=' + config.wideSessionId);\r\n\r\n notificationWS.onopen = function () {\r\n console.log('[notification onopen] connected');\r\n };\r\n\r\n notificationWS.onmessage = function (e) {\r\n var data = JSON.parse(e.data),\r\n $notification = $('.bottom-window-group .notification > table'),\r\n notificationHTML = '';\r\n \r\n if (data.cmd && \"init-notification\" === data.cmd) {\r\n console.log('[notification onmessage]' + e.data);\r\n \r\n return;\r\n }\r\n\r\n notificationHTML += '' + data.severity\r\n + '' + data.message\r\n + '' + data.type + '';\r\n $notification.append(notificationHTML);\r\n\r\n $(\".notification-count\").show();\r\n };\r\n\r\n notificationWS.onclose = function (e) {\r\n console.log('[notification onclose] disconnected (' + e.code + ')');\r\n };\r\n\r\n notificationWS.onerror = function (e) {\r\n console.log('[notification onerror]');\r\n };\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file tree.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.1.1, Dec 15, 2015\r\n */\r\nvar tree = {\r\n fileTree: undefined,\r\n // 递归获取当前节点展开中的最后一个节点\r\n getCurrentNodeLastNode: function (node) {\r\n var returnNode = node.children[node.children.length - 1];\r\n if (returnNode.open) {\r\n return tree.getCurrentNodeLastNode(returnNode);\r\n } else {\r\n return returnNode;\r\n }\r\n },\r\n // 按照树展现获取下一个节点\r\n getNextShowNode: function (node) {\r\n if (node.level !== 0) {\r\n if (node.getParentNode().getNextNode()) {\r\n return node.getParentNode().getNextNode();\r\n } else {\r\n return tree.getNextShowNode(node.getParentNode());\r\n }\r\n } else {\r\n return node.getNextNode();\r\n }\r\n },\r\n isBottomNode: function (node) {\r\n if (node.open) {\r\n return false;\r\n }\r\n\r\n if (node.getParentNode()) {\r\n if (node.getParentNode().isLastNode) {\r\n return tree.isBottomNode(node.getParentNode());\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n if (node.isLastNode) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n },\r\n getTIdByPath: function (path) {\r\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n if (nodes[i].path === path) {\r\n return nodes[i].tId;\r\n }\r\n }\r\n\r\n return undefined;\r\n },\r\n getOpenPaths: function () {\r\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes()),\r\n paths = [];\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n if (nodes[i].open) {\r\n paths.push(nodes[i].path);\r\n }\r\n }\r\n\r\n return paths;\r\n },\r\n getAllParents: function (node, parents) {\r\n if (!parents) {\r\n parents = [];\r\n }\r\n\r\n if (!node || !node.parentTId) {\r\n return parents;\r\n } else {\r\n parents.push(node.getParentNode());\r\n return tree.getAllParents(node.getParentNode(), parents);\r\n }\r\n },\r\n isParents: function (tId, parentPath) {\r\n var node = tree.fileTree.getNodeByTId(tId);\r\n if (!node || !node.parentTId) {\r\n return false;\r\n } else {\r\n var parentNode = tree.fileTree.getNodeByTId(node.parentTId);\r\n if (node.path === parentPath) {\r\n return true;\r\n } else {\r\n return tree.isParents(parentNode.tId, parentPath);\r\n }\r\n }\r\n },\r\n isDir: function () {\r\n if (wide.curNode.iconSkin.indexOf(\"ico-ztree-dir\") === 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n newFile: function (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewFilePrompt\").dialog(\"open\");\r\n },\r\n newDir: function (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewDirPrompt\").dialog(\"open\");\r\n },\r\n removeIt: function (it) {\r\n if (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n } else {\r\n if (!wide.curNode.removable) {\r\n return false;\r\n }\r\n }\r\n\r\n $(\"#dialogRemoveConfirm\").dialog(\"open\");\r\n },\r\n rename: function (it) {\r\n if (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n }\r\n\r\n $(\"#dialogRenamePrompt\").dialog(\"open\");\r\n },\r\n export: function () {\r\n var request = newWideRequest(),\r\n isSucc = false;\r\n request.path = wide.curNode.path;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: '/file/zip/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n\r\n isSucc = true;\r\n }\r\n });\r\n\r\n if (isSucc) {\r\n window.open('/file/zip?path=' + wide.curNode.path + \".zip\");\r\n }\r\n },\r\n crossCompile: function (platform) {\r\n var request = newWideRequest();\r\n request.path = wide.curNode.path;\r\n request.platform = platform;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: '/cross',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n }\r\n });\r\n },\r\n refresh: function (it) {\r\n if (it) {\r\n if ($(it).hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n }\r\n\r\n tree.fileTree.reAsyncChildNodes(wide.curNode, \"refresh\", true);\r\n },\r\n init: function () {\r\n $(\"#file\").click(function () {\r\n $(this).focus();\r\n });\r\n\r\n var request = newWideRequest();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/files',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n var $dirRMenu = $(\"#dirRMenu\");\r\n var $fileRMenu = $(\"#fileRMenu\");\r\n var setting = {\r\n data: {\r\n key: {\r\n title: \"path\"\r\n }\r\n },\r\n view: {\r\n showTitle: true,\r\n selectedMulti: false\r\n },\r\n async: {\r\n enable: true,\r\n url: \"/file/refresh\",\r\n autoParam: [\"path\"]\r\n },\r\n callback: {\r\n onDblClick: function (event, treeId, treeNode) {\r\n if (treeNode) {\r\n tree.openFile(treeNode);\r\n }\r\n },\r\n onRightClick: function (event, treeId, treeNode) {\r\n if (treeNode && !treeNode.isGOAPI) {\r\n menu.undisabled(['import', 'export', 'git-clone']);\r\n\r\n wide.curNode = treeNode;\r\n tree.fileTree.selectNode(treeNode);\r\n\r\n if (!tree.isDir()) { // if right click on a file\r\n if (wide.curNode.removable) {\r\n $fileRMenu.find(\".remove\").removeClass(\"disabled\");\r\n } else {\r\n $fileRMenu.find(\".remove\").addClass(\"disabled\");\r\n }\r\n\r\n if (-1 === wide.curNode.path.indexOf(\"zip\", wide.curNode.path.length - \"zip\".length)) { // !path.endsWith(\"zip\")\r\n $fileRMenu.find(\".decompress\").hide();\r\n } else {\r\n $fileRMenu.find(\".decompress\").show();\r\n }\r\n\r\n if (-1 === wide.curNode.path.indexOf(\"go\", wide.curNode.path.length - \"go\".length)) { // !path.endsWith(\"go\")\r\n $fileRMenu.find(\".linux64\").hide();\r\n } else {\r\n $fileRMenu.find(\".linux64\").show();\r\n }\r\n\r\n var top = event.clientY - 10;\r\n if ($fileRMenu.height() + top > $('.content').height()) {\r\n top = top - $fileRMenu.height() - 25;\r\n }\r\n $fileRMenu.css({\r\n \"top\": top + \"px\",\r\n \"left\": event.clientX + \"px\",\r\n \"display\": \"block\"\r\n }).show();\r\n\r\n $dirRMenu.hide();\r\n\r\n menu.disabled(['import', 'git-clone']);\r\n } else { // 右击了目录\r\n if (wide.curNode.removable) {\r\n $dirRMenu.find(\".remove\").removeClass(\"disabled\");\r\n } else {\r\n $dirRMenu.find(\".remove\").addClass(\"disabled\");\r\n }\r\n\r\n if (wide.curNode.creatable) {\r\n $dirRMenu.find(\".create\").removeClass(\"disabled\");\r\n } else {\r\n $dirRMenu.find(\".create\").addClass(\"disabled\");\r\n }\r\n\r\n var top = event.clientY - 10;\r\n if ($dirRMenu.height() + top > $('.content').height()) {\r\n top = top - $dirRMenu.height() - 25;\r\n }\r\n\r\n $dirRMenu.css({\r\n \"top\": top + \"px\",\r\n \"left\": event.clientX + \"px\",\r\n \"display\": \"block\"\r\n }).show();\r\n\r\n $fileRMenu.hide();\r\n }\r\n $(\"#files\").focus();\r\n }\r\n },\r\n onClick: function (event, treeId, treeNode, clickFlag) {\r\n if (treeNode) {\r\n wide.curNode = treeNode;\r\n tree.fileTree.selectNode(treeNode);\r\n\r\n menu.undisabled(['import', 'export', 'git-clone']);\r\n if (!tree.isDir()) {\r\n menu.disabled(['import', 'git-clone']);\r\n }\r\n\r\n $(\"#files\").focus();\r\n }\r\n }\r\n }\r\n };\r\n tree.fileTree = $.fn.zTree.init($(\"#files\"), setting, result.data.children);\r\n\r\n session.restore();\r\n }\r\n }\r\n });\r\n\r\n this._initSearch();\r\n this._initRename();\r\n },\r\n openFile: function (treeNode, cursor) {\r\n wide.curNode = treeNode;\r\n var tempCursor = cursor;\r\n\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n // 该节点文件已经打开\r\n if (editors.data[i].id === treeNode.path) {\r\n editors.tabs.setCurrent(treeNode.path);\r\n wide.curEditor = editors.data[i].editor;\r\n\r\n if (!tempCursor) {\r\n tempCursor = wide.curEditor.getCursor();\r\n }\r\n $(\".footer .cursor\").text('| ' + (tempCursor.line + 1) + ':' + (tempCursor.ch + 1) + ' |');\r\n\r\n wide.curEditor.setCursor(tempCursor);\r\n var half = Math.floor(wide.curEditor.getScrollInfo().clientHeight / wide.curEditor.defaultTextHeight() / 2);\r\n var cursorCoords = wide.curEditor.cursorCoords({line: tempCursor.line - half, ch: 0}, \"local\");\r\n wide.curEditor.scrollTo(0, cursorCoords.top);\r\n wide.curEditor.focus();\r\n\r\n wide.refreshOutline();\r\n return false;\r\n }\r\n }\r\n\r\n if (!tree.isDir()) {\r\n var request = newWideRequest();\r\n request.path = treeNode.path;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: '/file',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n\r\n var data = result.data;\r\n\r\n if (!data.mode) {\r\n var mode = CodeMirror.findModeByFileName(treeNode.path);\r\n if (mode) {\r\n data.mode = mode.mime;\r\n } else {\r\n data.mode = 'text/plain';\r\n }\r\n }\r\n\r\n if (!data.mode) {\r\n console.error(\"Can't find mode by file name [\" + treeNode.path + \"]\");\r\n }\r\n\r\n if (\"img\" === data.mode) { // 是图片文件的话新建 tab 打开\r\n // 最好是开 tab,但这个最终取决于浏览器设置\r\n var w = window.open(data.path);\r\n return false;\r\n }\r\n\r\n if (!tempCursor) {\r\n tempCursor = CodeMirror.Pos(0, 0);\r\n }\r\n\r\n editors.newEditor(data, tempCursor);\r\n\r\n wide.refreshOutline();\r\n }\r\n });\r\n }\r\n },\r\n _initSearch: function () {\r\n $(\"#dialogSearchForm > input:eq(0)\").keyup(function (event) {\r\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\r\n $okBtn.click();\r\n }\r\n\r\n if ($.trim($(this).val()) === \"\") {\r\n $okBtn.prop(\"disabled\", true);\r\n } else {\r\n $okBtn.prop(\"disabled\", false);\r\n }\r\n });\r\n\r\n $(\"#dialogSearchForm > input:eq(1)\").keyup(function (event) {\r\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\r\n $okBtn.click();\r\n }\r\n });\r\n\r\n $(\"#dialogSearchForm\").dialog({\r\n \"modal\": true,\r\n \"height\": 80,\r\n \"width\": 260,\r\n \"title\": config.label.search,\r\n \"okText\": config.label.search,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogSearchForm > input:eq(0)\").val('').focus();\r\n $(\"#dialogSearchForm > input:eq(1)\").val('');\r\n $(\"#dialogSearchForm\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest();\r\n\r\n if (!wide.curNode) {\r\n request.dir = \"\";\r\n } else {\r\n request.dir = wide.curNode.path;\r\n }\r\n\r\n request.text = $(\"#dialogSearchForm > input:eq(0)\").val();\r\n request.extension = $(\"#dialogSearchForm > input:eq(1)\").val();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/file/search/text',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n $(\"#dialogSearchForm\").dialog(\"close\");\r\n editors.appendSearch(result.data, 'founds', request.text);\r\n }\r\n });\r\n }\r\n });\r\n },\r\n _initRename: function () {\r\n $(\"#dialogRenamePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.rename,\r\n \"okText\": config.label.rename,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogRenamePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n $(\"#dialogRenamePrompt > input\").val(wide.curNode.name).select().focus();\r\n },\r\n \"ok\": function () {\r\n var name = $(\"#dialogRenamePrompt > input\").val(),\r\n request = newWideRequest();\r\n\r\n request.oldPath = wide.curNode.path;\r\n request.newPath = wide.curNode.path.substring(0, wide.curNode.path.lastIndexOf(\"/\") + 1) + name;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/file/rename',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogRenamePrompt\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogRenamePrompt\").dialog(\"close\");\r\n }\r\n });\r\n }\r\n });\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file wide.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.0.1, Dec 8, 2015\r\n */\r\nvar wide = {\r\n curNode: undefined,\r\n curEditor: undefined,\r\n curProcessId: undefined, // curent running process id (pid)\r\n refreshOutline: function () {\r\n if (!wide.curEditor ||\r\n (wide.curEditor && wide.curEditor.doc.getMode().name !== \"go\")) {\r\n $(\"#outline\").html('');\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.code = wide.curEditor.getValue();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n async: false,\r\n url: '/outline',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n var data = result.data;\r\n\r\n var outlineHTML = '
      ',\r\n decls = ['constDecls', 'varDecls', 'funcDecls',\r\n 'structDecls', 'interfaceDecls', 'typeDecls'];\r\n\r\n for (var i = 0, max = decls.length; i < max; i++) {\r\n var key = decls[i];\r\n for (var j = 0, maxj = data[key].length; j < maxj; j++) {\r\n var obj = data[key][j];\r\n outlineHTML += '
    • ' + obj.Name + '
    • ';\r\n }\r\n }\r\n $(\"#outline\").html(outlineHTML + '
    ');\r\n\r\n $(\"#outline li\").dblclick(function () {\r\n var $it = $(this),\r\n cursor = CodeMirror.Pos($it.data('line'), $it.data(\"ch\"));\r\n\r\n var editor = wide.curEditor;\r\n editor.setCursor(cursor);\r\n\r\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\r\n var cursorCoords = editor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\r\n editor.scrollTo(0, cursorCoords.top);\r\n\r\n editor.focus();\r\n });\r\n }\r\n });\r\n },\r\n _initDialog: function () {\r\n $(\".dialog-prompt > input\").keyup(function (event) {\r\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\r\n $okBtn.click();\r\n }\r\n\r\n if ($.trim($(this).val()) === \"\") {\r\n $okBtn.prop(\"disabled\", true);\r\n } else {\r\n $okBtn.prop(\"disabled\", false);\r\n }\r\n });\r\n\r\n $(\"#dialogAlert\").dialog({\r\n \"modal\": true,\r\n \"height\": 40,\r\n \"width\": 350,\r\n \"title\": config.label.tip,\r\n \"hiddenOk\": true,\r\n \"cancelText\": config.label.confirm,\r\n \"afterOpen\": function (msg) {\r\n $(\"#dialogAlert\").html(msg);\r\n }\r\n });\r\n\r\n $(\"#dialogRemoveConfirm\").dialog({\r\n \"modal\": true,\r\n \"height\": 36,\r\n \"width\": 260,\r\n \"title\": config.label.delete,\r\n \"okText\": config.label.delete,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogRemoveConfirm > b\").html('\"' + wide.curNode.name + '\"');\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest();\r\n request.path = wide.curNode.path;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/file/remove',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogRemoveConfirm\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogRemoveConfirm\").dialog(\"close\");\r\n }\r\n });\r\n }\r\n });\r\n\r\n $(\"#dialogNewFilePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.create_file,\r\n \"okText\": config.label.create,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogNewFilePrompt > input\").val('').focus();\r\n $(\"#dialogNewFilePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest(),\r\n name = $(\"#dialogNewFilePrompt > input\").val();\r\n\r\n request.path = wide.curNode.path + \"/\" + name;\r\n request.fileType = \"f\";\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/file/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogNewFilePrompt\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewFilePrompt\").dialog(\"close\");\r\n\r\n setTimeout(function () { // Delay, waiting the file change notified and then open it\r\n var tId = tree.getTIdByPath(request.path);\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n }, 100);\r\n }\r\n });\r\n }\r\n });\r\n\r\n $(\"#dialogNewDirPrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.create_dir,\r\n \"okText\": config.label.create,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogNewDirPrompt > input\").val('').focus();\r\n $(\"#dialogNewDirPrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var name = $(\"#dialogNewDirPrompt > input\").val(),\r\n request = newWideRequest();\r\n\r\n request.path = wide.curNode.path + \"/\" + name;\r\n request.fileType = \"d\";\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/file/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogNewDirPrompt\").dialog(\"close\");\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n return false;\r\n }\r\n\r\n $(\"#dialogNewDirPrompt\").dialog(\"close\");\r\n }\r\n });\r\n }\r\n });\r\n\r\n $(\"#dialogGoFilePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 320,\r\n \"width\": 660,\r\n \"title\": config.label.goto_file,\r\n \"okText\": config.label.go,\r\n \"cancelText\": config.label.cancel,\r\n \"afterInit\": function () {\r\n $(\"#dialogGoFilePrompt\").on(\"dblclick\", \"li\", function () {\r\n var tId = tree.getTIdByPath($(this).find(\".ft-small\").text());\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\r\n wide.curEditor.focus();\r\n });\r\n\r\n $(\"#dialogGoFilePrompt\").on(\"click\", \"li\", function () {\r\n var $list = $(\"#dialogGoFilePrompt > .list\");\r\n $list.find(\"li\").removeClass(\"selected\");\r\n $list.data(\"index\", $(this).data(\"index\"));\r\n $(this).addClass(\"selected\");\r\n });\r\n\r\n hotkeys.bindList($(\"#dialogGoFilePrompt > input\"), $(\"#dialogGoFilePrompt > .list\"), function ($selected) {\r\n var tId = tree.getTIdByPath($selected.find(\".ft-small\").text());\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\r\n wide.curEditor.focus();\r\n });\r\n\r\n $(\"#dialogGoFilePrompt > input\").bind(\"input\", function () {\r\n var name = $(\"#dialogGoFilePrompt > input\").val();\r\n\r\n var request = newWideRequest();\r\n request.path = '';\r\n request.name = '*' + name + '*';\r\n if (wide.curNode) {\r\n request.path = wide.curNode.path;\r\n }\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/file/find/name',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n return;\r\n }\r\n\r\n var data = result.data;\r\n\r\n var goFileHTML = '';\r\n for (var i = 0, max = data.length; i < max; i++) {\r\n var path = data[i].path,\r\n name = path.substr(path.lastIndexOf(\"/\") + 1),\r\n icoSkin = wide.getClassBySuffix(name.split(\".\")[1]);\r\n if (i === 0) {\r\n goFileHTML += '
  • '\r\n + name + '    '\r\n + path + '
  • ';\r\n } else {\r\n goFileHTML += '
  • '\r\n + name + '    '\r\n + path + '
  • ';\r\n }\r\n }\r\n\r\n $(\"#dialogGoFilePrompt > ul\").html(goFileHTML);\r\n }\r\n });\r\n });\r\n },\r\n \"afterOpen\": function () {\r\n $(\"#dialogGoFilePrompt > input\").val('').focus();\r\n $(\"#dialogGoFilePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n $(\"#dialogGoFilePrompt .list\").html('').data(\"index\", 0);\r\n },\r\n \"ok\": function () {\r\n var tId = tree.getTIdByPath($(\"#dialogGoFilePrompt .selected .ft-small\").text());\r\n tree.openFile(tree.fileTree.getNodeByTId(tId));\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\r\n wide.curEditor.focus();\r\n }\r\n });\r\n\r\n $(\"#dialogGoLinePrompt\").dialog({\r\n \"modal\": true,\r\n \"height\": 52,\r\n \"width\": 260,\r\n \"title\": config.label.goto_line,\r\n \"okText\": config.label.go,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n $(\"#dialogGoLinePrompt > input\").val('').focus();\r\n $(\"#dialogGoLinePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var line = parseInt($(\"#dialogGoLinePrompt > input\").val()) - 1;\r\n $(\"#dialogGoLinePrompt\").dialog(\"close\");\r\n\r\n var editor = wide.curEditor;\r\n var cursor = editor.getCursor();\r\n\r\n editor.setCursor(CodeMirror.Pos(line, cursor.ch));\r\n\r\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\r\n var cursorCoords = editor.cursorCoords({line: line - half, ch: cursor.ch}, \"local\");\r\n editor.scrollTo(0, cursorCoords.top);\r\n\r\n editor.focus();\r\n }\r\n });\r\n },\r\n _initWS: function () {\r\n var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);\r\n outputWS.onopen = function () {\r\n console.log('[output onopen] connected');\r\n };\r\n\r\n outputWS.onmessage = function (e) {\r\n console.log('[output onmessage]' + e.data);\r\n var data = JSON.parse(e.data);\r\n\r\n if (goLintFound) {\r\n goLintFound = [];\r\n }\r\n\r\n if ('run' === data.nextCmd) {\r\n var request = newWideRequest();\r\n request.executable = data.executable;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/run',\r\n data: JSON.stringify(request),\r\n dataType: \"json\"\r\n });\r\n }\r\n\r\n switch (data.cmd) {\r\n case 'run':\r\n var content = $('.bottom-window-group .output > div').html();\r\n if (!wide.curProcessId || '' === content) {\r\n bottomGroup.fillOutput(content + '
    ' + data.output + '
    ');\r\n } else {\r\n bottomGroup.fillOutput(content.replace(/<\\/pre>$/g, data.output + ''));\r\n }\r\n\r\n wide.curProcessId = data.pid;\r\n\r\n break;\r\n case 'run-done':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html().replace(/<\\/pre>$/g, data.output + ''));\r\n\r\n wide.curProcessId = undefined;\r\n $(\"#buildRun\").removeClass(\"ico-stop\")\r\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\r\n\r\n break;\r\n case 'start-build':\r\n case 'start-test':\r\n case 'start-vet':\r\n case 'start-install':\r\n case 'start-get':\r\n bottomGroup.fillOutput(data.output);\r\n\r\n break;\r\n case 'go test':\r\n case 'go vet':\r\n case 'go install':\r\n case 'go get':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\r\n\r\n break;\r\n case 'git clone':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\r\n tree.fileTree.reAsyncChildNodes(wide.curNode, \"refresh\", false);\r\n\r\n break;\r\n case 'build':\r\n case 'cross-build':\r\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\r\n\r\n if (data.lints) { // has build error\r\n var files = {};\r\n\r\n for (var i = 0; i < data.lints.length; i++) {\r\n var lint = data.lints[i];\r\n\r\n goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),\r\n to: CodeMirror.Pos(lint.lineNo, 0),\r\n message: lint.msg, severity: lint.severity});\r\n\r\n files[lint.file] = lint.file;\r\n }\r\n\r\n $(\"#buildRun\").removeClass(\"ico-stop\")\r\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\r\n\r\n // trigger gutter lint\r\n for (var path in files) {\r\n var editor = editors.getEditorByPath(path);\r\n CodeMirror.signal(editor, \"change\", editor);\r\n }\r\n } else {\r\n if ('cross-build' === data.cmd) {\r\n var request = newWideRequest(),\r\n path = null;\r\n request.path = data.executable;\r\n request.name = data.name;\r\n\r\n $.ajax({\r\n async: false,\r\n type: 'POST',\r\n url: '/file/zip/new',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (!result.succ) {\r\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\r\n\r\n return false;\r\n }\r\n\r\n path = result.data;\r\n }\r\n });\r\n\r\n if (path) {\r\n window.open('/file/zip?path=' + path + \".zip\");\r\n }\r\n }\r\n }\r\n\r\n break;\r\n }\r\n };\r\n outputWS.onclose = function (e) {\r\n console.log('[output onclose] disconnected (' + e.code + ')');\r\n };\r\n outputWS.onerror = function (e) {\r\n console.log('[output onerror]');\r\n };\r\n },\r\n _initFooter: function () {\r\n $(\".footer .cursor\").dblclick(function () {\r\n $(\"#dialogGoLinePrompt\").dialog(\"open\");\r\n });\r\n },\r\n init: function () {\r\n this._initFooter();\r\n\r\n this._initWS();\r\n\r\n // 点击隐藏弹出层\r\n $(\"body\").bind(\"mouseup\", function (event) {\r\n // MAC 右键文件树失效\r\n if (event.which === 3) {\r\n return false;\r\n }\r\n\r\n $(\".frame\").hide();\r\n\r\n if (!($(event.target).closest(\".frame\").length === 1 || event.target.className === \"frame\")) {\r\n $(\".menu > ul > li\").unbind().removeClass(\"selected\");\r\n menu.subMenu();\r\n }\r\n });\r\n\r\n // 刷新提示\r\n window.onbeforeunload = function () {\r\n if (editors.data.length > 0) {\r\n return config.label.confirm_save;\r\n }\r\n };\r\n\r\n // 禁止鼠标右键菜单\r\n document.oncontextmenu = function () {\r\n return false;\r\n };\r\n\r\n this._initDialog();\r\n },\r\n _save: function (path, editor) {\r\n if (!path) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/file/save',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n // reset the save state\r\n editor.doc.markClean();\r\n $(\".edit-panel .tabs > div\").each(function () {\r\n var $span = $(this).find(\"span:eq(0)\");\r\n if ($span.attr(\"title\") === path) {\r\n $span.removeClass(\"changed\");\r\n }\r\n });\r\n }\r\n });\r\n },\r\n saveFile: function () {\r\n var path = editors.getCurrentPath();\r\n if (!path) {\r\n return false;\r\n }\r\n\r\n var editor = wide.curEditor;\r\n if (editor.doc.isClean()) { // no modification\r\n return false;\r\n }\r\n\r\n if (\"text/x-go\" === editor.getOption(\"mode\")) {\r\n wide.gofmt(path, wide.curEditor); // go fmt will save\r\n\r\n // build the file at once\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n request.nextCmd = \"\"; // build only, no following operation\r\n $.ajax({\r\n type: 'POST',\r\n url: '/build',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n\r\n // refresh outline\r\n wide.refreshOutline();\r\n\r\n return;\r\n }\r\n\r\n wide._save(path, wide.curEditor);\r\n },\r\n stop: function () {\r\n if ($(\"#buildRun\").hasClass(\"ico-buildrun\")) {\r\n menu.run();\r\n return false;\r\n }\r\n\r\n if (!wide.curProcessId) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.pid = wide.curProcessId;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/stop',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n $(\"#buildRun\").removeClass(\"ico-stop\")\r\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\r\n }\r\n });\r\n },\r\n gofmt: function (path, editor) {\r\n var cursor = editor.getCursor();\r\n var scrollInfo = editor.getScrollInfo();\r\n\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n request.cursorLine = cursor.line;\r\n request.cursorCh = cursor.ch;\r\n\r\n $.ajax({\r\n async: false, // sync\r\n type: 'POST',\r\n url: '/go/fmt',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n editor.setValue(result.data.code);\r\n editor.setCursor(cursor);\r\n editor.scrollTo(null, scrollInfo.top);\r\n\r\n wide._save(path, editor);\r\n }\r\n }\r\n });\r\n },\r\n fmt: function (path, editor) {\r\n var mode = editor.getOption(\"mode\");\r\n\r\n var cursor = editor.getCursor();\r\n var scrollInfo = editor.getScrollInfo();\r\n\r\n var request = newWideRequest();\r\n request.file = path;\r\n request.code = editor.getValue();\r\n request.cursorLine = cursor.line;\r\n request.cursorCh = cursor.ch;\r\n\r\n var formatted = null;\r\n\r\n switch (mode) {\r\n case \"text/x-go\":\r\n $.ajax({\r\n async: false, // sync\r\n type: 'POST',\r\n url: '/go/fmt',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n formatted = result.data.code;\r\n }\r\n }\r\n });\r\n\r\n break;\r\n case \"text/html\":\r\n formatted = html_beautify(editor.getValue());\r\n break;\r\n case \"text/javascript\":\r\n case \"application/json\":\r\n formatted = js_beautify(editor.getValue());\r\n break;\r\n case \"text/css\":\r\n formatted = css_beautify(editor.getValue());\r\n break;\r\n default :\r\n break;\r\n }\r\n\r\n if (formatted) {\r\n editor.setValue(formatted);\r\n editor.setCursor(cursor);\r\n editor.scrollTo(null, scrollInfo.top);\r\n\r\n wide._save(path, editor);\r\n }\r\n },\r\n getClassBySuffix: function (suffix) {\r\n var iconSkin = \"ico-ztree-other \";\r\n switch (suffix) {\r\n case \"html\":\r\n case \"htm\":\r\n iconSkin = \"ico-ztree-html \";\r\n break;\r\n case \"go\":\r\n iconSkin = \"ico-ztree-go \";\r\n break;\r\n case \"css\":\r\n iconSkin = \"ico-ztree-css \";\r\n break;\r\n case \"txt\":\r\n iconSkin = \"ico-ztree-text \";\r\n break;\r\n case \"sql\":\r\n iconSkin = \"ico-ztree-sql \";\r\n break;\r\n case \"properties\":\r\n iconSkin = \"ico-ztree-pro \";\r\n break;\r\n case \"md\":\r\n iconSkin = \"ico-ztree-md \";\r\n break;\r\n case \"js\", \"json\":\r\n iconSkin = \"ico-ztree-js \";\r\n break;\r\n case \"xml\":\r\n iconSkin = \"ico-ztree-xml \";\r\n break;\r\n case \"jpg\":\r\n case \"jpeg\":\r\n case \"bmp\":\r\n case \"gif\":\r\n case \"png\":\r\n case \"svg\":\r\n case \"ico\":\r\n iconSkin = \"ico-ztree-img \";\r\n break;\r\n }\r\n\r\n return iconSkin;\r\n }\r\n};\r\n\r\n$(document).ready(function () {\r\n wide.init();\r\n tree.init();\r\n menu.init();\r\n hotkeys.init();\r\n session.init();\r\n notification.init();\r\n editors.init();\r\n windows.init();\r\n bottomGroup.init();\r\n});\r\n","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file session.js\r\n *\r\n * @author Liyuan Li\r\n * @version 1.1.0.1, Dec 8, 2015\r\n */\r\nvar session = {\r\n init: function () {\r\n this._initWS();\r\n\r\n var getLayoutState = function (paneState) {\r\n var state = 'normal';\r\n if (paneState.isClosed) {\r\n state = 'min';\r\n } else if (paneState.size >= $('body').width()) {\r\n state = 'max';\r\n }\r\n\r\n return state;\r\n };\r\n\r\n // save session content every 30 seconds\r\n setInterval(function () {\r\n var request = newWideRequest(),\r\n filse = [],\r\n fileTree = [],\r\n currentId = editors.getCurrentId(),\r\n currentFile = currentId ? editors.getCurrentPath() : \"\";\r\n\r\n editors.tabs.obj._$tabs.find(\"div\").each(function () {\r\n var $it = $(this);\r\n if ($it.find(\"span:eq(0)\").attr(\"title\") !== config.label.start_page) {\r\n filse.push($it.find(\"span:eq(0)\").attr(\"title\"));\r\n }\r\n });\r\n\r\n fileTree = tree.getOpenPaths();\r\n\r\n request.currentFile = currentFile; // current editor file\r\n request.fileTree = fileTree; // file tree expansion state\r\n request.files = filse; // editor tabs\r\n\r\n\r\n request.layout = {\r\n \"side\": {\r\n \"size\": windows.outerLayout.west.state.size,\r\n \"state\": getLayoutState(windows.outerLayout.west.state)\r\n },\r\n \"sideRight\": {\r\n \"size\": windows.innerLayout.east.state.size,\r\n \"state\": getLayoutState(windows.innerLayout.east.state)\r\n },\r\n \"bottom\": {\r\n \"size\": windows.innerLayout.south.state.size,\r\n \"state\": getLayoutState(windows.innerLayout.south.state)\r\n }\r\n };\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/session/save',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n }\r\n });\r\n }, 30000);\r\n },\r\n restore: function () {\r\n if (!config.latestSessionContent) {\r\n return;\r\n }\r\n\r\n var fileTree = config.latestSessionContent.fileTree,\r\n files = config.latestSessionContent.files,\r\n currentFile = config.latestSessionContent.currentFile,\r\n id = \"\",\r\n nodesToOpen = [];\r\n\r\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());\r\n\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n // expand tree\r\n for (var j = 0, jj = fileTree.length; j < jj; j++) {\r\n if (nodes[i].path === fileTree[j]) {\r\n // expand this node only if its parents are open\r\n var parents = tree.getAllParents(tree.fileTree.getNodeByTId(nodes[i].tId)),\r\n isOpen = true;\r\n for (var l = 0, max = parents.length; l < max; l++) {\r\n if (parents[l].open === false) {\r\n isOpen = false;\r\n }\r\n }\r\n if (isOpen) {\r\n tree.fileTree.expandNode(nodes[i], true, false, true);\r\n } else {\r\n // flag it is open\r\n nodes[i].open = true;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n // open editors\r\n for (var k = 0, kk = files.length; k < kk; k++) {\r\n if (nodes[i].path === files[k]) {\r\n nodesToOpen.push(nodes[i]);\r\n break;\r\n }\r\n }\r\n\r\n if (nodes[i].path === currentFile) {\r\n id = nodes[i].path;\r\n\r\n // FIXME: 上面的展开是异步进行的,所以执行到这里的时候可能还没有展开完,导致定位不了可视区域\r\n tree.fileTree.selectNode(nodes[i]);\r\n wide.curNode = nodes[i];\r\n }\r\n }\r\n\r\n // handle the open sequence of editors\r\n for (var m = 0, mm = files.length; m < mm; m++) {\r\n for (var n = 0, nn = nodesToOpen.length; n < nn; n++) {\r\n if (nodesToOpen[n].path === files[m]) {\r\n tree.openFile(nodesToOpen[n]);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // set the current editor\r\n editors.tabs.setCurrent(id);\r\n for (var c = 0, max = editors.data.length; c < max; c++) {\r\n if (id === editors.data[c].id) {\r\n wide.curEditor = editors.data[c].editor;\r\n break;\r\n }\r\n } \r\n },\r\n _initWS: function () {\r\n // Used for session retention, server will release all resources of the session if this channel closed\r\n var sessionWS = new ReconnectingWebSocket(config.channel + '/session/ws?sid=' + config.wideSessionId);\r\n\r\n sessionWS.onopen = function () {\r\n console.log('[session onopen] connected');\r\n\r\n var dateFormat = function (time, fmt) {\r\n var date = new Date(time);\r\n var dateObj = {\r\n \"M+\": date.getMonth() + 1,\r\n \"d+\": date.getDate(),\r\n \"h+\": date.getHours(),\r\n \"m+\": date.getMinutes(),\r\n \"s+\": date.getSeconds(),\r\n \"q+\": Math.floor((date.getMonth() + 3) / 3),\r\n \"S\": date.getMilliseconds()\r\n };\r\n if (/(y+)/.test(fmt))\r\n fmt = fmt.replace(RegExp.$1, (date.getFullYear() + \"\").substr(4 - RegExp.$1.length));\r\n for (var k in dateObj)\r\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\r\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1)\r\n ? (dateObj[k]) : ((\"00\" + dateObj[k]).substr((\"\" + dateObj[k]).length)));\r\n }\r\n return fmt;\r\n };\r\n\r\n var data = {type: \"Network\", severity: \"INFO\",\r\n message: \"Connected to server [sid=\" + config.wideSessionId + \"], \" + dateFormat(new Date().getTime(), 'yyyy-MM-dd hh:mm:ss')},\r\n $notification = $('.bottom-window-group .notification > table'),\r\n notificationHTML = '';\r\n\r\n notificationHTML += '' + data.severity\r\n + '' + data.message\r\n + '' + data.type + '';\r\n $notification.append(notificationHTML);\r\n };\r\n\r\n sessionWS.onmessage = function (e) {\r\n var data = JSON.parse(e.data);\r\n switch (data.cmd) {\r\n case 'create-file':\r\n var node = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.dir)),\r\n name = data.path.replace(data.dir + '/', ''),\r\n mode = CodeMirror.findModeByFileName(name),\r\n iconSkin = wide.getClassBySuffix(name.split(\".\")[1]);\r\n\r\n if (data.type && data.type === 'f') {\r\n tree.fileTree.addNodes(node, [{\r\n \"id\": data.path,\r\n \"name\": name,\r\n \"iconSkin\": iconSkin,\r\n \"path\": data.path,\r\n \"mode\": mode,\r\n \"removable\": true,\r\n \"creatable\": true\r\n }]);\r\n\r\n } else {\r\n tree.fileTree.addNodes(node, [{\r\n \"id\": data.path,\r\n \"name\": name,\r\n \"iconSkin\": \"ico-ztree-dir \",\r\n \"path\": data.path,\r\n \"removable\": true,\r\n \"creatable\": true,\r\n \"isParent\": true\r\n }]);\r\n }\r\n break;\r\n case 'remove-file':\r\n case 'rename-file':\r\n var node = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.path));\r\n tree.fileTree.removeNode(node);\r\n\r\n var nodes = tree.fileTree.transformToArray(node);\r\n for (var i = 0, ii = nodes.length; i < ii; i++) {\r\n editors.tabs.del(nodes[i].path);\r\n }\r\n\r\n break;\r\n }\r\n };\r\n sessionWS.onclose = function (e) {\r\n console.log('[session onclose] disconnected (' + e.code + ')');\r\n\r\n var data = {type: \"Network\", severity: \"ERROR\",\r\n message: \"Disconnected from server, trying to reconnect it [sid=\" + config.wideSessionId + \"]\"},\r\n $notification = $('.bottom-window-group .notification > table'),\r\n notificationHTML = '';\r\n\r\n notificationHTML += '' + data.severity\r\n + '' + data.message\r\n + '' + data.type + '';\r\n $notification.append(notificationHTML);\r\n\r\n $(\".notification-count\").show();\r\n };\r\n sessionWS.onerror = function (e) {\r\n console.log('[session onerror]');\r\n };\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file menu.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.1.3, Oct 5, 2018\r\n */\r\nvar menu = {\r\n init: function () {\r\n this.subMenu();\r\n this._initPreference();\r\n this._initAbout();\r\n this._initShare();\r\n\r\n // 点击子菜单后消失\r\n $(\".menu .frame li\").click(function () {\r\n $(\".menu > ul > li\").unbind().removeClass(\"selected\");\r\n menu.subMenu();\r\n });\r\n },\r\n _initShare: function () {\r\n $(\".menu .ico-share\").hover(function () {\r\n $(\".menu .share-panel\").show();\r\n });\r\n\r\n $(\".share-panel .font-ico\").click(function () {\r\n var key = $(this).attr('class').split('-')[2];\r\n var url = \"https://wide.b3log.org\", pic = 'https://wide.b3log.org/static/images/wide-logo.png';\r\n var urls = {};\r\n urls.email = \"mailto:?subject=\" + $('title').text()\r\n + \"&body=\" + $('meta[name=description]').attr('content') + ' ' + url;\r\n\r\n var twitterShare = encodeURIComponent($('meta[name=description]').attr('content') + \" \" + url + \" #golang\");\r\n urls.twitter = \"https://twitter.com/intent/tweet?status=\" + twitterShare;\r\n\r\n urls.facebook = \"https://www.facebook.com/sharer/sharer.php?u=\" + url;\r\n urls.googleplus = \"https://plus.google.com/share?url=\" + url;\r\n\r\n var title = encodeURIComponent($('title').text() + '. \\n' + $('meta[name=description]').attr('content')\r\n + \" #golang#\");\r\n urls.weibo = \"http://v.t.sina.com.cn/share/share.php?title=\" + title + \"&url=\" + url + \"&pic=\" + pic;\r\n urls.qqz = \"https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=\" + url + \"&sharesource=qzone&title=\" + title+ \"&pics=\" + pic;\r\n\r\n window.open(urls[key], \"_blank\", \"top=100,left=200,width=648,height=618\");\r\n });\r\n },\r\n _initAbout: function () {\r\n $(\"#dialogAbout\").load('/about', function () {\r\n $(\"#dialogAbout\").dialog({\r\n \"modal\": true,\r\n \"title\": config.label.about,\r\n \"hideFooter\": true,\r\n \"afterOpen\": function () {\r\n $.ajax({\r\n url: \"https://rhythm.b3log.org/version/wide/latest\",\r\n type: \"GET\",\r\n dataType: \"jsonp\",\r\n jsonp: \"callback\",\r\n success: function (data, textStatus) {\r\n if ($(\"#dialogAbout .version\").text() === data.wideVersion) {\r\n $(\".upgrade\").text(config.label.uptodate);\r\n } else {\r\n $(\".upgrade\").html(config.label.new_version_available + config.label.colon\r\n + \"\" + data.wideVersion + \"\");\r\n }\r\n }\r\n });\r\n }\r\n });\r\n });\r\n },\r\n disabled: function (list) {\r\n for (var i = 0, max = list.length; i < max; i++) {\r\n $(\".menu li.\" + list[i]).addClass(\"disabled\");\r\n }\r\n },\r\n undisabled: function (list) {\r\n for (var i = 0, max = list.length; i < max; i++) {\r\n $(\".menu li.\" + list[i]).removeClass(\"disabled\");\r\n }\r\n },\r\n // 焦点不在菜单上时需点击展开子菜单,否则为鼠标移动展开\r\n subMenu: function () {\r\n $(\".menu > ul > li\").click(function (event) {\r\n if ($(event.target).closest(\".frame\").length === 1) {\r\n return;\r\n }\r\n var $it = $(this);\r\n $it.find('.frame').show();\r\n $(\".menu > ul > li\").removeClass(\"selected\");\r\n $(this).addClass(\"selected\");\r\n\r\n $(\".menu > ul > li\").unbind();\r\n\r\n $(\".menu > ul > li\").mouseover(function () {\r\n if ($(event.target).closest(\".frame\").length === 1) {\r\n return;\r\n }\r\n $(\".menu .frame\").hide();\r\n $(this).find('.frame').show();\r\n $(\".menu > ul > li\").removeClass(\"selected\");\r\n $(this).addClass(\"selected\");\r\n });\r\n });\r\n },\r\n openPreference: function () {\r\n $(\"#dialogPreference\").dialog(\"open\");\r\n },\r\n saveAllFiles: function () {\r\n if ($(\".menu li.save-all\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n var path = editors.data[i].id;\r\n var editor = editors.data[i].editor;\r\n\r\n if (\"text/x-go\" === editor.getOption(\"mode\")) {\r\n wide.fmt(path, editor);\r\n } else {\r\n wide._save(path, editor);\r\n }\r\n }\r\n },\r\n closeAllFiles: function () {\r\n if ($(\".menu li.close-all\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n // 设置全部关闭标识\r\n var removeData = [];\r\n $(\".edit-panel .tabs > div\").each(function (i) {\r\n if (i !== 0) {\r\n removeData.push($(this).data(\"index\"));\r\n }\r\n });\r\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\r\n // 开始关闭\r\n $(\".edit-panel .tabs .ico-close:eq(0)\").click();\r\n },\r\n exit: function () {\r\n var request = newWideRequest();\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/logout',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n success: function (result) {\r\n if (result.succ) {\r\n window.location.href = \"/login\";\r\n }\r\n }\r\n });\r\n },\r\n openAbout: function () {\r\n $(\"#dialogAbout\").dialog(\"open\");\r\n },\r\n goget: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-get\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/go/get',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n goinstall: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-install\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/go/install',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // go test.\r\n test: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-test\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/go/test',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // go vet.\r\n govet: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.go-vet\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/go/vet',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // Build & Run.\r\n run: function () {\r\n menu.saveAllFiles();\r\n\r\n if ($(\"#buildRun\").hasClass(\"ico-stop\")) {\r\n wide.stop();\r\n return false;\r\n }\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.run\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n request.code = wide.curEditor.getValue();\r\n request.nextCmd = \"run\";\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/build',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n\r\n $(\"#buildRun\").addClass(\"ico-stop\")\r\n .removeClass(\"ico-buildrun\").attr(\"title\", config.label.stop);\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n // Build.\r\n build: function () {\r\n menu.saveAllFiles();\r\n\r\n var currentPath = editors.getCurrentPath();\r\n if (!currentPath) {\r\n return false;\r\n }\r\n\r\n if ($(\".menu li.build\").hasClass(\"disabled\")) {\r\n return false;\r\n }\r\n\r\n var request = newWideRequest();\r\n request.file = currentPath;\r\n request.code = wide.curEditor.getValue();\r\n request.nextCmd = \"\"; // build only, no following operation\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/build',\r\n data: JSON.stringify(request),\r\n dataType: \"json\",\r\n beforeSend: function () {\r\n bottomGroup.resetOutput();\r\n },\r\n success: function (result) {\r\n }\r\n });\r\n },\r\n _initPreference: function () {\r\n $(\"#dialogPreference\").load('/preference', function () {\r\n $(\"#dialogPreference input\").keyup(function () {\r\n var isChange = false,\r\n emptys = [],\r\n emptysTip = '';\r\n $(\"#dialogPreference input\").each(function () {\r\n var $it = $(this);\r\n // data-value 如为数字,则不会和 value 一样转换为 String,再次不使用全等\r\n if ($it.val() != $it.data(\"value\")) {\r\n isChange = true;\r\n }\r\n\r\n if ($.trim($it.val()) === '') {\r\n emptys.push($it);\r\n }\r\n });\r\n\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (isChange) {\r\n $okBtn.prop(\"disabled\", false);\r\n } else {\r\n $okBtn.prop(\"disabled\", true);\r\n }\r\n\r\n if (emptys.length === 0) {\r\n $(\"#dialogPreference\").find(\".tip\").html(\"\");\r\n $okBtn.prop(\"disabled\", false);\r\n } else {\r\n for (var i = 0, max = emptys.length; i < max; i++) {\r\n var tabIndex = emptys[i].closest('div').data(\"index\"),\r\n text = $.trim(emptys[i].parent().text());\r\n emptysTip += '[' + $('#dialogPreference .tabs > div[data-index=\"' + tabIndex + '\"]').text()\r\n + '] -> [' + text.substr(0, text.length - 1)\r\n + ']: ' + config.label.no_empty + \"
    \";\r\n }\r\n $(\"#dialogPreference\").find(\".tip\").html(emptysTip);\r\n $okBtn.prop(\"disabled\", true);\r\n }\r\n });\r\n\r\n $(\"#dialogPreference select\").on(\"change\", function () {\r\n var isChange = false;\r\n $(\"#dialogPreference select\").each(function () {\r\n if ($(this).val() !== $(this).data(\"value\")) {\r\n isChange = true;\r\n }\r\n });\r\n\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n if (isChange) {\r\n $okBtn.prop(\"disabled\", false);\r\n } else {\r\n $okBtn.prop(\"disabled\", true);\r\n }\r\n });\r\n\r\n $(\"#dialogPreference\").dialog({\r\n \"modal\": true,\r\n \"height\": 280,\r\n \"width\": 800,\r\n \"title\": config.label.preference,\r\n \"okText\": config.label.apply,\r\n \"cancelText\": config.label.cancel,\r\n \"afterOpen\": function () {\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n $okBtn.prop(\"disabled\", true);\r\n },\r\n \"ok\": function () {\r\n var request = newWideRequest(),\r\n $dialogPreference = $(\"#dialogPreference\"),\r\n $fontFamily = $dialogPreference.find(\"input[name=fontFamily]\"),\r\n $fontSize = $dialogPreference.find(\"input[name=fontSize]\"),\r\n $goFmt = $dialogPreference.find(\"select[name=goFmt]\"),\r\n $GoBuildArgsForLinux = $dialogPreference.find(\"input[name=GoBuildArgsForLinux]\"),\r\n $GoBuildArgsForWindows = $dialogPreference.find(\"input[name=GoBuildArgsForWindows]\"),\r\n $GoBuildArgsForDarwin = $dialogPreference.find(\"input[name=GoBuildArgsForDarwin]\"),\r\n $workspace = $dialogPreference.find(\"input[name=workspace]\"),\r\n $password = $dialogPreference.find(\"input[name=password]\"),\r\n $email = $dialogPreference.find(\"input[name=email]\"),\r\n $locale = $dialogPreference.find(\"select[name=locale]\"),\r\n $theme = $dialogPreference.find(\"select[name=theme]\"),\r\n $editorFontFamily = $dialogPreference.find(\"input[name=editorFontFamily]\"),\r\n $editorFontSize = $dialogPreference.find(\"input[name=editorFontSize]\"),\r\n $editorLineHeight = $dialogPreference.find(\"input[name=editorLineHeight]\"),\r\n $editorTheme = $dialogPreference.find(\"select[name=editorTheme]\"),\r\n $editorTabSize = $dialogPreference.find(\"input[name=editorTabSize]\"),\r\n $keymap = $dialogPreference.find(\"select[name=keymap]\");\r\n\r\n $.extend(request, {\r\n \"fontFamily\": $fontFamily.val(),\r\n \"fontSize\": $fontSize.val(),\r\n \"goFmt\": $goFmt.val(),\r\n \"GoBuildArgsForLinux\": $GoBuildArgsForLinux.val(),\r\n \"GoBuildArgsForWindows\": $GoBuildArgsForWindows.val(),\r\n \"GoBuildArgsForDarwin\": $GoBuildArgsForDarwin.val(),\r\n \"workspace\": $workspace.val(),\r\n \"password\": $password.val(),\r\n \"email\": $email.val(),\r\n \"locale\": $locale.val(),\r\n \"theme\": $theme.val(),\r\n \"editorFontFamily\": $editorFontFamily.val(),\r\n \"editorFontSize\": $editorFontSize.val(),\r\n \"editorLineHeight\": $editorLineHeight.val(),\r\n \"editorTheme\": $editorTheme.val(),\r\n \"editorTabSize\": $editorTabSize.val(),\r\n \"keymap\": $keymap.val()\r\n });\r\n\r\n if (config.keymap !== $keymap.val()) {\r\n window.location.reload();\r\n }\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: '/preference',\r\n data: JSON.stringify(request),\r\n success: function (result, textStatus, jqXHR) {\r\n if (!result.succ) {\r\n return false;\r\n }\r\n\r\n $fontFamily.data(\"value\", $fontFamily.val());\r\n $fontSize.data(\"value\", $fontSize.val());\r\n $goFmt.data(\"value\", $goFmt.val());\r\n $GoBuildArgsForLinux.data(\"value\", $GoBuildArgsForLinux.val());\r\n $GoBuildArgsForWindows.data(\"value\", $GoBuildArgsForWindows.val());\r\n $GoBuildArgsForDarwin.data(\"value\", $GoBuildArgsForDarwin.val());\r\n $workspace.data(\"value\", $workspace.val());\r\n $password.data(\"value\", $password.val());\r\n $email.data(\"value\", $email.val());\r\n $locale.data(\"value\", $locale.val());\r\n $theme.data(\"value\", $theme.val());\r\n $editorFontFamily.data(\"value\", $editorFontFamily.val());\r\n $editorFontSize.data(\"value\", $editorFontSize.val());\r\n $editorLineHeight.data(\"value\", $editorLineHeight.val());\r\n $editorTheme.data(\"value\", $editorTheme.val());\r\n $editorTabSize.data(\"value\", $editorTabSize.val());\r\n $keymap.data(\"value\", $keymap.val());\r\n\r\n // update the config\r\n config.keymap = $keymap.val();\r\n\r\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\r\n $okBtn.prop(\"disabled\", true);\r\n\r\n $(\"#themesLink\").attr(\"href\", '/static/css/themes/' + $theme.val() + '.css');\r\n\r\n config.editorTheme = $editorTheme.val();\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n editors.data[i].editor.setOption(\"theme\", $editorTheme.val());\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n new Tabs({\r\n id: \".preference\"\r\n });\r\n });\r\n }\r\n};\r\n","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file windows.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.1.2.2, Feb 16, 2016\r\n */\r\nvar windows = {\r\n isMaxEditor: false,\r\n outerLayout: {},\r\n innerLayout: {},\r\n init: function () {\r\n if (!config.latestSessionContent) {\r\n config.latestSessionContent = {\r\n \"fileTree\": [],\r\n \"files\": [],\r\n \"currentFile\": \"\",\r\n };\r\n }\r\n \r\n if (!config.latestSessionContent.layout) {\r\n config.latestSessionContent.layout = {\r\n \"side\": {\r\n \"size\": 200,\r\n \"state\": 'normal'\r\n },\r\n \"sideRight\": {\r\n \"size\": 200,\r\n \"state\": 'normal'\r\n },\r\n \"bottom\": {\r\n \"size\": 100,\r\n \"state\": 'normal'\r\n }\r\n };\r\n }\r\n\r\n var layout = config.latestSessionContent.layout;\r\n\r\n this.outerLayout = $('body').layout({\r\n north__paneSelector: \".menu\",\r\n center__paneSelector: \".content\",\r\n south__paneSelector: \".footer\",\r\n north__size: 22,\r\n south__size: 19,\r\n spacing_open: 2,\r\n north__spacing_open: 0,\r\n south__spacing_open: 0,\r\n defaults: {\r\n fxSpeed_open: 300,\r\n fxSpeed_close: 100,\r\n fxSettings_close: {\r\n easing: \"easeOutQuint\"\r\n },\r\n fxSettings_open: {\r\n easing: \"easeInQuint\"\r\n }\r\n },\r\n west: {\r\n size: layout.side.size,\r\n paneSelector: \".side\",\r\n togglerLength_open: 0,\r\n togglerLength_closed: 15,\r\n togglerAlign_closed: \"top\",\r\n slideTrigger_open: \"mouseover\",\r\n spacing_closed: 15,\r\n minSize: 100,\r\n togglerClass: \"ico-restore\",\r\n togglerTip_open: config.label.min,\r\n togglerTip_closed: config.label.restore_side,\r\n resizerTip: config.label.resize,\r\n initClosed: (layout.side.state === 'min')\r\n }\r\n });\r\n\r\n this.innerLayout = $('div.content').layout({\r\n spacing_open: 2,\r\n defaults: {\r\n fxSpeed_open: 300,\r\n fxSpeed_close: 100,\r\n fxSettings_close: {\r\n easing: \"easeOutQuint\"\r\n },\r\n fxSettings_open: {\r\n easing: \"easeInQuint\"\r\n }\r\n },\r\n center: {\r\n paneSelector: \".edit-panel\"\r\n },\r\n east: {\r\n size: layout.sideRight.size,\r\n paneSelector: \".side-right\",\r\n togglerLength_open: 0,\r\n togglerLength_closed: 15,\r\n togglerAlign_closed: \"top\",\r\n slideTrigger_open: \"mouseover\",\r\n spacing_closed: 15,\r\n minSize: 100,\r\n togglerClass: \"ico-restore\",\r\n togglerTip_open: config.label.min,\r\n togglerTip_closed: config.label.restore_outline,\r\n resizerTip: config.label.resize,\r\n initClosed: (layout.sideRight.state === 'min')\r\n },\r\n south: {\r\n size: layout.bottom.size,\r\n paneSelector: \".bottom-window-group\",\r\n togglerLength_open: 0,\r\n togglerLength_closed: 15,\r\n togglerAlign_closed: \"top\",\r\n slideTrigger_open: \"mouseover\",\r\n spacing_closed: 16,\r\n minSize: 100,\r\n togglerClass: \"ico-restore\",\r\n togglerTip_open: config.label.min,\r\n togglerTip_closed: config.label.restore_bottom,\r\n resizerTip: config.label.resize,\r\n initClosed: (layout.bottom.state === 'min'),\r\n ondrag_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'drag');\r\n },\r\n onresize_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'resize');\r\n },\r\n onclose_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'close');\r\n },\r\n onopen_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'open');\r\n },\r\n onshow_end: function (type, pane) {\r\n windows.refreshEditor(pane, 'show');\r\n }\r\n }\r\n });\r\n\r\n this.outerLayout.addCloseBtn(\".side .ico-min\", \"west\");\r\n this.innerLayout.addCloseBtn(\".side-right .ico-min\", \"east\");\r\n this.innerLayout.addCloseBtn(\".bottom-window-group .ico-min\", \"south\");\r\n\r\n if (layout.side.state === 'max') {\r\n windows.maxSide();\r\n }\r\n if (layout.sideRight.state === 'max') {\r\n windows.maxSideRight();\r\n }\r\n if (layout.bottom.state === 'max') {\r\n windows.maxBottom();\r\n }\r\n\r\n $(\".toolbars .ico-max\").click(function () {\r\n windows.toggleEditor();\r\n });\r\n\r\n $(\".edit-panel .tabs\").on(\"dblclick\", function () {\r\n windows.toggleEditor();\r\n });\r\n\r\n $(\".bottom-window-group .tabs\").dblclick(function () {\r\n var $it = $(\".bottom-window-group\");\r\n if ($it.hasClass(\"bottom-window-group-max\")) {\r\n windows.restoreBottom();\r\n } else {\r\n windows.maxBottom($it);\r\n }\r\n });\r\n\r\n $(\".side .tabs\").dblclick(function () {\r\n var $it = $(\".side\");\r\n if ($it.hasClass(\"side-max\")) {\r\n windows.restoreSide();\r\n } else {\r\n windows.restoreSide($it);\r\n }\r\n });\r\n\r\n $(\".side-right .tabs\").dblclick(function () {\r\n var $it = $(\".side-right\");\r\n if ($it.hasClass(\"side-right-max\")) {\r\n windows.restoreSideRight();\r\n } else {\r\n windows.maxSideRight($it);\r\n }\r\n });\r\n\r\n $('.bottom-window-group .search').height($('.bottom-window-group .tabs-panel').height());\r\n $(window).resize(function () {\r\n windows.refreshEditor($('.bottom-window-group'));\r\n });\r\n\r\n },\r\n maxEditor: function () {\r\n var $it = $(\".toolbars .font-ico\");\r\n windows.outerLayout.close('west');\r\n windows.innerLayout.close('south');\r\n windows.innerLayout.close('east');\r\n $it.removeClass('ico-max').addClass('ico-restore').attr('title', config.label.min);\r\n windows.isMaxEditor = true;\r\n },\r\n maxBottom: function ($it) {\r\n $it.data('height', $it.height()).addClass(\"bottom-window-group-max\").find('.ico-min').hide();\r\n windows.outerLayout.hide('west');\r\n windows.innerLayout.hide('east');\r\n windows.innerLayout.sizePane('south', $('.content').height());\r\n },\r\n maxSide: function ($it) {\r\n $it.data('width', $it.width()).addClass(\"side-max\").find('.ico-min').hide();\r\n $('.content').hide();\r\n windows.outerLayout.sizePane('west', $('body').width());\r\n },\r\n maxSideRight: function ($it) {\r\n $it.addClass(\"side-right-max\").data('width', $it.width()).find('.ico-min').hide();\r\n windows.outerLayout.hide('west');\r\n windows.innerLayout.hide('south');\r\n windows.innerLayout.sizePane('east', $('body').width());\r\n },\r\n toggleEditor: function () {\r\n var $it = $(\".toolbars .font-ico\");\r\n if ($it.hasClass('ico-restore')) {\r\n windows.restoreEditor();\r\n } else {\r\n windows.maxEditor();\r\n }\r\n },\r\n restoreBottom: function () {\r\n var $it = $(\".bottom-window-group\");\r\n $it.removeClass(\"bottom-window-group-max\").find('.ico-min').show();\r\n windows.outerLayout.show('west');\r\n windows.innerLayout.show('east');\r\n windows.innerLayout.sizePane('south', $it.data('height'));\r\n },\r\n restoreSide: function () {\r\n var $it = $(\".side\");\r\n $it.removeClass(\"side-max\").find('.ico-min').show();\r\n $('.content').show();\r\n windows.outerLayout.sizePane('west', $it.data('width'));\r\n },\r\n restoreSideRight: function () {\r\n var $it = $(\".side-right\");\r\n $it.removeClass(\"side-right-max\").find('.ico-min').show();\r\n windows.outerLayout.show('west');\r\n windows.innerLayout.show('south');\r\n windows.innerLayout.sizePane('east', $it.data('width'));\r\n },\r\n restoreEditor: function () {\r\n windows.outerLayout.open('west');\r\n windows.innerLayout.open('south');\r\n windows.innerLayout.open('east');\r\n windows.isMaxEditor = false;\r\n $(\".toolbars .font-ico\").addClass('ico-max').removeClass('ico-restore').attr('title', config.label.max_editor);\r\n },\r\n refreshEditor: function (pane, type) {\r\n var editorDatas = editors.data,\r\n height = $('.content').height() - pane.height() - 24;\r\n switch (type) {\r\n case 'close':\r\n height = $('.content').height() - 40;\r\n break;\r\n default:\r\n break;\r\n }\r\n for (var i = 0, ii = editorDatas.length; i < ii; i++) {\r\n editorDatas[i].editor.setSize(\"100%\", height);\r\n }\r\n\r\n $('.bottom-window-group .search').height($('.bottom-window-group .tabs-panel').height());\r\n },\r\n flowBottom: function () {\r\n if (windows.innerLayout.south.state.isClosed) {\r\n windows.innerLayout.slideOpen('south');\r\n }\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file hotkeys.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.0.0.2, Dec 15, 2015\r\n */\r\nvar hotkeys = {\r\n defaultKeyMap: {\r\n // Ctrl-0\r\n goEditor: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 48,\r\n fun: function () {\r\n if (wide.curEditor) {\r\n wide.curEditor.focus();\r\n }\r\n }\r\n },\r\n // Ctrl-1\r\n goFileTree: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 49,\r\n fun: function () {\r\n // 有些元素需设置 tabindex 为 -1 时才可以 focus\r\n if (windows.outerLayout.west.state.isClosed) {\r\n windows.outerLayout.slideOpen('west');\r\n }\r\n $(\"#files\").focus();\r\n }\r\n },\r\n // Ctrl-2\r\n goOutline: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 50,\r\n fun: function () {\r\n if (windows.innerLayout.east.state.isClosed) {\r\n windows.innerLayout.slideOpen('east');\r\n }\r\n\r\n $(\"#outline\").focus();\r\n }\r\n },\r\n // Ctrl-4\r\n goOutput: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 52,\r\n fun: function () {\r\n bottomGroup.tabs.setCurrent(\"output\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .output\").focus();\r\n }\r\n },\r\n // Ctrl-5\r\n goSearch: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 53,\r\n fun: function () {\r\n bottomGroup.tabs.setCurrent(\"search\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .search\").focus();\r\n }\r\n },\r\n // Ctrl-6\r\n goNotification: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 54,\r\n fun: function () {\r\n bottomGroup.tabs.setCurrent(\"notification\");\r\n windows.flowBottom();\r\n $(\".bottom-window-group .notification\").focus();\r\n }\r\n },\r\n // Alt-C\r\n clearWindow: {\r\n ctrlKey: false,\r\n altKey: true,\r\n shiftKey: false,\r\n which: 67\r\n },\r\n // Ctrl-D 窗口组切换 \r\n changeEditor: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 68\r\n },\r\n // Ctrl-F search \r\n search: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 70\r\n },\r\n // Ctrl-Q close current editor \r\n closeCurEditor: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 81\r\n },\r\n // Ctrl-R\r\n rename: {\r\n ctrlKey: true,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 82\r\n },\r\n // Shift-Alt-O 跳转到文件\r\n goFile: {\r\n ctrlKey: false,\r\n altKey: true,\r\n shiftKey: true,\r\n which: 79\r\n },\r\n // F5 Build\r\n build: {\r\n ctrlKey: false,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 116\r\n },\r\n // F6 Build & Run\r\n buildRun: {\r\n ctrlKey: false,\r\n altKey: false,\r\n shiftKey: false,\r\n which: 117\r\n }\r\n },\r\n bindList: function ($source, $list, enterFun) {\r\n $list.data(\"index\", 0);\r\n $source.keydown(function (event) {\r\n var index = $list.data(\"index\"),\r\n count = $list.find(\"li\").length;\r\n\r\n if (count === 0) {\r\n return true;\r\n }\r\n\r\n if (event.which === 38) { // up\r\n index--;\r\n if (index < 0) {\r\n index = count - 1;\r\n }\r\n }\r\n\r\n if (event.which === 40) { // down\r\n index++;\r\n if (index > count - 1) {\r\n index = 0;\r\n }\r\n }\r\n\r\n var $selected = $list.find(\"li:eq(\" + index + \")\");\r\n\r\n if (event.which === 13) { // enter\r\n enterFun($selected);\r\n }\r\n\r\n $list.find(\"li\").removeClass(\"selected\");\r\n $list.data(\"index\", index);\r\n $selected.addClass(\"selected\");\r\n\r\n if (index === 0) {\r\n $list.scrollTop(0);\r\n } else {\r\n if ($selected[0].offsetTop + $list.scrollTop() > $list.height()) {\r\n if (event.which === 40) {\r\n $list.scrollTop($list.scrollTop() + $selected.height());\r\n } else {\r\n $list.scrollTop($selected[0].offsetTop);\r\n }\r\n } else {\r\n $list.scrollTop(0);\r\n }\r\n }\r\n\r\n // 阻止上下键改变光标位置\r\n if (event.which === 38 || event.which === 40 || event.which === 13) {\r\n return false;\r\n }\r\n });\r\n },\r\n _bindOutput: function () {\r\n $(\".bottom-window-group .output\").keydown(function (event) {\r\n var hotKeys = hotkeys.defaultKeyMap;\r\n if (event.altKey === hotKeys.clearWindow.altKey\r\n && event.which === hotKeys.clearWindow.which) { // Alt-C clear output\r\n bottomGroup.clear('output');\r\n\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n });\r\n },\r\n _bindFileTree: function () {\r\n $(\"#files\").keydown(function (event) {\r\n event.preventDefault();\r\n\r\n var hotKeys = hotkeys.defaultKeyMap;\r\n if (event.ctrlKey === hotKeys.search.ctrlKey\r\n && event.which === hotKeys.search.which) { // Ctrl-F 搜索\r\n $(\"#dialogSearchForm\").dialog(\"open\");\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.rename.ctrlKey\r\n && event.which === hotKeys.rename.which) { // Ctrl-R 重命名\r\n if (wide.curNode.removable) {\r\n $(\"#dialogRenamePrompt\").dialog(\"open\");\r\n }\r\n return;\r\n }\r\n\r\n switch (event.which) {\r\n case 46: // delete\r\n tree.removeIt();\r\n break;\r\n case 13: // enter\r\n if (!wide.curNode) {\r\n return false;\r\n }\r\n\r\n if (tree.isDir()) {\r\n if (wide.curNode.open) {\r\n return false;\r\n }\r\n\r\n tree.fileTree.expandNode(wide.curNode, true, false, true);\r\n $(\"#files\").focus();\r\n\r\n break;\r\n }\r\n\r\n tree.openFile(wide.curNode);\r\n\r\n break;\r\n case 38: // up\r\n var node = {};\r\n\r\n if (!wide.curNode) { // select the first one if no node been selected\r\n node = tree.fileTree.getNodeByTId(\"files_1\");\r\n } else {\r\n if (wide.curNode && wide.curNode.isFirstNode && wide.curNode.level === 0) {\r\n return false;\r\n }\r\n\r\n node = wide.curNode.getPreNode();\r\n if (wide.curNode.isFirstNode && wide.curNode.getParentNode()) {\r\n node = wide.curNode.getParentNode();\r\n }\r\n\r\n var preNode = wide.curNode.getPreNode();\r\n if (preNode && tree.isDir() && preNode.open) {\r\n node = tree.getCurrentNodeLastNode(preNode);\r\n }\r\n }\r\n\r\n wide.curNode = node;\r\n tree.fileTree.selectNode(node);\r\n $(\"#files\").focus();\r\n break;\r\n case 40: // down\r\n var node = {};\r\n\r\n if (!wide.curNode) { // select the first one if no node been selected \r\n node = tree.fileTree.getNodeByTId(\"files_1\");\r\n } else {\r\n if (wide.curNode && tree.isBottomNode(wide.curNode)) {\r\n return false;\r\n }\r\n\r\n node = wide.curNode.getNextNode();\r\n if (tree.isDir() && wide.curNode.open) {\r\n node = wide.curNode.children[0];\r\n }\r\n\r\n var nextShowNode = tree.getNextShowNode(wide.curNode);\r\n if (wide.curNode.isLastNode && wide.curNode.level !== 0 && !wide.curNode.open && nextShowNode) {\r\n node = nextShowNode;\r\n }\r\n }\r\n\r\n if (node) {\r\n wide.curNode = node;\r\n tree.fileTree.selectNode(node);\r\n }\r\n\r\n $(\"#files\").focus();\r\n break;\r\n case 37: // left\r\n if (!wide.curNode) {\r\n wide.curNode = tree.fileTree.getNodeByTId(\"files_1\");\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#files\").focus();\r\n return false;\r\n }\r\n\r\n if (!tree.isDir() || !wide.curNode.open) {\r\n return false;\r\n }\r\n\r\n tree.fileTree.expandNode(wide.curNode, false, false, true);\r\n $(\"#files\").focus();\r\n break;\r\n case 39: // right\r\n if (!wide.curNode) {\r\n wide.curNode = tree.fileTree.getNodeByTId(\"files_1\");\r\n tree.fileTree.selectNode(wide.curNode);\r\n $(\"#files\").focus();\r\n return false;\r\n }\r\n\r\n if (!tree.isDir() || wide.curNode.open) {\r\n return false;\r\n }\r\n\r\n tree.fileTree.expandNode(wide.curNode, true, false, true);\r\n $(\"#files\").focus();\r\n\r\n break;\r\n case 116: // F5\r\n if (!wide.curNode || !tree.isDir()) {\r\n return false;\r\n }\r\n\r\n tree.refresh(wide.curNode);\r\n\r\n break;\r\n }\r\n });\r\n },\r\n _bindDocument: function () {\r\n var hotKeys = this.defaultKeyMap;\r\n $(document).keydown(function (event) {\r\n if (event.ctrlKey === hotKeys.goEditor.ctrlKey\r\n && event.which === hotKeys.goEditor.which) { // Ctrl-0 焦点切换到当前编辑器\r\n hotKeys.goEditor.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goFileTree.ctrlKey\r\n && event.which === hotKeys.goFileTree.which) { // Ctrl-1 焦点切换到文件树\r\n hotKeys.goFileTree.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goOutline.ctrlKey\r\n && event.which === hotKeys.goOutline.which) { // Ctrl-2 焦点切换到大纲\r\n hotKeys.goOutline.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goOutput.ctrlKey\r\n && event.which === hotKeys.goOutput.which) { // Ctrl-4 焦点切换到输出窗口 \r\n hotKeys.goOutput.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goSearch.ctrlKey\r\n && event.which === hotKeys.goSearch.which) { // Ctrl-5 焦点切换到搜索窗口 \r\n hotKeys.goSearch.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goNotification.ctrlKey\r\n && event.which === hotKeys.goNotification.which) { // Ctrl-6 焦点切换到通知窗口 \r\n hotKeys.goNotification.fun();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.closeCurEditor.ctrlKey\r\n && event.which === hotKeys.closeCurEditor.which) { // Ctrl-Q 关闭当前编辑器 \r\n $(\".edit-panel .tabs > div.current\").find(\".ico-close\").click();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.changeEditor.ctrlKey\r\n && event.which === hotKeys.changeEditor.which) { // Ctrl-D 窗口组切换\r\n if (document.activeElement.className === \"notification\"\r\n || document.activeElement.className === \"output\"\r\n || document.activeElement.className === \"search\") {\r\n // 焦点在底部窗口组时,对底部进行切换\r\n var tabs = [\"output\", \"search\", \"notification\"],\r\n nextPath = \"\";\r\n for (var i = 0, ii = tabs.length; i < ii; i++) {\r\n if (bottomGroup.tabs.getCurrentId() === tabs[i]) {\r\n if (i < ii - 1) {\r\n nextPath = tabs[i + 1];\r\n } else {\r\n nextPath = tabs[0];\r\n }\r\n break;\r\n }\r\n }\r\n bottomGroup.tabs.setCurrent(nextPath);\r\n $(\".bottom-window-group .\" + nextPath).focus();\r\n\r\n event.preventDefault();\r\n\r\n return false;\r\n }\r\n\r\n if (editors.data.length > 1) {\r\n var nextPath = \"\";\r\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\r\n var currentId = editors.getCurrentId();\r\n if (currentId) {\r\n if (currentId === editors.data[i].id) {\r\n if (i < ii - 1) {\r\n nextPath = editors.data[i + 1].id;\r\n wide.curEditor = editors.data[i + 1].editor;\r\n } else {\r\n nextPath = editors.data[0].id;\r\n wide.curEditor = editors.data[0].editor;\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n editors.tabs.setCurrent(nextPath);\r\n var nextTId = tree.getTIdByPath(nextPath);\r\n wide.curNode = tree.fileTree.getNodeByTId(nextTId);\r\n\r\n tree.fileTree.selectNode(wide.curNode);\r\n wide.refreshOutline();\r\n var cursor = wide.curEditor.getCursor();\r\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\r\n wide.curEditor.focus();\r\n }\r\n\r\n event.preventDefault();\r\n\r\n return false;\r\n }\r\n\r\n if (event.which === hotKeys.build.which) { // F5 Build\r\n menu.build();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.which === hotKeys.buildRun.which) { // F6 Build & Run\r\n menu.run();\r\n event.preventDefault();\r\n\r\n return;\r\n }\r\n\r\n if (event.ctrlKey === hotKeys.goFile.ctrlKey\r\n && event.altKey === hotKeys.goFile.altKey\r\n && event.shiftKey === hotKeys.goFile.shiftKey\r\n && event.which === hotKeys.goFile.which) { // Shift-Alt-O 跳转到文件\r\n $(\"#dialogGoFilePrompt\").dialog(\"open\");\r\n }\r\n });\r\n },\r\n init: function () {\r\n this._bindFileTree();\r\n this._bindOutput();\r\n this._bindDocument();\r\n }\r\n};","/*\r\n * Copyright (c) 2014-2019, b3log.org & hacpai.com\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/*\r\n * @file bottomGroup.js\r\n *\r\n * @author Liyuan Li\r\n * @author Liang Ding\r\n * @version 1.1.1.1, Mar 15, 2017\r\n */\r\nvar bottomGroup = {\r\n tabs: undefined,\r\n searchTab: undefined,\r\n init: function () {\r\n this._initTabs();\r\n this._initFrame();\r\n\r\n $('.bottom-window-group .output').click(function () {\r\n $(this).focus();\r\n });\r\n\r\n $('.bottom-window-group .output').on('click', '.path', function (event) {\r\n var $path = $(this),\r\n tId = tree.getTIdByPath($path.data(\"path\"));\r\n tree.openFile(tree.fileTree.getNodeByTId(tId),\r\n CodeMirror.Pos($path.data(\"line\") - 1, $path.data(\"column\") - 1));\r\n event.preventDefault();\r\n return false;\r\n });\r\n },\r\n _initFrame: function () {\r\n $(\".bottom-window-group .output\").parent().mouseup(function (event) {\r\n event.stopPropagation();\r\n\r\n if (event.button === 0) { // 左键\r\n $(\".bottom-window-group .frame\").hide();\r\n return;\r\n }\r\n\r\n // event.button === 2 右键\r\n var left = event.screenX,\r\n $it = $(this);\r\n if ($(\".side\").css(\"left\") === \"auto\" || $(\".side\").css(\"left\") === \"0px\") {\r\n left = event.screenX - $(\".side\").width();\r\n }\r\n $(\".bottom-window-group .frame\").show().css({\r\n \"left\": left + \"px\",\r\n \"top\": (event.offsetY + event.target.offsetTop - $it.scrollTop() - 10) + \"px\"\r\n });\r\n return;\r\n });\r\n },\r\n clear: function (id) {\r\n $('.bottom-window-group .' + id + ' > div').text('');\r\n },\r\n resetOutput: function () {\r\n this.clear('output');\r\n bottomGroup.tabs.setCurrent(\"output\");\r\n windows.flowBottom();\r\n },\r\n _initTabs: function () {\r\n this.tabs = new Tabs({\r\n id: \".bottom-window-group\",\r\n clickAfter: function (id) {\r\n this._$tabsPanel.find(\".\" + id).focus();\r\n }\r\n });\r\n },\r\n fillOutput: function (data) {\r\n var $output = $('.bottom-window-group .output');\r\n\r\n data = data.replace(/\\r/g, '');\r\n data = data.replace(/\\n/g, '
    ');\r\n\r\n if (-1 !== data.indexOf(\"
    \")) {\r\n data = Autolinker.link(data);\r\n }\r\n\r\n $output.find(\"div\").html(data);\r\n $output.parent().scrollTop($output[0].scrollHeight);\r\n }\r\n};\r\n"]} \ No newline at end of file diff --git a/views/index.html b/views/index.html index a18cdb4..bc715db 100644 --- a/views/index.html +++ b/views/index.html @@ -8,27 +8,27 @@ {{if eq $.conf.RuntimeMode "dev"}} - - - - - - + + + + + + {{range $index, $theme := .editorThemes}} - {{end}} - - - - - - + {{end}} + + + + + + {{else}} - - + + {{end}} - - - + + + @@ -558,12 +558,12 @@