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
91fe97f1
Commit
91fe97f1
authored
May 07, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
parent
09315d6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
minder.data.js
src/core/minder.data.js
+15
-16
expand.js
src/module/expand.js
+5
-0
No files found.
src/core/minder.data.js
View file @
91fe97f1
...
@@ -41,7 +41,7 @@ function importNode( node, json, km ) {
...
@@ -41,7 +41,7 @@ function importNode( node, json, km ) {
for
(
var
field
in
data
)
{
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
node
.
setData
(
field
,
data
[
field
]
);
}
}
node
.
setData
(
'text'
,
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
node
.
getType
()
]
)
);
node
.
setData
(
'text'
,
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
node
.
getType
()
]
)
);
var
childrenTreeData
=
json
.
children
;
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
if
(
!
childrenTreeData
)
return
;
...
@@ -53,7 +53,6 @@ function importNode( node, json, km ) {
...
@@ -53,7 +53,6 @@ function importNode( node, json, km ) {
return
node
;
return
node
;
}
}
// 导入导出
// 导入导出
kity
.
extendClass
(
Minder
,
{
kity
.
extendClass
(
Minder
,
{
exportData
:
function
(
protocalName
)
{
exportData
:
function
(
protocalName
)
{
...
@@ -62,11 +61,11 @@ kity.extendClass( Minder, {
...
@@ -62,11 +61,11 @@ kity.extendClass( Minder, {
json
=
exportNode
(
this
.
getRoot
()
);
json
=
exportNode
(
this
.
getRoot
()
);
protocal
=
KityMinder
.
findProtocal
(
protocalName
);
protocal
=
KityMinder
.
findProtocal
(
protocalName
);
if
(
this
.
_fire
(
new
MinderEvent
(
'beforeexport'
,
{
if
(
this
.
_fire
(
new
MinderEvent
(
'beforeexport'
,
{
json
:
json
,
json
:
json
,
protocalName
:
protocalName
,
protocalName
:
protocalName
,
protocal
:
protocal
protocal
:
protocal
},
true
)
)
===
true
)
return
;
},
true
)
)
===
true
)
return
;
if
(
protocal
)
{
if
(
protocal
)
{
return
protocal
.
encode
(
json
,
this
);
return
protocal
.
encode
(
json
,
this
);
...
@@ -106,22 +105,22 @@ kity.extendClass( Minder, {
...
@@ -106,22 +105,22 @@ kity.extendClass( Minder, {
//*******************
//*******************
function
ts
(
d
,
str
,
last
)
{
function
ts
(
d
,
str
,
last
)
{
var
h
=
d
.
getHours
(),
var
h
=
d
.
getHours
(),
m
=
d
.
getMinutes
(),
m
=
d
.
getMinutes
(),
s
=
d
.
getSeconds
(),
s
=
d
.
getSeconds
(),
ms
=
d
.
getMilliseconds
();
ms
=
d
.
getMilliseconds
();
if
(
last
)
{
if
(
last
)
{
console
.
log
(
'--- '
+
str
+
': '
+
(
d
-
last
)
+
' ---'
);
console
.
log
(
'--- '
+
str
+
': '
+
(
d
-
last
)
+
' ---'
);
}
else
{
}
else
{
console
.
log
(
'--- '
+
str
+
' ---'
);
console
.
log
(
'--- '
+
str
+
' ---'
);
}
}
return
d
;
return
d
;
}
}
var
t1
=
ts
(
new
Date
(),
'开始解析'
);
var
t1
=
ts
(
new
Date
(),
'开始解析'
);
//*******************
//*******************
json
=
params
.
json
||
(
params
.
json
=
protocal
.
decode
(
local
)
);
json
=
params
.
json
||
(
params
.
json
=
protocal
.
decode
(
local
)
);
...
@@ -130,20 +129,20 @@ kity.extendClass( Minder, {
...
@@ -130,20 +129,20 @@ kity.extendClass( Minder, {
var
self
=
this
;
var
self
=
this
;
json
.
then
(
local
,
function
(
data
)
{
json
.
then
(
local
,
function
(
data
)
{
//*******************
//*******************
var
t2
=
ts
(
new
Date
(),
'解压解析耗时'
,
t1
);
var
t2
=
ts
(
new
Date
(),
'解压解析耗时'
,
t1
);
//*******************
//*******************
self
.
_afterImportData
(
data
,
params
);
self
.
_afterImportData
(
data
,
params
);
//*******************
//*******************
ts
(
new
Date
(),
'渲染耗时'
,
t2
);
ts
(
new
Date
(),
'渲染耗时'
,
t2
);
//*******************
//*******************
}
);
}
);
}
else
{
}
else
{
//*******************
//*******************
var
t2
=
ts
(
new
Date
(),
'解压解析耗时'
,
t1
);
var
t2
=
ts
(
new
Date
(),
'解压解析耗时'
,
t1
);
//*******************
//*******************
this
.
_afterImportData
(
json
,
params
);
this
.
_afterImportData
(
json
,
params
);
//*******************
//*******************
ts
(
new
Date
(),
'渲染耗时'
,
t2
);
ts
(
new
Date
(),
'渲染耗时'
,
t2
);
//*******************
//*******************
}
}
return
this
;
return
this
;
...
...
src/module/expand.js
View file @
91fe97f1
...
@@ -51,6 +51,11 @@ KityMinder.registerModule( "Expand", function () {
...
@@ -51,6 +51,11 @@ KityMinder.registerModule( "Expand", function () {
}
}
}
);
}
);
return
{
return
{
'events'
:
{
'importData'
:
function
(
e
)
{
var
data
=
e
.
data
;
}
},
'commands'
:
{}
'commands'
:
{}
};
};
}
);
}
);
\ No newline at end of file
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