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
8bcb3716
Commit
8bcb3716
authored
Mar 10, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
merge from dev
parents
dfcf899e
613463da
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
28 deletions
+47
-28
README.md
README.md
+15
-2
index.html
dev/index.html
+1
-1
index.html
dist/index.html
+1
-1
social.js
social/social.js
+2
-1
hand.js
src/module/hand.js
+2
-1
zoom.js
src/module/zoom.js
+25
-21
kityminder.css
themes/default/css/kityminder.css
+1
-1
No files found.
README.md
View file @
8bcb3716
...
...
@@ -14,9 +14,22 @@ KM是基于SVG技术实现,使用JavaScript+html实现。支持绝大多数的
3.
Safari
4.
IE9+
## 线上版本
[
http://fex-team.baidu.com/kityminder/dist
](
http://fex-team.baidu.com/kityminder/dist
)
## 项目链接
[
直接使用链接
](
http://fex-team.github.io/kityminder/dist/
)
## 依赖说明
KityMinder 依赖 Kity 库。刚下载的压缩包或者刚从 github 拉下来的代码会有一个空的 kity 目录。要运行调试,必须加载 Kity 的依赖:
1.
如果你下载的是 KityMinder 的压缩包,那么需要手动下载
[
Kity
](
http://kitygraph.github.io/kityminder/kity/dist/kitygraph.all.js
)
库到 kity/dist/kitygraph.all.js
2.
如果你是从 github 上拉源代码下来的,那么可以更新一下子模块:
```
bash
cd
YOUR_KITYMINDER_PATH
git submodule init
git submodule update
```
## 联系我们
邮件: kity@baidu.com
...
...
dev/index.html
View file @
8bcb3716
...
...
@@ -27,6 +27,6 @@
<body>
<div
id=
"kityminder"
onselectstart=
"return false"
></div>
<body>
<
/
body>
</html>
\ No newline at end of file
dist/index.html
View file @
8bcb3716
...
...
@@ -27,6 +27,6 @@
<body>
<div
id=
"kityminder"
onselectstart=
"return false"
></div>
<body>
<
/
body>
</html>
\ No newline at end of file
social/social.js
View file @
8bcb3716
...
...
@@ -237,7 +237,8 @@ $( function () {
var
data
=
window
.
km
.
exportData
(
'json'
);
$share_btn
.
loading
(
'正在分享...'
);
var
shareUrl
=
baseUrl
+
'index.html?share_id='
+
share_id
;
var
currentUrl
=
window
.
location
.
origin
+
window
.
location
.
pathname
;
var
shareUrl
=
currentUrl
+
'?share_id='
+
share_id
;
share
(
data
,
share_id
,
function
(
success
)
{
if
(
success
)
{
var
$popup
=
$
(
'<div></div>'
).
addClass
(
'popup'
).
appendTo
(
'body'
);
...
...
src/module/hand.js
View file @
8bcb3716
...
...
@@ -113,6 +113,7 @@ KityMinder.registerModule( 'Hand', function () {
mousewheel
:
function
(
e
)
{
var
dx
,
dy
;
e
=
e
.
originEvent
;
if
(
e
.
ctrlKey
||
e
.
shiftKey
)
return
;
if
(
'wheelDeltaX'
in
e
)
{
...
...
@@ -133,7 +134,7 @@ KityMinder.registerModule( 'Hand', function () {
e
.
preventDefault
();
},
dblclick
:
function
(
e
)
{
'normal.dblclick'
:
function
(
e
)
{
if
(
e
.
getTargetNode
()
)
return
;
var
viewport
=
this
.
getPaper
().
getViewPort
();
...
...
src/module/zoom.js
View file @
8bcb3716
KityMinder
.
registerModule
(
'Zoom'
,
function
()
{
var
MAX_ZOOM
=
2
,
MIN_ZOOM
=
0.5
,
MIN_ZOOM
=
kity
.
Browser
.
chrome
?
1
:
0.5
,
ZOOM_STEP
=
Math
.
sqrt
(
2
);
function
zoom
(
minder
,
rate
)
{
...
...
@@ -28,31 +28,31 @@ KityMinder.registerModule( 'Zoom', function () {
}
}
);
animator
.
start
(
paper
,
1
00
,
'ease'
);
animator
.
start
(
paper
,
5
00
,
'ease'
);
minder
.
_zoomValue
=
zoomValue
*=
rate
;
}
var
ZoomInCommand
=
kity
.
createClass
(
'ZoomInCommand'
,
{
base
:
Command
,
execute
:
function
(
minder
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
zoom
(
minder
,
1
/
ZOOM_STEP
);
}
},
queryState
:
function
(
minder
)
{
return
(
minder
.
_zoomValue
>
MIN_ZOOM
)
?
0
:
-
1
;
return
(
minder
.
_zoomValue
>
1
/
MAX_ZOOM
)
?
0
:
-
1
;
}
}
);
var
ZoomOutCommand
=
kity
.
createClass
(
'ZoomOutCommand'
,
{
base
:
Command
,
execute
:
function
(
minder
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
zoom
(
minder
,
ZOOM_STEP
);
}
},
queryState
:
function
(
minder
)
{
return
(
minder
.
_zoomValue
<
MAX_ZOOM
)
?
0
:
-
1
;
return
(
minder
.
_zoomValue
<
1
/
MIN_ZOOM
)
?
0
:
-
1
;
}
}
);
...
...
@@ -64,26 +64,30 @@ KityMinder.registerModule( 'Zoom', function () {
events
:
{
'normal.keydown'
:
function
(
e
)
{
var
me
=
this
;
var
originEvent
=
e
.
originEvent
;
var
keyCode
=
originEvent
.
keyCode
||
originEvent
.
which
;
if
(
keymap
[
'='
]
==
keyCode
)
{
me
.
execCommand
(
'zoom-in'
);
}
if
(
keymap
[
'-'
]
==
keyCode
)
{
me
.
execCommand
(
'zoom-out'
);
'normal.keydown'
:
function
(
e
)
{
var
me
=
this
;
var
originEvent
=
e
.
originEvent
;
var
keyCode
=
originEvent
.
keyCode
||
originEvent
.
which
;
if
(
keymap
[
'='
]
==
keyCode
)
{
me
.
execCommand
(
'zoom-in'
);
}
if
(
keymap
[
'-'
]
==
keyCode
)
{
me
.
execCommand
(
'zoom-out'
);
}
},
}
},
'ready'
:
function
()
{
this
.
_zoomValue
=
1
;
},
// disable mouse wheel
'mousewheel_'
:
function
(
e
)
{
'normal.mousewheel'
:
function
(
e
)
{
if
(
!
e
.
originEvent
.
ctrlKey
)
return
;
var
delta
=
e
.
originEvent
.
wheelDelta
;
var
me
=
this
;
if
(
!
kity
.
Browser
.
mac
)
{
delta
=
-
delta
;
}
// 稀释
if
(
Math
.
abs
(
delta
)
>
100
)
{
clearTimeout
(
this
.
_wheelZoomTimeout
);
...
...
@@ -95,9 +99,9 @@ KityMinder.registerModule( 'Zoom', function () {
var
value
;
var
lastValue
=
me
.
getPaper
().
_zoom
||
1
;
if
(
delta
<
0
)
{
me
.
execCommand
(
'zoom-in'
);
me
.
execCommand
(
'zoom-in'
);
}
else
if
(
delta
>
0
)
{
me
.
execCommand
(
'zoom-out'
);
me
.
execCommand
(
'zoom-out'
);
}
},
100
);
...
...
themes/default/css/kityminder.css
View file @
8bcb3716
...
...
@@ -3,7 +3,7 @@ html, body, div {
margin
:
0
;
padding
:
0
;
}
html
,
body
,
#kity
-
minder
,
div
.kmui-editor-body
{
html
,
body
,
#kityminder
,
div
.kmui-editor-body
{
height
:
100%
;
width
:
100%
;
overflow
:
hidden
;
...
...
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