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
e67dffb4
Commit
e67dffb4
authored
Jun 26, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing something...
parent
65e58fb0
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
24 deletions
+24
-24
index.html
index.html
+4
-4
kity
kity
+1
-1
layout.js
src/core/layout.js
+5
-2
minder.data.js
src/core/minder.data.js
+1
-4
render.js
src/core/render.js
+2
-4
expand.js
src/module/expand.js
+4
-1
keyboard.js
src/module/keyboard.js
+1
-1
select.js
src/module/select.js
+5
-6
zoom.js
src/module/zoom.js
+1
-1
No files found.
index.html
View file @
e67dffb4
...
@@ -70,21 +70,21 @@
...
@@ -70,21 +70,21 @@
var
lastVersion
=
localStorage
.
lastKMVersion
;
var
lastVersion
=
localStorage
.
lastKMVersion
;
$
(
'#km-version'
).
text
(
'v'
+
KM
.
version
);
$
(
'#km-version'
).
text
(
'v'
+
KM
.
version
);
if
(
lastVersion
!=
KM
.
version
)
{
if
(
lastVersion
!=
KM
.
version
)
{
$
(
'#km-version'
).
addClass
(
'new-version'
);
$
(
'#km-version'
).
addClass
(
'new-version'
);
localStorage
.
lastKMVersion
=
KM
.
version
;
localStorage
.
lastKMVersion
=
KM
.
version
;
}
}
});
});
km
.
on
(
'unziperror'
,
function
(
ev
){
km
.
on
(
'unziperror'
,
function
(
ev
)
{
alert
(
'unziperror'
);
alert
(
'unziperror'
);
});
});
km
.
on
(
'parseerror'
,
function
(
ev
){
km
.
on
(
'parseerror'
,
function
(
ev
)
{
alert
(
'parseerror'
);
alert
(
'parseerror'
);
});
});
km
.
on
(
'unknownprotocal'
,
function
(
ev
){
km
.
on
(
'unknownprotocal'
,
function
(
ev
)
{
alert
(
'unknownprotocal'
);
alert
(
'unknownprotocal'
);
});
});
</script>
</script>
...
...
kity
@
17b22116
Subproject commit
5382742eb5b1764af2bb4fdf4fa7565318bfbb78
Subproject commit
17b221165e51ee1f69358d4d5bacfe4fe4c7d22c
src/core/layout.js
View file @
e67dffb4
...
@@ -176,8 +176,6 @@ kity.extendClass(Minder, {
...
@@ -176,8 +176,6 @@ kity.extendClass(Minder, {
root
=
root
||
this
.
getRoot
();
root
=
root
||
this
.
getRoot
();
var
me
=
this
;
var
me
=
this
;
if
(
root
.
getComplex
()
>
100
)
duration
=
0
;
function
apply
(
node
,
pMatrix
)
{
function
apply
(
node
,
pMatrix
)
{
var
matrix
=
node
.
getLayoutTransform
().
merge
(
pMatrix
);
var
matrix
=
node
.
getLayoutTransform
().
merge
(
pMatrix
);
var
lastMatrix
=
node
.
_lastLayoutTransform
||
new
kity
.
Matrix
();
var
lastMatrix
=
node
.
_lastLayoutTransform
||
new
kity
.
Matrix
();
...
@@ -202,6 +200,11 @@ kity.extendClass(Minder, {
...
@@ -202,6 +200,11 @@ kity.extendClass(Minder, {
matrix
:
value
matrix
:
value
});
});
}).
start
(
node
,
duration
,
'ease'
).
on
(
'finish'
,
function
()
{
}).
start
(
node
,
duration
,
'ease'
).
on
(
'finish'
,
function
()
{
// 可能性能低的时候会丢帧
me
.
fire
(
'layoutapply'
,
{
node
:
node
,
matrix
:
matrix
});
me
.
fire
(
'layoutfinish'
,
{
me
.
fire
(
'layoutfinish'
,
{
node
:
node
,
node
:
node
,
matrix
:
matrix
matrix
:
matrix
...
...
src/core/minder.data.js
View file @
e67dffb4
...
@@ -128,10 +128,7 @@ kity.extendClass(Minder, {
...
@@ -128,10 +128,7 @@ kity.extendClass(Minder, {
importNode
(
this
.
_root
,
json
,
this
);
importNode
(
this
.
_root
,
json
,
this
);
this
.
_root
.
preTraverse
(
function
(
node
)
{
this
.
refresh
(
500
);
node
.
render
();
});
this
.
_root
.
layout
();
this
.
fire
(
'import'
,
params
);
this
.
fire
(
'import'
,
params
);
...
...
src/core/render.js
View file @
e67dffb4
...
@@ -52,14 +52,12 @@ kity.extendClass(Minder, {
...
@@ -52,14 +52,12 @@ kity.extendClass(Minder, {
var
g
=
KityMinder
.
Geometry
;
var
g
=
KityMinder
.
Geometry
;
var
i
,
latestBox
,
renderer
;
var
i
,
latestBox
,
renderer
;
this
.
fire
(
'beforerender'
,
{
node
:
node
});
if
(
!
node
.
_renderers
)
{
if
(
!
node
.
_renderers
)
{
this
.
_createRendererForNode
(
node
);
this
.
_createRendererForNode
(
node
);
}
}
this
.
fire
(
'beforerender'
,
{
node
:
node
});
node
.
_contentBox
=
g
.
wrapBox
({
node
.
_contentBox
=
g
.
wrapBox
({
left
:
0
,
left
:
0
,
right
:
0
,
right
:
0
,
...
...
src/module/expand.js
View file @
e67dffb4
...
@@ -224,7 +224,9 @@ KityMinder.registerModule('Expand', function() {
...
@@ -224,7 +224,9 @@ KityMinder.registerModule('Expand', function() {
events
:
{
events
:
{
'layoutapply'
:
function
(
e
)
{
'layoutapply'
:
function
(
e
)
{
var
r
=
e
.
node
.
getRenderer
(
'ExpanderRenderer'
);
var
r
=
e
.
node
.
getRenderer
(
'ExpanderRenderer'
);
if
(
r
.
getRenderShape
())
{
r
.
update
(
r
.
getRenderShape
(),
e
.
node
);
r
.
update
(
r
.
getRenderShape
(),
e
.
node
);
}
},
},
'preimport'
:
function
(
e
)
{
'preimport'
:
function
(
e
)
{
var
json
=
e
.
json
;
var
json
=
e
.
json
;
...
@@ -233,6 +235,7 @@ KityMinder.registerModule('Expand', function() {
...
@@ -233,6 +235,7 @@ KityMinder.registerModule('Expand', function() {
var
node
=
e
.
node
;
var
node
=
e
.
node
;
var
visible
=
!
node
.
parent
||
node
.
parent
.
isExpanded
();
var
visible
=
!
node
.
parent
||
node
.
parent
.
isExpanded
();
node
.
getRenderContainer
().
setVisible
(
visible
);
node
.
getRenderContainer
().
setVisible
(
visible
);
if
(
!
visible
)
e
.
stopPropagation
();
}
}
},
},
renderers
:
{
renderers
:
{
...
...
src/module/keyboard.js
View file @
e67dffb4
...
@@ -139,7 +139,7 @@ KityMinder.registerModule("KeyboardModule", function() {
...
@@ -139,7 +139,7 @@ KityMinder.registerModule("KeyboardModule", function() {
var
node
=
e
.
getTargetNode
();
var
node
=
e
.
getTargetNode
();
var
lang
=
this
.
getLang
();
var
lang
=
this
.
getLang
();
this
.
receiver
.
keydownNode
=
node
;
if
(
this
.
receiver
)
this
.
receiver
.
keydownNode
=
node
;
var
keyEvent
=
e
.
originEvent
;
var
keyEvent
=
e
.
originEvent
;
...
...
src/module/select.js
View file @
e67dffb4
KityMinder
.
registerModule
(
'Select'
,
function
()
{
KityMinder
.
registerModule
(
'Select'
,
function
()
{
var
minder
=
this
;
var
minder
=
this
;
var
rc
=
minder
.
getRenderContainer
();
var
g
=
KityMinder
.
Geometry
;
var
g
=
KityMinder
.
Geometry
;
// 在实例上渲染框选矩形、计算框选范围的对象
// 在实例上渲染框选矩形、计算框选范围的对象
...
@@ -26,7 +27,7 @@ KityMinder.registerModule('Select', function() {
...
@@ -26,7 +27,7 @@ KityMinder.registerModule('Select', function() {
return
this
.
selectEnd
();
return
this
.
selectEnd
();
}
}
startPosition
=
g
.
snapToSharp
(
e
.
getPosition
(
'paper'
));
startPosition
=
g
.
snapToSharp
(
e
.
getPosition
(
rc
));
},
},
selectMove
:
function
(
e
)
{
selectMove
:
function
(
e
)
{
if
(
minder
.
getStatus
()
==
'textedit'
)
{
if
(
minder
.
getStatus
()
==
'textedit'
)
{
...
@@ -35,9 +36,7 @@ KityMinder.registerModule('Select', function() {
...
@@ -35,9 +36,7 @@ KityMinder.registerModule('Select', function() {
if
(
!
startPosition
)
return
;
if
(
!
startPosition
)
return
;
var
p1
=
startPosition
,
var
p1
=
startPosition
,
p2
=
e
.
getPosition
(
'paper'
);
p2
=
e
.
getPosition
(
rc
);
console
.
log
(
e
.
kityEvent
.
targetShape
);
// 检测是否要进入选区模式
// 检测是否要进入选区模式
if
(
!
marqueeMode
)
{
if
(
!
marqueeMode
)
{
...
@@ -47,7 +46,7 @@ KityMinder.registerModule('Select', function() {
...
@@ -47,7 +46,7 @@ KityMinder.registerModule('Select', function() {
}
}
// 已经达到阈值,记录下来并且重置选区形状
// 已经达到阈值,记录下来并且重置选区形状
marqueeMode
=
true
;
marqueeMode
=
true
;
minder
.
getPaper
()
.
addShape
(
marqueeShape
);
rc
.
addShape
(
marqueeShape
);
marqueeShape
marqueeShape
.
fill
(
minder
.
getStyle
(
'marquee-background'
))
.
fill
(
minder
.
getStyle
(
'marquee-background'
))
.
stroke
(
minder
.
getStyle
(
'marquee-stroke'
)).
setOpacity
(
0.8
).
getDrawer
().
clear
();
.
stroke
(
minder
.
getStyle
(
'marquee-stroke'
)).
setOpacity
(
0.8
).
getDrawer
().
clear
();
...
@@ -71,7 +70,7 @@ KityMinder.registerModule('Select', function() {
...
@@ -71,7 +70,7 @@ KityMinder.registerModule('Select', function() {
// 计算选中范围
// 计算选中范围
minder
.
getRoot
().
traverse
(
function
(
node
)
{
minder
.
getRoot
().
traverse
(
function
(
node
)
{
var
renderBox
=
node
.
get
RenderContainer
().
getRenderBox
(
'top'
);
var
renderBox
=
node
.
get
LayoutBox
(
);
if
(
g
.
getIntersectBox
(
renderBox
,
marquee
))
{
if
(
g
.
getIntersectBox
(
renderBox
,
marquee
))
{
selectedNodes
.
push
(
node
);
selectedNodes
.
push
(
node
);
}
}
...
...
src/module/zoom.js
View file @
e67dffb4
...
@@ -3,7 +3,7 @@ KityMinder.registerModule( 'Zoom', function () {
...
@@ -3,7 +3,7 @@ KityMinder.registerModule( 'Zoom', function () {
var
timeline
;
var
timeline
;
me
.
setOptions
(
'zoom'
,
[
50
,
80
,
100
,
120
,
150
,
200
]
);
me
.
set
Default
Options
(
'zoom'
,
[
50
,
80
,
100
,
120
,
150
,
200
]
);
function
zoomMinder
(
minder
,
zoom
)
{
function
zoomMinder
(
minder
,
zoom
)
{
var
paper
=
minder
.
getPaper
();
var
paper
=
minder
.
getPaper
();
...
...
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