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
47d3b6f5
Commit
47d3b6f5
authored
Feb 11, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构
parent
6b68f6ec
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1113 additions
and
593 deletions
+1113
-593
dev.html
demo/dev.html
+2
-10
kity
kity
+1
-1
minder.select.js
src/core/minder.select.js
+2
-2
node.js
src/core/node.js
+8
-8
editor.receiver.js
src/module/editor.receiver.js
+93
-97
font.js
src/module/font.js
+1
-0
layout.default.js
src/module/layout.default.js
+1004
-473
layout.js
src/module/layout.js
+2
-2
No files found.
demo/dev.html
View file @
47d3b6f5
...
@@ -25,15 +25,7 @@
...
@@ -25,15 +25,7 @@
</body>
</body>
<script>
<script>
var
minder
=
KM
.
createMinder
(
kityminder
);
var
minder
=
KM
.
createMinder
(
kityminder
);
document
.
getElementById
(
"StyleChange"
).
addEventListener
(
"change"
,
function
(
e
){
minder
.
getRoot
().
setData
(
'fontcolor'
,
'red'
);
var
val
=
e
.
target
.
value
;
minder
.
updateLayout
(
minder
.
getRoot
());
minder
.
execCommand
(
"switchlayout"
,
val
);
},
false
);
minder
.
select
(
minder
.
getRoot
());
var
node
=
new
KM
.
MinderNode
(
'test'
);
node
.
setData
(
'fontcolor'
,
'red'
);
minder
.
execCommand
(
'appendChildNode'
,
node
);
// var b = new kity.Bezier([new kity.BezierPoint(0,0).setVertex(100,100),new kity.BezierPoint(100,0).setVertex(100,100)]);
// minder.getRenderContainer().addShape(b.stroke("white"));
</script>
</script>
</html>
</html>
\ No newline at end of file
kity
@
1bfcdd71
Subproject commit
cfe7d5a248f0634d85dab3e51dc2d90d2d23ac5e
Subproject commit
1bfcdd712725d25d54bfe88d0ee0fac6ee33830a
src/core/minder.select.js
View file @
47d3b6f5
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
kity
.
extendClass
(
Minder
,
function
()
{
kity
.
extendClass
(
Minder
,
function
()
{
function
highlightNode
(
km
,
node
)
{
function
highlightNode
(
km
,
node
)
{
node
.
setData
(
"highlight"
,
true
);
node
.
setData
(
"highlight"
,
true
);
km
.
render
Node
(
node
);
km
.
highlight
Node
(
node
);
}
}
function
unhighlightNode
(
km
,
node
)
{
function
unhighlightNode
(
km
,
node
)
{
node
.
setData
(
"highlight"
,
false
);
node
.
setData
(
"highlight"
,
false
);
km
.
render
Node
(
node
);
km
.
highlight
Node
(
node
);
}
}
return
{
return
{
_initSelection
:
function
()
{
_initSelection
:
function
()
{
...
...
src/core/node.js
View file @
47d3b6f5
...
@@ -8,8 +8,8 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
...
@@ -8,8 +8,8 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
}
else
{
}
else
{
this
.
setData
(
options
);
this
.
setData
(
options
);
}
}
this
.
_createShapeDom
()
this
.
_createShapeDom
()
;
this
.
setData
(
"layout"
,
{}
);
},
},
_createShapeDom
:
function
()
{
_createShapeDom
:
function
()
{
this
.
rc
=
new
kity
.
Group
();
this
.
rc
=
new
kity
.
Group
();
...
@@ -26,10 +26,10 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
...
@@ -26,10 +26,10 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
this
.
rc
.
appendShape
(
g
);
this
.
rc
.
appendShape
(
g
);
},
},
_createBgGroup
:
function
()
{
_createBgGroup
:
function
()
{
this
.
_createGroup
(
'bgrc'
)
this
.
_createGroup
(
'bgrc'
)
;
},
},
_createContGroup
:
function
()
{
_createContGroup
:
function
()
{
this
.
_createGroup
(
'contrc'
)
this
.
_createGroup
(
'contrc'
)
;
},
},
_createTextShape
:
function
()
{
_createTextShape
:
function
()
{
this
.
getContRc
().
appendShape
(
new
kity
.
Text
(
this
.
getData
(
'text'
)
||
''
)
);
this
.
getContRc
().
appendShape
(
new
kity
.
Text
(
this
.
getData
(
'text'
)
||
''
)
);
...
@@ -37,24 +37,24 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
...
@@ -37,24 +37,24 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
getContRc
:
function
()
{
getContRc
:
function
()
{
var
groups
=
this
.
rc
.
getShapesByType
(
'group'
),
var
groups
=
this
.
rc
.
getShapesByType
(
'group'
),
result
;
result
;
u
tils
.
each
(
groups
,
function
(
i
,
p
)
{
U
tils
.
each
(
groups
,
function
(
i
,
p
)
{
if
(
p
.
getData
(
'rctype'
)
==
'contrc'
)
{
if
(
p
.
getData
(
'rctype'
)
==
'contrc'
)
{
result
=
p
;
result
=
p
;
return
false
;
return
false
;
}
}
}
);
}
);
return
result
return
result
;
},
},
getBgRc
:
function
()
{
getBgRc
:
function
()
{
var
groups
=
this
.
rc
.
getShapesByType
(
'group'
),
var
groups
=
this
.
rc
.
getShapesByType
(
'group'
),
result
;
result
;
u
tils
.
each
(
groups
,
function
(
i
,
p
)
{
U
tils
.
each
(
groups
,
function
(
i
,
p
)
{
if
(
p
.
getData
(
'rctype'
)
==
'bgrc'
)
{
if
(
p
.
getData
(
'rctype'
)
==
'bgrc'
)
{
result
=
p
;
result
=
p
;
return
false
;
return
false
;
}
}
}
);
}
);
return
result
return
result
;
},
},
setPoint
:
function
(
x
,
y
)
{
setPoint
:
function
(
x
,
y
)
{
this
.
setData
(
'point'
,
{
this
.
setData
(
'point'
,
{
...
...
src/module/editor.receiver.js
View file @
47d3b6f5
This diff is collapsed.
Click to expand it.
src/module/font.js
View file @
47d3b6f5
...
@@ -35,6 +35,7 @@ KityMinder.registerModule( "fontmodule", function () {
...
@@ -35,6 +35,7 @@ KityMinder.registerModule( "fontmodule", function () {
e
.
node
.
getTextShape
().
setAttr
(
'font-family'
,
val
);
e
.
node
.
getTextShape
().
setAttr
(
'font-family'
,
val
);
}
}
if
(
val
=
e
.
node
.
getData
(
'fontcolor'
)
)
{
if
(
val
=
e
.
node
.
getData
(
'fontcolor'
)
)
{
console
.
log
(
val
);
e
.
node
.
getTextShape
().
fill
(
val
);
e
.
node
.
getTextShape
().
fill
(
val
);
}
}
}
}
...
...
src/module/layout.default.js
View file @
47d3b6f5
This diff is collapsed.
Click to expand it.
src/module/layout.js
View file @
47d3b6f5
...
@@ -16,9 +16,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -16,9 +16,9 @@ KityMinder.registerModule( "LayoutModule", function () {
_root
.
setData
(
"currentstyle"
,
name
);
_root
.
setData
(
"currentstyle"
,
name
);
return
name
;
return
name
;
},
},
render
Node
:
function
(
node
)
{
highlight
Node
:
function
(
node
)
{
var
curStyle
=
this
.
getCurrentStyle
();
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
render
Node
.
call
(
this
,
node
);
this
.
getLayoutStyle
(
curStyle
).
highlight
Node
.
call
(
this
,
node
);
},
},
initStyle
:
function
()
{
initStyle
:
function
()
{
var
curStyle
=
this
.
getCurrentStyle
();
var
curStyle
=
this
.
getCurrentStyle
();
...
...
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