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
47d75e57
Commit
47d75e57
authored
Mar 19, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix empty text reload issue
parent
546612fc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
27 deletions
+52
-27
kityminder.all.js
dist/kityminder.all.js
+33
-13
kityminder.all.min.js
dist/kityminder.all.min.js
+5
-5
social.js
social/social.js
+2
-2
minder.data.js
src/core/minder.data.js
+12
-7
No files found.
dist/kityminder.all.js
View file @
47d75e57
/*!
/*!
* ====================================================
* ====================================================
* kityminder - v1.0.0 - 2014-03-1
8
* kityminder - v1.0.0 - 2014-03-1
9
* https://github.com/fex-team/kityminder
* https://github.com/fex-team/kityminder
* GitHub: https://github.com/fex-team/kityminder.git
* GitHub: https://github.com/fex-team/kityminder.git
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
...
@@ -968,9 +968,9 @@ Utils.extend( KityMinder, {
...
@@ -968,9 +968,9 @@ Utils.extend( KityMinder, {
return
KityMinder
.
_protocals
[
name
]
||
null
;
return
KityMinder
.
_protocals
[
name
]
||
null
;
},
},
getSupportedProtocals
:
function
()
{
getSupportedProtocals
:
function
()
{
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
});
}
);
},
},
getAllRegisteredProtocals
:
function
()
{
getAllRegisteredProtocals
:
function
()
{
return
KityMinder
.
_protocals
;
return
KityMinder
.
_protocals
;
...
@@ -991,18 +991,23 @@ function exportNode( node ) {
...
@@ -991,18 +991,23 @@ function exportNode( node ) {
return
exported
;
return
exported
;
}
}
function
importNode
(
node
,
json
)
{
var
DEFAULT_TEXT
=
{
'root'
:
'maintopic'
,
'main'
:
'topic'
};
function
importNode
(
node
,
json
,
km
)
{
var
data
=
json
.
data
;
var
data
=
json
.
data
;
for
(
var
field
in
data
)
{
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
node
.
setData
(
field
,
data
[
field
]
);
}
}
node
.
setText
(
data
.
text
);
node
.
setText
(
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
data
.
type
]
)
);
var
childrenTreeData
=
json
.
children
;
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
if
(
!
childrenTreeData
)
return
;
for
(
var
i
=
0
;
i
<
childrenTreeData
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
childrenTreeData
.
length
;
i
++
)
{
var
childNode
=
new
MinderNode
();
var
childNode
=
new
MinderNode
();
importNode
(
childNode
,
childrenTreeData
[
i
]
);
importNode
(
childNode
,
childrenTreeData
[
i
]
,
km
);
node
.
appendChild
(
childNode
);
node
.
appendChild
(
childNode
);
}
}
return
node
;
return
node
;
...
@@ -1061,7 +1066,7 @@ kity.extendClass( Minder, {
...
@@ -1061,7 +1066,7 @@ kity.extendClass( Minder, {
this
.
_root
.
removeChild
(
0
);
this
.
_root
.
removeChild
(
0
);
}
}
importNode
(
this
.
_root
,
json
);
importNode
(
this
.
_root
,
json
,
this
);
this
.
_fire
(
new
MinderEvent
(
'import'
,
params
,
false
)
);
this
.
_fire
(
new
MinderEvent
(
'import'
,
params
,
false
)
);
this
.
_firePharse
(
{
this
.
_firePharse
(
{
...
@@ -4700,16 +4705,27 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -4700,16 +4705,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
)
}
}
...
@@ -4723,7 +4739,6 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -4723,7 +4739,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
;
}
}
...
@@ -4819,6 +4834,12 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -4819,6 +4834,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
)
{
...
@@ -4829,7 +4850,6 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -4829,7 +4850,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
)
{
...
...
dist/kityminder.all.min.js
View file @
47d75e57
This source diff could not be displayed because it is too large. You can
view the blob
instead.
social/social.js
View file @
47d75e57
...
@@ -67,10 +67,10 @@ $( function () {
...
@@ -67,10 +67,10 @@ $( function () {
$user_menu
.
attachTo
(
$user_btn
);
$user_menu
.
attachTo
(
$user_btn
);
$save_btn
=
$
(
'<button>保存</button>'
).
click
(
saveThisFile
)
$save_btn
=
$
(
'<button
id="save-btn"
>保存</button>'
).
click
(
saveThisFile
)
.
addClass
(
'baidu-cloud'
).
appendTo
(
$panel
).
disabled
(
true
);
.
addClass
(
'baidu-cloud'
).
appendTo
(
$panel
).
disabled
(
true
);
$share_btn
=
$
(
'<button>分享</button>'
).
click
(
shareThisFile
)
$share_btn
=
$
(
'<button
id="share-btn"
>分享</button>'
).
click
(
shareThisFile
)
.
addClass
(
'share'
).
appendTo
(
$panel
).
disabled
(
true
);
.
addClass
(
'share'
).
appendTo
(
$panel
).
disabled
(
true
);
...
...
src/core/minder.data.js
View file @
47d75e57
...
@@ -7,9 +7,9 @@ Utils.extend( KityMinder, {
...
@@ -7,9 +7,9 @@ Utils.extend( KityMinder, {
return
KityMinder
.
_protocals
[
name
]
||
null
;
return
KityMinder
.
_protocals
[
name
]
||
null
;
},
},
getSupportedProtocals
:
function
()
{
getSupportedProtocals
:
function
()
{
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
Utils
.
keys
(
KityMinder
.
_protocals
).
sort
(
function
(
a
,
b
)
{
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
return
KityMinder
.
_protocals
[
b
].
recognizePriority
-
KityMinder
.
_protocals
[
a
].
recognizePriority
;
});
}
);
},
},
getAllRegisteredProtocals
:
function
()
{
getAllRegisteredProtocals
:
function
()
{
return
KityMinder
.
_protocals
;
return
KityMinder
.
_protocals
;
...
@@ -30,18 +30,23 @@ function exportNode( node ) {
...
@@ -30,18 +30,23 @@ function exportNode( node ) {
return
exported
;
return
exported
;
}
}
function
importNode
(
node
,
json
)
{
var
DEFAULT_TEXT
=
{
'root'
:
'maintopic'
,
'main'
:
'topic'
};
function
importNode
(
node
,
json
,
km
)
{
var
data
=
json
.
data
;
var
data
=
json
.
data
;
for
(
var
field
in
data
)
{
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
node
.
setData
(
field
,
data
[
field
]
);
}
}
node
.
setText
(
data
.
text
);
node
.
setText
(
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
data
.
type
]
)
);
var
childrenTreeData
=
json
.
children
;
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
if
(
!
childrenTreeData
)
return
;
for
(
var
i
=
0
;
i
<
childrenTreeData
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
childrenTreeData
.
length
;
i
++
)
{
var
childNode
=
new
MinderNode
();
var
childNode
=
new
MinderNode
();
importNode
(
childNode
,
childrenTreeData
[
i
]
);
importNode
(
childNode
,
childrenTreeData
[
i
]
,
km
);
node
.
appendChild
(
childNode
);
node
.
appendChild
(
childNode
);
}
}
return
node
;
return
node
;
...
@@ -100,7 +105,7 @@ kity.extendClass( Minder, {
...
@@ -100,7 +105,7 @@ kity.extendClass( Minder, {
this
.
_root
.
removeChild
(
0
);
this
.
_root
.
removeChild
(
0
);
}
}
importNode
(
this
.
_root
,
json
);
importNode
(
this
.
_root
,
json
,
this
);
this
.
_fire
(
new
MinderEvent
(
'import'
,
params
,
false
)
);
this
.
_fire
(
new
MinderEvent
(
'import'
,
params
,
false
)
);
this
.
_firePharse
(
{
this
.
_firePharse
(
{
...
...
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