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
677aeef7
Commit
677aeef7
authored
Feb 14, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui
parent
ff767e18
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 @
677aeef7
...
...
@@ -16,6 +16,7 @@ $dependency = Array(
,
'src/core/keymap.js'
,
'src/core/minder.lang.js'
,
'src/core/minder.defaultoptions.js'
,
'src/module/background.js'
,
'src/module/history.js'
,
'src/module/icon.js'
,
'src/module/layout.js'
...
...
src/core/minder.data.js
View file @
677aeef7
...
...
@@ -9,7 +9,7 @@ Utils.extend( KityMinder, {
getSupportedProtocals
:
function
()
{
return
Utils
.
keys
(
KityMinder
.
_protocals
);
},
getAllRegisteredProtocals
:
function
()
{
getAllRegisteredProtocals
:
function
()
{
return
KityMinder
.
_protocals
}
}
);
...
...
@@ -33,6 +33,7 @@ function importNode( node, json ) {
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
}
node
.
setText
(
data
.
text
);
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
...
...
src/core/minder.js
View file @
677aeef7
...
...
@@ -37,7 +37,6 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_paper
=
new
kity
.
Paper
();
this
.
_paper
.
getNode
().
setAttribute
(
'contenteditable'
,
true
);
this
.
_addBackground
();
this
.
_addRenderContainer
();
this
.
_root
=
new
MinderNode
(
"Main Topic"
);
...
...
@@ -50,21 +49,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_rc
=
new
kity
.
Group
();
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
)
{
this
.
_paper
.
renderTo
(
this
.
_renderTarget
=
target
);
this
.
_bindEvents
();
...
...
src/module/keyboard.js
View file @
677aeef7
...
...
@@ -2,7 +2,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
function
buildPositionNetwork
(
root
)
{
var
pointIndexes
=
[],
p
,
x
,
y
;
p
;
root
.
traverse
(
function
(
node
)
{
p
=
node
.
getData
(
'point'
);
pointIndexes
.
push
(
{
...
...
src/module/layout.default.js
View file @
677aeef7
...
...
@@ -112,12 +112,15 @@ KityMinder.registerModule( "LayoutDefault", function () {
switch
(
node
.
getType
()
)
{
case
"root"
:
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
.
bgShadow
.
fill
(
'black'
).
setOpacity
(
0.2
).
setRadius
(
nodeStyle
.
radius
).
translate
(
3
,
5
);
break
;
case
"sub"
:
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
]
);
break
;
default
:
...
...
@@ -149,8 +152,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
switch
(
nodeType
)
{
case
"root"
:
case
"main"
:
Layout
.
bgRect
.
setWidth
(
_contRCWidth
+
nodeStyle
.
padding
[
1
]
+
nodeStyle
.
padding
[
3
]
);
Layout
.
bgRect
.
setHeight
(
_contRCHeight
+
nodeStyle
.
padding
[
0
]
+
nodeStyle
.
padding
[
2
]
);
var
width
=
_contRCWidth
+
nodeStyle
.
padding
[
1
]
+
nodeStyle
.
padding
[
3
],
height
=
_contRCHeight
+
nodeStyle
.
padding
[
0
]
+
nodeStyle
.
padding
[
2
];
Layout
.
bgRect
.
setWidth
(
width
).
setHeight
(
height
);
Layout
.
bgShadow
.
setWidth
(
width
).
setHeight
(
height
);
break
;
case
"sub"
:
var
_contWidth
=
contRc
.
getWidth
();
...
...
src/module/layout.js
View file @
677aeef7
...
...
@@ -170,6 +170,9 @@ KityMinder.registerModule( "LayoutModule", function () {
this
.
_lastStyleResetTimeout
=
setTimeout
(
function
()
{
this
.
updateLayout
(
this
.
getRoot
()
);
}.
bind
(
this
),
100
);
},
"import"
:
function
(
e
)
{
this
.
initStyle
(
this
.
getRoot
()
);
}
},
"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