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
1c1c0355
Commit
1c1c0355
authored
Jun 11, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:fex-team/kityminder into dev
parents
c38aad81
41c9ddf3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
73 deletions
+11
-73
import.js
import.js
+2
-1
bottom.js
src/layout/bottom.js
+0
-70
default.js
src/layout/default.js
+1
-1
mindmanager.js
src/protocal/mindmanager.js
+3
-0
xmind.js
src/protocal/xmind.js
+4
-0
bottom.js
src/theme/bottom.js
+1
-1
No files found.
import.js
View file @
1c1c0355
...
...
@@ -27,8 +27,10 @@
'core/theme.js'
,
'layout/default.js'
,
'layout/bottom.js'
,
'layout/filetree.js'
,
'theme/default.js'
,
'theme/bottom.js'
,
'theme/filetree.js'
,
'module/node.js'
,
'module/text.js'
,
'module/outline.js'
,
...
...
@@ -54,7 +56,6 @@
'module/nodetext.js'
,
'module/hyperlink.js'
,
'module/expand.js'
,
'module/connect.js'
,
'ui/jquery-ui-1.10.4.custom.min.js'
,
'ui/widget.js'
,
'ui/button.js'
,
...
...
src/layout/bottom.js
View file @
1c1c0355
...
...
@@ -48,79 +48,9 @@ KityMinder.registerLayout('bottom', kity.createClass({
x
+=
children
[
i
].
getStyle
(
'margin-left'
);
}
y
=
nodeContentBox
.
height
+
node
.
getStyle
(
'margin-bottom'
)
+
children
[
i
].
getStyle
(
'margin-top'
);
console
.
log
(
y
);
children
[
i
].
setLayoutTransform
(
new
kity
.
Matrix
().
translate
(
x
,
y
));
x
+=
childTreeBox
.
width
/
2
+
children
[
i
].
getStyle
(
'margin-right'
);
}
}
// if (!children.length) return;
// var _this = this;
// // children 所占的总树高
// var totalTreeHeight = 0;
// // 计算每个 child 的树所占的矩形区域
// var childTreeBoxes = children.map(function(node, index, children) {
// var box = _this.getTreeBox([node]);
// // 计算总树高,需要把竖直方向上的 margin 加入计算
// totalTreeHeight += box.height;
// if (index > 0) {
// totalTreeHeight += children[index - 1].getStyle('margin-bottom');
// totalTreeHeight += node.getStyle('margin-top');
// }
// return box;
// });
// var nodeContentBox = parent.getContentBox();
// var i, x, y, child, childTreeBox, childContentBox;
// var transform = new kity.Matrix();
// y = -totalTreeHeight / 2 - 200;
// for (i = 0; i < children.length; i++) {
// child = children[i];
// childTreeBox = childTreeBoxes[i];
// childContentBox = child.getContentBox();
// if (!childContentBox.height) continue;
// // 水平方向上的布局
// if (side == 'right') {
// x = nodeContentBox.right - childContentBox.left;
// x += parent.getStyle('margin-right') + child.getStyle('margin-left');
// child.setLayoutVector(new kity.Vector(childContentBox.left, childContentBox.cy));
// } else {
// x = nodeContentBox.left - childContentBox.right;
// x -= parent.getStyle('margin-left') + child.getStyle('margin-right');
// child.setLayoutVector(new kity.Vector(childContentBox.right, childContentBox.cy));
// }
// // 竖直方向上的布局
// y += childTreeBox.height / 2;
// if (i > 0) {
// y += children[i].getStyle('margin-top');
// }
// children[i].setLayoutTransform(new kity.Matrix().translate(x, y));
// y += childTreeBox.height / 2 + children[i].getStyle('margin-bottom');
// }
// if (parent.isRoot()) {
// var branchBox = this.getBranchBox(children);
// var dy = branchBox.cy - nodeContentBox.cy;
// children.forEach(function(child) {
// child.getLayoutTransform().translate(0, -dy);
// });
// }
// }
}
}));
\ No newline at end of file
src/layout/default.js
View file @
1c1c0355
...
...
@@ -160,4 +160,4 @@ KityMinder.registerConnectProvider('default', function(node, parent) {
}
return
pathData
;
});
});
\ No newline at end of file
src/protocal/mindmanager.js
View file @
1c1c0355
...
...
@@ -94,14 +94,17 @@ KityMinder.registerProtocal( 'mindmanager', function () {
then
:
function
(
local
,
callback
)
{
getEntries
(
local
,
function
(
entries
)
{
var
hasMainDoc
=
false
;
entries
.
forEach
(
function
(
entry
)
{
if
(
entry
.
filename
==
'Document.xml'
)
{
hasMainDoc
=
true
;
entry
.
getData
(
new
zip
.
TextWriter
(),
function
(
text
)
{
var
km
=
xml2km
(
$
.
parseXML
(
text
)
);
callback
&&
callback
(
km
);
}
);
}
}
);
!
hasMainDoc
&&
alert
(
'找不到文件主文档,请检查文件是否是合法mindmanager格式文件'
);
}
);
}
};
...
...
src/protocal/xmind.js
View file @
1c1c0355
...
...
@@ -100,14 +100,18 @@ KityMinder.registerProtocal( 'xmind', function () {
then
:
function
(
local
,
callback
){
getEntries
(
local
,
function
(
entries
)
{
var
hasMainDoc
=
false
;
entries
.
forEach
(
function
(
entry
)
{
if
(
entry
.
filename
==
'content.xml'
){
hasMainDoc
=
true
;
entry
.
getData
(
new
zip
.
TextWriter
(),
function
(
text
)
{
var
km
=
xml2km
(
$
.
parseXML
(
text
));
callback
&&
callback
(
km
);
});
}
});
!
hasMainDoc
&&
alert
(
'找不到文件主文档,请检查文件是否是合法xmind格式文件'
);
});
}
};
...
...
src/theme/bottom.js
View file @
1c1c0355
...
...
@@ -4,7 +4,7 @@ KityMinder.registerTheme('bottom', {
'root-stroke'
:
'none'
,
'root-font-size'
:
24
,
'root-padding'
:
[
15
,
25
],
'root-margin'
:
10
0
,
'root-margin'
:
0
,
'root-radius'
:
30
,
'root-space'
:
10
,
...
...
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