wide/static/js/wide.min.js.map

1 line
247 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"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","gitClone","import","fileupload","formData","done","fail","$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","git_clone","repository","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,EAAIG,GAAK,kBAC7BH,EAAII,OAASF,EAAEF,EAAIG,GAAK,YACxBH,EAAIK,OAAS,GAEbC,KAAKN,IAAMA,EACXM,KAAKN,IAAIO,UAAY,GAErB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WC,KAAKzvB,IAG3BuvB,EAAQruB,KAAK,OAAO+I,KAAKjK,GACzBuvB,EAAQ3uB,SAASstB,UAAUqB,EAAQ,GAAGtoB","file":"wide.min.js","sourcesContent":["/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file tabs.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @version 1.0.0.1, Dec 8, 2015\n */\nvar Tabs = function (obj) {\n obj._$tabsPanel = $(obj.id + \" > .tabs-panel\");\n obj._$tabs = $(obj.id + \" > .tabs\");\n obj._stack = [];\n\n this.obj = obj;\n this.obj.STACKSIZE = 64;\n\n this._init(obj);\n\n // DOM 元素存在时,应顺序入栈\n var _it = this;\n $(obj.id + \" > .tabs > div\").each(function () {\n var id = $(this).data(\"index\");\n if (obj._stack.length === _it.obj.STACKSIZE) {\n obj._stack.splice(0, 1);\n }\n if (obj._stack[obj._stack.length - 1] !== id) {\n _it.obj._stack.push(id);\n }\n });\n\n};\n\n$.extend(Tabs.prototype, {\n _init: function (obj) {\n var _that = this;\n\n obj._$tabs.on(\"click\", \"div\", function (event) {\n if ($(this).hasClass('current')) {\n return false;\n }\n\n var id = $(this).data(\"index\");\n _that.setCurrent(id);\n if (typeof (obj.clickAfter) === \"function\") {\n obj.clickAfter(id);\n }\n });\n\n obj._$tabs.on(\"click\", \".ico-close\", function (event) {\n var id = $(this).parent().data(\"index\"),\n isRemove = true;\n\n if (typeof obj.removeBefore === 'function') {\n isRemove = obj.removeBefore(id);\n }\n\n if (isRemove) {\n _that.del(id);\n }\n event.stopPropagation();\n });\n },\n _hasId: function (id) {\n var $tabs = this.obj._$tabs;\n if ($tabs.find('div[data-index=\"' + id + '\"]').length === 0) {\n return false;\n }\n return true;\n },\n add: function (data) {\n // 添加当前 tab\n if (this.getCurrentId() === data.id) {\n return false;\n }\n\n // 当前 tab 已经存在\n if (this._hasId(data.id)) {\n this.setCurrent(data.id);\n return false;\n }\n\n var $tabsPanel = this.obj._$tabsPanel,\n $tabs = this.obj._$tabs;\n\n $tabs.append('<div data-index=\"' + data.id + '\">'\n + data.title + ' <span class=\"ico-close font-ico\"></span></div>');\n $tabsPanel.append('<div data-index=\"' + data.id + '\">' + data.content\n + '</div>');\n\n this.setCurrent(data.id);\n\n if (typeof data.after === 'function') {\n data.after();\n }\n },\n del: function (id) {\n var $tabsPanel = this.obj._$tabsPanel,\n $tabs = this.obj._$tabs,\n stack = this.obj._stack,\n prevId = null;\n\n $tabs.children(\"div[data-index='\" + id + \"']\").remove();\n $tabsPanel.children(\"div[data-index='\" + id + \"']\").remove();\n\n // 移除堆栈中该 id\n for (var i = 0; i < stack.length; i++) {\n if (id === stack[i]) {\n stack.splice(i, 1);\n i--;\n }\n }\n\n prevId = stack[stack.length - 1];\n\n if (typeof this.obj.removeAfter === 'function') {\n this.obj.removeAfter(id, prevId);\n }\n\n this.setCurrent(prevId);\n },\n getCurrentId: function () {\n var $tabs = this.obj._$tabs;\n return $tabs.children(\".current\").data(\"index\");\n },\n setCurrent: function (path) {\n if (!path) {\n return false;\n }\n\n var $tabsPanel = this.obj._$tabsPanel,\n $tabs = this.obj._$tabs;\n\n var $currentTab = $tabs.children(\".current\");\n if ($currentTab.data(\"index\") === path) {\n return false;\n }\n\n // tab 顺序入栈,如栈满则清除\n var stack = this.obj._stack;\n if (stack.length === this.obj.STACKSIZE) {\n stack.splice(0, 1);\n }\n if (stack[stack.length - 1] !== path) {\n this.obj._stack.push(path);\n }\n\n $tabs.children(\"div\").removeClass(\"current\");\n $tabsPanel.children(\"div\").hide();\n\n $tabs.children('div[data-index=\"' + path + '\"]').addClass(\"current\");\n $tabsPanel.children('div[data-index=\"' + path + '\"]').show();\n\n if (typeof this.obj.setAfter === 'function') {\n this.obj.setAfter();\n }\n\n var id = this.getCurrentId();\n if (\"startPage\" === id) {\n return;\n }\n\n // set tree node selected\n var tId = tree.getTIdByPath(id);\n var node = tree.fileTree.getNodeByTId(tId);\n tree.fileTree.selectNode(node);\n wide.curNode = node;\n\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n if (editors.data[i].id === id) {\n wide.curEditor = editors.data[i].editor;\n break;\n }\n }\n\n if (wide.curEditor) {\n var cursor = wide.curEditor.getCursor();\n wide.curEditor.setCursor(cursor);\n wide.curEditor.focus();\n wide.refreshOutline();\n\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\n }\n }\n});","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file dialog.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @version 1.0.0.1, Dec 8, 2015\n */\n(function ($) {\n $.fn.extend({\n dialog: {\n version: \"0.0.1.7\",\n author: \"v@b3log.org\"\n }\n });\n\n var dpuuid = new Date().getTime();\n var PROP_NAME = 'dialog';\n\n var Dialog = function () {\n this._defaults = {\n \"styleClass\": {\n \"background\": \"dialog-background\",\n \"panel\": \"dialog-panel\",\n \"main\": \"dialog-main\",\n \"footer\": \"dialog-footer\",\n \"headerMiddle\": \"dialog-header-middle\",\n \"headerBg\": \"dialog-header-bg\",\n \"closeIcon\": \"dialog-close-icon\",\n \"closeIconHover\": \"dialog-close-icon-hover\",\n \"title\": \"dialog-title\"\n }\n };\n };\n\n $.extend(Dialog.prototype, {\n _attach: function (target, settings) {\n if (!target.id) {\n this.uuid++;\n target.id = 'dp' + this.uuid;\n }\n var inst = this._newInst($(target));\n\n inst.settings = $.extend({}, settings || {});\n $.data(target, PROP_NAME, inst);\n this._init(target);\n },\n /* Create a new instance object. */\n _newInst: function (target) {\n // escape jQuery meta chars\n var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\\\\\$1');\n return {\n id: id\n };\n },\n _getInst: function (target) {\n try {\n return $.data(target, PROP_NAME);\n } catch (err) {\n throw 'Missing instance data for this dialog';\n }\n },\n _destroyDialog: function (target) {\n var inst = $.dialog._getInst(target);\n var id = inst.id;\n $.removeData(target, PROP_NAME);\n\n $(target).prependTo(\"#\" + id + \"Wrap\").unwrap();\n $(target).removeAttr(\"style\");\n\n var styleClass = this._getDefaults($.dialog._defaults, inst.settings, \"styleClass\");\n $(\".\" + styleClass.background).remove();\n $(\"#\" + id + \"Dialog\").remove();\n },\n _init: function (target) {\n var inst = this._getInst(target);\n var id = inst.id,\n settings = inst.settings;\n var windowH = $(window).height(),\n windowW = $(window).width();\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\"),\n dialogH = settings.height ? settings.height : parseInt(windowH * 0.6),\n dialogW = settings.width ? settings.width : parseInt(windowW * 0.6);\n\n // get settings or default value.\n settings.title = settings.title ? settings.title : \"\";\n settings.okText = settings.okText ? settings.okText : \"Ok\";\n settings.cancelText = settings.cancelText ? settings.cancelText : \"Cancel\";\n\n // build HTML.\n var footerHTML = \"\",\n headerHTML = \"<div class='\"\n + styleClass.headerBg + \"'><div class='\"\n + styleClass.title + \"'>\"\n + settings.title + \"</div><a href='javascript:void(0);' class='ico-close font-ico \"\n + styleClass.closeIcon + \"'></a></div>\";\n\n // Sets footerHTML.\n if (!settings.hideFooter) {\n if (!settings.hiddenOk) {\n footerHTML = \"<button>\" + settings.okText +\n \"</button>\";\n }\n footerHTML += \"<button>\"\n + settings.cancelText + \"</button>\";\n }\n\n var dialogHTML = \"<div id='\" + id + \"Dialog' class='\" + styleClass.panel\n + \"' style='width: \" + dialogW + \"px;' onselectstart='return false;'>\" + headerHTML\n + \"<div class='\" + styleClass.main + \"'><div style='overflow: auto; height: \"\n + dialogH + \"px;'></div><div class='\" + styleClass.footer + \"'>\"\n + footerHTML + \"</div></div>\";\n\n var bgHTML = \"\";\n if (settings.modal && $(\".\" + styleClass.background).length === 0) {\n var bgHeight = windowH < document.documentElement.scrollHeight\n ? document.documentElement.scrollHeight : windowH;\n bgHTML = \"<div style='height:\" + bgHeight\n + \"px;' class='\" + styleClass.background + \"'></div>\";\n }\n\n // Package dialog.\n $(\"#\" + id).wrap(\"<div id='\" + id + \"Wrap'></div>\");\n var cloneObj = $(target).clone(true);\n $(target).remove();\n $('body').append(bgHTML + dialogHTML);\n $($(\"#\" + id + \"Dialog .\" + styleClass.main + \" div\").get(0)).append(cloneObj);\n $(cloneObj).show();\n\n // Bind event.\n $(\"#\" + id + \"Dialog .\" + styleClass.closeIcon).bind(\"click\", function () {\n $.dialog._close(id, settings);\n });\n\n var $buttons = $(\"#\" + id + \"Dialog .\" + styleClass.footer + \" button\");\n $($buttons.get(1)).bind(\"click\", function () {\n $.dialog._close(id, settings);\n });\n\n $($buttons.get(0)).bind(\"click\", function () {\n if (settings.ok === undefined || settings.ok()) {\n $.dialog._close(id, settings);\n }\n });\n\n this._bindMove(id, styleClass.headerBg, dialogH, dialogW);\n\n // esc exit\n $(window).keyup(function (event) {\n if (event.keyCode === 27) {\n $.dialog._close(id, settings);\n }\n });\n\n $(window).resize(function () {\n var height = $(\"body\").height() > $(window).height() ? $(\"body\").height() : $(window).height();\n $(\".dialog-background\").height(height);\n });\n\n if (typeof settings.afterInit === \"function\") {\n settings.afterInit();\n }\n },\n _bindMove: function (id, className) {\n $(\"#\" + id + \"Dialog .\" + className).mousedown(function (event) {\n var _document = document;\n if (!event) {\n event = window.event;\n }\n var dialog = document.getElementById(id + \"Dialog\");\n var x = event.clientX - parseInt(dialog.style.left),\n y = event.clientY - parseInt(dialog.style.top);\n _document.ondragstart = \"return false;\";\n _document.onselectstart = \"return false;\";\n _document.onselect = \"document.selection.empty();\";\n\n if (this.setCapture) {\n this.setCapture();\n } else if (window.captureEvents) {\n window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);\n }\n\n _document.onmousemove = function (event) {\n if (!event) {\n event = window.event;\n }\n var positionX = event.clientX - x,\n positionY = event.clientY - y;\n if (positionX < 0) {\n positionX = 0;\n }\n if (positionX > $(window).width() - $(dialog).width()) {\n positionX = $(window).width() - $(dialog).width();\n }\n if (positionY > $(window).height() - $(dialog).height()) {\n positionY = $(window).height() - $(dialog).height();\n }\n if (positionY < 0) {\n positionY = 0;\n }\n dialog.style.left = positionX + \"px\";\n dialog.style.top = positionY + \"px\";\n };\n\n _document.onmouseup = function () {\n if (this.releaseCapture) {\n this.releaseCapture();\n } else if (window.captureEvents) {\n window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);\n }\n _document.onmousemove = null;\n _document.onmouseup = null;\n _document.ondragstart = null;\n _document.onselectstart = null;\n _document.onselect = null;\n };\n });\n },\n _close: function (id, settings) {\n if ($(\"#\" + id + \"Dialog\").css(\"display\") === \"none\") {\n return;\n }\n if (settings.close === undefined || settings.close()) {\n $(\"#\" + id + \"Dialog\").hide();\n if (settings.modal) {\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\n $(\".\" + styleClass.background).hide();\n }\n }\n },\n _closeDialog: function (target) {\n var inst = this._getInst(target);\n var id = inst.id,\n settings = inst.settings;\n $.dialog._close(id, settings);\n },\n _openDialog: function (target, msg) {\n var inst = this._getInst(target);\n var id = inst.id,\n settings = inst.settings,\n top = \"\", left = \"\",\n $dialog = $(\"#\" + id + \"Dialog\"),\n windowH = $(window).height(),\n windowW = $(window).width(),\n dialogH = settings.height ? settings.height : parseInt(windowH * 0.6),\n dialogW = settings.width ? settings.width : parseInt(windowW * 0.6);\n\n // Sets position.\n if (settings.position) {\n top = settings.position.top;\n left = settings.position.left;\n } else {\n // 20(footer) + 23(header)\n top = parseInt((windowH - dialogH - 43) / 2);\n if (top < 0) {\n top = 0;\n }\n left = parseInt((windowW - dialogW) / 2);\n }\n $dialog.css({\n \"top\": top + \"px\",\n \"left\": left + \"px\"\n }).show();\n\n if (settings.modal) {\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\n $(\".\" + styleClass.background).show();\n }\n\n if (typeof settings.afterOpen === \"function\") {\n settings.afterOpen(msg);\n }\n\n $(\"#\" + id + \"Dialog .dialog-footer button:eq(0)\").focus();\n },\n _updateDialog: function (target, data) {\n var inst = this._getInst(target);\n var id = inst.id,\n settings = inst.settings;\n var styleClass = this._getDefaults($.dialog._defaults, settings, \"styleClass\");\n $.extend(settings, data);\n var $dialog = $(\"#\" + id + \"Dialog\");\n if (data.position) {\n $dialog.css({\n \"top\": data.position.top,\n \"left\": data.position.left\n });\n }\n\n if (data.width) {\n $dialog.width(data.width + 26);\n $dialog.find(\".\" + styleClass.main + \" div\")[0].style.width = data.width + \"px\";\n $dialog.find(\".\" + styleClass.headerBg).width(data.width + 18);\n }\n\n if (data.height) {\n $dialog.find(\".\" + styleClass.main + \" div\")[0].style.height = data.height + \"px\";\n }\n\n if (data.title) {\n $dialog.find(\".\" + styleClass.title).html(data.title);\n }\n\n if (data.modal !== undefined) {\n if (data.modal) {\n $(\".\" + styleClass.background).show();\n } else {\n $(\".\" + styleClass.background).hide();\n }\n }\n\n if (data.hideFooter !== undefined) {\n if (data.hideFooter) {\n $dialog.find(\".\" + styleClass.footer).hide();\n } else {\n $dialog.find(\".\" + styleClass.footer).show();\n }\n }\n\n },\n _getDefaults: function (defaults, settings, key) {\n if (key === \"styleClass\") {\n if (settings.theme === \"default\" || settings.theme === undefined) {\n return defaults.styleClass;\n }\n settings.styleClass = {};\n for (var styleName in defaults[key]) {\n settings.styleClass[styleName] = settings.theme + \"-\" + defaults.styleClass[styleName];\n }\n } else if (key === \"height\" || key === \"width\") {\n if (settings[key] === null || settings[key] === undefined) {\n return \"auto\";\n } else {\n return settings[key] + \"px\";\n }\n } else {\n if (settings[key] === null || settings[key] === undefined) {\n return defaults[key];\n }\n }\n return settings[key];\n }\n });\n\n $.fn.dialog = function (options) {\n var otherArgs = Array.prototype.slice.call(arguments);\n\n if (typeof options === 'string') {\n otherArgs.shift();\n return $.dialog['_' + options + 'Dialog'].apply($.dialog, [this[0]].concat(otherArgs));\n }\n return this.each(function () {\n $.dialog._attach(this, options);\n });\n };\n\n $.dialog = new Dialog();\n\n // Add another global to avoid noConflict issues with inline event handlers\n window['DP_jQuery_' + dpuuid] = $;\n})(jQuery);","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file editor.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.1.1.0, Jan 12, 2016\n */\nvar editors = {\n autocompleteMutex: false,\n data: [],\n tabs: {},\n getEditorByPath: function (path) {\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n if (editors.data[i].editor.options.path === path) {\n return editors.data[i].editor;\n }\n }\n },\n close: function () {\n $('.edit-panel .tabs > div[data-index=\"' + $('.edit-panel .frame').data('index') + ']').find('.ico-close').click();\n },\n closeOther: function () {\n var currentIndex = $(\".edit-panel .frame\").data(\"index\");\n\n // 设置全部关闭标识\n var removeData = [];\n $(\".edit-panel .tabs > div\").each(function (i) {\n if (currentIndex !== $(this).data(\"index\")) {\n removeData.push($(this).data(\"index\"));\n }\n });\n if (removeData.length === 0) {\n return false;\n }\n var firstIndex = removeData.splice(0, 1);\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\n // 开始关闭\n $('.edit-panel .tabs > div[data-index=\"' + firstIndex + '\"]').find(\".ico-close\").click();\n },\n _removeAllMarker: function () {\n var removeData = $(\"#dialogCloseEditor\").data(\"removeData\");\n if (removeData && removeData.length > 0) {\n var removeIndex = removeData.splice(0, 1);\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\n $('.edit-panel .tabs > div[data-index=\"' + removeIndex + '\"] .ico-close').click();\n }\n if (wide.curEditor) {\n wide.curEditor.focus();\n }\n },\n _initClose: function () {\n new ZeroClipboard($(\"#copyFilePath\"));\n\n // 关闭、关闭其他、关闭所有\n $(\".edit-panel\").on(\"mouseup\", '.tabs > div', function (event) {\n event.stopPropagation();\n\n if (event.button === 0) { // 左键\n $(\".edit-panel .frame\").hide();\n return false;\n }\n\n // event.button === 2 右键\n var left = event.screenX;\n if ($(\".side\").css(\"left\") === \"auto\" || $(\".side\").css(\"left\") === \"0px\") {\n left = event.screenX - $(\".side\").width();\n }\n $(\".edit-panel .frame\").show().css({\n \"left\": left + \"px\",\n \"top\": \"21px\"\n }).data('index', $(this).data(\"index\"));\n\n $(\"#copyFilePath\").attr('data-clipboard-text', $(this).find(\"span:eq(0)\").attr(\"title\"));\n return false;\n });\n },\n init: function () {\n $(\"#dialogCloseEditor\").dialog({\n \"modal\": true,\n \"height\": 90,\n \"width\": 260,\n \"title\": config.label.tip,\n \"hideFooter\": true,\n \"afterOpen\": function (fileName) {\n $(\"#dialogCloseEditor > div:eq(0)\").html(config.label.file\n + ' <b>' + fileName + '</b>. ' + config.label.confirm_save + '?');\n $(\"#dialogCloseEditor button:eq(0)\").focus();\n },\n \"afterInit\": function () {\n $(\"#dialogCloseEditor button.save\").click(function () {\n var i = $(\"#dialogCloseEditor\").data(\"index\");\n wide.fmt(editors.data[i].id, editors.data[i].editor);\n editors.tabs.del(editors.data[i].id);\n $(\"#dialogCloseEditor\").dialog(\"close\");\n editors._removeAllMarker();\n });\n\n $(\"#dialogCloseEditor button.discard\").click(function () {\n var i = $(\"#dialogCloseEditor\").data(\"index\");\n editors.tabs.del(editors.data[i].id);\n $(\"#dialogCloseEditor\").dialog(\"close\");\n editors._removeAllMarker();\n });\n\n $(\"#dialogCloseEditor button.cancel\").click(function (event) {\n $(\"#dialogCloseEditor\").dialog(\"close\");\n editors._removeAllMarker();\n });\n }\n });\n\n editors.tabs = new Tabs({\n id: \".edit-panel\",\n setAfter: function () {\n if (wide.curEditor) {\n wide.curEditor.focus();\n }\n },\n clickAfter: function (id) {\n if (id === 'startPage') {\n wide.curEditor = undefined;\n $(\".footer .cursor\").text('');\n wide.refreshOutline();\n \n return false;\n }\n },\n removeBefore: function (id) {\n if (id === 'startPage') { // 当前关闭的 tab 是起始页\n editors._removeAllMarker();\n return true;\n }\n\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n if (editors.data[i].id === id) {\n if (editors.data[i].editor.doc.isClean()) {\n editors._removeAllMarker();\n return true;\n } else {\n $(\"#dialogCloseEditor\").dialog(\"open\", $('.edit-panel .tabs > div[data-index=\"'\n + editors.data[i].id + '\"] > span:eq(0)').text());\n $(\"#dialogCloseEditor\").data(\"index\", i);\n return false;\n }\n\n break;\n }\n }\n },\n removeAfter: function (id, nextId) {\n if ($(\".edit-panel .tabs > div\").length === 0) {\n // 全部 tab 都关闭时才 disables 菜单中“全部关闭”的按钮\n menu.disabled(['close-all']);\n }\n\n // 移除编辑器\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n if (editors.data[i].id === id) {\n editors.data.splice(i, 1);\n break;\n }\n }\n\n if (editors.data.length === 0) { // 起始页可能存在,所以用编辑器数据判断\n menu.disabled(['save-all', 'build', 'run', 'go-test', 'go-vet', 'go-get', 'go-install',\n 'find', 'find-next', 'find-previous', 'replace', 'replace-all',\n 'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment',\n 'edit']);\n\n // remove selected tree node\n tree.fileTree.cancelSelectedNode();\n wide.curNode = undefined;\n wide.curEditor = undefined;\n wide.refreshOutline();\n $(\".footer .cursor\").text('');\n return false;\n }\n\n if (!nextId) {\n // 编辑器区域不存在打开的 Tab\n // remove selected tree node\n tree.fileTree.cancelSelectedNode();\n wide.curNode = undefined;\n wide.curEditor = undefined;\n wide.refreshOutline();\n $(\".footer .cursor\").text('');\n return false;\n }\n\n if (nextId === editors.tabs.getCurrentId()) {\n // 关闭的不是当前编辑器\n return false;\n }\n }\n });\n\n this._initCodeMirrorHotKeys();\n this.openStartPage();\n this._initClose();\n },\n openStartPage: function () {\n wide.curEditor = undefined;\n wide.refreshOutline();\n $(\".footer .cursor\").text('');\n\n var dateFormat = function (time, fmt) {\n var date = new Date(time);\n var dateObj = {\n \"M+\": date.getMonth() + 1, //月份 \n \"d+\": date.getDate(), //日 \n \"h+\": date.getHours(), //小时 \n \"m+\": date.getMinutes(), //分 \n \"s+\": date.getSeconds(), //秒 \n \"q+\": Math.floor((date.getMonth() + 3) / 3), //季度 \n \"S\": date.getMilliseconds() //毫秒 \n };\n if (/(y+)/.test(fmt))\n fmt = fmt.replace(RegExp.$1, (date.getFullYear() + \"\").substr(4 - RegExp.$1.length));\n for (var k in dateObj)\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1)\n ? (dateObj[k]) : ((\"00\" + dateObj[k]).substr((\"\" + dateObj[k]).length)));\n }\n return fmt;\n };\n\n editors.tabs.add({\n id: \"startPage\",\n title: '<span title=\"' + config.label.start_page\n + '\"><span class=\"ico-start font-ico\"></span> ' + config.label.start_page + '</span>',\n content: '<div id=\"startPage\"></div>',\n after: function () {\n $(\"#startPage\").load(config.context + '/start?sid=' + config.wideSessionId);\n $.ajax({\n url: \"https://hacpai.com/apis/articles?tags=wide,golang&p=1&size=20\",\n type: \"GET\",\n dataType: \"jsonp\",\n jsonp: \"callback\",\n success: function (data, textStatus) {\n var articles = data.articles;\n if (0 === articles.length) {\n return;\n }\n\n // 按 size = 20 取,但只保留最多 9 篇\n var length = articles.length;\n if (length > 9) {\n length = 9;\n }\n\n var listHTML = \"<ul><li class='title'>\" + config.label.community +\n \"<a href='https://hacpai.com/article/1437497122181' target='_blank' class='fn-right'>边看边练</li>\";\n for (var i = 0; i < length; i++) {\n var article = articles[i];\n listHTML += \"<li>\"\n + \"<a target='_blank' href='\"\n + article.articlePermalink + \"'>\"\n + article.articleTitle + \"</a>&nbsp; <span class='date'>\"\n + dateFormat(article.articleCreateTime, 'yyyy-MM-dd');\n +\"</span></li>\";\n }\n\n $(\"#startPage .news\").html(listHTML + \"</ul>\");\n }\n });\n }\n });\n },\n getCurrentId: function () {\n var ret = editors.tabs.getCurrentId();\n if (ret === 'startPage') {\n ret = null;\n }\n \n return ret;\n },\n getCurrentPath: function () {\n var currentPath = $(\".edit-panel .tabs .current span:eq(0)\").attr(\"title\");\n if (currentPath === config.label.start_page) {\n currentPath = null;\n }\n return currentPath;\n },\n _initCodeMirrorHotKeys: function () {\n CodeMirror.registerHelper(\"hint\", \"go\", function (editor) {\n editor = wide.curEditor; // 使用当前编辑器覆盖实参,因为异步调用的原因,实参不一定正确\n var word = /[\\w$]+/;\n\n var cur = editor.getCursor(), curLine = editor.getLine(cur.line);\n\n var start = cur.ch, end = start;\n while (end < curLine.length && word.test(curLine.charAt(end))) {\n ++end;\n }\n while (start && word.test(curLine.charAt(start - 1))) {\n --start;\n }\n\n var request = newWideRequest();\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\n request.code = editor.getValue();\n request.cursorLine = cur.line;\n request.cursorCh = cur.ch;\n\n var autocompleteHints = [];\n\n if (editors.autocompleteMutex && editor.state.completionActive) {\n return;\n }\n\n editors.autocompleteMutex = true;\n\n $.ajax({\n async: false, // 同步执行\n type: 'POST',\n url: config.context + '/autocomplete',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (data) {\n var autocompleteArray = data[1];\n\n if (autocompleteArray) {\n for (var i = 0; i < autocompleteArray.length; i++) {\n var displayText = '',\n text = autocompleteArray[i].name;\n\n switch (autocompleteArray[i].class) {\n case \"type\":\n displayText = '<span class=\"fn-clear\"><span class=\"ico-type ico\"></span>'// + autocompleteArray[i].class \n + '<b>' + autocompleteArray[i].name + '</b> '\n + autocompleteArray[i].type + '</span>';\n break;\n case \"const\":\n displayText = '<span class=\"fn-clear\"><span class=\"ico-const ico\"></span>'// + autocompleteArray[i].class \n + '<b>' + autocompleteArray[i].name + '</b> '\n + autocompleteArray[i].type + '</span>';\n break;\n case \"var\":\n displayText = '<span class=\"fn-clear\"><span class=\"ico-var ico\"></span>'// + autocompleteArray[i].class \n + '<b>' + autocompleteArray[i].name + '</b> '\n + autocompleteArray[i].type + '</span>';\n break;\n case \"package\":\n displayText = '<span class=\"fn-clear\"><span class=\"ico-package ico\"></span>'// + autocompleteArray[i].class \n + '<b>' + autocompleteArray[i].name + '</b> '\n + autocompleteArray[i].type + '</span>';\n break;\n case \"func\":\n displayText = '<span><span class=\"ico-func ico\"></span>'// + autocompleteArray[i].class \n + '<b>' + autocompleteArray[i].name + '</b>'\n + autocompleteArray[i].type.substring(4) + '</span>';\n text += '()';\n break;\n default:\n console.warn(\"Can't handle autocomplete [\" + autocompleteArray[i].class + \"]\");\n break;\n }\n\n autocompleteHints[i] = {\n displayText: displayText,\n text: text\n };\n }\n }\n\n editor.doc.markClean();\n $(\".edit-panel .tabs .current > span:eq(0)\").removeClass(\"changed\");\n }\n });\n\n setTimeout(function () {\n editors.autocompleteMutex = false;\n }, 20);\n\n return {list: autocompleteHints, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};\n });\n\n CodeMirror.commands.autocompleteAfterDot = function (cm) {\n var mode = cm.getMode();\n if (mode && \"go\" !== mode.name) {\n return CodeMirror.Pass;\n }\n\n var token = cm.getTokenAt(cm.getCursor());\n\n if (\"comment\" === token.type || \"string\" === token.type) {\n return CodeMirror.Pass;\n }\n\n setTimeout(function () {\n if (!cm.state.completionActive) {\n cm.showHint({hint: CodeMirror.hint.go, completeSingle: false});\n }\n }, 50);\n\n return CodeMirror.Pass;\n };\n\n CodeMirror.commands.autocompleteAnyWord = function (cm) {\n cm.showHint({hint: CodeMirror.hint.auto});\n };\n\n CodeMirror.commands.gotoLine = function (cm) {\n $(\"#dialogGoLinePrompt\").dialog(\"open\");\n };\n\n // 用于覆盖 cm 默认绑定的某些快捷键功能.\n CodeMirror.commands.doNothing = function (cm) {\n };\n\n CodeMirror.commands.exprInfo = function (cm) {\n var cur = wide.curEditor.getCursor();\n\n var request = newWideRequest();\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\n request.code = wide.curEditor.getValue();\n request.cursorLine = cur.line;\n request.cursorCh = cur.ch;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/exprinfo',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n return;\n }\n \n var position = wide.curEditor.cursorCoords();\n $(\"body\").append('<div style=\"top:'\n + (position.top + 15) + 'px;left:' + position.left\n + 'px\" class=\"edit-exprinfo\">' + result.data + '</div>');\n }\n });\n };\n\n CodeMirror.commands.copyLinesDown = function (cm) {\n var content = '',\n selectoion = cm.listSelections()[0];\n\n var from = selectoion.anchor,\n to = selectoion.head;\n if (from.line > to.line) {\n from = selectoion.head;\n to = selectoion.anchor;\n }\n\n for (var i = from.line, max = to.line; i <= max; i++) {\n if (to.ch !== 0 || i !== max) { // 下一行选中为0时不应添加内容\n content += '\\n' + cm.getLine(i);\n }\n }\n // 下一行选中为0时应添加到上一行末\n var replaceToLine = to.line;\n if (to.ch === 0) {\n replaceToLine = to.line - 1;\n }\n cm.replaceRange(content, CodeMirror.Pos(replaceToLine));\n\n var offset = replaceToLine - from.line + 1;\n cm.setSelection(CodeMirror.Pos(from.line + offset, from.ch),\n CodeMirror.Pos(to.line + offset, to.ch));\n };\n\n CodeMirror.commands.copyLinesUp = function (cm) {\n var content = '',\n selectoion = cm.listSelections()[0];\n\n var from = selectoion.anchor,\n to = selectoion.head;\n if (from.line > to.line) {\n from = selectoion.head;\n to = selectoion.anchor;\n }\n\n for (var i = from.line, max = to.line; i <= max; i++) {\n if (to.ch !== 0 || i !== max) { // 下一行选中为0时不应添加内容\n content += '\\n' + cm.getLine(i);\n }\n }\n\n // 下一行选中为0时应添加到上一行末\n var replaceToLine = to.line;\n if (to.ch === 0) {\n replaceToLine = to.line - 1;\n }\n cm.replaceRange(content, CodeMirror.Pos(replaceToLine));\n\n cm.setSelection(CodeMirror.Pos(from.line, from.ch),\n CodeMirror.Pos(to.line, to.ch));\n };\n\n CodeMirror.commands.moveLinesUp = function (cm) {\n var selectoion = cm.listSelections()[0];\n\n var from = selectoion.anchor,\n to = selectoion.head;\n if (from.line > to.line) {\n from = selectoion.head;\n to = selectoion.anchor;\n }\n\n if (from.line === 0) {\n return false;\n }\n // 下一行选中为0时应添加到上一行末\n var replaceToLine = to.line;\n if (to.ch === 0) {\n replaceToLine = to.line - 1;\n }\n cm.replaceRange('\\n' + cm.getLine(from.line - 1), CodeMirror.Pos(replaceToLine));\n if (from.line === 1) {\n // 移除第一行的换行\n cm.replaceRange('', CodeMirror.Pos(0, 0),\n CodeMirror.Pos(1, 0));\n } else {\n cm.replaceRange('', CodeMirror.Pos(from.line - 2, cm.getLine(from.line - 2).length),\n CodeMirror.Pos(from.line - 1, cm.getLine(from.line - 1).length));\n }\n\n cm.setSelection(CodeMirror.Pos(from.line - 1, from.ch),\n CodeMirror.Pos(to.line - 1, to.ch));\n };\n\n CodeMirror.commands.moveLinesDown = function (cm) {\n var selectoion = cm.listSelections()[0];\n\n var from = selectoion.anchor,\n to = selectoion.head;\n if (from.line > to.line) {\n from = selectoion.head;\n to = selectoion.anchor;\n }\n\n if (to.line === cm.lastLine()) {\n return false;\n }\n\n // 下一行选中为0时应添加到上一行末\n var replaceToLine = to.line;\n if (to.ch === 0) {\n replaceToLine = to.line - 1;\n }\n // 把选中的下一行添加到选中区域的上一行\n if (from.line === 0) {\n cm.replaceRange(cm.getLine(replaceToLine + 1) + '\\n', CodeMirror.Pos(0, 0));\n } else {\n cm.replaceRange('\\n' + cm.getLine(replaceToLine + 1), CodeMirror.Pos(from.line - 1));\n }\n // 删除选中的下一行\n cm.replaceRange('', CodeMirror.Pos(replaceToLine + 1, cm.getLine(replaceToLine + 1).length),\n CodeMirror.Pos(replaceToLine + 2, cm.getLine(replaceToLine + 2).length));\n\n cm.setSelection(CodeMirror.Pos(from.line + 1, from.ch),\n CodeMirror.Pos(to.line + 1, to.ch));\n };\n\n CodeMirror.commands.jumpToDecl = function (cm) {\n var cur = wide.curEditor.getCursor();\n\n var request = newWideRequest();\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\n request.code = wide.curEditor.getValue();\n request.cursorLine = cur.line;\n request.cursorCh = cur.ch;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/find/decl',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n return;\n }\n \n var data = result.data;\n\n var tId = tree.getTIdByPath(data.path);\n wide.curNode = tree.fileTree.getNodeByTId(tId);\n tree.fileTree.selectNode(wide.curNode);\n\n tree.openFile(wide.curNode, CodeMirror.Pos(data.cursorLine - 1, data.cursorCh - 1));\n }\n });\n };\n\n CodeMirror.commands.findUsages = function (cm) {\n var cur = wide.curEditor.getCursor();\n\n var request = newWideRequest();\n request.path = $(\".edit-panel .tabs .current > span:eq(0)\").attr(\"title\");\n request.code = wide.curEditor.getValue();\n request.cursorLine = cur.line;\n request.cursorCh = cur.ch;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/find/usages',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n return;\n }\n\n editors.appendSearch(result.data, 'usages', '');\n }\n });\n };\n\n CodeMirror.commands.selectIdentifier = function (cm) {\n var cur = cm.getCursor();\n var word = cm.findWordAt(cur);\n cm.extendSelection(word.anchor, word.head);\n };\n },\n appendSearch: function (data, type, key) {\n var searcHTML = '<ul class=\"list\">',\n key = key.toLowerCase();\n\n for (var i = 0, ii = data.length; i < ii; i++) {\n var contents = '',\n lowerCaseContents = data[i].contents[0].toLowerCase(),\n matches = lowerCaseContents.split(key),\n startIndex = 0,\n endIndex = 0;\n for (var j = 0, max = matches.length; j < max; j++) {\n startIndex = endIndex + matches[j].length;\n endIndex = startIndex + key.length;\n var keyWord = data[i].contents[0].substring(startIndex, endIndex);\n if (keyWord !== '') {\n keyWord = '<b>' + keyWord + '</b>';\n }\n contents += data[i].contents[0].substring(startIndex - matches[j].length, startIndex) + keyWord;\n }\n\n searcHTML += '<li title=\"' + data[i].path + '\">'\n + contents + \"&nbsp;&nbsp;&nbsp;&nbsp;<span class='ft-small'>\" + data[i].path\n + '<i class=\"position\" data-line=\"'\n + data[i].line + '\" data-ch=\"' + data[i].ch + '\"> (' + data[i].line + ':'\n + data[i].ch + ')</i></span></li>';\n }\n\n if (data.length === 0) {\n searcHTML += '<li>' + config.label.search_no_match + '</li>';\n }\n searcHTML += '</ul>';\n\n var $search = $('.bottom-window-group .search'),\n title = config.label.find_usages;\n if (type === \"founds\") {\n title = config.label.search_text;\n }\n if ($search.find(\"ul\").length === 0) {\n bottomGroup.searchTab = new Tabs({\n id: \".bottom-window-group .search\",\n removeAfter: function (id, prevId) {\n if ($search.find(\"ul\").length === 1) {\n $search.find(\".tabs\").hide();\n }\n }\n });\n\n $search.on(\"click\", \"li\", function () {\n $search.find(\"li\").removeClass(\"selected\");\n $(this).addClass(\"selected\");\n });\n\n $search.on(\"dblclick\", \"li\", function () {\n var $it = $(this),\n tId = tree.getTIdByPath($it.attr(\"title\"));\n tree.openFile(tree.fileTree.getNodeByTId(tId));\n tree.fileTree.selectNode(wide.curNode);\n\n var line = $it.find(\".position\").data(\"line\") - 1;\n var cursor = CodeMirror.Pos(line, $it.find(\".position\").data(\"ch\") - 1);\n\n\n var editor = wide.curEditor;\n editor.setCursor(cursor);\n\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\n var cursorCoords = editor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\n editor.scrollTo(0, cursorCoords.top);\n\n wide.curEditor.focus();\n });\n\n $search.find(\".tabs-panel > div\").append(searcHTML);\n\n $search.find(\".tabs .first\").text(title);\n } else {\n $search.find(\".tabs\").show();\n bottomGroup.searchTab.add({\n \"id\": \"search\" + (new Date()).getTime(),\n \"title\": title,\n \"content\": searcHTML\n });\n }\n\n // focus\n bottomGroup.tabs.setCurrent(\"search\");\n windows.flowBottom();\n $(\".bottom-window-group .search\").focus();\n },\n // 新建一个编辑器 Tab如果已经存在 Tab 则切换到该 Tab.\n newEditor: function (data, cursor) {\n var id = wide.curNode.id;\n\n editors.tabs.add({\n id: id,\n title: '<span title=\"' + wide.curNode.path + '\"><span class=\"'\n + wide.curNode.iconSkin + 'ico\"></span>' + wide.curNode.name + '</span>',\n content: '<textarea id=\"editor' + id + '\"></textarea>'\n });\n\n menu.undisabled(['save-all', 'close-all', 'build', 'run', 'go-test', 'go-vet', 'go-get', 'go-install',\n 'find', 'find-next', 'find-previous', 'replace', 'replace-all',\n 'format', 'autocomplete', 'jump-to-decl', 'expr-info', 'find-usages', 'toggle-comment',\n 'edit']);\n\n var textArea = document.getElementById(\"editor\" + id);\n textArea.value = data.content;\n\n var editor = CodeMirror.fromTextArea(textArea, {\n lineNumbers: true,\n autofocus: true,\n autoCloseBrackets: true,\n matchBrackets: true,\n highlightSelectionMatches: {showToken: /\\w/},\n rulers: [{color: \"#ccc\", column: 120, lineStyle: \"dashed\"}],\n styleActiveLine: true,\n theme: config.editorTheme,\n tabSize: config.editorTabSize,\n indentUnit: 4,\n indentWithTabs: true,\n foldGutter: true,\n cursorHeight: 1,\n path: data.path,\n readOnly: wide.curNode.isGOAPI,\n profile: 'xhtml', // define Emmet output profile\n extraKeys: {\n \"Ctrl-\\\\\": \"autocompleteAnyWord\",\n \".\": \"autocompleteAfterDot\",\n \"Ctrl-/\": 'toggleComment',\n \"Ctrl-I\": \"exprInfo\",\n \"Ctrl-L\": \"gotoLine\",\n \"Ctrl-E\": \"deleteLine\",\n \"Ctrl-D\": \"doNothing\", // 取消默认的 deleteLine\n \"Ctrl-B\": \"jumpToDecl\",\n \"Ctrl-S\": function () {\n wide.saveFile();\n },\n \"Shift-Ctrl-S\": function () {\n menu.saveAllFiles();\n },\n \"Shift-Alt-F\": function () {\n var currentPath = editors.getCurrentPath();\n if (!currentPath) {\n return false;\n }\n wide.fmt(currentPath, wide.curEditor);\n },\n \"Alt-F7\": \"findUsages\",\n \"Shift-Alt-Enter\": function () {\n if (windows.isMaxEditor) {\n windows.restoreEditor();\n } else {\n windows.maxEditor();\n }\n },\n \"Shift-Ctrl-Up\": \"copyLinesUp\",\n \"Shift-Ctrl-Down\": \"copyLinesDown\",\n \"Shift-Alt-Up\": \"moveLinesUp\",\n \"Shift-Alt-Down\": \"moveLinesDown\",\n \"Shift-Alt-J\": \"selectIdentifier\"\n }\n });\n\n if (\"text/html\" === data.mode) {\n emmetCodeMirror(editor);\n }\n\n editor.on('cursorActivity', function (cm) {\n $(\".edit-exprinfo\").remove();\n var cursor = cm.getCursor();\n\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\n });\n\n editor.on('blur', function (cm) {\n $(\".edit-exprinfo\").remove();\n });\n\n editor.on('changes', function (cm) {\n if (cm.doc.isClean()) { // no modification\n $(\".edit-panel .tabs > div\").each(function () {\n var $span = $(this).find(\"span:eq(0)\");\n if ($span.attr(\"title\") === cm.options.path) {\n $span.removeClass(\"changed\");\n }\n });\n\n return;\n }\n\n // changed\n\n $(\".edit-panel .tabs > div\").each(function () {\n var $span = $(this).find(\"span:eq(0)\");\n if ($span.attr(\"title\") === cm.options.path) {\n $span.addClass(\"changed\");\n }\n });\n });\n\n editor.on('keydown', function (cm, evt) {\n if (evt.altKey || evt.ctrlKey || evt.shiftKey) {\n return;\n }\n\n var k = evt.which;\n\n if (k < 48) {\n return;\n }\n\n // hit [0-9]\n\n if (k > 57 && k < 65) {\n return;\n }\n\n // hit [a-z]\n\n if (k > 90) {\n return;\n }\n\n if (config.autocomplete) {\n if (0.5 <= Math.random()) {\n CodeMirror.commands.autocompleteAfterDot(cm);\n }\n }\n });\n\n editor.setSize('100%', $(\".edit-panel\").height() - $(\".edit-panel .tabs\").height());\n editor.setOption(\"mode\", data.mode);\n editor.setOption(\"gutters\", [\"CodeMirror-lint-markers\", \"CodeMirror-foldgutter\"]);\n\n if (\"wide\" !== config.keymap) {\n editor.setOption(\"keyMap\", config.keymap);\n }\n\n if (\"text/x-go\" === data.mode || \"application/json\" === data.mode) {\n editor.setOption(\"lint\", true);\n }\n\n if (\"application/xml\" === data.mode || \"text/html\" === data.mode) {\n editor.setOption(\"autoCloseTags\", true);\n }\n\n wide.curEditor = editor;\n editors.data.push({\n \"editor\": editor,\n \"id\": id\n });\n\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\n\n var half = Math.floor(wide.curEditor.getScrollInfo().clientHeight / wide.curEditor.defaultTextHeight() / 2);\n var cursorCoords = wide.curEditor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\n wide.curEditor.scrollTo(0, cursorCoords.top);\n\n editor.setCursor(cursor);\n editor.focus();\n }\n};","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file notification.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.0.0.1, Dec 8, 2015\n */\nvar notification = {\n init: function () {\n $(\".notification-count\").click(function () {\n bottomGroup.tabs.setCurrent(\"notification\");\n $(\".bottom-window-group .notification\").focus();\n $(this).hide();\n });\n\n this._initWS();\n },\n _initWS: function () {\n var notificationWS = new ReconnectingWebSocket(config.channel + '/notification/ws?sid=' + config.wideSessionId);\n\n notificationWS.onopen = function () {\n console.log('[notification onopen] connected');\n };\n\n notificationWS.onmessage = function (e) {\n var data = JSON.parse(e.data),\n $notification = $('.bottom-window-group .notification > table'),\n notificationHTML = '';\n \n if (data.cmd && \"init-notification\" === data.cmd) {\n console.log('[notification onmessage]' + e.data);\n \n return;\n }\n\n notificationHTML += '<tr><td class=\"severity\">' + data.severity\n + '</td><td class=\"message\">' + data.message\n + '</td><td class=\"type\">' + data.type + '</td></tr>';\n $notification.append(notificationHTML);\n\n $(\".notification-count\").show();\n };\n\n notificationWS.onclose = function (e) {\n console.log('[notification onclose] disconnected (' + e.code + ')');\n };\n\n notificationWS.onerror = function (e) {\n console.log('[notification onerror]');\n };\n }\n};","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file tree.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.0.1.1, Dec 15, 2015\n */\nvar tree = {\n fileTree: undefined,\n // 递归获取当前节点展开中的最后一个节点\n getCurrentNodeLastNode: function (node) {\n var returnNode = node.children[node.children.length - 1];\n if (returnNode.open) {\n return tree.getCurrentNodeLastNode(returnNode);\n } else {\n return returnNode;\n }\n },\n // 按照树展现获取下一个节点\n getNextShowNode: function (node) {\n if (node.level !== 0) {\n if (node.getParentNode().getNextNode()) {\n return node.getParentNode().getNextNode();\n } else {\n return tree.getNextShowNode(node.getParentNode());\n }\n } else {\n return node.getNextNode();\n }\n },\n isBottomNode: function (node) {\n if (node.open) {\n return false;\n }\n\n if (node.getParentNode()) {\n if (node.getParentNode().isLastNode) {\n return tree.isBottomNode(node.getParentNode());\n } else {\n return false;\n }\n } else {\n if (node.isLastNode) {\n return true;\n } else {\n return false;\n }\n }\n },\n getTIdByPath: function (path) {\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n if (nodes[i].path === path) {\n return nodes[i].tId;\n }\n }\n\n return undefined;\n },\n getOpenPaths: function () {\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes()),\n paths = [];\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n if (nodes[i].open) {\n paths.push(nodes[i].path);\n }\n }\n\n return paths;\n },\n getAllParents: function (node, parents) {\n if (!parents) {\n parents = [];\n }\n\n if (!node || !node.parentTId) {\n return parents;\n } else {\n parents.push(node.getParentNode());\n return tree.getAllParents(node.getParentNode(), parents);\n }\n },\n isParents: function (tId, parentPath) {\n var node = tree.fileTree.getNodeByTId(tId);\n if (!node || !node.parentTId) {\n return false;\n } else {\n var parentNode = tree.fileTree.getNodeByTId(node.parentTId);\n if (node.path === parentPath) {\n return true;\n } else {\n return tree.isParents(parentNode.tId, parentPath);\n }\n }\n },\n isDir: function () {\n if (wide.curNode.iconSkin.indexOf(\"ico-ztree-dir\") === 0) {\n return true;\n }\n\n return false;\n },\n newFile: function (it) {\n if ($(it).hasClass(\"disabled\")) {\n return false;\n }\n\n $(\"#dialogNewFilePrompt\").dialog(\"open\");\n },\n newDir: function (it) {\n if ($(it).hasClass(\"disabled\")) {\n return false;\n }\n\n $(\"#dialogNewDirPrompt\").dialog(\"open\");\n },\n removeIt: function (it) {\n if (it) {\n if ($(it).hasClass(\"disabled\")) {\n return false;\n }\n } else {\n if (!wide.curNode.removable) {\n return false;\n }\n }\n\n $(\"#dialogRemoveConfirm\").dialog(\"open\");\n },\n rename: function (it) {\n if (it) {\n if ($(it).hasClass(\"disabled\")) {\n return false;\n }\n }\n\n $(\"#dialogRenamePrompt\").dialog(\"open\");\n },\n export: function () {\n var request = newWideRequest(),\n isSucc = false;\n request.path = wide.curNode.path;\n\n $.ajax({\n async: false,\n type: 'POST',\n url: config.context + '/file/zip/new',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\n\n return false;\n }\n\n isSucc = true;\n }\n });\n\n if (isSucc) {\n window.open(config.context + '/file/zip?path=' + wide.curNode.path + \".zip\");\n }\n },\n crossCompile: function (platform) {\n var request = newWideRequest();\n request.path = wide.curNode.path;\n request.platform = platform;\n\n $.ajax({\n async: false,\n type: 'POST',\n url: config.context + '/cross',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\n\n return false;\n }\n }\n });\n },\n decompress: function () {\n var request = newWideRequest();\n request.path = wide.curNode.path;\n\n $.ajax({\n async: false,\n type: 'POST',\n url: config.context + '/file/decompress',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\n\n return false;\n }\n\n var dir = wide.curNode.getParentNode();\n tree.fileTree.reAsyncChildNodes(dir, \"refresh\");\n }\n });\n },\n refresh: function (it) {\n if (it) {\n if ($(it).hasClass(\"disabled\")) {\n return false;\n }\n }\n\n tree.fileTree.reAsyncChildNodes(wide.curNode, \"refresh\", true);\n },\n gitClone: function (it) {\n if (it) {\n if ($(it).hasClass(\"disabled\")) {\n return false;\n }\n }\n\n $(\"#dialogGitClonePrompt\").dialog('open');\n },\n import: function () {\n var request = newWideRequest();\n request.path = wide.curNode.path;\n\n $('#importFileupload').fileupload({\n url: \"/file/upload?path=\" + request.path,\n dataType: 'json',\n formData: request,\n done: function (e, result) {\n tree.fileTree.reAsyncChildNodes(wide.curNode, \"refresh\");\n },\n fail: function () {\n console.log(arguments);\n }\n });\n },\n init: function () {\n $(\"#file\").click(function () {\n $(this).focus();\n });\n\n var request = newWideRequest();\n\n $.ajax({\n type: 'POST',\n url: config.context + '/files',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (result.succ) {\n var $dirRMenu = $(\"#dirRMenu\");\n var $fileRMenu = $(\"#fileRMenu\");\n var setting = {\n data: {\n key: {\n title: \"path\"\n }\n },\n view: {\n showTitle: true,\n selectedMulti: false\n },\n async: {\n enable: true,\n url: config.context + \"/file/refresh\",\n autoParam: [\"path\"]\n },\n callback: {\n onDblClick: function (event, treeId, treeNode) {\n if (treeNode) {\n tree.openFile(treeNode);\n }\n },\n onRightClick: function (event, treeId, treeNode) {\n if (treeNode && !treeNode.isGOAPI) {\n menu.undisabled(['import', 'export', 'git-clone']);\n\n wide.curNode = treeNode;\n tree.fileTree.selectNode(treeNode);\n\n if (!tree.isDir()) { // if right click on a file\n if (wide.curNode.removable) {\n $fileRMenu.find(\".remove\").removeClass(\"disabled\");\n } else {\n $fileRMenu.find(\".remove\").addClass(\"disabled\");\n }\n\n if (-1 === wide.curNode.path.indexOf(\"zip\", wide.curNode.path.length - \"zip\".length)) { // !path.endsWith(\"zip\")\n $fileRMenu.find(\".decompress\").hide();\n } else {\n $fileRMenu.find(\".decompress\").show();\n }\n\n if (-1 === wide.curNode.path.indexOf(\"go\", wide.curNode.path.length - \"go\".length)) { // !path.endsWith(\"go\")\n $fileRMenu.find(\".linux64\").hide();\n } else {\n $fileRMenu.find(\".linux64\").show();\n }\n\n var top = event.clientY - 10;\n if ($fileRMenu.height() + top > $('.content').height()) {\n top = top - $fileRMenu.height() - 25;\n }\n $fileRMenu.css({\n \"top\": top + \"px\",\n \"left\": event.clientX + \"px\",\n \"display\": \"block\"\n }).show();\n\n $dirRMenu.hide();\n\n menu.disabled(['import', 'git-clone']);\n } else { // 右击了目录\n if (wide.curNode.removable) {\n $dirRMenu.find(\".remove\").removeClass(\"disabled\");\n } else {\n $dirRMenu.find(\".remove\").addClass(\"disabled\");\n }\n\n if (wide.curNode.creatable) {\n $dirRMenu.find(\".create\").removeClass(\"disabled\");\n } else {\n $dirRMenu.find(\".create\").addClass(\"disabled\");\n }\n\n var top = event.clientY - 10;\n if ($dirRMenu.height() + top > $('.content').height()) {\n top = top - $dirRMenu.height() - 25;\n }\n\n $dirRMenu.css({\n \"top\": top + \"px\",\n \"left\": event.clientX + \"px\",\n \"display\": \"block\"\n }).show();\n\n $fileRMenu.hide();\n }\n $(\"#files\").focus();\n }\n },\n onClick: function (event, treeId, treeNode, clickFlag) {\n if (treeNode) {\n wide.curNode = treeNode;\n tree.fileTree.selectNode(treeNode);\n\n menu.undisabled(['import', 'export', 'git-clone']);\n if (!tree.isDir()) {\n menu.disabled(['import', 'git-clone']);\n }\n\n $(\"#files\").focus();\n }\n }\n }\n };\n tree.fileTree = $.fn.zTree.init($(\"#files\"), setting, result.data.children);\n\n session.restore();\n }\n }\n });\n\n this._initSearch();\n this._initRename();\n },\n openFile: function (treeNode, cursor) {\n wide.curNode = treeNode;\n var tempCursor = cursor;\n\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n // 该节点文件已经打开\n if (editors.data[i].id === treeNode.path) {\n editors.tabs.setCurrent(treeNode.path);\n wide.curEditor = editors.data[i].editor;\n\n if (!tempCursor) {\n tempCursor = wide.curEditor.getCursor();\n }\n $(\".footer .cursor\").text('| ' + (tempCursor.line + 1) + ':' + (tempCursor.ch + 1) + ' |');\n\n wide.curEditor.setCursor(tempCursor);\n var half = Math.floor(wide.curEditor.getScrollInfo().clientHeight / wide.curEditor.defaultTextHeight() / 2);\n var cursorCoords = wide.curEditor.cursorCoords({line: tempCursor.line - half, ch: 0}, \"local\");\n wide.curEditor.scrollTo(0, cursorCoords.top);\n wide.curEditor.focus();\n\n wide.refreshOutline();\n return false;\n }\n }\n\n if (!tree.isDir()) {\n var request = newWideRequest();\n request.path = treeNode.path;\n\n $.ajax({\n async: false,\n type: 'POST',\n url: config.context + '/file',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\n\n return false;\n }\n\n var data = result.data;\n\n if (!data.mode) {\n var mode = CodeMirror.findModeByFileName(treeNode.path);\n if (mode) {\n data.mode = mode.mime;\n } else {\n data.mode = 'text/plain';\n }\n }\n\n if (!data.mode) {\n console.error(\"Can't find mode by file name [\" + treeNode.path + \"]\");\n }\n\n if (\"img\" === data.mode) { // 是图片文件的话新建 tab 打开\n // 最好是开 tab但这个最终取决于浏览器设置\n var w = window.open(config.context + data.path);\n return false;\n }\n\n if (!tempCursor) {\n tempCursor = CodeMirror.Pos(0, 0);\n }\n\n editors.newEditor(data, tempCursor);\n\n wide.refreshOutline();\n }\n });\n }\n },\n _initSearch: function () {\n $(\"#dialogSearchForm > input:eq(0)\").keyup(function (event) {\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\n $okBtn.click();\n }\n\n if ($.trim($(this).val()) === \"\") {\n $okBtn.prop(\"disabled\", true);\n } else {\n $okBtn.prop(\"disabled\", false);\n }\n });\n\n $(\"#dialogSearchForm > input:eq(1)\").keyup(function (event) {\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\n $okBtn.click();\n }\n });\n\n $(\"#dialogSearchForm\").dialog({\n \"modal\": true,\n \"height\": 80,\n \"width\": 260,\n \"title\": config.label.search,\n \"okText\": config.label.search,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n $(\"#dialogSearchForm > input:eq(0)\").val('').focus();\n $(\"#dialogSearchForm > input:eq(1)\").val('');\n $(\"#dialogSearchForm\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\n },\n \"ok\": function () {\n var request = newWideRequest();\n\n if (!wide.curNode) {\n request.dir = \"\";\n } else {\n request.dir = wide.curNode.path;\n }\n\n request.text = $(\"#dialogSearchForm > input:eq(0)\").val();\n request.extension = $(\"#dialogSearchForm > input:eq(1)\").val();\n\n $.ajax({\n type: 'POST',\n url: config.context + '/file/search/text',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n return;\n }\n\n $(\"#dialogSearchForm\").dialog(\"close\");\n editors.appendSearch(result.data, 'founds', request.text);\n }\n });\n }\n });\n },\n _initRename: function () {\n $(\"#dialogRenamePrompt\").dialog({\n \"modal\": true,\n \"height\": 52,\n \"width\": 260,\n \"title\": config.label.rename,\n \"okText\": config.label.rename,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n $(\"#dialogRenamePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\n $(\"#dialogRenamePrompt > input\").val(wide.curNode.name).select().focus();\n },\n \"ok\": function () {\n var name = $(\"#dialogRenamePrompt > input\").val(),\n request = newWideRequest();\n\n request.oldPath = wide.curNode.path;\n request.newPath = wide.curNode.path.substring(0, wide.curNode.path.lastIndexOf(\"/\") + 1) + name;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/file/rename',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogRenamePrompt\").dialog(\"close\");\n bottomGroup.tabs.setCurrent(\"notification\");\n windows.flowBottom();\n $(\".bottom-window-group .notification\").focus();\n return false;\n }\n\n $(\"#dialogRenamePrompt\").dialog(\"close\");\n }\n });\n }\n });\n }\n};","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file wide.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.0.0.1, Dec 8, 2015\n */\nvar wide = {\n curNode: undefined,\n curEditor: undefined,\n curProcessId: undefined, // curent running process id (pid)\n refreshOutline: function () {\n if (!wide.curEditor ||\n (wide.curEditor && wide.curEditor.doc.getMode().name !== \"go\")) {\n $(\"#outline\").html('');\n return false;\n }\n\n var request = newWideRequest();\n request.code = wide.curEditor.getValue();\n\n $.ajax({\n type: 'POST',\n async: false,\n url: config.context + '/outline',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n return;\n }\n\n var data = result.data;\n\n var outlineHTML = '<ul class=\"list\">',\n decls = ['constDecls', 'varDecls', 'funcDecls',\n 'structDecls', 'interfaceDecls', 'typeDecls'];\n\n for (var i = 0, max = decls.length; i < max; i++) {\n var key = decls[i];\n for (var j = 0, maxj = data[key].length; j < maxj; j++) {\n var obj = data[key][j];\n outlineHTML += '<li data-ch=\"' + obj.Ch + '\" data-line=\"'\n + obj.Line + '\"><span class=\"ico ico-'\n + key.replace('Decls', '') + '\"></span> ' + obj.Name + '</li>';\n }\n }\n $(\"#outline\").html(outlineHTML + '</ul>');\n\n $(\"#outline li\").dblclick(function () {\n var $it = $(this),\n cursor = CodeMirror.Pos($it.data('line'), $it.data(\"ch\"));\n\n var editor = wide.curEditor;\n editor.setCursor(cursor);\n\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\n var cursorCoords = editor.cursorCoords({line: cursor.line - half, ch: 0}, \"local\");\n editor.scrollTo(0, cursorCoords.top);\n\n editor.focus();\n });\n }\n });\n },\n _initDialog: function () {\n $(\".dialog-prompt > input\").keyup(function (event) {\n var $okBtn = $(this).closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\n if (event.which === 13 && !$okBtn.prop(\"disabled\")) {\n $okBtn.click();\n }\n\n if ($.trim($(this).val()) === \"\") {\n $okBtn.prop(\"disabled\", true);\n } else {\n $okBtn.prop(\"disabled\", false);\n }\n });\n\n $(\"#dialogAlert\").dialog({\n \"modal\": true,\n \"height\": 40,\n \"width\": 350,\n \"title\": config.label.tip,\n \"hiddenOk\": true,\n \"cancelText\": config.label.confirm,\n \"afterOpen\": function (msg) {\n $(\"#dialogAlert\").html(msg);\n }\n });\n\n $(\"#dialogRemoveConfirm\").dialog({\n \"modal\": true,\n \"height\": 36,\n \"width\": 260,\n \"title\": config.label.delete,\n \"okText\": config.label.delete,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n $(\"#dialogRemoveConfirm > b\").html('\"' + wide.curNode.name + '\"');\n },\n \"ok\": function () {\n var request = newWideRequest();\n request.path = wide.curNode.path;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/file/remove',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogRemoveConfirm\").dialog(\"close\");\n bottomGroup.tabs.setCurrent(\"notification\");\n windows.flowBottom();\n $(\".bottom-window-group .notification\").focus();\n return false;\n }\n\n $(\"#dialogRemoveConfirm\").dialog(\"close\");\n }\n });\n }\n });\n\n $(\"#dialogNewFilePrompt\").dialog({\n \"modal\": true,\n \"height\": 52,\n \"width\": 260,\n \"title\": config.label.create_file,\n \"okText\": config.label.create,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n $(\"#dialogNewFilePrompt > input\").val('').focus();\n $(\"#dialogNewFilePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\n },\n \"ok\": function () {\n var request = newWideRequest(),\n name = $(\"#dialogNewFilePrompt > input\").val();\n\n request.path = wide.curNode.path + \"/\" + name;\n request.fileType = \"f\";\n\n $.ajax({\n type: 'POST',\n url: config.context + '/file/new',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogNewFilePrompt\").dialog(\"close\");\n bottomGroup.tabs.setCurrent(\"notification\");\n windows.flowBottom();\n $(\".bottom-window-group .notification\").focus();\n return false;\n }\n\n $(\"#dialogNewFilePrompt\").dialog(\"close\");\n\n setTimeout(function () { // Delay, waiting the file change notified and then open it\n var tId = tree.getTIdByPath(request.path);\n tree.openFile(tree.fileTree.getNodeByTId(tId));\n tree.fileTree.selectNode(wide.curNode);\n }, 100);\n }\n });\n }\n });\n\n $(\"#dialogNewDirPrompt\").dialog({\n \"modal\": true,\n \"height\": 52,\n \"width\": 260,\n \"title\": config.label.create_dir,\n \"okText\": config.label.create,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n $(\"#dialogNewDirPrompt > input\").val('').focus();\n $(\"#dialogNewDirPrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\n },\n \"ok\": function () {\n var name = $(\"#dialogNewDirPrompt > input\").val(),\n request = newWideRequest();\n\n request.path = wide.curNode.path + \"/\" + name;\n request.fileType = \"d\";\n\n $.ajax({\n type: 'POST',\n url: config.context + '/file/new',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogNewDirPrompt\").dialog(\"close\");\n bottomGroup.tabs.setCurrent(\"notification\");\n windows.flowBottom();\n $(\".bottom-window-group .notification\").focus();\n return false;\n }\n\n $(\"#dialogNewDirPrompt\").dialog(\"close\");\n }\n });\n }\n });\n\n $(\"#dialogGoFilePrompt\").dialog({\n \"modal\": true,\n \"height\": 320,\n \"width\": 660,\n \"title\": config.label.goto_file,\n \"okText\": config.label.go,\n \"cancelText\": config.label.cancel,\n \"afterInit\": function () {\n $(\"#dialogGoFilePrompt\").on(\"dblclick\", \"li\", function () {\n var tId = tree.getTIdByPath($(this).find(\".ft-small\").text());\n tree.openFile(tree.fileTree.getNodeByTId(tId));\n tree.fileTree.selectNode(wide.curNode);\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\n wide.curEditor.focus();\n });\n\n $(\"#dialogGoFilePrompt\").on(\"click\", \"li\", function () {\n var $list = $(\"#dialogGoFilePrompt > .list\");\n $list.find(\"li\").removeClass(\"selected\");\n $list.data(\"index\", $(this).data(\"index\"));\n $(this).addClass(\"selected\");\n });\n\n hotkeys.bindList($(\"#dialogGoFilePrompt > input\"), $(\"#dialogGoFilePrompt > .list\"), function ($selected) {\n var tId = tree.getTIdByPath($selected.find(\".ft-small\").text());\n tree.openFile(tree.fileTree.getNodeByTId(tId));\n tree.fileTree.selectNode(wide.curNode);\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\n wide.curEditor.focus();\n });\n\n $(\"#dialogGoFilePrompt > input\").bind(\"input\", function () {\n var name = $(\"#dialogGoFilePrompt > input\").val();\n\n var request = newWideRequest();\n request.path = '';\n request.name = '*' + name + '*';\n if (wide.curNode) {\n request.path = wide.curNode.path;\n }\n\n $.ajax({\n type: 'POST',\n url: config.context + '/file/find/name',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n return;\n }\n\n var data = result.data;\n\n var goFileHTML = '';\n for (var i = 0, max = data.length; i < max; i++) {\n var path = data[i].path,\n name = path.substr(path.lastIndexOf(\"/\") + 1),\n icoSkin = wide.getClassBySuffix(name.split(\".\")[1]);\n if (i === 0) {\n goFileHTML += '<li data-index=\"' + i + '\" class=\"selected\" title=\"'\n + path + '\"><span class=\"'\n + icoSkin + 'ico\"></span>'\n + name + '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"ft-small\">'\n + path + '</span></li>';\n } else {\n goFileHTML += '<li data-index=\"' + i + '\" title=\"'\n + path + '\"><span class=\"' + icoSkin + 'ico\"></span>'\n + name + '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"ft-small\">'\n + path + '</span></li>';\n }\n }\n\n $(\"#dialogGoFilePrompt > ul\").html(goFileHTML);\n }\n });\n });\n },\n \"afterOpen\": function () {\n $(\"#dialogGoFilePrompt > input\").val('').focus();\n $(\"#dialogGoFilePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\n $(\"#dialogGoFilePrompt .list\").html('').data(\"index\", 0);\n },\n \"ok\": function () {\n var tId = tree.getTIdByPath($(\"#dialogGoFilePrompt .selected .ft-small\").text());\n tree.openFile(tree.fileTree.getNodeByTId(tId));\n tree.fileTree.selectNode(wide.curNode);\n $(\"#dialogGoFilePrompt\").dialog(\"close\");\n wide.curEditor.focus();\n }\n });\n\n $(\"#dialogGoLinePrompt\").dialog({\n \"modal\": true,\n \"height\": 52,\n \"width\": 260,\n \"title\": config.label.goto_line,\n \"okText\": config.label.go,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n $(\"#dialogGoLinePrompt > input\").val('').focus();\n $(\"#dialogGoLinePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\n },\n \"ok\": function () {\n var line = parseInt($(\"#dialogGoLinePrompt > input\").val()) - 1;\n $(\"#dialogGoLinePrompt\").dialog(\"close\");\n\n var editor = wide.curEditor;\n var cursor = editor.getCursor();\n\n editor.setCursor(CodeMirror.Pos(line, cursor.ch));\n\n var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);\n var cursorCoords = editor.cursorCoords({line: line - half, ch: cursor.ch}, \"local\");\n editor.scrollTo(0, cursorCoords.top);\n\n editor.focus();\n }\n });\n\n $(\"#dialogGitClonePrompt\").dialog({\n \"modal\": true,\n \"height\": 52,\n \"width\": 360,\n \"title\": config.label.git_clone,\n \"okText\": config.label.confirm,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n $(\"#dialogGitClonePrompt > input\").val('').focus();\n $(\"#dialogGitClonePrompt\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\").prop(\"disabled\", true);\n },\n \"ok\": function () {\n $(\"#dialogGitClonePrompt\").dialog(\"close\");\n\n var request = newWideRequest();\n request.path = wide.curNode.path;\n request.repository = $(\"#dialogGitClonePrompt > input\").val();\n\n $.ajax({\n type: 'POST',\n url: config.context + '/git/clone',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n }\n });\n }\n });\n },\n _initWS: function () {\n var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);\n outputWS.onopen = function () {\n console.log('[output onopen] connected');\n };\n\n outputWS.onmessage = function (e) {\n console.log('[output onmessage]' + e.data);\n var data = JSON.parse(e.data);\n\n if (goLintFound) {\n goLintFound = [];\n }\n\n if ('run' === data.nextCmd) {\n var request = newWideRequest();\n request.executable = data.executable;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/run',\n data: JSON.stringify(request),\n dataType: \"json\"\n });\n }\n\n switch (data.cmd) {\n case 'run':\n var content = $('.bottom-window-group .output > div').html();\n if (!wide.curProcessId || '' === content) {\n bottomGroup.fillOutput(content + '<pre>' + data.output + '</pre>');\n } else {\n bottomGroup.fillOutput(content.replace(/<\\/pre>$/g, data.output + '</pre>'));\n }\n\n wide.curProcessId = data.pid;\n\n break;\n case 'run-done':\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html().replace(/<\\/pre>$/g, data.output + '</pre>'));\n\n wide.curProcessId = undefined;\n $(\"#buildRun\").removeClass(\"ico-stop\")\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\n\n break;\n case 'start-build':\n case 'start-test':\n case 'start-vet':\n case 'start-install':\n case 'start-get':\n case 'start-git_clone':\n bottomGroup.fillOutput(data.output);\n\n break;\n case 'go test':\n case 'go vet':\n case 'go install':\n case 'go get':\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\n\n break;\n case 'git clone':\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\n tree.fileTree.reAsyncChildNodes(wide.curNode, \"refresh\", false);\n\n break;\n case 'build':\n case 'cross-build':\n bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + data.output);\n\n if (data.lints) { // has build error\n var files = {};\n\n for (var i = 0; i < data.lints.length; i++) {\n var lint = data.lints[i];\n\n goLintFound.push({from: CodeMirror.Pos(lint.lineNo, 0),\n to: CodeMirror.Pos(lint.lineNo, 0),\n message: lint.msg, severity: lint.severity});\n\n files[lint.file] = lint.file;\n }\n\n $(\"#buildRun\").removeClass(\"ico-stop\")\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\n\n // trigger gutter lint\n for (var path in files) {\n var editor = editors.getEditorByPath(path);\n CodeMirror.signal(editor, \"change\", editor);\n }\n } else {\n if ('cross-build' === data.cmd) {\n var request = newWideRequest(),\n path = null;\n request.path = data.executable;\n request.name = data.name;\n\n $.ajax({\n async: false,\n type: 'POST',\n url: config.context + '/file/zip/new',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (!result.succ) {\n $(\"#dialogAlert\").dialog(\"open\", result.msg);\n\n return false;\n }\n\n path = result.data;\n }\n });\n\n if (path) {\n window.open(config.context + '/file/zip?path=' + path + \".zip\");\n }\n }\n }\n\n break;\n }\n };\n outputWS.onclose = function (e) {\n console.log('[output onclose] disconnected (' + e.code + ')');\n };\n outputWS.onerror = function (e) {\n console.log('[output onerror]');\n };\n },\n _initFooter: function () {\n $(\".footer .cursor\").dblclick(function () {\n $(\"#dialogGoLinePrompt\").dialog(\"open\");\n });\n },\n init: function () {\n this._initFooter();\n\n this._initWS();\n\n // 点击隐藏弹出层\n $(\"body\").bind(\"mouseup\", function (event) {\n // MAC 右键文件树失效\n if (event.which === 3) {\n return false;\n }\n\n $(\".frame\").hide();\n\n if (!($(event.target).closest(\".frame\").length === 1 || event.target.className === \"frame\")) {\n $(\".menu > ul > li\").unbind().removeClass(\"selected\");\n menu.subMenu();\n }\n });\n\n // 刷新提示\n window.onbeforeunload = function () {\n if (editors.data.length > 0) {\n return config.label.confirm_save;\n }\n };\n\n // 禁止鼠标右键菜单\n document.oncontextmenu = function () {\n return false;\n };\n\n this._initDialog();\n },\n _save: function (path, editor) {\n if (!path) {\n return false;\n }\n\n var request = newWideRequest();\n request.file = path;\n request.code = editor.getValue();\n\n $.ajax({\n type: 'POST',\n url: config.context + '/file/save',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n // reset the save state\n editor.doc.markClean();\n $(\".edit-panel .tabs > div\").each(function () {\n var $span = $(this).find(\"span:eq(0)\");\n if ($span.attr(\"title\") === path) {\n $span.removeClass(\"changed\");\n }\n });\n }\n });\n },\n saveFile: function () {\n var path = editors.getCurrentPath();\n if (!path) {\n return false;\n }\n\n var editor = wide.curEditor;\n if (editor.doc.isClean()) { // no modification\n return false;\n }\n\n if (\"text/x-go\" === editor.getOption(\"mode\")) {\n wide.gofmt(path, wide.curEditor); // go fmt will save\n\n // build the file at once\n var request = newWideRequest();\n request.file = path;\n request.code = editor.getValue();\n request.nextCmd = \"\"; // build only, no following operation\n $.ajax({\n type: 'POST',\n url: config.context + '/build',\n data: JSON.stringify(request),\n dataType: \"json\",\n beforeSend: function () {\n bottomGroup.resetOutput();\n },\n success: function (result) {\n }\n });\n\n // refresh outline\n wide.refreshOutline();\n\n return;\n }\n\n wide._save(path, wide.curEditor);\n },\n stop: function () {\n if ($(\"#buildRun\").hasClass(\"ico-buildrun\")) {\n menu.run();\n return false;\n }\n\n if (!wide.curProcessId) {\n return false;\n }\n\n var request = newWideRequest();\n request.pid = wide.curProcessId;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/stop',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n $(\"#buildRun\").removeClass(\"ico-stop\")\n .addClass(\"ico-buildrun\").attr(\"title\", config.label.build_n_run);\n }\n });\n },\n gofmt: function (path, editor) {\n var cursor = editor.getCursor();\n var scrollInfo = editor.getScrollInfo();\n\n var request = newWideRequest();\n request.file = path;\n request.code = editor.getValue();\n request.cursorLine = cursor.line;\n request.cursorCh = cursor.ch;\n\n $.ajax({\n async: false, // sync\n type: 'POST',\n url: config.context + '/go/fmt',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (result.succ) {\n editor.setValue(result.data.code);\n editor.setCursor(cursor);\n editor.scrollTo(null, scrollInfo.top);\n\n wide._save(path, editor);\n }\n }\n });\n },\n fmt: function (path, editor) {\n var mode = editor.getOption(\"mode\");\n\n var cursor = editor.getCursor();\n var scrollInfo = editor.getScrollInfo();\n\n var request = newWideRequest();\n request.file = path;\n request.code = editor.getValue();\n request.cursorLine = cursor.line;\n request.cursorCh = cursor.ch;\n\n var formatted = null;\n\n switch (mode) {\n case \"text/x-go\":\n $.ajax({\n async: false, // sync\n type: 'POST',\n url: config.context + '/go/fmt',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (result.succ) {\n formatted = result.data.code;\n }\n }\n });\n\n break;\n case \"text/html\":\n formatted = html_beautify(editor.getValue());\n break;\n case \"text/javascript\":\n case \"application/json\":\n formatted = js_beautify(editor.getValue());\n break;\n case \"text/css\":\n formatted = css_beautify(editor.getValue());\n break;\n default :\n break;\n }\n\n if (formatted) {\n editor.setValue(formatted);\n editor.setCursor(cursor);\n editor.scrollTo(null, scrollInfo.top);\n\n wide._save(path, editor);\n }\n },\n getClassBySuffix: function (suffix) {\n var iconSkin = \"ico-ztree-other \";\n switch (suffix) {\n case \"html\":\n case \"htm\":\n iconSkin = \"ico-ztree-html \";\n break;\n case \"go\":\n iconSkin = \"ico-ztree-go \";\n break;\n case \"css\":\n iconSkin = \"ico-ztree-css \";\n break;\n case \"txt\":\n iconSkin = \"ico-ztree-text \";\n break;\n case \"sql\":\n iconSkin = \"ico-ztree-sql \";\n break;\n case \"properties\":\n iconSkin = \"ico-ztree-pro \";\n break;\n case \"md\":\n iconSkin = \"ico-ztree-md \";\n break;\n case \"js\", \"json\":\n iconSkin = \"ico-ztree-js \";\n break;\n case \"xml\":\n iconSkin = \"ico-ztree-xml \";\n break;\n case \"jpg\":\n case \"jpeg\":\n case \"bmp\":\n case \"gif\":\n case \"png\":\n case \"svg\":\n case \"ico\":\n iconSkin = \"ico-ztree-img \";\n break;\n }\n\n return iconSkin;\n }\n};\n\n$(document).ready(function () {\n wide.init();\n tree.init();\n menu.init();\n hotkeys.init();\n session.init();\n notification.init();\n editors.init();\n windows.init();\n bottomGroup.init();\n});\n","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file session.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @version 1.1.0.1, Dec 8, 2015\n */\nvar session = {\n init: function () {\n this._initWS();\n\n var getLayoutState = function (paneState) {\n var state = 'normal';\n if (paneState.isClosed) {\n state = 'min';\n } else if (paneState.size >= $('body').width()) {\n state = 'max';\n }\n\n return state;\n };\n\n // save session content every 30 seconds\n setInterval(function () {\n var request = newWideRequest(),\n filse = [],\n fileTree = [],\n currentId = editors.getCurrentId(),\n currentFile = currentId ? editors.getCurrentPath() : \"\";\n\n editors.tabs.obj._$tabs.find(\"div\").each(function () {\n var $it = $(this);\n if ($it.find(\"span:eq(0)\").attr(\"title\") !== config.label.start_page) {\n filse.push($it.find(\"span:eq(0)\").attr(\"title\"));\n }\n });\n\n fileTree = tree.getOpenPaths();\n\n request.currentFile = currentFile; // current editor file\n request.fileTree = fileTree; // file tree expansion state\n request.files = filse; // editor tabs\n\n\n request.layout = {\n \"side\": {\n \"size\": windows.outerLayout.west.state.size,\n \"state\": getLayoutState(windows.outerLayout.west.state)\n },\n \"sideRight\": {\n \"size\": windows.innerLayout.east.state.size,\n \"state\": getLayoutState(windows.innerLayout.east.state)\n },\n \"bottom\": {\n \"size\": windows.innerLayout.south.state.size,\n \"state\": getLayoutState(windows.innerLayout.south.state)\n }\n };\n\n $.ajax({\n type: 'POST',\n url: config.context + '/session/save',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n }\n });\n }, 30000);\n },\n restore: function () {\n if (!config.latestSessionContent) {\n return;\n }\n\n var fileTree = config.latestSessionContent.fileTree,\n files = config.latestSessionContent.files,\n currentFile = config.latestSessionContent.currentFile,\n id = \"\",\n nodesToOpen = [];\n\n var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());\n\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n // expand tree\n for (var j = 0, jj = fileTree.length; j < jj; j++) {\n if (nodes[i].path === fileTree[j]) {\n // expand this node only if its parents are open\n var parents = tree.getAllParents(tree.fileTree.getNodeByTId(nodes[i].tId)),\n isOpen = true;\n for (var l = 0, max = parents.length; l < max; l++) {\n if (parents[l].open === false) {\n isOpen = false;\n }\n }\n if (isOpen) {\n tree.fileTree.expandNode(nodes[i], true, false, true);\n } else {\n // flag it is open\n nodes[i].open = true;\n }\n break;\n }\n }\n\n // open editors\n for (var k = 0, kk = files.length; k < kk; k++) {\n if (nodes[i].path === files[k]) {\n nodesToOpen.push(nodes[i]);\n break;\n }\n }\n\n if (nodes[i].path === currentFile) {\n id = nodes[i].path;\n\n // FIXME: 上面的展开是异步进行的,所以执行到这里的时候可能还没有展开完,导致定位不了可视区域\n tree.fileTree.selectNode(nodes[i]);\n wide.curNode = nodes[i];\n }\n }\n\n // handle the open sequence of editors\n for (var m = 0, mm = files.length; m < mm; m++) {\n for (var n = 0, nn = nodesToOpen.length; n < nn; n++) {\n if (nodesToOpen[n].path === files[m]) {\n tree.openFile(nodesToOpen[n]);\n break;\n }\n }\n }\n\n // set the current editor\n editors.tabs.setCurrent(id);\n for (var c = 0, max = editors.data.length; c < max; c++) {\n if (id === editors.data[c].id) {\n wide.curEditor = editors.data[c].editor;\n break;\n }\n } \n },\n _initWS: function () {\n // Used for session retention, server will release all resources of the session if this channel closed\n var sessionWS = new ReconnectingWebSocket(config.channel + '/session/ws?sid=' + config.wideSessionId);\n\n sessionWS.onopen = function () {\n console.log('[session onopen] connected');\n\n var dateFormat = function (time, fmt) {\n var date = new Date(time);\n var dateObj = {\n \"M+\": date.getMonth() + 1,\n \"d+\": date.getDate(),\n \"h+\": date.getHours(),\n \"m+\": date.getMinutes(),\n \"s+\": date.getSeconds(),\n \"q+\": Math.floor((date.getMonth() + 3) / 3),\n \"S\": date.getMilliseconds()\n };\n if (/(y+)/.test(fmt))\n fmt = fmt.replace(RegExp.$1, (date.getFullYear() + \"\").substr(4 - RegExp.$1.length));\n for (var k in dateObj)\n if (new RegExp(\"(\" + k + \")\").test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1)\n ? (dateObj[k]) : ((\"00\" + dateObj[k]).substr((\"\" + dateObj[k]).length)));\n }\n return fmt;\n };\n\n var data = {type: \"Network\", severity: \"INFO\",\n message: \"Connected to server [sid=\" + config.wideSessionId + \"], \" + dateFormat(new Date().getTime(), 'yyyy-MM-dd hh:mm:ss')},\n $notification = $('.bottom-window-group .notification > table'),\n notificationHTML = '';\n\n notificationHTML += '<tr><td class=\"severity\">' + data.severity\n + '</td><td class=\"message\">' + data.message\n + '</td><td class=\"type\">' + data.type + '</td></tr>';\n $notification.append(notificationHTML);\n };\n\n sessionWS.onmessage = function (e) {\n var data = JSON.parse(e.data);\n switch (data.cmd) {\n case 'create-file':\n var node = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.dir)),\n name = data.path.replace(data.dir + '/', ''),\n mode = CodeMirror.findModeByFileName(name),\n iconSkin = wide.getClassBySuffix(name.split(\".\")[1]);\n\n if (data.type && data.type === 'f') {\n tree.fileTree.addNodes(node, [{\n \"id\": data.path,\n \"name\": name,\n \"iconSkin\": iconSkin,\n \"path\": data.path,\n \"mode\": mode,\n \"removable\": true,\n \"creatable\": true\n }]);\n\n } else {\n tree.fileTree.addNodes(node, [{\n \"id\": data.path,\n \"name\": name,\n \"iconSkin\": \"ico-ztree-dir \",\n \"path\": data.path,\n \"removable\": true,\n \"creatable\": true,\n \"isParent\": true\n }]);\n }\n break;\n case 'remove-file':\n case 'rename-file':\n var node = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.path));\n tree.fileTree.removeNode(node);\n\n var nodes = tree.fileTree.transformToArray(node);\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n editors.tabs.del(nodes[i].path);\n }\n\n break;\n }\n };\n sessionWS.onclose = function (e) {\n console.log('[session onclose] disconnected (' + e.code + ')');\n\n var data = {type: \"Network\", severity: \"ERROR\",\n message: \"Disconnected from server, trying to reconnect it [sid=\" + config.wideSessionId + \"]\"},\n $notification = $('.bottom-window-group .notification > table'),\n notificationHTML = '';\n\n notificationHTML += '<tr><td class=\"severity\">' + data.severity\n + '</td><td class=\"message\">' + data.message\n + '</td><td class=\"type\">' + data.type + '</td></tr>';\n $notification.append(notificationHTML);\n\n $(\".notification-count\").show();\n };\n sessionWS.onerror = function (e) {\n console.log('[session onerror]');\n };\n }\n};","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file menu.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.0.1.3, Oct 5, 2018\n */\nvar menu = {\n init: function () {\n this.subMenu();\n this._initPreference();\n this._initAbout();\n this._initShare();\n\n // 点击子菜单后消失\n $(\".menu .frame li\").click(function () {\n $(\".menu > ul > li\").unbind().removeClass(\"selected\");\n menu.subMenu();\n });\n },\n _initShare: function () {\n $(\".menu .ico-share\").hover(function () {\n $(\".menu .share-panel\").show();\n });\n\n $(\".share-panel .font-ico\").click(function () {\n var key = $(this).attr('class').split('-')[2];\n var url = \"https://wide.b3log.org\", pic = 'https://wide.b3log.org/static/images/wide-logo.png';\n var urls = {};\n urls.email = \"mailto:?subject=\" + $('title').text()\n + \"&body=\" + $('meta[name=description]').attr('content') + ' ' + url;\n\n var twitterShare = encodeURIComponent($('meta[name=description]').attr('content') + \" \" + url + \" #golang\");\n urls.twitter = \"https://twitter.com/intent/tweet?status=\" + twitterShare;\n\n urls.facebook = \"https://www.facebook.com/sharer/sharer.php?u=\" + url;\n urls.googleplus = \"https://plus.google.com/share?url=\" + url;\n\n var title = encodeURIComponent($('title').text() + '. \\n' + $('meta[name=description]').attr('content')\n + \" #golang#\");\n urls.weibo = \"http://v.t.sina.com.cn/share/share.php?title=\" + title + \"&url=\" + url + \"&pic=\" + pic;\n urls.qqz = \"https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=\" + url + \"&sharesource=qzone&title=\" + title+ \"&pics=\" + pic;\n\n window.open(urls[key], \"_blank\", \"top=100,left=200,width=648,height=618\");\n });\n },\n _initAbout: function () {\n $(\"#dialogAbout\").load(config.context + '/about', function () {\n $(\"#dialogAbout\").dialog({\n \"modal\": true,\n \"title\": config.label.about,\n \"hideFooter\": true,\n \"afterOpen\": function () {\n $.ajax({\n url: \"https://rhythm.b3log.org/version/wide/latest\",\n type: \"GET\",\n dataType: \"jsonp\",\n jsonp: \"callback\",\n success: function (data, textStatus) {\n if ($(\"#dialogAbout .version\").text() === data.wideVersion) {\n $(\".upgrade\").text(config.label.uptodate);\n } else {\n $(\".upgrade\").html(config.label.new_version_available + config.label.colon\n + \"<a href='\" + data.wideDownload\n + \"' target='_blank'>\" + data.wideVersion + \"</a>\");\n }\n }\n });\n }\n });\n });\n },\n disabled: function (list) {\n for (var i = 0, max = list.length; i < max; i++) {\n $(\".menu li.\" + list[i]).addClass(\"disabled\");\n }\n },\n undisabled: function (list) {\n for (var i = 0, max = list.length; i < max; i++) {\n $(\".menu li.\" + list[i]).removeClass(\"disabled\");\n }\n },\n // 焦点不在菜单上时需点击展开子菜单,否则为鼠标移动展开\n subMenu: function () {\n $(\".menu > ul > li\").click(function (event) {\n if ($(event.target).closest(\".frame\").length === 1) {\n return;\n }\n var $it = $(this);\n $it.find('.frame').show();\n $(\".menu > ul > li\").removeClass(\"selected\");\n $(this).addClass(\"selected\");\n\n $(\".menu > ul > li\").unbind();\n\n $(\".menu > ul > li\").mouseover(function () {\n if ($(event.target).closest(\".frame\").length === 1) {\n return;\n }\n $(\".menu .frame\").hide();\n $(this).find('.frame').show();\n $(\".menu > ul > li\").removeClass(\"selected\");\n $(this).addClass(\"selected\");\n });\n });\n },\n openPreference: function () {\n $(\"#dialogPreference\").dialog(\"open\");\n },\n saveAllFiles: function () {\n if ($(\".menu li.save-all\").hasClass(\"disabled\")) {\n return false;\n }\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n var path = editors.data[i].id;\n var editor = editors.data[i].editor;\n\n if (\"text/x-go\" === editor.getOption(\"mode\")) {\n wide.fmt(path, editor);\n } else {\n wide._save(path, editor);\n }\n }\n },\n closeAllFiles: function () {\n if ($(\".menu li.close-all\").hasClass(\"disabled\")) {\n return false;\n }\n\n // 设置全部关闭标识\n var removeData = [];\n $(\".edit-panel .tabs > div\").each(function (i) {\n if (i !== 0) {\n removeData.push($(this).data(\"index\"));\n }\n });\n $(\"#dialogCloseEditor\").data(\"removeData\", removeData);\n // 开始关闭\n $(\".edit-panel .tabs .ico-close:eq(0)\").click();\n },\n exit: function () {\n var request = newWideRequest();\n\n $.ajax({\n type: 'POST',\n url: config.context + '/logout',\n data: JSON.stringify(request),\n dataType: \"json\",\n success: function (result) {\n if (result.succ) {\n window.location.href = config.context + \"/login\";\n }\n }\n });\n },\n openAbout: function () {\n $(\"#dialogAbout\").dialog(\"open\");\n },\n goget: function () {\n menu.saveAllFiles();\n\n var currentPath = editors.getCurrentPath();\n if (!currentPath) {\n return false;\n }\n\n if ($(\".menu li.go-get\").hasClass(\"disabled\")) {\n return false;\n }\n\n var request = newWideRequest();\n request.file = currentPath;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/go/get',\n data: JSON.stringify(request),\n dataType: \"json\",\n beforeSend: function () {\n bottomGroup.resetOutput();\n },\n success: function (result) {\n }\n });\n },\n goinstall: function () {\n menu.saveAllFiles();\n\n var currentPath = editors.getCurrentPath();\n if (!currentPath) {\n return false;\n }\n\n if ($(\".menu li.go-install\").hasClass(\"disabled\")) {\n return false;\n }\n\n var request = newWideRequest();\n request.file = currentPath;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/go/install',\n data: JSON.stringify(request),\n dataType: \"json\",\n beforeSend: function () {\n bottomGroup.resetOutput();\n },\n success: function (result) {\n }\n });\n },\n // go test.\n test: function () {\n menu.saveAllFiles();\n\n var currentPath = editors.getCurrentPath();\n if (!currentPath) {\n return false;\n }\n\n if ($(\".menu li.go-test\").hasClass(\"disabled\")) {\n return false;\n }\n\n var request = newWideRequest();\n request.file = currentPath;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/go/test',\n data: JSON.stringify(request),\n dataType: \"json\",\n beforeSend: function () {\n bottomGroup.resetOutput();\n },\n success: function (result) {\n }\n });\n },\n // go vet.\n govet: function () {\n menu.saveAllFiles();\n\n var currentPath = editors.getCurrentPath();\n if (!currentPath) {\n return false;\n }\n\n if ($(\".menu li.go-vet\").hasClass(\"disabled\")) {\n return false;\n }\n\n var request = newWideRequest();\n request.file = currentPath;\n\n $.ajax({\n type: 'POST',\n url: config.context + '/go/vet',\n data: JSON.stringify(request),\n dataType: \"json\",\n beforeSend: function () {\n bottomGroup.resetOutput();\n },\n success: function (result) {\n }\n });\n },\n // Build & Run.\n run: function () {\n menu.saveAllFiles();\n\n if ($(\"#buildRun\").hasClass(\"ico-stop\")) {\n wide.stop();\n return false;\n }\n\n var currentPath = editors.getCurrentPath();\n if (!currentPath) {\n return false;\n }\n\n if ($(\".menu li.run\").hasClass(\"disabled\")) {\n return false;\n }\n\n var request = newWideRequest();\n request.file = currentPath;\n request.code = wide.curEditor.getValue();\n request.nextCmd = \"run\";\n\n $.ajax({\n type: 'POST',\n url: config.context + '/build',\n data: JSON.stringify(request),\n dataType: \"json\",\n beforeSend: function () {\n bottomGroup.resetOutput();\n\n $(\"#buildRun\").addClass(\"ico-stop\")\n .removeClass(\"ico-buildrun\").attr(\"title\", config.label.stop);\n },\n success: function (result) {\n }\n });\n },\n // Build.\n build: function () {\n menu.saveAllFiles();\n\n var currentPath = editors.getCurrentPath();\n if (!currentPath) {\n return false;\n }\n\n if ($(\".menu li.build\").hasClass(\"disabled\")) {\n return false;\n }\n\n var request = newWideRequest();\n request.file = currentPath;\n request.code = wide.curEditor.getValue();\n request.nextCmd = \"\"; // build only, no following operation\n\n $.ajax({\n type: 'POST',\n url: config.context + '/build',\n data: JSON.stringify(request),\n dataType: \"json\",\n beforeSend: function () {\n bottomGroup.resetOutput();\n },\n success: function (result) {\n }\n });\n },\n _initPreference: function () {\n $(\"#dialogPreference\").load(config.context + '/preference', function () {\n $(\"#dialogPreference input\").keyup(function () {\n var isChange = false,\n emptys = [],\n emptysTip = '';\n $(\"#dialogPreference input\").each(function () {\n var $it = $(this);\n // data-value 如为数字,则不会和 value 一样转换为 String再次不使用全等\n if ($it.val() != $it.data(\"value\")) {\n isChange = true;\n }\n\n if ($.trim($it.val()) === '') {\n emptys.push($it);\n }\n });\n\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\n if (isChange) {\n $okBtn.prop(\"disabled\", false);\n } else {\n $okBtn.prop(\"disabled\", true);\n }\n\n if (emptys.length === 0) {\n $(\"#dialogPreference\").find(\".tip\").html(\"\");\n $okBtn.prop(\"disabled\", false);\n } else {\n for (var i = 0, max = emptys.length; i < max; i++) {\n var tabIndex = emptys[i].closest('div').data(\"index\"),\n text = $.trim(emptys[i].parent().text());\n emptysTip += '[' + $('#dialogPreference .tabs > div[data-index=\"' + tabIndex + '\"]').text()\n + '] -> [' + text.substr(0, text.length - 1)\n + ']: ' + config.label.no_empty + \"<br/>\";\n }\n $(\"#dialogPreference\").find(\".tip\").html(emptysTip);\n $okBtn.prop(\"disabled\", true);\n }\n });\n\n $(\"#dialogPreference select\").on(\"change\", function () {\n var isChange = false;\n $(\"#dialogPreference select\").each(function () {\n if ($(this).val() !== $(this).data(\"value\")) {\n isChange = true;\n }\n });\n\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\n if (isChange) {\n $okBtn.prop(\"disabled\", false);\n } else {\n $okBtn.prop(\"disabled\", true);\n }\n });\n\n $(\"#dialogPreference\").dialog({\n \"modal\": true,\n \"height\": 280,\n \"width\": 800,\n \"title\": config.label.preference,\n \"okText\": config.label.apply,\n \"cancelText\": config.label.cancel,\n \"afterOpen\": function () {\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\n $okBtn.prop(\"disabled\", true);\n },\n \"ok\": function () {\n var request = newWideRequest(),\n $dialogPreference = $(\"#dialogPreference\"),\n $fontFamily = $dialogPreference.find(\"input[name=fontFamily]\"),\n $fontSize = $dialogPreference.find(\"input[name=fontSize]\"),\n $goFmt = $dialogPreference.find(\"select[name=goFmt]\"),\n $GoBuildArgsForLinux = $dialogPreference.find(\"input[name=GoBuildArgsForLinux]\"),\n $GoBuildArgsForWindows = $dialogPreference.find(\"input[name=GoBuildArgsForWindows]\"),\n $GoBuildArgsForDarwin = $dialogPreference.find(\"input[name=GoBuildArgsForDarwin]\"),\n $workspace = $dialogPreference.find(\"input[name=workspace]\"),\n $password = $dialogPreference.find(\"input[name=password]\"),\n $email = $dialogPreference.find(\"input[name=email]\"),\n $locale = $dialogPreference.find(\"select[name=locale]\"),\n $theme = $dialogPreference.find(\"select[name=theme]\"),\n $editorFontFamily = $dialogPreference.find(\"input[name=editorFontFamily]\"),\n $editorFontSize = $dialogPreference.find(\"input[name=editorFontSize]\"),\n $editorLineHeight = $dialogPreference.find(\"input[name=editorLineHeight]\"),\n $editorTheme = $dialogPreference.find(\"select[name=editorTheme]\"),\n $editorTabSize = $dialogPreference.find(\"input[name=editorTabSize]\"),\n $keymap = $dialogPreference.find(\"select[name=keymap]\");\n\n $.extend(request, {\n \"fontFamily\": $fontFamily.val(),\n \"fontSize\": $fontSize.val(),\n \"goFmt\": $goFmt.val(),\n \"GoBuildArgsForLinux\": $GoBuildArgsForLinux.val(),\n \"GoBuildArgsForWindows\": $GoBuildArgsForWindows.val(),\n \"GoBuildArgsForDarwin\": $GoBuildArgsForDarwin.val(),\n \"workspace\": $workspace.val(),\n \"password\": $password.val(),\n \"email\": $email.val(),\n \"locale\": $locale.val(),\n \"theme\": $theme.val(),\n \"editorFontFamily\": $editorFontFamily.val(),\n \"editorFontSize\": $editorFontSize.val(),\n \"editorLineHeight\": $editorLineHeight.val(),\n \"editorTheme\": $editorTheme.val(),\n \"editorTabSize\": $editorTabSize.val(),\n \"keymap\": $keymap.val()\n });\n\n if (config.keymap !== $keymap.val()) {\n window.location.reload();\n }\n\n $.ajax({\n type: 'POST',\n url: config.context + '/preference',\n data: JSON.stringify(request),\n success: function (result, textStatus, jqXHR) {\n if (!result.succ) {\n return false;\n }\n\n $fontFamily.data(\"value\", $fontFamily.val());\n $fontSize.data(\"value\", $fontSize.val());\n $goFmt.data(\"value\", $goFmt.val());\n $GoBuildArgsForLinux.data(\"value\", $GoBuildArgsForLinux.val());\n $GoBuildArgsForWindows.data(\"value\", $GoBuildArgsForWindows.val());\n $GoBuildArgsForDarwin.data(\"value\", $GoBuildArgsForDarwin.val());\n $workspace.data(\"value\", $workspace.val());\n $password.data(\"value\", $password.val());\n $email.data(\"value\", $email.val());\n $locale.data(\"value\", $locale.val());\n $theme.data(\"value\", $theme.val());\n $editorFontFamily.data(\"value\", $editorFontFamily.val());\n $editorFontSize.data(\"value\", $editorFontSize.val());\n $editorLineHeight.data(\"value\", $editorLineHeight.val());\n $editorTheme.data(\"value\", $editorTheme.val());\n $editorTabSize.data(\"value\", $editorTabSize.val());\n $keymap.data(\"value\", $keymap.val());\n\n // update the config\n config.keymap = $keymap.val();\n\n var $okBtn = $(\"#dialogPreference\").closest(\".dialog-main\").find(\".dialog-footer > button:eq(0)\");\n $okBtn.prop(\"disabled\", true);\n\n $(\"#themesLink\").attr(\"href\", config.staticServer + '/static/css/themes/' + $theme.val() + '.css');\n\n config.editorTheme = $editorTheme.val();\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n editors.data[i].editor.setOption(\"theme\", $editorTheme.val());\n }\n }\n });\n }\n });\n\n new Tabs({\n id: \".preference\"\n });\n });\n }\n};\n","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file windows.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.1.2.2, Feb 16, 2016\n */\nvar windows = {\n isMaxEditor: false,\n outerLayout: {},\n innerLayout: {},\n init: function () {\n if (!config.latestSessionContent) {\n config.latestSessionContent = {\n \"fileTree\": [],\n \"files\": [],\n \"currentFile\": \"\",\n };\n }\n \n if (!config.latestSessionContent.layout) {\n config.latestSessionContent.layout = {\n \"side\": {\n \"size\": 200,\n \"state\": 'normal'\n },\n \"sideRight\": {\n \"size\": 200,\n \"state\": 'normal'\n },\n \"bottom\": {\n \"size\": 100,\n \"state\": 'normal'\n }\n };\n }\n\n var layout = config.latestSessionContent.layout;\n\n this.outerLayout = $('body').layout({\n north__paneSelector: \".menu\",\n center__paneSelector: \".content\",\n south__paneSelector: \".footer\",\n north__size: 22,\n south__size: 19,\n spacing_open: 2,\n north__spacing_open: 0,\n south__spacing_open: 0,\n defaults: {\n fxSpeed_open: 300,\n fxSpeed_close: 100,\n fxSettings_close: {\n easing: \"easeOutQuint\"\n },\n fxSettings_open: {\n easing: \"easeInQuint\"\n }\n },\n west: {\n size: layout.side.size,\n paneSelector: \".side\",\n togglerLength_open: 0,\n togglerLength_closed: 15,\n togglerAlign_closed: \"top\",\n slideTrigger_open: \"mouseover\",\n spacing_closed: 15,\n minSize: 100,\n togglerClass: \"ico-restore\",\n togglerTip_open: config.label.min,\n togglerTip_closed: config.label.restore_side,\n resizerTip: config.label.resize,\n initClosed: (layout.side.state === 'min')\n }\n });\n\n this.innerLayout = $('div.content').layout({\n spacing_open: 2,\n defaults: {\n fxSpeed_open: 300,\n fxSpeed_close: 100,\n fxSettings_close: {\n easing: \"easeOutQuint\"\n },\n fxSettings_open: {\n easing: \"easeInQuint\"\n }\n },\n center: {\n paneSelector: \".edit-panel\"\n },\n east: {\n size: layout.sideRight.size,\n paneSelector: \".side-right\",\n togglerLength_open: 0,\n togglerLength_closed: 15,\n togglerAlign_closed: \"top\",\n slideTrigger_open: \"mouseover\",\n spacing_closed: 15,\n minSize: 100,\n togglerClass: \"ico-restore\",\n togglerTip_open: config.label.min,\n togglerTip_closed: config.label.restore_outline,\n resizerTip: config.label.resize,\n initClosed: (layout.sideRight.state === 'min')\n },\n south: {\n size: layout.bottom.size,\n paneSelector: \".bottom-window-group\",\n togglerLength_open: 0,\n togglerLength_closed: 15,\n togglerAlign_closed: \"top\",\n slideTrigger_open: \"mouseover\",\n spacing_closed: 16,\n minSize: 100,\n togglerClass: \"ico-restore\",\n togglerTip_open: config.label.min,\n togglerTip_closed: config.label.restore_bottom,\n resizerTip: config.label.resize,\n initClosed: (layout.bottom.state === 'min'),\n ondrag_end: function (type, pane) {\n windows.refreshEditor(pane, 'drag');\n },\n onresize_end: function (type, pane) {\n windows.refreshEditor(pane, 'resize');\n },\n onclose_end: function (type, pane) {\n windows.refreshEditor(pane, 'close');\n },\n onopen_end: function (type, pane) {\n windows.refreshEditor(pane, 'open');\n },\n onshow_end: function (type, pane) {\n windows.refreshEditor(pane, 'show');\n }\n }\n });\n\n this.outerLayout.addCloseBtn(\".side .ico-min\", \"west\");\n this.innerLayout.addCloseBtn(\".side-right .ico-min\", \"east\");\n this.innerLayout.addCloseBtn(\".bottom-window-group .ico-min\", \"south\");\n\n if (layout.side.state === 'max') {\n windows.maxSide();\n }\n if (layout.sideRight.state === 'max') {\n windows.maxSideRight();\n }\n if (layout.bottom.state === 'max') {\n windows.maxBottom();\n }\n\n $(\".toolbars .ico-max\").click(function () {\n windows.toggleEditor();\n });\n\n $(\".edit-panel .tabs\").on(\"dblclick\", function () {\n windows.toggleEditor();\n });\n\n $(\".bottom-window-group .tabs\").dblclick(function () {\n var $it = $(\".bottom-window-group\");\n if ($it.hasClass(\"bottom-window-group-max\")) {\n windows.restoreBottom();\n } else {\n windows.maxBottom($it);\n }\n });\n\n $(\".side .tabs\").dblclick(function () {\n var $it = $(\".side\");\n if ($it.hasClass(\"side-max\")) {\n windows.restoreSide();\n } else {\n windows.restoreSide($it);\n }\n });\n\n $(\".side-right .tabs\").dblclick(function () {\n var $it = $(\".side-right\");\n if ($it.hasClass(\"side-right-max\")) {\n windows.restoreSideRight();\n } else {\n windows.maxSideRight($it);\n }\n });\n\n $('.bottom-window-group .search').height($('.bottom-window-group .tabs-panel').height());\n $(window).resize(function () {\n windows.refreshEditor($('.bottom-window-group'));\n });\n\n },\n maxEditor: function () {\n var $it = $(\".toolbars .font-ico\");\n windows.outerLayout.close('west');\n windows.innerLayout.close('south');\n windows.innerLayout.close('east');\n $it.removeClass('ico-max').addClass('ico-restore').attr('title', config.label.min);\n windows.isMaxEditor = true;\n },\n maxBottom: function ($it) {\n $it.data('height', $it.height()).addClass(\"bottom-window-group-max\").find('.ico-min').hide();\n windows.outerLayout.hide('west');\n windows.innerLayout.hide('east');\n windows.innerLayout.sizePane('south', $('.content').height());\n },\n maxSide: function ($it) {\n $it.data('width', $it.width()).addClass(\"side-max\").find('.ico-min').hide();\n $('.content').hide();\n windows.outerLayout.sizePane('west', $('body').width());\n },\n maxSideRight: function ($it) {\n $it.addClass(\"side-right-max\").data('width', $it.width()).find('.ico-min').hide();\n windows.outerLayout.hide('west');\n windows.innerLayout.hide('south');\n windows.innerLayout.sizePane('east', $('body').width());\n },\n toggleEditor: function () {\n var $it = $(\".toolbars .font-ico\");\n if ($it.hasClass('ico-restore')) {\n windows.restoreEditor();\n } else {\n windows.maxEditor();\n }\n },\n restoreBottom: function () {\n var $it = $(\".bottom-window-group\");\n $it.removeClass(\"bottom-window-group-max\").find('.ico-min').show();\n windows.outerLayout.show('west');\n windows.innerLayout.show('east');\n windows.innerLayout.sizePane('south', $it.data('height'));\n },\n restoreSide: function () {\n var $it = $(\".side\");\n $it.removeClass(\"side-max\").find('.ico-min').show();\n $('.content').show();\n windows.outerLayout.sizePane('west', $it.data('width'));\n },\n restoreSideRight: function () {\n var $it = $(\".side-right\");\n $it.removeClass(\"side-right-max\").find('.ico-min').show();\n windows.outerLayout.show('west');\n windows.innerLayout.show('south');\n windows.innerLayout.sizePane('east', $it.data('width'));\n },\n restoreEditor: function () {\n windows.outerLayout.open('west');\n windows.innerLayout.open('south');\n windows.innerLayout.open('east');\n windows.isMaxEditor = false;\n $(\".toolbars .font-ico\").addClass('ico-max').removeClass('ico-restore').attr('title', config.label.max_editor);\n },\n refreshEditor: function (pane, type) {\n var editorDatas = editors.data,\n height = $('.content').height() - pane.height() - 24;\n switch (type) {\n case 'close':\n height = $('.content').height() - 40;\n break;\n default:\n break;\n }\n for (var i = 0, ii = editorDatas.length; i < ii; i++) {\n editorDatas[i].editor.setSize(\"100%\", height);\n }\n\n $('.bottom-window-group .search').height($('.bottom-window-group .tabs-panel').height());\n },\n flowBottom: function () {\n if (windows.innerLayout.south.state.isClosed) {\n windows.innerLayout.slideOpen('south');\n }\n }\n};","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file hotkeys.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.0.0.2, Dec 15, 2015\n */\nvar hotkeys = {\n defaultKeyMap: {\n // Ctrl-0\n goEditor: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 48,\n fun: function () {\n if (wide.curEditor) {\n wide.curEditor.focus();\n }\n }\n },\n // Ctrl-1\n goFileTree: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 49,\n fun: function () {\n // 有些元素需设置 tabindex 为 -1 时才可以 focus\n if (windows.outerLayout.west.state.isClosed) {\n windows.outerLayout.slideOpen('west');\n }\n $(\"#files\").focus();\n }\n },\n // Ctrl-2\n goOutline: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 50,\n fun: function () {\n if (windows.innerLayout.east.state.isClosed) {\n windows.innerLayout.slideOpen('east');\n }\n\n $(\"#outline\").focus();\n }\n },\n // Ctrl-4\n goOutput: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 52,\n fun: function () {\n bottomGroup.tabs.setCurrent(\"output\");\n windows.flowBottom();\n $(\".bottom-window-group .output\").focus();\n }\n },\n // Ctrl-5\n goSearch: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 53,\n fun: function () {\n bottomGroup.tabs.setCurrent(\"search\");\n windows.flowBottom();\n $(\".bottom-window-group .search\").focus();\n }\n },\n // Ctrl-6\n goNotification: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 54,\n fun: function () {\n bottomGroup.tabs.setCurrent(\"notification\");\n windows.flowBottom();\n $(\".bottom-window-group .notification\").focus();\n }\n },\n // Alt-C\n clearWindow: {\n ctrlKey: false,\n altKey: true,\n shiftKey: false,\n which: 67\n },\n // Ctrl-D 窗口组切换 \n changeEditor: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 68\n },\n // Ctrl-F search \n search: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 70\n },\n // Ctrl-Q close current editor \n closeCurEditor: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 81\n },\n // Ctrl-R\n rename: {\n ctrlKey: true,\n altKey: false,\n shiftKey: false,\n which: 82\n },\n // Shift-Alt-O 跳转到文件\n goFile: {\n ctrlKey: false,\n altKey: true,\n shiftKey: true,\n which: 79\n },\n // F5 Build\n build: {\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n which: 116\n },\n // F6 Build & Run\n buildRun: {\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n which: 117\n }\n },\n bindList: function ($source, $list, enterFun) {\n $list.data(\"index\", 0);\n $source.keydown(function (event) {\n var index = $list.data(\"index\"),\n count = $list.find(\"li\").length;\n\n if (count === 0) {\n return true;\n }\n\n if (event.which === 38) { // up\n index--;\n if (index < 0) {\n index = count - 1;\n }\n }\n\n if (event.which === 40) { // down\n index++;\n if (index > count - 1) {\n index = 0;\n }\n }\n\n var $selected = $list.find(\"li:eq(\" + index + \")\");\n\n if (event.which === 13) { // enter\n enterFun($selected);\n }\n\n $list.find(\"li\").removeClass(\"selected\");\n $list.data(\"index\", index);\n $selected.addClass(\"selected\");\n\n if (index === 0) {\n $list.scrollTop(0);\n } else {\n if ($selected[0].offsetTop + $list.scrollTop() > $list.height()) {\n if (event.which === 40) {\n $list.scrollTop($list.scrollTop() + $selected.height());\n } else {\n $list.scrollTop($selected[0].offsetTop);\n }\n } else {\n $list.scrollTop(0);\n }\n }\n\n // 阻止上下键改变光标位置\n if (event.which === 38 || event.which === 40 || event.which === 13) {\n return false;\n }\n });\n },\n _bindOutput: function () {\n $(\".bottom-window-group .output\").keydown(function (event) {\n var hotKeys = hotkeys.defaultKeyMap;\n if (event.altKey === hotKeys.clearWindow.altKey\n && event.which === hotKeys.clearWindow.which) { // Alt-C clear output\n bottomGroup.clear('output');\n\n event.preventDefault();\n\n return;\n }\n });\n },\n _bindFileTree: function () {\n $(\"#files\").keydown(function (event) {\n event.preventDefault();\n\n var hotKeys = hotkeys.defaultKeyMap;\n if (event.ctrlKey === hotKeys.search.ctrlKey\n && event.which === hotKeys.search.which) { // Ctrl-F 搜索\n $(\"#dialogSearchForm\").dialog(\"open\");\n return;\n }\n\n if (event.ctrlKey === hotKeys.rename.ctrlKey\n && event.which === hotKeys.rename.which) { // Ctrl-R 重命名\n if (wide.curNode.removable) {\n $(\"#dialogRenamePrompt\").dialog(\"open\");\n }\n return;\n }\n\n switch (event.which) {\n case 46: // delete\n tree.removeIt();\n break;\n case 13: // enter\n if (!wide.curNode) {\n return false;\n }\n\n if (tree.isDir()) {\n if (wide.curNode.open) {\n return false;\n }\n\n tree.fileTree.expandNode(wide.curNode, true, false, true);\n $(\"#files\").focus();\n\n break;\n }\n\n tree.openFile(wide.curNode);\n\n break;\n case 38: // up\n var node = {};\n\n if (!wide.curNode) { // select the first one if no node been selected\n node = tree.fileTree.getNodeByTId(\"files_1\");\n } else {\n if (wide.curNode && wide.curNode.isFirstNode && wide.curNode.level === 0) {\n return false;\n }\n\n node = wide.curNode.getPreNode();\n if (wide.curNode.isFirstNode && wide.curNode.getParentNode()) {\n node = wide.curNode.getParentNode();\n }\n\n var preNode = wide.curNode.getPreNode();\n if (preNode && tree.isDir() && preNode.open) {\n node = tree.getCurrentNodeLastNode(preNode);\n }\n }\n\n wide.curNode = node;\n tree.fileTree.selectNode(node);\n $(\"#files\").focus();\n break;\n case 40: // down\n var node = {};\n\n if (!wide.curNode) { // select the first one if no node been selected \n node = tree.fileTree.getNodeByTId(\"files_1\");\n } else {\n if (wide.curNode && tree.isBottomNode(wide.curNode)) {\n return false;\n }\n\n node = wide.curNode.getNextNode();\n if (tree.isDir() && wide.curNode.open) {\n node = wide.curNode.children[0];\n }\n\n var nextShowNode = tree.getNextShowNode(wide.curNode);\n if (wide.curNode.isLastNode && wide.curNode.level !== 0 && !wide.curNode.open && nextShowNode) {\n node = nextShowNode;\n }\n }\n\n if (node) {\n wide.curNode = node;\n tree.fileTree.selectNode(node);\n }\n\n $(\"#files\").focus();\n break;\n case 37: // left\n if (!wide.curNode) {\n wide.curNode = tree.fileTree.getNodeByTId(\"files_1\");\n tree.fileTree.selectNode(wide.curNode);\n $(\"#files\").focus();\n return false;\n }\n\n if (!tree.isDir() || !wide.curNode.open) {\n return false;\n }\n\n tree.fileTree.expandNode(wide.curNode, false, false, true);\n $(\"#files\").focus();\n break;\n case 39: // right\n if (!wide.curNode) {\n wide.curNode = tree.fileTree.getNodeByTId(\"files_1\");\n tree.fileTree.selectNode(wide.curNode);\n $(\"#files\").focus();\n return false;\n }\n\n if (!tree.isDir() || wide.curNode.open) {\n return false;\n }\n\n tree.fileTree.expandNode(wide.curNode, true, false, true);\n $(\"#files\").focus();\n\n break;\n case 116: // F5\n if (!wide.curNode || !tree.isDir()) {\n return false;\n }\n\n tree.refresh(wide.curNode);\n\n break;\n }\n });\n },\n _bindDocument: function () {\n var hotKeys = this.defaultKeyMap;\n $(document).keydown(function (event) {\n if (event.ctrlKey === hotKeys.goEditor.ctrlKey\n && event.which === hotKeys.goEditor.which) { // Ctrl-0 焦点切换到当前编辑器\n hotKeys.goEditor.fun();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.goFileTree.ctrlKey\n && event.which === hotKeys.goFileTree.which) { // Ctrl-1 焦点切换到文件树\n hotKeys.goFileTree.fun();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.goOutline.ctrlKey\n && event.which === hotKeys.goOutline.which) { // Ctrl-2 焦点切换到大纲\n hotKeys.goOutline.fun();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.goOutput.ctrlKey\n && event.which === hotKeys.goOutput.which) { // Ctrl-4 焦点切换到输出窗口 \n hotKeys.goOutput.fun();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.goSearch.ctrlKey\n && event.which === hotKeys.goSearch.which) { // Ctrl-5 焦点切换到搜索窗口 \n hotKeys.goSearch.fun();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.goNotification.ctrlKey\n && event.which === hotKeys.goNotification.which) { // Ctrl-6 焦点切换到通知窗口 \n hotKeys.goNotification.fun();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.closeCurEditor.ctrlKey\n && event.which === hotKeys.closeCurEditor.which) { // Ctrl-Q 关闭当前编辑器 \n $(\".edit-panel .tabs > div.current\").find(\".ico-close\").click();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.changeEditor.ctrlKey\n && event.which === hotKeys.changeEditor.which) { // Ctrl-D 窗口组切换\n if (document.activeElement.className === \"notification\"\n || document.activeElement.className === \"output\"\n || document.activeElement.className === \"search\") {\n // 焦点在底部窗口组时,对底部进行切换\n var tabs = [\"output\", \"search\", \"notification\"],\n nextPath = \"\";\n for (var i = 0, ii = tabs.length; i < ii; i++) {\n if (bottomGroup.tabs.getCurrentId() === tabs[i]) {\n if (i < ii - 1) {\n nextPath = tabs[i + 1];\n } else {\n nextPath = tabs[0];\n }\n break;\n }\n }\n bottomGroup.tabs.setCurrent(nextPath);\n $(\".bottom-window-group .\" + nextPath).focus();\n\n event.preventDefault();\n\n return false;\n }\n\n if (editors.data.length > 1) {\n var nextPath = \"\";\n for (var i = 0, ii = editors.data.length; i < ii; i++) {\n var currentId = editors.getCurrentId();\n if (currentId) {\n if (currentId === editors.data[i].id) {\n if (i < ii - 1) {\n nextPath = editors.data[i + 1].id;\n wide.curEditor = editors.data[i + 1].editor;\n } else {\n nextPath = editors.data[0].id;\n wide.curEditor = editors.data[0].editor;\n }\n break;\n }\n }\n }\n\n editors.tabs.setCurrent(nextPath);\n var nextTId = tree.getTIdByPath(nextPath);\n wide.curNode = tree.fileTree.getNodeByTId(nextTId);\n\n tree.fileTree.selectNode(wide.curNode);\n wide.refreshOutline();\n var cursor = wide.curEditor.getCursor();\n $(\".footer .cursor\").text('| ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + ' |');\n wide.curEditor.focus();\n }\n\n event.preventDefault();\n\n return false;\n }\n\n if (event.which === hotKeys.build.which) { // F5 Build\n menu.build();\n event.preventDefault();\n\n return;\n }\n\n if (event.which === hotKeys.buildRun.which) { // F6 Build & Run\n menu.run();\n event.preventDefault();\n\n return;\n }\n\n if (event.ctrlKey === hotKeys.goFile.ctrlKey\n && event.altKey === hotKeys.goFile.altKey\n && event.shiftKey === hotKeys.goFile.shiftKey\n && event.which === hotKeys.goFile.which) { // Shift-Alt-O 跳转到文件\n $(\"#dialogGoFilePrompt\").dialog(\"open\");\n }\n });\n },\n init: function () {\n this._bindFileTree();\n this._bindOutput();\n this._bindDocument();\n }\n};","/*\n * Copyright (c) 2014-2018, b3log.org & hacpai.com\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * @file bottomGroup.js\n *\n * @author <a href=\"http://vanessa.b3log.org\">Liyuan Li</a>\n * @author <a href=\"http://88250.b3log.org\">Liang Ding</a>\n * @version 1.1.1.1, Mar 15, 2017\n */\nvar bottomGroup = {\n tabs: undefined,\n searchTab: undefined,\n init: function () {\n this._initTabs();\n this._initFrame();\n\n $('.bottom-window-group .output').click(function () {\n $(this).focus();\n });\n\n $('.bottom-window-group .output').on('click', '.path', function (event) {\n var $path = $(this),\n tId = tree.getTIdByPath($path.data(\"path\"));\n tree.openFile(tree.fileTree.getNodeByTId(tId),\n CodeMirror.Pos($path.data(\"line\") - 1, $path.data(\"column\") - 1));\n event.preventDefault();\n return false;\n });\n },\n _initFrame: function () {\n $(\".bottom-window-group .output\").parent().mouseup(function (event) {\n event.stopPropagation();\n\n if (event.button === 0) { // 左键\n $(\".bottom-window-group .frame\").hide();\n return;\n }\n\n // event.button === 2 右键\n var left = event.screenX,\n $it = $(this);\n if ($(\".side\").css(\"left\") === \"auto\" || $(\".side\").css(\"left\") === \"0px\") {\n left = event.screenX - $(\".side\").width();\n }\n $(\".bottom-window-group .frame\").show().css({\n \"left\": left + \"px\",\n \"top\": (event.offsetY + event.target.offsetTop - $it.scrollTop() - 10) + \"px\"\n });\n return;\n });\n },\n clear: function (id) {\n $('.bottom-window-group .' + id + ' > div').text('');\n },\n resetOutput: function () {\n this.clear('output');\n bottomGroup.tabs.setCurrent(\"output\");\n windows.flowBottom();\n },\n _initTabs: function () {\n this.tabs = new Tabs({\n id: \".bottom-window-group\",\n clickAfter: function (id) {\n this._$tabsPanel.find(\".\" + id).focus();\n }\n });\n },\n fillOutput: function (data) {\n var $output = $('.bottom-window-group .output');\n\n data = data.replace(/\\r/g, '');\n data = data.replace(/\\n/g, '<br/>');\n\n if (-1 !== data.indexOf(\"<br/>\")) {\n data = Autolinker.link(data);\n }\n\n $output.find(\"div\").html(data);\n $output.parent().scrollTop($output[0].scrollHeight);\n }\n};\n"]}