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
e01af8c5
Commit
e01af8c5
authored
Jul 10, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改进输入
parent
346738a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
20 deletions
+4
-20
editor.js
src/module/editor.js
+2
-1
editor.receiver.js
src/module/editor.receiver.js
+2
-19
No files found.
src/module/editor.js
View file @
e01af8c5
...
@@ -30,11 +30,12 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -30,11 +30,12 @@ KityMinder.registerModule('TextEditModule', function() {
.
setEndOffset
(
textShape
.
getContent
().
length
)
.
setEndOffset
(
textShape
.
getContent
().
length
)
.
setColor
(
color
);
.
setColor
(
color
);
receiver
receiver
.
setMinderNode
(
node
)
.
setMinderNode
(
node
)
.
updateContainerRangeBySel
();
.
updateContainerRangeBySel
();
if
(
browser
.
ie
){
if
(
browser
.
ie
||
browser
.
gecko
){
var
timer
=
setInterval
(
function
(){
var
timer
=
setInterval
(
function
(){
var
nativeRange
=
range
.
nativeSel
.
getRangeAt
(
0
);
var
nativeRange
=
range
.
nativeSel
.
getRangeAt
(
0
);
if
(
!
nativeRange
||
nativeRange
.
collapsed
){
if
(
!
nativeRange
||
nativeRange
.
collapsed
){
...
...
src/module/editor.receiver.js
View file @
e01af8c5
...
@@ -254,7 +254,7 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -254,7 +254,7 @@ Minder.Receiver = kity.createClass('Receiver', {
//粘贴
//粘贴
if
(
keyCode
==
keymap
.
v
)
{
if
(
keyCode
==
keymap
.
v
)
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
me
.
range
.
updateNativeRange
().
insertNode
(
$
(
'<span>$$_kityminder_bookmark_$$</span>'
)[
0
]);
me
.
range
.
updateNativeRange
().
insertNode
(
$
(
'<span>$$_kityminder_bookmark_$$</span>'
)[
0
]);
me
.
container
.
innerHTML
=
utils
.
unhtml
(
me
.
container
.
textContent
.
replace
(
/
[\u
200b
\t\r\n]
/g
,
''
));
me
.
container
.
innerHTML
=
utils
.
unhtml
(
me
.
container
.
textContent
.
replace
(
/
[\u
200b
\t\r\n]
/g
,
''
));
var
index
=
me
.
container
.
textContent
.
indexOf
(
'$$_kityminder_bookmark_$$'
);
var
index
=
me
.
container
.
textContent
.
indexOf
(
'$$_kityminder_bookmark_$$'
);
...
@@ -266,28 +266,12 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -266,28 +266,12 @@ Minder.Receiver = kity.createClass('Receiver', {
}
}
//剪切
//剪切
if
(
keyCode
==
keymap
.
x
)
{
if
(
keyCode
==
keymap
.
x
)
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
setTextToContainer
(
keyCode
);
setTextToContainer
(
keyCode
);
},
100
);
},
100
);
return
;
return
;
}
}
// //全选键位监控
// if (keymap.a == keyCode) {
// if(me.selection.isHide()){
// return;
// }else{
// me.selection
// .setStartOffset(0)
// .setEndOffset(me.textShape.getContent().length);
// me.updateContainerRangeBySel().updateSelectionShow();
// return;
// }
// }
}
}
//针对不能连续删除做处理
//针对不能连续删除做处理
if
(
keymap
.
Del
==
keyCode
||
keymap
.
Backspace
==
keyCode
)
if
(
keymap
.
Del
==
keyCode
||
keymap
.
Backspace
==
keyCode
)
setTextToContainer
(
keyCode
);
setTextToContainer
(
keyCode
);
...
@@ -545,7 +529,6 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -545,7 +529,6 @@ Minder.Receiver = kity.createClass('Receiver', {
return
this
;
return
this
;
},
},
updateContainerRangeBySel
:
function
(){
updateContainerRangeBySel
:
function
(){
var
node
=
this
.
container
.
firstChild
;
var
node
=
this
.
container
.
firstChild
;
this
.
range
.
setStart
(
node
,
this
.
selection
.
startOffset
);
this
.
range
.
setStart
(
node
,
this
.
selection
.
startOffset
);
this
.
range
.
setEnd
(
node
,
this
.
selection
.
endOffset
);
this
.
range
.
setEnd
(
node
,
this
.
selection
.
endOffset
);
...
...
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