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
90d75c83
Commit
90d75c83
authored
Mar 19, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:fex-team/kityminder into dev
parents
f54afaa9
22a17341
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
CHANGELOG.md
CHANGELOG.md
+1
-0
editor.receiver.js
src/module/editor.receiver.js
+15
-5
editor.selection.js
src/module/editor.selection.js
+6
-1
No files found.
CHANGELOG.md
View file @
90d75c83
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
1.
添加了剪贴板操作的支持
1.
添加了剪贴板操作的支持
2.
添加了本地自动保存草稿的功能
2.
添加了本地自动保存草稿的功能
3.
发布版本上添加了 Github 地址
3.
发布版本上添加了 Github 地址
4.
优化了文字选中效果
### 功能调整
### 功能调整
...
...
src/module/editor.receiver.js
View file @
90d75c83
...
@@ -22,7 +22,7 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -22,7 +22,7 @@ Minder.Receiver = kity.createClass('Receiver',{
_div
.
setAttribute
(
'contenteditable'
,
true
);
_div
.
setAttribute
(
'contenteditable'
,
true
);
_div
.
className
=
'km_receiver'
;
_div
.
className
=
'km_receiver'
;
this
.
container
=
document
.
body
.
insertBefore
(
_div
,
document
.
body
.
firstChild
);
this
.
container
=
document
.
body
.
insertBefore
(
_div
,
document
.
body
.
firstChild
);
utils
.
addCssRule
(
'km_receiver_css'
,
' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;
clip:rect(1em 1em 1em 1em);}'
);
//
utils
.
addCssRule
(
'km_receiver_css'
,
' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;
}'
);
//clip:rect(1em 1em 1em 1em);
this
.
km
.
on
(
'textedit.beforekeyup textedit.keydown textedit.paste'
,
utils
.
proxy
(
this
.
keyboardEvents
,
this
));
this
.
km
.
on
(
'textedit.beforekeyup textedit.keydown textedit.paste'
,
utils
.
proxy
(
this
.
keyboardEvents
,
this
));
this
.
timer
=
null
;
this
.
timer
=
null
;
this
.
index
=
0
;
this
.
index
=
0
;
...
@@ -275,16 +275,27 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -275,16 +275,27 @@ Minder.Receiver = kity.createClass('Receiver',{
return
false
;
return
false
;
}
}
if
(
offset
.
x
>=
v
.
x
&&
offset
.
x
<=
v
.
x
+
v
.
width
){
if
(
offset
.
x
>=
v
.
x
&&
offset
.
x
<=
v
.
x
+
v
.
width
){
if
(
me
.
index
==
i
){
if
(
me
.
index
==
i
){
if
(
i
==
0
){
if
(
i
==
0
){
me
.
selection
.
setStartOffset
(
i
)
me
.
selection
.
setStartOffset
(
i
)
}
}
me
.
selection
.
setEndOffset
(
i
+
(
dir
==
1
?
1
:
0
))
if
(
offset
.
x
<=
v
.
x
+
v
.
width
/
2
){
me
.
selection
.
collapse
()
}
else
{
me
.
selection
.
setEndOffset
(
i
+
(
me
.
selection
.
endOffset
>
i
||
dir
==
1
?
1
:
0
))
}
}
else
if
(
i
>
me
.
index
){
}
else
if
(
i
>
me
.
index
){
me
.
selection
.
setStartOffset
(
me
.
index
);
me
.
selection
.
setStartOffset
(
me
.
index
);
me
.
selection
.
setEndOffset
(
i
+
(
dir
==
1
?
1
:
0
)
)
me
.
selection
.
setEndOffset
(
i
+
1
)
}
else
{
}
else
{
me
.
selection
.
setStartOffset
(
i
+
(
dir
==
1
?
1
:
0
));
if
(
dir
==
1
){
me
.
selection
.
setStartOffset
(
i
+
(
offset
.
x
>=
v
.
x
+
v
.
width
/
2
?
1
:
0
));
}
else
{
me
.
selection
.
setStartOffset
(
i
);
}
me
.
selection
.
setEndOffset
(
me
.
index
)
me
.
selection
.
setEndOffset
(
me
.
index
)
}
}
...
@@ -298,7 +309,6 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -298,7 +309,6 @@ Minder.Receiver = kity.createClass('Receiver',{
endOffset
=
this
.
textData
[
this
.
selection
.
endOffset
],
endOffset
=
this
.
textData
[
this
.
selection
.
endOffset
],
width
=
0
;
width
=
0
;
if
(
this
.
selection
.
collapsed
){
if
(
this
.
selection
.
collapsed
){
this
.
selection
.
updateShow
(
startOffset
||
this
.
textData
[
this
.
textData
.
length
-
1
],
0
);
this
.
selection
.
updateShow
(
startOffset
||
this
.
textData
[
this
.
textData
.
length
-
1
],
0
);
return
this
;
return
this
;
}
}
...
...
src/module/editor.selection.js
View file @
90d75c83
...
@@ -63,6 +63,12 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -63,6 +63,12 @@ Minder.Selection = kity.createClass( 'Selection', {
this
.
setShowHold
();
this
.
setShowHold
();
}
}
this
.
setPosition
(
offset
).
setWidth
(
width
);
this
.
setPosition
(
offset
).
setWidth
(
width
);
//解决在框选内容时,出现很窄的光标
if
(
width
==
0
){
this
.
setOpacity
(
0
);
}
else
{
this
.
setOpacity
(
0.5
);
}
return
this
;
return
this
;
},
},
setPosition
:
function
(
offset
)
{
setPosition
:
function
(
offset
)
{
...
@@ -73,7 +79,6 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -73,7 +79,6 @@ Minder.Selection = kity.createClass( 'Selection', {
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
}
}
return
this
.
update
();
return
this
.
update
();
},
},
setHeight
:
function
(
height
)
{
setHeight
:
function
(
height
)
{
...
...
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