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
e60fae33
Commit
e60fae33
authored
May 06, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:fex-team/kityminder into dev
parents
91c9bff2
06532951
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
12 deletions
+26
-12
node.js
src/core/node.js
+10
-5
utils.js
src/core/utils.js
+1
-1
history.js
src/module/history.js
+15
-6
No files found.
src/core/node.js
View file @
e60fae33
...
@@ -252,23 +252,25 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
...
@@ -252,23 +252,25 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
},
},
clone
:
function
()
{
clone
:
function
()
{
function
cloneNode
(
parent
,
isClonedNode
)
{
function
cloneNode
(
parent
,
isClonedNode
,
fn
)
{
var
_tmp
=
new
KM
.
MinderNode
(
isClonedNode
.
getText
()
);
var
_tmp
=
new
KM
.
MinderNode
(
isClonedNode
.
getText
()
);
_tmp
.
data
=
Utils
.
clonePlainObject
(
isClonedNode
.
getData
()
);
_tmp
.
data
=
Utils
.
clonePlainObject
(
isClonedNode
.
getData
()
);
_tmp
.
tmpData
=
Utils
.
clonePlainObject
(
isClonedNode
.
getTmpData
()
)
_tmp
.
tmpData
=
Utils
.
clonePlainObject
(
isClonedNode
.
getTmpData
()
)
;
_tmp
.
parent
=
parent
;
_tmp
.
parent
=
parent
;
if
(
parent
)
{
if
(
parent
)
{
parent
.
children
.
push
(
_tmp
);
parent
.
children
.
push
(
_tmp
);
}
}
for
(
var
i
=
0
,
ci
;
for
(
var
i
=
0
,
ci
;
(
ci
=
isClonedNode
.
children
[
i
++
]
);
)
{
(
ci
=
isClonedNode
.
children
[
i
++
]
);
)
{
cloneNode
(
_tmp
,
ci
);
cloneNode
(
_tmp
,
ci
,
fn
);
}
}
fn
&&
fn
(
isClonedNode
,
_tmp
);
return
_tmp
;
return
_tmp
;
}
}
return
function
()
{
return
function
(
fn
)
{
return
cloneNode
(
null
,
this
);
return
cloneNode
(
null
,
this
,
fn
);
};
};
}(),
}(),
equals
:
function
(
node
)
{
equals
:
function
(
node
)
{
...
@@ -311,6 +313,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
...
@@ -311,6 +313,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
isHighlight
:
function
()
{
isHighlight
:
function
()
{
return
this
.
getTmpData
(
'highlight'
)
return
this
.
getTmpData
(
'highlight'
)
},
},
select
:
function
(){
this
.
setTmpData
(
'highlight'
,
true
)
},
setTmpData
:
function
(
a
,
v
)
{
setTmpData
:
function
(
a
,
v
)
{
var
me
=
this
;
var
me
=
this
;
if
(
utils
.
isObject
(
a
)
)
{
if
(
utils
.
isObject
(
a
)
)
{
...
...
src/core/utils.js
View file @
e60fae33
...
@@ -247,7 +247,7 @@ var utils = Utils = KityMinder.Utils = {
...
@@ -247,7 +247,7 @@ var utils = Utils = KityMinder.Utils = {
}
}
};
};
element
.
onerror
=
function
()
{
element
.
onerror
=
function
()
{
throw
Error
(
'The load '
+
(
obj
.
href
||
obj
.
src
)
+
' fails,check the url settings of file
umeditor.config.js
'
)
throw
Error
(
'The load '
+
(
obj
.
href
||
obj
.
src
)
+
' fails,check the url settings of file '
)
};
};
doc
.
getElementsByTagName
(
"head"
)[
0
].
appendChild
(
element
);
doc
.
getElementsByTagName
(
"head"
)[
0
].
appendChild
(
element
);
}
}
...
...
src/module/history.js
View file @
e60fae33
...
@@ -4,13 +4,23 @@ KityMinder.registerModule( "HistoryModule", function () {
...
@@ -4,13 +4,23 @@ KityMinder.registerModule( "HistoryModule", function () {
var
Scene
=
kity
.
createClass
(
'Scene'
,
{
var
Scene
=
kity
.
createClass
(
'Scene'
,
{
constructor
:
function
(
root
)
{
constructor
:
function
(
root
)
{
this
.
data
=
root
.
clone
();
this
.
data
=
root
.
clone
(
function
(
node
,
cloneNode
){
km
.
fire
(
'cloneNode'
,{
'targetNode'
:
cloneNode
,
'sourceNode'
:
node
})
});
},
},
getData
:
function
()
{
getData
:
function
()
{
return
this
.
data
;
return
this
.
data
;
},
},
cloneData
:
function
()
{
cloneData
:
function
()
{
return
this
.
getData
().
clone
();
var
fn
=
function
(
node
,
cloneNode
){
km
.
fire
(
'cloneNode'
,{
'targetNode'
:
cloneNode
,
'sourceNode'
:
node
})};
return
this
.
getData
().
clone
(
fn
);
},
},
equals
:
function
(
scene
)
{
equals
:
function
(
scene
)
{
return
this
.
getData
().
equals
(
scene
.
getData
()
)
return
this
.
getData
().
equals
(
scene
.
getData
()
)
...
@@ -155,11 +165,10 @@ KityMinder.registerModule( "HistoryModule", function () {
...
@@ -155,11 +165,10 @@ KityMinder.registerModule( "HistoryModule", function () {
"saveScene"
:
function
(
e
)
{
"saveScene"
:
function
(
e
)
{
this
.
historyManager
.
saveScene
();
this
.
historyManager
.
saveScene
();
},
},
"renderNode"
:
function
(
e
)
{
'renderNode'
:
function
(
e
)
{
var
node
=
e
.
node
;
var
node
=
e
.
node
;
if
(
node
.
isSelected
()){
if
(
node
.
isHighlight
()
)
{
this
.
select
(
node
)
km
.
select
(
node
);
}
}
},
},
"keydown"
:
function
(
e
)
{
"keydown"
:
function
(
e
)
{
...
...
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