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" "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 { type Layout struct {
State string // panel state, "min"/"max"/"normal" Side *Panel `json:"side"` // Side panel
Size uint16 // panel size SideRight *Panel `json:"sideRight"` // Right-Side panel
Bottom *Panel `json:"bottom"` // Bottom panel
} }
// LatestSessionContent represents the latest session content. // LatestSessionContent represents the latest session content.
type LatestSessionContent struct { type LatestSessionContent struct {
FileTree []string // paths of expanding nodes of file tree FileTree []string `json:"fileTree"` // paths of expanding nodes of file tree
Files []string // paths of files of opening editor tabs Files []string `json:"files"` // paths of files of opening editor tabs
CurrentFile string // path of file of the current focused editor tab CurrentFile string `json:"currentFile"` // path of file of the current focused editor tab
Layout *Layout `json:"layout"` // UI Layout
SideLayout *Layout // Left side panel layout
EditorLayout *Layout // Editor panel layout
SideRightLayout *Layout // Right side panel layout
BottomLayout *Layout // Bottom panel layout
} }
// User configuration. // User configuration.

View File

@ -12,8 +12,8 @@
"Theme": "dark", "Theme": "dark",
"Keymap": "wide", "Keymap": "wide",
"Created": 1414080000000000000, "Created": 1414080000000000000,
"Updated": 1449477503396946400, "Updated": 1414080000000000000,
"Lived": 1449562842336881500, "Lived": 1414080000000000000,
"Editor": { "Editor": {
"FontFamily": "Consolas, 'Courier New', monospace", "FontFamily": "Consolas, 'Courier New', monospace",
"FontSize": "13px", "FontSize": "13px",
@ -23,17 +23,8 @@
}, },
"LatestSessionContent": { "LatestSessionContent": {
"FileTree": [ "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": [], "Files": [],
"CurrentFile": "", "CurrentFile": ""
"SideLayout": null,
"EditorLayout": null,
"SideRightLayout": null,
"BottomLayout": null
} }
} }

View File

@ -14,6 +14,13 @@
* limitations under the License. * 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 = { var bottomGroup = {
tabs: undefined, tabs: undefined,
searchTab: undefined, searchTab: undefined,

View File

@ -14,6 +14,12 @@
* limitations under the License. * 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 ($) { (function ($) {
$.fn.extend({ $.fn.extend({
dialog: { dialog: {

View File

@ -15,10 +15,11 @@
*/ */
/* /*
* @file editor. * @file editor.js
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @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 = { var editors = {
autocompleteMutex: false, autocompleteMutex: false,

View File

@ -14,6 +14,13 @@
* limitations under the License. * 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 = { var hotkeys = {
defaultKeyMap: { defaultKeyMap: {
// Ctrl-0 // Ctrl-0

View File

@ -14,6 +14,13 @@
* limitations under the License. * 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 = { var menu = {
init: function () { init: function () {
this.subMenu(); this.subMenu();

View File

@ -14,6 +14,13 @@
* limitations under the License. * 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 = { var notification = {
init: function () { init: function () {
$(".notification-count").click(function () { $(".notification-count").click(function () {

View File

@ -14,6 +14,13 @@
* limitations under the License. * 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 = { var playground = {
autocompleteMutex: false, autocompleteMutex: false,
editor: undefined, editor: undefined,

View File

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

View File

@ -14,6 +14,12 @@
* limitations under the License. * 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 = { var shell = {
_shellWS: undefined, _shellWS: undefined,
_initWS: function () { _initWS: function () {

View File

@ -14,6 +14,12 @@
* limitations under the License. * 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) { var Tabs = function (obj) {
obj._$tabsPanel = $(obj.id + " > .tabs-panel"); obj._$tabsPanel = $(obj.id + " > .tabs-panel");
obj._$tabs = $(obj.id + " > .tabs"); obj._$tabs = $(obj.id + " > .tabs");

View File

@ -14,6 +14,13 @@
* limitations under the License. * 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 = { var tree = {
fileTree: undefined, fileTree: undefined,
// 递归获取当前节点展开中的最后一个节点 // 递归获取当前节点展开中的最后一个节点

View File

@ -15,10 +15,11 @@
*/ */
/* /*
* @file wide. * @file wide.js
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @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 = { var wide = {
curNode: undefined, curNode: undefined,

View File

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