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
a7f5106e
Commit
a7f5106e
authored
Sep 25, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expierence improvement
parent
9b7017a1
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
14 deletions
+34
-14
zh-cn.js
lang/zh-cn/zh-cn.js
+5
-5
kity
lib/kity
+1
-1
key.js
src/core/key.js
+1
-1
editor.js
src/module/editor.js
+1
-1
editor.keyboard.js
src/module/editor.keyboard.js
+1
-1
text.js
src/module/text.js
+5
-1
view.js
src/module/view.js
+17
-2
contextmenu.js
ui/contextmenu.js
+2
-2
quickvisit.js
ui/topbar/quickvisit.js
+1
-0
No files found.
lang/zh-cn/zh-cn.js
View file @
a7f5106e
...
@@ -53,8 +53,8 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -53,8 +53,8 @@ KityMinder.LANG['zh-cn'] = {
'back'
:
'返回'
,
'back'
:
'返回'
,
'undo'
:
'撤销'
,
'undo'
:
'撤销
(Ctrl + Z)
'
,
'redo'
:
'重做'
,
'redo'
:
'重做
(Ctrl + Y)
'
,
'tabs'
:
{
'tabs'
:
{
'idea'
:
'思路'
,
'idea'
:
'思路'
,
...
@@ -63,9 +63,9 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -63,9 +63,9 @@ KityMinder.LANG['zh-cn'] = {
},
},
'quickvisit'
:
{
'quickvisit'
:
{
'new'
:
'新建'
,
'new'
:
'新建
(Ctrl + Alt + N)
'
,
'save'
:
'保存'
,
'save'
:
'保存
(Ctrl + S)
'
,
'share'
:
'分享'
'share'
:
'分享
(Ctrl + Alt + S)
'
},
},
'menu'
:
{
'menu'
:
{
...
...
kity
@
8f52e73c
Subproject commit
27c52cd1549a85fc859e86098e87f4ec55db385d
Subproject commit
8f52e73cc57a447f268e71783d44e34ee028f763
src/core/key.js
View file @
a7f5106e
...
@@ -76,7 +76,7 @@ kity.extendClass(Minder, {
...
@@ -76,7 +76,7 @@ kity.extendClass(Minder, {
var
has
=
'hasOwnProperty'
;
var
has
=
'hasOwnProperty'
;
this
.
on
(
'keydown'
,
function
(
e
)
{
this
.
on
(
'keydown'
,
function
(
e
)
{
for
(
var
keys
in
map
)
{
for
(
var
keys
in
map
)
{
if
(
!
map
[
has
](
keys
))
break
;
if
(
!
map
[
has
](
keys
))
continue
;
if
(
e
.
isShortcutKey
(
keys
))
{
if
(
e
.
isShortcutKey
(
keys
))
{
var
fn
=
map
[
keys
];
var
fn
=
map
[
keys
];
if
(
fn
.
__statusCondition
&&
fn
.
__statusCondition
!=
this
.
getStatus
())
return
;
if
(
fn
.
__statusCondition
&&
fn
.
__statusCondition
!=
this
.
getStatus
())
return
;
...
...
src/module/editor.js
View file @
a7f5106e
...
@@ -303,7 +303,7 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -303,7 +303,7 @@ KityMinder.registerModule('TextEditModule', function() {
receiver
.
setContainerStyle
();
receiver
.
setContainerStyle
();
},
},
'statuschange'
:
function
(
e
){
'statuschange'
:
function
(
e
){
if
(
this
.
getRollbackStatus
()
==
'textedit'
){
if
(
e
.
lastStatus
==
'textedit'
){
this
.
fire
(
'contentchange'
);
this
.
fire
(
'contentchange'
);
}
}
...
...
src/module/editor.keyboard.js
View file @
a7f5106e
...
@@ -158,6 +158,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -158,6 +158,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
case
keymap
.
Backspace
:
case
keymap
.
Backspace
:
case
keymap
.
Del
:
case
keymap
.
Del
:
case
keymap
[
'/'
]:
case
keymap
[
'/'
]:
case
keymap
.
F2
:
if
(
this
.
selection
.
isHide
()){
if
(
this
.
selection
.
isHide
()){
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
setStatus
(
'normal'
);
return
;
return
;
...
@@ -166,7 +167,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -166,7 +167,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
case
keymap
.
Control
:
case
keymap
.
Control
:
case
keymap
.
Alt
:
case
keymap
.
Alt
:
case
keymap
.
Cmd
:
case
keymap
.
Cmd
:
case
keymap
.
F2
:
if
(
this
.
selection
.
isHide
()
&&
this
.
km
.
getStatus
()
!=
'textedit'
&&
this
.
km
.
getStatus
()
!=
'inputready'
){
if
(
this
.
selection
.
isHide
()
&&
this
.
km
.
getStatus
()
!=
'textedit'
&&
this
.
km
.
getStatus
()
!=
'inputready'
){
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
setStatus
(
'normal'
);
...
...
src/module/text.js
View file @
a7f5106e
...
@@ -47,8 +47,12 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
...
@@ -47,8 +47,12 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
}
else
{
}
else
{
if
(
text
!==
undefined
&&
!
textShape
)
{
if
(
text
!==
undefined
&&
!
textShape
)
{
textShape
=
new
kity
.
Text
()
textShape
=
new
kity
.
Text
()
.
setAttr
(
'dominant-baseline'
,
'text-before-edge'
)
.
setAttr
(
'text-rendering'
,
'inherit'
);
.
setAttr
(
'text-rendering'
,
'inherit'
);
if
(
kity
.
Browser
.
ie
)
{
textShape
.
setVerticalAlign
(
'top'
);
}
else
{
textShape
.
setAttr
(
'dominant-baseline'
,
'text-before-edge'
);
}
textGroup
.
addItem
(
textShape
);
textGroup
.
addItem
(
textShape
);
}
}
textShape
.
setContent
(
text
);
textShape
.
setContent
(
text
);
...
...
src/module/view.js
View file @
a7f5106e
...
@@ -89,6 +89,8 @@ var ViewDragger = kity.createClass("ViewDragger", {
...
@@ -89,6 +89,8 @@ var ViewDragger = kity.createClass("ViewDragger", {
if
(
dragger
.
_minder
.
getStatus
()
==
'hand'
)
if
(
dragger
.
_minder
.
getStatus
()
==
'hand'
)
dragger
.
_minder
.
rollbackStatus
();
dragger
.
_minder
.
rollbackStatus
();
}
}
var
paper
=
dragger
.
_minder
.
getPaper
();
paper
.
setStyle
(
'cursor'
,
dragger
.
_minder
.
getStatus
()
==
'hand'
?
'-webkit-grab'
:
'default'
);
}
}
this
.
_minder
.
on
(
'normal.mousedown normal.touchstart '
+
this
.
_minder
.
on
(
'normal.mousedown normal.touchstart '
+
...
@@ -112,7 +114,11 @@ var ViewDragger = kity.createClass("ViewDragger", {
...
@@ -112,7 +114,11 @@ var ViewDragger = kity.createClass("ViewDragger", {
}
}
if
(
!
isTempDrag
)
return
;
if
(
!
isTempDrag
)
return
;
var
offset
=
kity
.
Vector
.
fromPoints
(
lastPosition
,
e
.
getPosition
());
var
offset
=
kity
.
Vector
.
fromPoints
(
lastPosition
,
e
.
getPosition
());
if
(
offset
.
length
()
>
3
)
this
.
setStatus
(
'hand'
);
if
(
offset
.
length
()
>
10
)
{
this
.
setStatus
(
'hand'
);
var
paper
=
dragger
.
_minder
.
getPaper
();
paper
.
setStyle
(
'cursor'
,
'-webkit-grabbing'
);
}
})
})
.
on
(
'hand.beforemousedown hand.beforetouchstart'
,
function
(
e
)
{
.
on
(
'hand.beforemousedown hand.beforetouchstart'
,
function
(
e
)
{
...
@@ -120,6 +126,8 @@ var ViewDragger = kity.createClass("ViewDragger", {
...
@@ -120,6 +126,8 @@ var ViewDragger = kity.createClass("ViewDragger", {
if
(
dragger
.
isEnabled
())
{
if
(
dragger
.
isEnabled
())
{
lastPosition
=
e
.
getPosition
();
lastPosition
=
e
.
getPosition
();
e
.
stopPropagation
();
e
.
stopPropagation
();
var
paper
=
dragger
.
_minder
.
getPaper
();
paper
.
setStyle
(
'cursor'
,
'-webkit-grabbing'
);
}
}
})
})
...
@@ -219,13 +227,20 @@ KityMinder.registerModule('View', function() {
...
@@ -219,13 +227,20 @@ KityMinder.registerModule('View', function() {
},
},
events
:
{
events
:
{
keyup
:
function
(
e
)
{
keyup
:
function
(
e
)
{
if
(
e
.
originEvent
.
keyCode
==
keymap
.
Spacebar
&&
this
.
getSelectedNodes
().
length
===
0
)
{
if
(
this
.
getStatus
()
==
'hand'
&&
e
.
getKeyCode
()
==
18
)
{
this
.
execCommand
(
'hand'
);
this
.
execCommand
(
'hand'
);
e
.
preventDefault
();
e
.
preventDefault
();
}
}
},
},
keydown
:
function
(
e
)
{
keydown
:
function
(
e
)
{
var
minder
=
this
;
var
minder
=
this
;
if
(
this
.
getStatus
()
!=
'hand'
&&
e
.
getKeyCode
()
==
18
)
{
this
.
execCommand
(
'hand'
);
e
.
preventDefault
();
}
else
if
(
this
.
getStatus
()
==
'hand'
)
{
this
.
execCommand
(
'hand'
);
}
[
'up'
,
'down'
,
'left'
,
'right'
].
forEach
(
function
(
name
)
{
[
'up'
,
'down'
,
'left'
,
'right'
].
forEach
(
function
(
name
)
{
if
(
e
.
isShortcutKey
(
'ctrl+'
+
name
))
{
if
(
e
.
isShortcutKey
(
'ctrl+'
+
name
))
{
minder
.
removeAllSelectedNodes
();
minder
.
removeAllSelectedNodes
();
...
...
ui/contextmenu.js
View file @
a7f5106e
...
@@ -18,7 +18,7 @@ KityMinder.registerUI('contextmenu', function(minder) {
...
@@ -18,7 +18,7 @@ KityMinder.registerUI('contextmenu', function(minder) {
.
addClass
(
'km-context-menu fui-popup-menu'
)
.
addClass
(
'km-context-menu fui-popup-menu'
)
.
appendTo
(
'#content-wrapper'
);
.
appendTo
(
'#content-wrapper'
);
$menu
.
delegate
(
'li'
,
'
click
'
,
function
(
e
,
info
)
{
$menu
.
delegate
(
'li'
,
'
mousedown
'
,
function
(
e
,
info
)
{
var
item
=
$
(
e
.
target
).
closest
(
'li'
).
data
(
'menu'
);
var
item
=
$
(
e
.
target
).
closest
(
'li'
).
data
(
'menu'
);
if
(
item
.
command
)
{
if
(
item
.
command
)
{
minder
.
execCommand
(
item
.
command
);
minder
.
execCommand
(
item
.
command
);
...
@@ -29,7 +29,7 @@ KityMinder.registerUI('contextmenu', function(minder) {
...
@@ -29,7 +29,7 @@ KityMinder.registerUI('contextmenu', function(minder) {
e
.
preventDefault
();
e
.
preventDefault
();
});
});
$
(
'#content-wrapper'
).
on
(
'
click
'
,
function
(
e
)
{
$
(
'#content-wrapper'
).
on
(
'
mousedown
'
,
function
(
e
)
{
$menu
.
hide
();
$menu
.
hide
();
});
});
...
...
ui/topbar/quickvisit.js
View file @
a7f5106e
...
@@ -11,6 +11,7 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
...
@@ -11,6 +11,7 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
function
btn
(
name
)
{
function
btn
(
name
)
{
return
$
(
'<a class="quick-visit-button"></a>'
)
return
$
(
'<a class="quick-visit-button"></a>'
)
.
text
(
minder
.
getLang
(
'ui.quickvisit.'
+
name
))
.
text
(
minder
.
getLang
(
'ui.quickvisit.'
+
name
))
.
attr
(
'title'
,
minder
.
getLang
(
'ui.quickvisit.'
+
name
))
.
addClass
(
name
)
.
addClass
(
name
)
.
appendTo
(
'#panel'
);
.
appendTo
(
'#panel'
);
}
}
...
...
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