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
5071ea9f
Commit
5071ea9f
authored
May 08, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #10
parent
3884420c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
utils.js
src/core/utils.js
+15
-0
editor.receiver.js
src/module/editor.receiver.js
+2
-4
No files found.
src/core/utils.js
View file @
5071ea9f
...
...
@@ -268,6 +268,21 @@ var utils = Utils = KityMinder.Utils = {
}
return
target
;
},
unhtml
:
function
(
str
,
reg
)
{
return
str
?
str
.
replace
(
reg
||
/
[
&<">'
](?:(
amp|lt|quot|gt|#39|nbsp
)
;
)?
/g
,
function
(
a
,
b
)
{
if
(
b
)
{
return
a
;
}
else
{
return
{
'<'
:
'<'
,
'&'
:
'&'
,
'"'
:
'"'
,
'>'
:
'>'
,
"'"
:
'''
}[
a
]
}
})
:
''
;
}
};
...
...
src/module/editor.receiver.js
View file @
5071ea9f
...
...
@@ -46,7 +46,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
textShape
=
new
kity
.
Text
();
}
this
.
textShape
=
textShape
;
this
.
container
.
innerHTML
=
textShape
.
getContent
(
);
this
.
container
.
innerHTML
=
utils
.
unhtml
(
textShape
.
getContent
()
);
return
this
;
},
setTextShapeSize
:
function
(
size
)
{
...
...
@@ -90,9 +90,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me
.
setContainerStyle
();
me
.
minderNode
.
setText
(
text
);
if
(
text
.
length
==
0
)
{
me
.
minderNode
.
setText
(
'a'
);
}
me
.
km
.
updateLayout
(
me
.
minderNode
);
...
...
@@ -142,7 +140,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
setTimeout
(
function
()
{
me
.
range
.
updateNativeRange
().
insertNode
(
$
(
'<span>$$_kityminder_bookmark_$$</span>'
)[
0
]
);
me
.
container
.
innerHTML
=
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_$$'
);
me
.
container
.
textContent
=
me
.
container
.
textContent
.
replace
(
'$$_kityminder_bookmark_$$'
,
''
);
me
.
range
.
setStart
(
me
.
container
.
firstChild
,
index
).
collapse
(
true
).
select
();
...
...
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