Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
af830a57
Commit
af830a57
authored
May 05, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:fex-team/kityminder into dev
parents
52868ca8
79033689
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
30 deletions
+70
-30
zh-cn.js
lang/zh-cn/zh-cn.js
+2
-1
node.js
src/adapter/node.js
+2
-1
keymap.js
src/core/keymap.js
+28
-24
editor.js
src/module/editor.js
+5
-4
editor.receiver.js
src/module/editor.receiver.js
+1
-0
keyboard.js
src/module/keyboard.js
+4
-0
layout.js
src/module/layout.js
+28
-0
No files found.
lang/zh-cn/zh-cn.js
View file @
af830a57
...
@@ -49,7 +49,8 @@ KityMinder.LANG[ 'zh-cn' ] = {
...
@@ -49,7 +49,8 @@ KityMinder.LANG[ 'zh-cn' ] = {
'node'
:
{
'node'
:
{
'appendsiblingnode'
:
'插入同级节点'
,
'appendsiblingnode'
:
'插入同级节点'
,
'appendchildnode'
:
'插入子节点'
,
'appendchildnode'
:
'插入子节点'
,
'removenode'
:
'删除节点'
'removenode'
:
'删除节点'
,
'editnode'
:
'编辑节点'
},
},
'layout'
:
{
'layout'
:
{
'default'
:
'左右展开'
,
'default'
:
'左右展开'
,
...
...
src/adapter/node.js
View file @
af830a57
...
@@ -2,7 +2,8 @@ KM.registerToolbarUI( 'node', function ( name ) {
...
@@ -2,7 +2,8 @@ KM.registerToolbarUI( 'node', function ( name ) {
var
shortcutKeys
=
{
var
shortcutKeys
=
{
"appendsiblingnode"
:
"enter"
,
"appendsiblingnode"
:
"enter"
,
"appendchildnode"
:
"tab"
,
"appendchildnode"
:
"tab"
,
"removenode"
:
"del|backspace"
"removenode"
:
"del|backspace"
,
"editnode"
:
"F2"
};
};
var
me
=
this
,
var
me
=
this
,
...
...
src/core/keymap.js
View file @
af830a57
...
@@ -3,41 +3,45 @@ var keymap = KityMinder.keymap = {
...
@@ -3,41 +3,45 @@ var keymap = KityMinder.keymap = {
'Tab'
:
9
,
'Tab'
:
9
,
'Enter'
:
13
,
'Enter'
:
13
,
'Shift'
:
16
,
'Shift'
:
16
,
'Control'
:
17
,
'Control'
:
17
,
'Alt'
:
18
,
'Alt'
:
18
,
'CapsLock'
:
20
,
'CapsLock'
:
20
,
'Esc'
:
27
,
'Esc'
:
27
,
'Spacebar'
:
32
,
'Spacebar'
:
32
,
'PageUp'
:
33
,
'PageUp'
:
33
,
'PageDown'
:
34
,
'PageDown'
:
34
,
'End'
:
35
,
'End'
:
35
,
'Home'
:
36
,
'Home'
:
36
,
'Left'
:
37
,
'Left'
:
37
,
'Up'
:
38
,
'Up'
:
38
,
'Right'
:
39
,
'Right'
:
39
,
'Down'
:
40
,
'Down'
:
40
,
'Insert'
:
45
,
'Insert'
:
45
,
'Del'
:
46
,
'Del'
:
46
,
'NumLock'
:
144
,
'NumLock'
:
144
,
'Cmd'
:
91
,
'Cmd'
:
91
,
'='
:
187
,
'F2'
:
113
,
'-'
:
189
,
'F3'
:
114
,
'F4'
:
115
,
"b"
:
66
,
'='
:
187
,
'i'
:
73
,
'-'
:
189
,
"b"
:
66
,
'i'
:
73
,
//回退
//回退
'z'
:
90
,
'z'
:
90
,
'y'
:
89
,
'y'
:
89
,
//粘贴
//粘贴
'v'
:
86
,
'v'
:
86
,
'x'
:
88
,
'x'
:
88
,
...
...
src/module/editor.js
View file @
af830a57
...
@@ -135,12 +135,13 @@ KityMinder.registerModule( "TextEditModule", function () {
...
@@ -135,12 +135,13 @@ KityMinder.registerModule( "TextEditModule", function () {
"resize"
:
function
(
e
)
{
"resize"
:
function
(
e
)
{
sel
.
setHide
();
sel
.
setHide
();
},
},
'execCommand'
:
function
(
e
)
{
"execCommand"
:
function
(
e
)
{
var
cmds
=
{
var
cmds
=
{
'appendchildnode'
:
1
,
'appendchildnode'
:
1
,
'appendsiblingnode'
:
1
'appendsiblingnode'
:
1
,
'editnode'
:
1
};
};
if
(
cmds
[
e
.
commandName
]
){
if
(
cmds
[
e
.
commandName
]
){
var
node
=
km
.
getSelectedNode
();
var
node
=
km
.
getSelectedNode
();
if
(
!
node
){
if
(
!
node
){
...
...
src/module/editor.receiver.js
View file @
af830a57
...
@@ -175,6 +175,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -175,6 +175,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
switch
(
keyCode
)
{
switch
(
keyCode
)
{
case
keymap
.
Enter
:
case
keymap
.
Enter
:
case
keymap
.
Tab
:
case
keymap
.
Tab
:
case
keymap
.
F2
:
if
(
this
.
keydownNode
===
this
.
minderNode
)
{
if
(
this
.
keydownNode
===
this
.
minderNode
)
{
this
.
rollbackStatus
();
this
.
rollbackStatus
();
this
.
setTextEditStatus
(
false
);
this
.
setTextEditStatus
(
false
);
...
...
src/module/keyboard.js
View file @
af830a57
...
@@ -146,6 +146,10 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -146,6 +146,10 @@ KityMinder.registerModule( "KeyboardModule", function () {
e
.
preventDefault
();
e
.
preventDefault
();
if
(
this
.
queryCommandState
(
'removenode'
)
!==
-
1
)
this
.
execCommand
(
'removenode'
);
if
(
this
.
queryCommandState
(
'removenode'
)
!==
-
1
)
this
.
execCommand
(
'removenode'
);
break
;
break
;
case
keys
.
F2
:
e
.
preventDefault
();
if
(
this
.
queryCommandState
(
'editnode'
)
!==
-
1
)
this
.
execCommand
(
'editnode'
);
break
;
case
keys
.
Left
:
case
keys
.
Left
:
navigateTo
(
this
,
'left'
);
navigateTo
(
this
,
'left'
);
...
...
src/module/layout.js
View file @
af830a57
...
@@ -195,12 +195,33 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -195,12 +195,33 @@ KityMinder.registerModule( "LayoutModule", function () {
}
}
};
};
}
)()
);
}
)()
);
var
EditNodeCommand
=
kity
.
createClass
(
"EditNodeCommand"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
)
{
return
null
;
}
km
.
select
(
selectedNode
,
true
);
},
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
)
{
return
-
1
;
}
else
{
return
0
;
}
}
};
}
)()
);
return
{
return
{
"commands"
:
{
"commands"
:
{
"appendchildnode"
:
AppendChildNodeCommand
,
"appendchildnode"
:
AppendChildNodeCommand
,
"appendsiblingnode"
:
AppendSiblingNodeCommand
,
"appendsiblingnode"
:
AppendSiblingNodeCommand
,
"removenode"
:
RemoveNodeCommand
,
"removenode"
:
RemoveNodeCommand
,
"editnode"
:
EditNodeCommand
,
"switchlayout"
:
SwitchLayoutCommand
"switchlayout"
:
SwitchLayoutCommand
},
},
"events"
:
{
"events"
:
{
...
@@ -251,6 +272,12 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -251,6 +272,12 @@ KityMinder.registerModule( "LayoutModule", function () {
this
.
execCommand
(
'appendchildnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)
)
)
this
.
execCommand
(
'appendchildnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)
)
)
},
},
cmdName
:
'appendchildnode'
cmdName
:
'appendchildnode'
},
{
label
:
this
.
getLang
(
'node.editnode'
),
exec
:
function
()
{
this
.
execCommand
(
'editnode'
,
null
);
},
cmdName
:
'editnode'
},
{
},
{
label
:
this
.
getLang
(
'node.removenode'
),
label
:
this
.
getLang
(
'node.removenode'
),
cmdName
:
'removenode'
cmdName
:
'removenode'
...
@@ -264,6 +291,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -264,6 +291,7 @@ KityMinder.registerModule( "LayoutModule", function () {
"node"
:
{
"node"
:
{
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendchildnode'
:
'appendchildnode'
,
'appendchildnode'
:
'appendchildnode'
,
'editnode'
:
'editnode'
,
'removenode'
:
'removenode'
'removenode'
:
'removenode'
},
},
'defaultExpand'
:
{
'defaultExpand'
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment