This commit is contained in:
Liang Ding 2015-12-08 23:48:16 +08:00
parent f8a693f20c
commit 77cd76d0c0
15 changed files with 94 additions and 38 deletions

View File

@ -28,22 +28,25 @@ import (
"github.com/b3log/wide/util"
)
// Layout represents the layot of a panel.
// Panel represents a UI panel.
type Panel struct {
State string `json:"state"` // panel state, "min"/"max"/"normal"
Size uint16 `json:"size"` // panel size
}
// Layout represents the UI layout.
type Layout struct {
State string // panel state, "min"/"max"/"normal"
Size uint16 // panel size
Side *Panel `json:"side"` // Side panel
SideRight *Panel `json:"sideRight"` // Right-Side panel
Bottom *Panel `json:"bottom"` // Bottom panel
}
// LatestSessionContent represents the latest session content.
type LatestSessionContent struct {
FileTree []string // paths of expanding nodes of file tree
Files []string // paths of files of opening editor tabs
CurrentFile string // path of file of the current focused editor tab
SideLayout *Layout // Left side panel layout
EditorLayout *Layout // Editor panel layout
SideRightLayout *Layout // Right side panel layout
BottomLayout *Layout // Bottom panel layout
FileTree []string `json:"fileTree"` // paths of expanding nodes of file tree
Files []string `json:"files"` // paths of files of opening editor tabs
CurrentFile string `json:"currentFile"` // path of file of the current focused editor tab
Layout *Layout `json:"layout"` // UI Layout
}
// User configuration.

View File

@ -12,8 +12,8 @@
"Theme": "dark",
"Keymap": "wide",
"Created": 1414080000000000000,
"Updated": 1449477503396946400,
"Lived": 1449562842336881500,
"Updated": 1414080000000000000,
"Lived": 1414080000000000000,
"Editor": {
"FontFamily": "Consolas, 'Courier New', monospace",
"FontSize": "13px",
@ -23,17 +23,8 @@
},
"LatestSessionContent": {
"FileTree": [
"D:/Code/GoGoGo/src",
"D:/Code/GoGoGo/src/github.com",
"D:/Code/GoGoGo/src/github.com/b3log",
"D:/Code/GoGoGo/src/github.com/b3log/wide",
"E:\\go\\src"
],
"Files": [],
"CurrentFile": "",
"SideLayout": null,
"EditorLayout": null,
"SideRightLayout": null,
"BottomLayout": null
"CurrentFile": ""
}
}

View File

@ -14,6 +14,13 @@
* limitations under the License.
*/
/*
* @file bottomGroup.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.1, Dec 8, 2015
*/
var bottomGroup = {
tabs: undefined,
searchTab: undefined,

View File

@ -14,6 +14,12 @@
* limitations under the License.
*/
/*
* @file dialog.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.0.0.1, Dec 8, 2015
*/
(function ($) {
$.fn.extend({
dialog: {

View File

@ -15,10 +15,11 @@
*/
/*
* @file editor.
* @file editor.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 0.1.0.0, Dec 6, 2015
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.0, Dec 6, 2015
*/
var editors = {
autocompleteMutex: false,

View File

@ -14,6 +14,13 @@
* limitations under the License.
*/
/*
* @file hotkeys.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var hotkeys = {
defaultKeyMap: {
// Ctrl-0

View File

@ -14,6 +14,13 @@
* limitations under the License.
*/
/*
* @file menu.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var menu = {
init: function () {
this.subMenu();

View File

@ -14,6 +14,13 @@
* limitations under the License.
*/
/*
* @file notification.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var notification = {
init: function () {
$(".notification-count").click(function () {

View File

@ -14,6 +14,13 @@
* limitations under the License.
*/
/*
* @file playground.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var playground = {
autocompleteMutex: false,
editor: undefined,

View File

@ -15,10 +15,10 @@
*/
/*
* @file session.
* @file session.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 0.1.0.1, Dec 8, 2015
* @version 1.1.0.1, Dec 8, 2015
*/
var session = {
init: function () {
@ -87,9 +87,9 @@ var session = {
return;
}
var fileTree = config.latestSessionContent.FileTree,
files = config.latestSessionContent.Files,
currentFile = config.latestSessionContent.CurrentFile,
var fileTree = config.latestSessionContent.fileTree,
files = config.latestSessionContent.files,
currentFile = config.latestSessionContent.currentFile,
id = "",
nodesToOpen = [];

View File

@ -14,6 +14,12 @@
* limitations under the License.
*/
/*
* @file shell.js
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var shell = {
_shellWS: undefined,
_initWS: function () {

View File

@ -14,6 +14,12 @@
* limitations under the License.
*/
/*
* @file tabs.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var Tabs = function (obj) {
obj._$tabsPanel = $(obj.id + " > .tabs-panel");
obj._$tabs = $(obj.id + " > .tabs");

View File

@ -14,6 +14,13 @@
* limitations under the License.
*/
/*
* @file tree.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var tree = {
fileTree: undefined,
// 递归获取当前节点展开中的最后一个节点

View File

@ -15,10 +15,11 @@
*/
/*
* @file wide.
* @file wide.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 0.1.0.0, Dec 6, 2015
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1, Dec 8, 2015
*/
var wide = {
curNode: undefined,

View File

@ -15,19 +15,19 @@
*/
/*
* @file windows.
* @file windows.js
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 0.1.1.0, Dec 8, 2015
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.1, Dec 8, 2015
*/
var windows = {
isMaxEditor: false,
outerLayout: {},
innerLayout: {},
init: function () {
var layout = {};
if (!config.latestSessionContent) {
config.latestSessionContent.Layout = {
if (!config.latestSessionContent.layout) {
config.latestSessionContent.layout = {
"side": {
"size": 200,
"state": 'normal'
@ -42,8 +42,8 @@ var windows = {
}
};
}
layout = config.latestSessionContent.Layout;
var layout = config.latestSessionContent.layout;
this.outerLayout = $('body').layout({
north__paneSelector: ".menu",