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
Hide 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 = {
...
@@ -26,5 +26,7 @@ var keymap = KityMinder.keymap = {
'Del'
:
46
,
'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 () {
...
@@ -31,6 +31,9 @@ KityMinder.registerModule( "TextEditModule", function () {
.
setRange
(
range
);
.
setRange
(
range
);
}
}
}
}
},
'restoreScene'
:
function
(){
cursor
.
setHide
();
}
}
}
}
};
};
...
...
src/module/editor.receiver.js
View file @
6cee6acf
...
@@ -68,13 +68,13 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -68,13 +68,13 @@ Minder.Receiver = kity.createClass('Receiver',{
clearTimeout
(
this
.
timer
);
clearTimeout
(
this
.
timer
);
var
me
=
this
;
var
me
=
this
;
var
keyCode
=
e
.
originEvent
.
keyCode
;
var
orgEvt
=
e
.
originEvent
;
var
keyCode
=
orgEvt
.
keyCode
;
switch
(
e
.
type
){
switch
(
e
.
type
){
case
'beforekeyup'
:
case
'beforekeyup'
:
if
(
this
.
isTextEditStatus
()){
if
(
this
.
isTextEditStatus
()){
switch
(
keyCode
){
switch
(
keyCode
){
case
keymap
.
Enter
:
case
keymap
.
Enter
:
case
keymap
.
Tab
:
case
keymap
.
Tab
:
...
@@ -82,6 +82,12 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -82,6 +82,12 @@ Minder.Receiver = kity.createClass('Receiver',{
this
.
clear
();
this
.
clear
();
e
.
stopPropagation
();
e
.
stopPropagation
();
return
;
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
,
''
);
var
text
=
(
this
.
container
.
textContent
||
this
.
container
.
innerText
).
replace
(
/
\u
200b/g
,
''
);
...
@@ -96,7 +102,7 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -96,7 +102,7 @@ Minder.Receiver = kity.createClass('Receiver',{
this
.
timer
=
setTimeout
(
function
(){
this
.
timer
=
setTimeout
(
function
(){
me
.
cursor
.
setShow
()
me
.
cursor
.
setShow
()
},
500
);
},
500
);
return
true
;
return
true
;
}
}
...
...
src/module/history.js
View file @
6cee6acf
...
@@ -58,6 +58,7 @@ KityMinder.registerModule( "HistoryModule", function () {
...
@@ -58,6 +58,7 @@ KityMinder.registerModule( "HistoryModule", function () {
this
.
km
.
initStyle
();
this
.
km
.
initStyle
();
this
.
update
();
this
.
update
();
this
.
km
.
fire
(
'restoreScene'
);
},
},
getScene
:
function
()
{
getScene
:
function
()
{
return
new
Scene
(
this
.
km
.
getRoot
()
)
return
new
Scene
(
this
.
km
.
getRoot
()
)
...
@@ -93,8 +94,7 @@ KityMinder.registerModule( "HistoryModule", function () {
...
@@ -93,8 +94,7 @@ KityMinder.registerModule( "HistoryModule", function () {
this
.
historyManager
=
new
HistoryManager
(
this
);
this
.
historyManager
=
new
HistoryManager
(
this
);
var
keys
=
{
var
keys
=
{
// /*Backspace*/ 8:1, /*Delete*/ 46:1,
/*Shift*/
16
:
1
,
/*Ctrl*/
17
:
1
,
/*Alt*/
18
:
1
,
/*Command*/
91
:
1
,
/*Shift*/
16
:
1
,
/*Ctrl*/
17
:
1
,
/*Alt*/
18
:
1
,
37
:
1
,
38
:
1
,
39
:
1
,
40
:
1
37
:
1
,
38
:
1
,
39
:
1
,
40
:
1
},
},
keycont
=
0
,
keycont
=
0
,
...
@@ -152,26 +152,26 @@ KityMinder.registerModule( "HistoryModule", function () {
...
@@ -152,26 +152,26 @@ KityMinder.registerModule( "HistoryModule", function () {
}
}
},
},
"keydown"
:
function
(
e
){
"keydown"
:
function
(
e
){
//
var orgEvt = e.originEvent;
var
orgEvt
=
e
.
originEvent
;
//
var keyCode = orgEvt.keyCode || orgEvt.which;
var
keyCode
=
orgEvt
.
keyCode
||
orgEvt
.
which
;
//
if (!keys[keyCode] && !orgEvt.ctrlKey && !orgEvt.metaKey && !orgEvt.shiftKey && !orgEvt.altKey) {
if
(
!
keys
[
keyCode
]
&&
!
orgEvt
.
ctrlKey
&&
!
orgEvt
.
metaKey
&&
!
orgEvt
.
shiftKey
&&
!
orgEvt
.
altKey
)
{
//
//
//
if (km.historyManager.list.length == 0) {
if
(
km
.
historyManager
.
list
.
length
==
0
)
{
//
km.historyManager.saveScene();
km
.
historyManager
.
saveScene
();
//
}
}
//
clearTimeout(saveSceneTimer);
clearTimeout
(
saveSceneTimer
);
//
//
saveSceneTimer = setTimeout(function(){
saveSceneTimer
=
setTimeout
(
function
(){
//
km.historyManager.saveScene();
km
.
historyManager
.
saveScene
();
//
},200);
},
200
);
//
//
lastKeyCode = keyCode;
lastKeyCode
=
keyCode
;
//
keycont++;
keycont
++
;
//
if (keycont >= km.getOptions('maxInputCount') ) {
if
(
keycont
>=
km
.
getOptions
(
'maxInputCount'
)
)
{
//
km.historyManager.saveScene()
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