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
99dab78a
Commit
99dab78a
authored
May 08, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:fex-team/kityminder into dev
parents
8d7326fe
5071ea9f
Changes
2
Show 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 @
99dab78a
...
@@ -268,6 +268,21 @@ var utils = Utils = KityMinder.Utils = {
...
@@ -268,6 +268,21 @@ var utils = Utils = KityMinder.Utils = {
}
}
return
target
;
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 @
99dab78a
...
@@ -46,7 +46,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -46,7 +46,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
textShape
=
new
kity
.
Text
();
textShape
=
new
kity
.
Text
();
}
}
this
.
textShape
=
textShape
;
this
.
textShape
=
textShape
;
this
.
container
.
innerHTML
=
textShape
.
getContent
(
);
this
.
container
.
innerHTML
=
utils
.
unhtml
(
textShape
.
getContent
()
);
return
this
;
return
this
;
},
},
setTextShapeSize
:
function
(
size
)
{
setTextShapeSize
:
function
(
size
)
{
...
@@ -90,9 +90,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -90,9 +90,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me
.
setContainerStyle
();
me
.
setContainerStyle
();
me
.
minderNode
.
setText
(
text
);
me
.
minderNode
.
setText
(
text
);
if
(
text
.
length
==
0
)
{
if
(
text
.
length
==
0
)
{
me
.
minderNode
.
setText
(
'a'
);
me
.
minderNode
.
setText
(
'a'
);
}
}
me
.
km
.
updateLayout
(
me
.
minderNode
);
me
.
km
.
updateLayout
(
me
.
minderNode
);
...
@@ -142,7 +140,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -142,7 +140,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
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
=
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_$$'
);
me
.
container
.
textContent
=
me
.
container
.
textContent
.
replace
(
'$$_kityminder_bookmark_$$'
,
''
);
me
.
container
.
textContent
=
me
.
container
.
textContent
.
replace
(
'$$_kityminder_bookmark_$$'
,
''
);
me
.
range
.
setStart
(
me
.
container
.
firstChild
,
index
).
collapse
(
true
).
select
();
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