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
4f8c1fb1
Commit
4f8c1fb1
authored
Apr 07, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Plain Diff
merge from dev
parents
62242512
1869f542
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
99 additions
and
47 deletions
+99
-47
CHANGELOG.md
CHANGELOG.md
+11
-0
index.html
dev/index.html
+1
-1
social.js
social/social.js
+21
-7
node.js
src/adapter/node.js
+1
-1
minder.select.js
src/core/minder.select.js
+8
-4
basestyle.js
src/module/basestyle.js
+2
-2
editor.js
src/module/editor.js
+3
-0
keyboard.js
src/module/keyboard.js
+2
-19
layout.default.js
src/module/layout.default.js
+22
-3
layout.js
src/module/layout.js
+24
-9
png.js
src/protocal/png.js
+2
-0
svg.js
src/protocal/svg.js
+2
-1
No files found.
CHANGELOG.md
View file @
4f8c1fb1
# KityMinder 更新日志
## v1.2.0
### 功能更新
1.
支持本地格式文件导入
*
支持文件拖拽和网盘文件导入
*
格式支持xmind/freemind/mindmanager,其他格式不支持
*
支持标签,包括优先级和任务进度
2.
新增节点移动到视野中
## v1.1.1
### 功能更新
...
...
@@ -15,6 +25,7 @@
1.
修复切换文件时,回复历史没有清空的问题
2.
修复在添加 markers 时,会出现 js 报错的问题
3.
仅有根节点,将其删除,再添加节点报错
## v1.1.0
...
...
dev/index.html
View file @
4f8c1fb1
...
...
@@ -23,7 +23,7 @@
<link
href=
"../themes/default/css/import.css"
type=
"text/css"
rel=
"stylesheet"
/>
<link
href=
"../dialogs/dialogs.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"favicon.ico"
type=
"image/x-icon"
rel=
"shortcut icon"
>
</head>
<body>
...
...
social/social.js
View file @
4f8c1fb1
...
...
@@ -115,6 +115,9 @@ $( function () {
click
:
function
()
{
window
.
open
(
'http://pan.baidu.com/disk/home#dir/path=/apps/kityminder'
);
}
},
{
label
:
'注销'
,
click
:
logout
},
{
divider
:
true
}
]
...
...
@@ -261,16 +264,27 @@ $( function () {
}
);
}
function
logout
()
{
baidu
.
frontia
.
logOutCurrentAccount
();
setAccount
(
null
);
}
// 设置用户后为其初始化
function
setAccount
(
account
)
{
currentAccount
=
account
;
$user_btn
.
prependTo
(
$panel
);
$save_btn
.
appendTo
(
$panel
);
$share_btn
.
appendTo
(
$panel
);
$login_btn
.
detach
();
loadAvator
();
loadRecent
();
window
.
location
.
hash
=
''
;
if
(
account
)
{
$user_btn
.
prependTo
(
$panel
);
$save_btn
.
appendTo
(
$panel
);
$share_btn
.
appendTo
(
$panel
);
$login_btn
.
detach
();
loadAvator
();
loadRecent
();
window
.
location
.
hash
=
''
;
}
else
{
$user_btn
.
detach
();
$save_btn
.
detach
();
$login_btn
.
prependTo
(
$panel
);
}
}
// 加载用户头像
...
...
src/adapter/node.js
View file @
4f8c1fb1
...
...
@@ -28,7 +28,7 @@ KM.registerToolbarUI( 'node', function ( name ) {
comboboxWidget
=
$combox
.
kmui
();
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
me
.
execCommand
(
res
.
value
,
new
MinderNode
(
me
.
getLang
().
topic
)
);
me
.
execCommand
(
res
.
value
,
new
MinderNode
(
me
.
getLang
().
topic
)
,
true
);
}
).
on
(
"beforeshow"
,
function
()
{
if
(
$combox
.
parent
().
length
===
0
)
{
$combox
.
appendTo
(
me
.
$container
.
find
(
'.kmui-dialog-container'
)
);
...
...
src/core/minder.select.js
View file @
4f8c1fb1
// 选区管理
kity
.
extendClass
(
Minder
,
function
()
{
function
highlightNode
(
km
,
node
)
{
node
.
setTmpData
(
"highlight"
,
true
);
km
.
highlightNode
(
node
);
if
(
node
){
node
.
setTmpData
(
"highlight"
,
true
);
km
.
highlightNode
(
node
);
}
}
function
unhighlightNode
(
km
,
node
)
{
node
.
setTmpData
(
"highlight"
,
false
);
km
.
highlightNode
(
node
);
if
(
node
){
node
.
setTmpData
(
"highlight"
,
false
);
km
.
highlightNode
(
node
);
}
}
return
{
_initSelection
:
function
()
{
...
...
src/module/basestyle.js
View file @
4f8c1fb1
...
...
@@ -30,7 +30,7 @@ KityMinder.registerModule( "basestylemodule", function () {
return
-
1
;
}
utils
.
each
(
nodes
,
function
(
i
,
n
){
if
(
n
.
getData
(
'bold'
)
){
if
(
n
&&
n
.
getData
(
'bold'
)
){
result
=
1
;
return
false
;
}
...
...
@@ -65,7 +65,7 @@ KityMinder.registerModule( "basestylemodule", function () {
return
-
1
;
}
utils
.
each
(
nodes
,
function
(
i
,
n
){
if
(
n
.
getData
(
'italic'
)
){
if
(
n
&&
n
.
getData
(
'italic'
)
){
result
=
1
;
return
false
;
}
...
...
src/module/editor.js
View file @
4f8c1fb1
...
...
@@ -142,6 +142,9 @@ KityMinder.registerModule( "TextEditModule", function () {
if
(
cmds
[
e
.
commandName
]){
var
node
=
km
.
getSelectedNode
();
if
(
!
node
){
return
;
}
var
textShape
=
node
.
getTextShape
();
...
...
src/module/keyboard.js
View file @
4f8c1fb1
...
...
@@ -49,32 +49,16 @@ KityMinder.registerModule( "KeyboardModule", function () {
};
}
function
coefForX
(
a
,
b
)
{
return
0.1
*
min
(
abs
(
a
.
top
-
b
.
top
),
abs
(
a
.
bottom
-
b
.
bottom
)
)
+
1
;
}
function
coefForY
(
a
,
b
)
{
return
0.1
*
min
(
abs
(
a
.
left
-
b
.
left
),
abs
(
a
.
right
-
b
.
right
)
)
+
1
;
}
function
findClosestPointsFor
(
pointIndexes
,
iFind
)
{
var
find
=
pointIndexes
[
iFind
];
var
most
=
{},
quad
;
var
current
,
dist
;
var
table
=
[];
console
.
log
(
'table for '
+
find
.
text
);
for
(
var
i
=
0
;
i
<
pointIndexes
.
length
;
i
++
)
{
if
(
i
==
iFind
)
continue
;
current
=
pointIndexes
[
i
];
dist
=
getCoefedDistance
(
current
,
find
);
table
.
push
(
{
text
:
current
.
text
,
dist
:
dist
.
cx
}
);
// left check
if
(
current
.
right
<
find
.
left
)
{
if
(
!
most
.
left
||
dist
.
cx
<
most
.
left
.
dist
)
{
...
...
@@ -115,7 +99,6 @@ KityMinder.registerModule( "KeyboardModule", function () {
}
}
}
console
.
table
(
table
);
find
.
node
.
_nearestNodes
=
{
right
:
most
.
right
&&
most
.
right
.
node
||
null
,
top
:
most
.
top
&&
most
.
top
.
node
||
null
,
...
...
@@ -151,11 +134,11 @@ KityMinder.registerModule( "KeyboardModule", function () {
this
.
receiver
.
keydownNode
=
node
;
switch
(
e
.
originEvent
.
keyCode
)
{
case
keys
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
);
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
,
true
);
e
.
preventDefault
();
break
;
case
keys
.
Tab
:
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
);
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
,
true
);
e
.
preventDefault
();
break
;
case
keys
.
Backspace
:
...
...
src/module/layout.default.js
View file @
4f8c1fb1
...
...
@@ -393,6 +393,21 @@ KityMinder.registerModule( "LayoutDefault", function () {
Layout
.
shicon
.
update
();
}
};
var
showNodeInView
=
function
(
node
){
var
padding
=
5
;
var
viewport
=
minder
.
getPaper
().
getViewPort
();
var
offset
=
node
.
getRenderContainer
().
getRenderBox
(
minder
.
getRenderContainer
()
);
var
tmpX
=
viewport
.
center
.
x
*
2
-
(
offset
.
x
+
offset
.
width
);
var
tmpY
=
viewport
.
center
.
y
*
2
-
(
offset
.
y
+
offset
.
height
);
var
dx
=
offset
.
x
<
0
?
-
offset
.
x
:
Math
.
min
(
tmpX
,
0
);
var
dy
=
offset
.
y
<
0
?
-
offset
.
y
:
Math
.
min
(
tmpY
,
0
);
km
.
getRenderContainer
().
fxTranslate
(
dx
,
dy
,
100
,
"easeOutQuint"
);
};
var
_style
=
{
highlightNode
:
function
(
node
)
{
var
highlight
=
node
.
isHighlight
();
...
...
@@ -485,7 +500,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
_root
.
setPoint
(
_root
.
getLayout
().
x
,
_root
.
getLayout
().
y
);
},
appendChildNode
:
function
(
parent
,
node
,
sibling
)
{
appendChildNode
:
function
(
parent
,
node
,
focus
,
sibling
)
{
minder
.
handelNodeInsert
(
node
);
node
.
clearLayout
();
var
Layout
=
node
.
getLayout
();
...
...
@@ -569,10 +584,14 @@ KityMinder.registerModule( "LayoutDefault", function () {
translateNode
(
set
[
i
]
);
updateConnectAndshIcon
(
set
[
i
]
);
}
if
(
focus
){
showNodeInView
(
node
);
}
},
appendSiblingNode
:
function
(
sibling
,
node
)
{
appendSiblingNode
:
function
(
sibling
,
node
,
focus
)
{
var
parent
=
sibling
.
getParent
();
this
.
appendChildNode
(
parent
,
node
,
sibling
);
this
.
appendChildNode
(
parent
,
node
,
focus
,
sibling
);
},
removeNode
:
function
(
nodes
)
{
while
(
nodes
.
length
!==
0
)
{
...
...
src/module/layout.js
View file @
4f8c1fb1
...
...
@@ -40,13 +40,13 @@ KityMinder.registerModule( "LayoutModule", function () {
}
);
this
.
getLayoutStyle
(
curStyle
).
initStyle
.
call
(
this
);
},
appendChildNode
:
function
(
parent
,
node
,
index
)
{
appendChildNode
:
function
(
parent
,
node
,
focus
,
index
)
{
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
appendChildNode
.
call
(
this
,
parent
,
node
,
index
);
this
.
getLayoutStyle
(
curStyle
).
appendChildNode
.
call
(
this
,
parent
,
node
,
focus
,
index
);
},
appendSiblingNode
:
function
(
sibling
,
node
)
{
appendSiblingNode
:
function
(
sibling
,
node
,
focus
)
{
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
appendSiblingNode
.
call
(
this
,
sibling
,
node
);
this
.
getLayoutStyle
(
curStyle
).
appendSiblingNode
.
call
(
this
,
sibling
,
node
,
focus
);
},
removeNode
:
function
(
nodes
)
{
var
curStyle
=
this
.
getCurrentStyle
();
...
...
@@ -104,12 +104,18 @@ KityMinder.registerModule( "LayoutModule", function () {
var
AppendChildNodeCommand
=
kity
.
createClass
(
"AppendChildNodeCommand"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
,
node
)
{
execute
:
function
(
km
,
node
,
focus
,
silbling
)
{
var
parent
=
km
.
getSelectedNode
();
if
(
!
parent
){
return
null
;
}
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
getData
(
"expand"
)
===
false
)
{
km
.
expandNode
(
parent
);
}
km
.
appendChildNode
(
parent
,
node
);
km
.
appendChildNode
(
parent
,
node
,
focus
,
silbling
);
km
.
select
(
node
,
true
);
return
node
;
},
...
...
@@ -126,13 +132,17 @@ KityMinder.registerModule( "LayoutModule", function () {
var
AppendSiblingNodeCommand
=
kity
.
createClass
(
"AppendSiblingNodeCommand"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
,
node
)
{
execute
:
function
(
km
,
node
,
focus
)
{
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
){
return
null
;
}
if
(
selectedNode
.
isRoot
()
)
{
node
.
setType
(
"main"
);
km
.
appendChildNode
(
selectedNode
,
node
);
km
.
appendChildNode
(
selectedNode
,
node
,
focus
);
}
else
{
km
.
appendSiblingNode
(
selectedNode
,
node
);
km
.
appendSiblingNode
(
selectedNode
,
node
,
focus
);
}
km
.
select
(
node
,
true
);
return
node
;
...
...
@@ -152,6 +162,11 @@ KityMinder.registerModule( "LayoutModule", function () {
return
{
base
:
Command
,
execute
:
function
(
km
)
{
if
(
km
.
getRoot
().
children
.
length
==
0
){
return
;
}
var
selectedNodes
=
km
.
getSelectedNodes
();
var
_root
=
km
.
getRoot
();
var
_buffer
=
[];
...
...
src/protocal/png.js
View file @
4f8c1fb1
...
...
@@ -31,6 +31,8 @@ KityMinder.registerProtocal( "png", function () {
renderContainer
.
translate
(
-
renderBox
.
x
,
-
renderBox
.
y
);
svgXml
=
km
.
getPaper
().
container
.
innerHTML
;
// svg 含有 符号导出报错 Entity 'nbsp' not defined
svgXml
=
svgXml
.
replace
(
/ /g
,
' '
).
replace
(
/
\s
+/g
,
' '
);
renderContainer
.
translate
(
renderBox
.
x
,
renderBox
.
y
);
...
...
src/protocal/svg.js
View file @
4f8c1fb1
...
...
@@ -3,7 +3,8 @@ KityMinder.registerProtocal( "svg", function () {
fileDescription
:
'SVG 矢量图'
,
fileExtension
:
'.svg'
,
encode
:
function
(
json
,
km
)
{
return
km
.
getPaper
().
container
.
innerHTML
;
// svg 含有 符号导出报错 Entity 'nbsp' not defined
return
km
.
getPaper
().
container
.
innerHTML
.
replace
(
/ /g
,
' '
);
},
recognizePriority
:
-
1
};
...
...
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