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
02bf7378
Commit
02bf7378
authored
Feb 14, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/kitygraph/kityminder
into dev
parents
1854c29d
677aeef7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
22 deletions
+17
-22
dev.php
dist/dev.php
+1
-0
minder.data.js
src/core/minder.data.js
+2
-1
minder.js
src/core/minder.js
+1
-16
keyboard.js
src/module/keyboard.js
+1
-1
layout.default.js
src/module/layout.default.js
+9
-4
layout.js
src/module/layout.js
+3
-0
No files found.
dist/dev.php
View file @
02bf7378
...
@@ -16,6 +16,7 @@ $dependency = Array(
...
@@ -16,6 +16,7 @@ $dependency = Array(
,
'src/core/keymap.js'
,
'src/core/keymap.js'
,
'src/core/minder.lang.js'
,
'src/core/minder.lang.js'
,
'src/core/minder.defaultoptions.js'
,
'src/core/minder.defaultoptions.js'
,
'src/module/background.js'
,
'src/module/history.js'
,
'src/module/history.js'
,
'src/module/icon.js'
,
'src/module/icon.js'
,
'src/module/layout.js'
,
'src/module/layout.js'
...
...
src/core/minder.data.js
View file @
02bf7378
...
@@ -9,7 +9,7 @@ Utils.extend( KityMinder, {
...
@@ -9,7 +9,7 @@ Utils.extend( KityMinder, {
getSupportedProtocals
:
function
()
{
getSupportedProtocals
:
function
()
{
return
Utils
.
keys
(
KityMinder
.
_protocals
);
return
Utils
.
keys
(
KityMinder
.
_protocals
);
},
},
getAllRegisteredProtocals
:
function
()
{
getAllRegisteredProtocals
:
function
()
{
return
KityMinder
.
_protocals
return
KityMinder
.
_protocals
}
}
}
);
}
);
...
@@ -33,6 +33,7 @@ function importNode( node, json ) {
...
@@ -33,6 +33,7 @@ function importNode( node, json ) {
for
(
var
field
in
data
)
{
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
node
.
setData
(
field
,
data
[
field
]
);
}
}
node
.
setText
(
data
.
text
);
var
childrenTreeData
=
json
.
children
;
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
if
(
!
childrenTreeData
)
return
;
...
...
src/core/minder.js
View file @
02bf7378
...
@@ -37,7 +37,6 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
...
@@ -37,7 +37,6 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_paper
=
new
kity
.
Paper
();
this
.
_paper
=
new
kity
.
Paper
();
this
.
_paper
.
getNode
().
setAttribute
(
'contenteditable'
,
true
);
this
.
_paper
.
getNode
().
setAttribute
(
'contenteditable'
,
true
);
this
.
_addBackground
();
this
.
_addRenderContainer
();
this
.
_addRenderContainer
();
this
.
_root
=
new
MinderNode
(
"Main Topic"
);
this
.
_root
=
new
MinderNode
(
"Main Topic"
);
...
@@ -50,21 +49,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
...
@@ -50,21 +49,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_rc
=
new
kity
.
Group
();
this
.
_rc
=
new
kity
.
Group
();
this
.
_paper
.
addShape
(
this
.
_rc
);
this
.
_paper
.
addShape
(
this
.
_rc
);
},
},
_addBackground
:
function
()
{
var
start
=
kity
.
Color
.
createHSL
(
200
,
8
,
40
);
var
end
=
start
.
dec
(
'l'
,
5
);
var
_paper
=
this
.
_paper
;
var
_bg
=
this
.
_background
=
new
kity
.
Ellipse
(
400
,
300
).
fill
(
new
kity
.
RadialGradientBrush
().
pipe
(
function
()
{
this
.
addStop
(
0
,
start
);
this
.
addStop
(
1
,
end
);
_paper
.
addResource
(
this
);
}
)
);
_paper
.
setStyle
(
'background'
,
end
.
toString
()
);
setTimeout
(
function
()
{
_bg
.
translate
(
_paper
.
getNode
().
clientWidth
/
2
,
_paper
.
getNode
().
clientHeight
/
2
);
},
100
);
_paper
.
addShape
(
this
.
_background
);
},
renderTo
:
function
(
target
)
{
renderTo
:
function
(
target
)
{
this
.
_paper
.
renderTo
(
this
.
_renderTarget
=
target
);
this
.
_paper
.
renderTo
(
this
.
_renderTarget
=
target
);
this
.
_bindEvents
();
this
.
_bindEvents
();
...
...
src/module/keyboard.js
View file @
02bf7378
...
@@ -2,7 +2,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -2,7 +2,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
function
buildPositionNetwork
(
root
)
{
function
buildPositionNetwork
(
root
)
{
var
pointIndexes
=
[],
var
pointIndexes
=
[],
p
,
x
,
y
;
p
;
root
.
traverse
(
function
(
node
)
{
root
.
traverse
(
function
(
node
)
{
p
=
node
.
getData
(
'point'
);
p
=
node
.
getData
(
'point'
);
pointIndexes
.
push
(
{
pointIndexes
.
push
(
{
...
...
src/module/layout.default.js
View file @
02bf7378
...
@@ -112,12 +112,15 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -112,12 +112,15 @@ KityMinder.registerModule( "LayoutDefault", function () {
switch
(
node
.
getType
()
)
{
switch
(
node
.
getType
()
)
{
case
"root"
:
case
"root"
:
case
"main"
:
case
"main"
:
node
.
getBgRc
().
clear
().
addShape
(
Layout
.
bgRect
=
new
kity
.
Rect
()
);
var
bg
=
node
.
getBgRc
().
clear
();
bg
.
addShape
(
Layout
.
bgShadow
=
new
kity
.
Rect
()
);
bg
.
addShape
(
Layout
.
bgRect
=
new
kity
.
Rect
()
);
Layout
.
bgRect
.
fill
(
nodeStyle
.
fill
).
setRadius
(
nodeStyle
.
radius
);
Layout
.
bgRect
.
fill
(
nodeStyle
.
fill
).
setRadius
(
nodeStyle
.
radius
);
Layout
.
bgShadow
.
fill
(
'black'
).
setOpacity
(
0.2
).
setRadius
(
nodeStyle
.
radius
).
translate
(
3
,
5
);
break
;
break
;
case
"sub"
:
case
"sub"
:
var
underline
=
Layout
.
underline
=
new
kity
.
Path
();
var
underline
=
Layout
.
underline
=
new
kity
.
Path
();
var
highlightshape
=
Layout
.
highlightshape
=
new
kity
.
Rect
();
var
highlightshape
=
Layout
.
highlightshape
=
new
kity
.
Rect
()
.
setRadius
(
4
)
;
node
.
getBgRc
().
clear
().
addShapes
(
[
highlightshape
,
underline
]
);
node
.
getBgRc
().
clear
().
addShapes
(
[
highlightshape
,
underline
]
);
break
;
break
;
default
:
default
:
...
@@ -149,8 +152,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -149,8 +152,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
switch
(
nodeType
)
{
switch
(
nodeType
)
{
case
"root"
:
case
"root"
:
case
"main"
:
case
"main"
:
Layout
.
bgRect
.
setWidth
(
_contRCWidth
+
nodeStyle
.
padding
[
1
]
+
nodeStyle
.
padding
[
3
]
);
var
width
=
_contRCWidth
+
nodeStyle
.
padding
[
1
]
+
nodeStyle
.
padding
[
3
],
Layout
.
bgRect
.
setHeight
(
_contRCHeight
+
nodeStyle
.
padding
[
0
]
+
nodeStyle
.
padding
[
2
]
);
height
=
_contRCHeight
+
nodeStyle
.
padding
[
0
]
+
nodeStyle
.
padding
[
2
];
Layout
.
bgRect
.
setWidth
(
width
).
setHeight
(
height
);
Layout
.
bgShadow
.
setWidth
(
width
).
setHeight
(
height
);
break
;
break
;
case
"sub"
:
case
"sub"
:
var
_contWidth
=
contRc
.
getWidth
();
var
_contWidth
=
contRc
.
getWidth
();
...
...
src/module/layout.js
View file @
02bf7378
...
@@ -170,6 +170,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -170,6 +170,9 @@ KityMinder.registerModule( "LayoutModule", function () {
this
.
_lastStyleResetTimeout
=
setTimeout
(
function
()
{
this
.
_lastStyleResetTimeout
=
setTimeout
(
function
()
{
this
.
updateLayout
(
this
.
getRoot
()
);
this
.
updateLayout
(
this
.
getRoot
()
);
}.
bind
(
this
),
100
);
}.
bind
(
this
),
100
);
},
"import"
:
function
(
e
)
{
this
.
initStyle
(
this
.
getRoot
()
);
}
}
},
},
"defaultOptions"
:
{
"defaultOptions"
:
{
...
...
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