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
93fef115
Commit
93fef115
authored
Apr 09, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
Conflicts: CHANGELOG.md
parents
d91d507d
52b2e4e0
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
87 additions
and
32 deletions
+87
-32
CHANGELOG.md
CHANGELOG.md
+6
-3
favicon.ico
dev/favicon.ico
+0
-0
index.html
dev/index.html
+2
-1
favicon.ico
dist/favicon.ico
+0
-0
index.html
dist/index.html
+2
-0
publish
publish
+3
-0
social.js
social/social.js
+1
-1
node.js
src/adapter/node.js
+1
-1
minder.data.js
src/core/minder.data.js
+4
-3
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
-2
layout.default.js
src/module/layout.default.js
+22
-3
layout.js
src/module/layout.js
+24
-9
mindmanager.js
src/protocal/mindmanager.js
+1
-1
png.js
src/protocal/png.js
+4
-1
svg.js
src/protocal/svg.js
+2
-1
No files found.
CHANGELOG.md
View file @
93fef115
...
...
@@ -4,9 +4,11 @@
## v1.2.0
### 功能更新
1.
支持本地格式文件导入,包括拖文件和从网盘中打开,格式包含xmind/freemind/mindmanager
2.
添加只读模式,配置项 readOnly,添加动态调用接口setEnabled,setDisabled
1.
支持本地格式文件导入
*
支持文件拖拽和网盘文件导入
*
格式支持xmind/freemind/mindmanager,其他格式不支持
*
支持标签,包括优先级和任务进度
2.
新增节点移动到视野中
## v1.1.1
...
...
@@ -23,6 +25,7 @@
1.
修复切换文件时,回复历史没有清空的问题
2.
修复在添加 markers 时,会出现 js 报错的问题
3.
仅有根节点,将其删除,再添加节点报错
## v1.1.0
...
...
dev/favicon.ico
0 → 100644
View file @
93fef115
66.1 KB
dev/index.html
View file @
93fef115
...
...
@@ -23,7 +23,8 @@
<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"
>
<link
href=
"favicon.ico"
type=
"image/x-icon"
rel=
"apple-touch-icon-precomposed"
>
</head>
<body>
...
...
dist/favicon.ico
0 → 100644
View file @
93fef115
66.1 KB
dist/index.html
View file @
93fef115
...
...
@@ -19,6 +19,8 @@
<link
href=
"../dialogs/dialogs.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
rel=
"stylesheet"
href=
"css/links.css"
/>
<link
href=
"favicon.ico"
type=
"image/x-icon"
rel=
"shortcut icon"
>
<link
href=
"favicon.ico"
type=
"image/x-icon"
rel=
"apple-touch-icon-precomposed"
>
</head>
...
...
publish
View file @
93fef115
...
...
@@ -2,6 +2,9 @@ echo -e "\033[0;33;1mPublish start."
echo -e "\033[0;33;1m> Checking out gh-pages\033[0m"
git checkout -q gh-pages
echo -e "\033[0;33;1m> Merging server changes\033[0m"
git pull origin gh-pages
echo -e "\033[0;33;1m> Merging dev commits\033[0m"
git merge dev -qm "merge from dev"
...
...
social/social.js
View file @
93fef115
...
...
@@ -179,7 +179,7 @@ $( function () {
// 检查 URL 是否分享连接,是则加载分享内容
function
loadShare
()
{
var
pattern
=
/
shareId
=
(\w
+
)([
&#
]
|$
)
/
;
var
pattern
=
/
(?:
shareId|share_id
)
=
(\w
+
)([
&#
]
|$
)
/
;
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
if
(
!
match
)
return
;
...
...
src/adapter/node.js
View file @
93fef115
...
...
@@ -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.data.js
View file @
93fef115
...
...
@@ -32,7 +32,8 @@ function exportNode( node ) {
var
DEFAULT_TEXT
=
{
'root'
:
'maintopic'
,
'main'
:
'topic'
'main'
:
'topic'
,
'sub'
:
'topic'
};
function
importNode
(
node
,
json
,
km
)
{
...
...
@@ -40,14 +41,14 @@ function importNode( node, json, km ) {
for
(
var
field
in
data
)
{
node
.
setData
(
field
,
data
[
field
]
);
}
node
.
setText
(
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
data
.
type
]
)
);
node
.
setText
(
data
.
text
||
km
.
getLang
(
DEFAULT_TEXT
[
node
.
getType
()
]
)
);
var
childrenTreeData
=
json
.
children
;
if
(
!
childrenTreeData
)
return
;
for
(
var
i
=
0
;
i
<
childrenTreeData
.
length
;
i
++
)
{
var
childNode
=
new
MinderNode
();
importNode
(
childNode
,
childrenTreeData
[
i
],
km
);
node
.
appendChild
(
childNode
);
importNode
(
childNode
,
childrenTreeData
[
i
],
km
);
}
return
node
;
}
...
...
src/core/minder.select.js
View file @
93fef115
// 选区管理
kity
.
extendClass
(
Minder
,
function
()
{
function
highlightNode
(
km
,
node
)
{
if
(
node
){
node
.
setTmpData
(
"highlight"
,
true
);
km
.
highlightNode
(
node
);
}
}
function
unhighlightNode
(
km
,
node
)
{
if
(
node
){
node
.
setTmpData
(
"highlight"
,
false
);
km
.
highlightNode
(
node
);
}
}
return
{
_initSelection
:
function
()
{
this
.
_selectedNodes
=
[];
...
...
src/module/basestyle.js
View file @
93fef115
...
...
@@ -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 @
93fef115
...
...
@@ -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 @
93fef115
...
...
@@ -134,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 @
93fef115
...
...
@@ -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 @
93fef115
...
...
@@ -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/mindmanager.js
View file @
93fef115
...
...
@@ -25,7 +25,7 @@ KityMinder.registerProtocal( 'mindmanager', function () {
function
processTopic
(
topic
,
obj
){
//处理文本
obj
.
data
=
{
text
:
topic
.
Text
&&
topic
.
Text
.
PlainText
||
'
_
'
};
// 节点默认的文本,没有Text属性
obj
.
data
=
{
text
:
topic
.
Text
&&
topic
.
Text
.
PlainText
||
''
};
// 节点默认的文本,没有Text属性
// 处理标签
if
(
topic
.
Task
){
...
...
src/protocal/png.js
View file @
93fef115
...
...
@@ -44,6 +44,9 @@ KityMinder.registerProtocal( "png", function () {
// need a xml with width and height
svgXml
=
$
(
'<div></div'
).
append
(
$svg
).
html
();
// svg 含有 符号导出报错 Entity 'nbsp' not defined
svgXml
=
svgXml
.
replace
(
/ /g
,
' '
);
blob
=
new
Blob
(
[
svgXml
],
{
type
:
"image/svg+xml;charset=utf-8"
}
);
...
...
src/protocal/svg.js
View file @
93fef115
...
...
@@ -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