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
0b314a0c
Commit
0b314a0c
authored
Feb 28, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:kitygraph/kityminder into dev
parents
6d69960d
5d59055b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
29 deletions
+60
-29
saveto.js
src/adapter/saveto.js
+2
-2
basestyle.js
src/module/basestyle.js
+6
-0
font.js
src/module/font.js
+9
-0
layout.bottom.js
src/module/layout.bottom.js
+11
-2
layout.default.js
src/module/layout.default.js
+10
-2
layout.js
src/module/layout.js
+22
-23
No files found.
src/adapter/saveto.js
View file @
0b314a0c
...
@@ -39,8 +39,8 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
...
@@ -39,8 +39,8 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
var
transform
=
renderContainer
.
getTransform
();
var
transform
=
renderContainer
.
getTransform
();
renderContainer
.
resetTransform
();
renderContainer
.
resetTransform
();
var
svg
=
$
(
svghtml
).
attr
(
{
var
svg
=
$
(
svghtml
).
attr
(
{
width
:
renderBox
.
x
+
renderBox
.
width
,
width
:
renderBox
.
width
,
height
:
renderBox
.
y
+
renderBox
.
height
,
height
:
renderBox
.
height
,
viewBox
:
null
viewBox
:
null
}
);
}
);
var
div
=
$
(
"<div></div>"
).
append
(
svg
);
var
div
=
$
(
"<div></div>"
).
append
(
svg
);
...
...
src/module/basestyle.js
View file @
0b314a0c
...
@@ -26,6 +26,9 @@ KityMinder.registerModule( "basestylemodule", function () {
...
@@ -26,6 +26,9 @@ KityMinder.registerModule( "basestylemodule", function () {
queryState
:
function
(
)
{
queryState
:
function
(
)
{
var
nodes
=
km
.
getSelectedNodes
(),
var
nodes
=
km
.
getSelectedNodes
(),
result
=
0
;
result
=
0
;
if
(
nodes
.
length
==
0
){
return
-
1
;
}
utils
.
each
(
nodes
,
function
(
i
,
n
){
utils
.
each
(
nodes
,
function
(
i
,
n
){
if
(
n
.
getData
(
'bold'
)){
if
(
n
.
getData
(
'bold'
)){
result
=
1
;
result
=
1
;
...
@@ -58,6 +61,9 @@ KityMinder.registerModule( "basestylemodule", function () {
...
@@ -58,6 +61,9 @@ KityMinder.registerModule( "basestylemodule", function () {
queryState
:
function
(
)
{
queryState
:
function
(
)
{
var
nodes
=
km
.
getSelectedNodes
(),
var
nodes
=
km
.
getSelectedNodes
(),
result
=
0
;
result
=
0
;
if
(
nodes
.
length
==
0
){
return
-
1
;
}
utils
.
each
(
nodes
,
function
(
i
,
n
){
utils
.
each
(
nodes
,
function
(
i
,
n
){
if
(
n
.
getData
(
'italic'
)){
if
(
n
.
getData
(
'italic'
)){
result
=
1
;
result
=
1
;
...
...
src/module/font.js
View file @
0b314a0c
...
@@ -51,6 +51,9 @@ KityMinder.registerModule( "fontmodule", function () {
...
@@ -51,6 +51,9 @@ KityMinder.registerModule( "fontmodule", function () {
n
.
setData
(
'fontcolor'
,
color
);
n
.
setData
(
'fontcolor'
,
color
);
n
.
getTextShape
().
fill
(
color
)
n
.
getTextShape
().
fill
(
color
)
}
)
}
)
},
queryState
:
function
(
km
){
return
km
.
getSelectedNodes
().
length
==
0
?
-
1
:
0
}
}
}
),
}
),
...
@@ -64,6 +67,9 @@ KityMinder.registerModule( "fontmodule", function () {
...
@@ -64,6 +67,9 @@ KityMinder.registerModule( "fontmodule", function () {
n
.
getTextShape
().
setAttr
(
'font-family'
,
family
);
n
.
getTextShape
().
setAttr
(
'font-family'
,
family
);
km
.
updateLayout
(
n
)
km
.
updateLayout
(
n
)
}
)
}
)
},
queryState
:
function
(
km
){
return
km
.
getSelectedNodes
().
length
==
0
?
-
1
:
0
}
}
}
),
}
),
"fontsize"
:
kity
.
createClass
(
"fontsizeCommand"
,
{
"fontsize"
:
kity
.
createClass
(
"fontsizeCommand"
,
{
...
@@ -76,6 +82,9 @@ KityMinder.registerModule( "fontmodule", function () {
...
@@ -76,6 +82,9 @@ KityMinder.registerModule( "fontmodule", function () {
n
.
getTextShape
().
setSize
(
size
);
n
.
getTextShape
().
setSize
(
size
);
km
.
updateLayout
(
n
)
km
.
updateLayout
(
n
)
}
)
}
)
},
queryState
:
function
(
km
){
return
km
.
getSelectedNodes
().
length
==
0
?
-
1
:
0
}
}
}
)
}
)
},
},
...
...
src/module/layout.bottom.js
View file @
0b314a0c
...
@@ -408,9 +408,11 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -408,9 +408,11 @@ KityMinder.registerModule( "LayoutBottom", function () {
appendChildNode
:
function
(
parent
,
node
,
sibling
)
{
appendChildNode
:
function
(
parent
,
node
,
sibling
)
{
node
.
clearLayout
();
node
.
clearLayout
();
var
parentLayout
=
parent
.
getLayout
();
var
parentLayout
=
parent
.
getLayout
();
var
expand
=
parent
.
getData
(
"expand"
);
//设置分支类型
//设置分支类型
if
(
parent
.
getType
()
===
"root"
)
{
if
(
parent
.
getType
()
===
"root"
)
{
node
.
setType
(
"main"
);
node
.
setType
(
"main"
);
node
.
setData
(
"expand"
,
true
);
minder
.
handelNodeInsert
(
node
);
minder
.
handelNodeInsert
(
node
);
}
else
{
}
else
{
node
.
setType
(
"sub"
);
node
.
setType
(
"sub"
);
...
@@ -490,8 +492,15 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -490,8 +492,15 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
}
},
},
expandNode
:
function
(
ico
)
{
expandNode
:
function
(
ico
)
{
var
isExpand
=
ico
.
icon
.
switchState
();
var
isExpand
,
node
;
var
node
=
ico
.
icon
.
_node
;
if
(
ico
instanceof
MinderNode
)
{
node
=
ico
;
isExpand
=
node
.
getLayout
().
shicon
.
switchState
();
}
else
{
isExpand
=
ico
.
icon
.
switchState
();
node
=
ico
.
icon
.
_node
;
}
node
.
setData
(
"expand"
,
isExpand
);
var
_buffer
=
node
.
getChildren
();
var
_buffer
=
node
.
getChildren
();
var
_cleanbuffer
=
[];
var
_cleanbuffer
=
[];
...
...
src/module/layout.default.js
View file @
0b314a0c
...
@@ -537,6 +537,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -537,6 +537,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
node
.
setType
(
"main"
);
node
.
setType
(
"main"
);
}
else
{
}
else
{
node
.
setType
(
"sub"
);
node
.
setType
(
"sub"
);
//var isExpand = parent.getData( "expand" );
}
}
//计算位置等流程
//计算位置等流程
updateBg
(
node
);
updateBg
(
node
);
...
@@ -600,8 +601,15 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -600,8 +601,15 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
}
},
},
expandNode
:
function
(
ico
)
{
expandNode
:
function
(
ico
)
{
var
isExpand
=
ico
.
icon
.
switchState
();
var
isExpand
,
node
;
var
node
=
ico
.
icon
.
_node
;
if
(
ico
instanceof
MinderNode
)
{
node
=
ico
;
isExpand
=
node
.
getLayout
().
shicon
.
switchState
();
}
else
{
isExpand
=
ico
.
icon
.
switchState
();
node
=
ico
.
icon
.
_node
;
}
node
.
setData
(
"expand"
,
isExpand
);
var
_buffer
=
node
.
getChildren
();
var
_buffer
=
node
.
getChildren
();
var
_cleanbuffer
=
[];
var
_cleanbuffer
=
[];
...
...
src/module/layout.js
View file @
0b314a0c
...
@@ -106,6 +106,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -106,6 +106,9 @@ KityMinder.registerModule( "LayoutModule", function () {
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
node
)
{
execute
:
function
(
km
,
node
)
{
var
parent
=
km
.
getSelectedNode
();
var
parent
=
km
.
getSelectedNode
();
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
getData
(
"expand"
)
===
false
)
{
km
.
expandNode
(
parent
);
}
km
.
appendChildNode
(
parent
,
node
);
km
.
appendChildNode
(
parent
,
node
);
km
.
select
(
node
,
true
);
km
.
select
(
node
,
true
);
return
node
;
return
node
;
...
@@ -129,7 +132,6 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -129,7 +132,6 @@ KityMinder.registerModule( "LayoutModule", function () {
node
.
setType
(
"main"
);
node
.
setType
(
"main"
);
km
.
appendChildNode
(
selectedNode
,
node
);
km
.
appendChildNode
(
selectedNode
,
node
);
}
else
{
}
else
{
node
.
setType
(
"sub"
);
km
.
appendSiblingNode
(
selectedNode
,
node
);
km
.
appendSiblingNode
(
selectedNode
,
node
);
}
}
km
.
select
(
node
,
true
);
km
.
select
(
node
,
true
);
...
@@ -203,26 +205,23 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -203,26 +205,23 @@ KityMinder.registerModule( "LayoutModule", function () {
this
.
initStyle
(
this
.
getRoot
()
);
this
.
initStyle
(
this
.
getRoot
()
);
}
}
},
},
'contextmenu'
:[
'contextmenu'
:
[
{
{
label
:
this
.
getLang
(
'node.appendsiblingnode'
),
label
:
this
.
getLang
(
'node.appendsiblingnode'
),
exec
:
function
()
{
exec
:
function
(){
this
.
execCommand
(
'appendsiblingnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)
)
)
this
.
execCommand
(
'appendsiblingnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)))
},
cmdName
:
'appendsiblingnode'
},
{
label
:
this
.
getLang
(
'node.appendchildnode'
),
exec
:
function
(){
this
.
execCommand
(
'appendchildnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)))
},
},
cmdName
:
'appendchildnode'
cmdName
:
'appendsiblingnode'
},
{
label
:
this
.
getLang
(
'node.appendchildnode'
),
exec
:
function
()
{
this
.
execCommand
(
'appendchildnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)
)
)
},
},
{
cmdName
:
'appendchildnode'
label
:
this
.
getLang
(
'node.removenode'
),
},
{
cmdName
:
'removenode'
label
:
this
.
getLang
(
'node.removenode'
),
},{
cmdName
:
'removenode'
divider
:
1
},
{
divider
:
1
}
}
],
],
...
...
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