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
6cee6acf
Commit
6cee6acf
authored
Feb 13, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
1724ab59
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
27 deletions
+38
-27
keymap.js
src/core/keymap.js
+3
-1
editor.js
src/module/editor.js
+3
-0
editor.receiver.js
src/module/editor.receiver.js
+10
-4
history.js
src/module/history.js
+22
-22
No files found.
src/core/keymap.js
View file @
6cee6acf
...
...
@@ -26,5 +26,7 @@ var keymap = KityMinder.keymap = {
'Del'
:
46
,
'NumLock'
:
144
'NumLock'
:
144
,
'Cmd'
:
91
};
\ No newline at end of file
src/module/editor.js
View file @
6cee6acf
...
...
@@ -31,6 +31,9 @@ KityMinder.registerModule( "TextEditModule", function () {
.
setRange
(
range
);
}
}
},
'restoreScene'
:
function
(){
cursor
.
setHide
();
}
}
};
...
...
src/module/editor.receiver.js
View file @
6cee6acf
...
...
@@ -68,13 +68,13 @@ Minder.Receiver = kity.createClass('Receiver',{
clearTimeout
(
this
.
timer
);
var
me
=
this
;
var
keyCode
=
e
.
originEvent
.
keyCode
;
var
orgEvt
=
e
.
originEvent
;
var
keyCode
=
orgEvt
.
keyCode
;
switch
(
e
.
type
){
case
'beforekeyup'
:
if
(
this
.
isTextEditStatus
()){
switch
(
keyCode
){
case
keymap
.
Enter
:
case
keymap
.
Tab
:
...
...
@@ -82,6 +82,12 @@ Minder.Receiver = kity.createClass('Receiver',{
this
.
clear
();
e
.
stopPropagation
();
return
;
case
keymap
.
Shift
:
case
keymap
.
Control
:
case
keymap
.
Alt
:
case
keymap
.
Cmd
:
return
;
}
var
text
=
(
this
.
container
.
textContent
||
this
.
container
.
innerText
).
replace
(
/
\u
200b/g
,
''
);
...
...
src/module/history.js
View file @
6cee6acf
...
...
@@ -58,6 +58,7 @@ KityMinder.registerModule( "HistoryModule", function () {
this
.
km
.
initStyle
();
this
.
update
();
this
.
km
.
fire
(
'restoreScene'
);
},
getScene
:
function
()
{
return
new
Scene
(
this
.
km
.
getRoot
()
)
...
...
@@ -93,8 +94,7 @@ KityMinder.registerModule( "HistoryModule", function () {
this
.
historyManager
=
new
HistoryManager
(
this
);
var
keys
=
{
// /*Backspace*/ 8:1, /*Delete*/ 46:1,
/*Shift*/
16
:
1
,
/*Ctrl*/
17
:
1
,
/*Alt*/
18
:
1
,
/*Shift*/
16
:
1
,
/*Ctrl*/
17
:
1
,
/*Alt*/
18
:
1
,
/*Command*/
91
:
1
,
37
:
1
,
38
:
1
,
39
:
1
,
40
:
1
},
keycont
=
0
,
...
...
@@ -152,26 +152,26 @@ KityMinder.registerModule( "HistoryModule", function () {
}
},
"keydown"
:
function
(
e
){
//
var orgEvt = e.originEvent;
//
var keyCode = orgEvt.keyCode || orgEvt.which;
//
if (!keys[keyCode] && !orgEvt.ctrlKey && !orgEvt.metaKey && !orgEvt.shiftKey && !orgEvt.altKey) {
//
//
//
if (km.historyManager.list.length == 0) {
//
km.historyManager.saveScene();
//
}
//
clearTimeout(saveSceneTimer);
//
//
saveSceneTimer = setTimeout(function(){
//
km.historyManager.saveScene();
//
},200);
//
//
lastKeyCode = keyCode;
//
keycont++;
//
if (keycont >= km.getOptions('maxInputCount') ) {
//
km.historyManager.saveScene()
//
}
//
}
var
orgEvt
=
e
.
originEvent
;
var
keyCode
=
orgEvt
.
keyCode
||
orgEvt
.
which
;
if
(
!
keys
[
keyCode
]
&&
!
orgEvt
.
ctrlKey
&&
!
orgEvt
.
metaKey
&&
!
orgEvt
.
shiftKey
&&
!
orgEvt
.
altKey
)
{
if
(
km
.
historyManager
.
list
.
length
==
0
)
{
km
.
historyManager
.
saveScene
();
}
clearTimeout
(
saveSceneTimer
);
saveSceneTimer
=
setTimeout
(
function
(){
km
.
historyManager
.
saveScene
();
},
200
);
lastKeyCode
=
keyCode
;
keycont
++
;
if
(
keycont
>=
km
.
getOptions
(
'maxInputCount'
)
)
{
km
.
historyManager
.
saveScene
()
}
}
}
}
};
...
...
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