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
8292538a
Commit
8292538a
authored
Mar 10, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dist
parent
613463da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
26 deletions
+31
-26
kityminder.all.js
dist/kityminder.all.js
+28
-23
kityminder.all.min.js
dist/kityminder.all.min.js
+3
-3
No files found.
dist/kityminder.all.js
View file @
8292538a
/*!
/*!
* ====================================================
* ====================================================
* kityminder - v1.0.0 - 2014-03-
07
* kityminder - v1.0.0 - 2014-03-
10
* https://github.com/fex-team/kityminder
* https://github.com/fex-team/kityminder
* GitHub: https://github.com/fex-team/kityminder.git
* GitHub: https://github.com/fex-team/kityminder.git
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
...
@@ -3555,6 +3555,7 @@ KityMinder.registerModule( 'Hand', function () {
...
@@ -3555,6 +3555,7 @@ KityMinder.registerModule( 'Hand', function () {
mousewheel
:
function
(
e
)
{
mousewheel
:
function
(
e
)
{
var
dx
,
dy
;
var
dx
,
dy
;
e
=
e
.
originEvent
;
e
=
e
.
originEvent
;
if
(
e
.
ctrlKey
||
e
.
shiftKey
)
return
;
if
(
'wheelDeltaX'
in
e
)
{
if
(
'wheelDeltaX'
in
e
)
{
...
@@ -3575,7 +3576,7 @@ KityMinder.registerModule( 'Hand', function () {
...
@@ -3575,7 +3576,7 @@ KityMinder.registerModule( 'Hand', function () {
e
.
preventDefault
();
e
.
preventDefault
();
},
},
dblclick
:
function
(
e
)
{
'normal.dblclick'
:
function
(
e
)
{
if
(
e
.
getTargetNode
()
)
return
;
if
(
e
.
getTargetNode
()
)
return
;
var
viewport
=
this
.
getPaper
().
getViewPort
();
var
viewport
=
this
.
getPaper
().
getViewPort
();
...
@@ -5027,7 +5028,7 @@ KityMinder.registerModule( "fontmodule", function () {
...
@@ -5027,7 +5028,7 @@ KityMinder.registerModule( "fontmodule", function () {
KityMinder
.
registerModule
(
'Zoom'
,
function
()
{
KityMinder
.
registerModule
(
'Zoom'
,
function
()
{
var
MAX_ZOOM
=
2
,
var
MAX_ZOOM
=
2
,
MIN_ZOOM
=
0.5
,
MIN_ZOOM
=
kity
.
Browser
.
chrome
?
1
:
0.5
,
ZOOM_STEP
=
Math
.
sqrt
(
2
);
ZOOM_STEP
=
Math
.
sqrt
(
2
);
function
zoom
(
minder
,
rate
)
{
function
zoom
(
minder
,
rate
)
{
...
@@ -5055,31 +5056,31 @@ KityMinder.registerModule( 'Zoom', function () {
...
@@ -5055,31 +5056,31 @@ KityMinder.registerModule( 'Zoom', function () {
}
}
}
);
}
);
animator
.
start
(
paper
,
1
00
,
'ease'
);
animator
.
start
(
paper
,
5
00
,
'ease'
);
minder
.
_zoomValue
=
zoomValue
*=
rate
;
minder
.
_zoomValue
=
zoomValue
*=
rate
;
}
}
var
ZoomInCommand
=
kity
.
createClass
(
'ZoomInCommand'
,
{
var
ZoomInCommand
=
kity
.
createClass
(
'ZoomInCommand'
,
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
minder
)
{
execute
:
function
(
minder
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
zoom
(
minder
,
1
/
ZOOM_STEP
);
zoom
(
minder
,
1
/
ZOOM_STEP
);
}
}
},
},
queryState
:
function
(
minder
)
{
queryState
:
function
(
minder
)
{
return
(
minder
.
_zoomValue
>
MIN_ZOOM
)
?
0
:
-
1
;
return
(
minder
.
_zoomValue
>
1
/
MAX_ZOOM
)
?
0
:
-
1
;
}
}
}
);
}
);
var
ZoomOutCommand
=
kity
.
createClass
(
'ZoomOutCommand'
,
{
var
ZoomOutCommand
=
kity
.
createClass
(
'ZoomOutCommand'
,
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
minder
)
{
execute
:
function
(
minder
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
if
(
!
this
.
queryState
(
minder
)
)
{
zoom
(
minder
,
ZOOM_STEP
);
zoom
(
minder
,
ZOOM_STEP
);
}
}
},
},
queryState
:
function
(
minder
)
{
queryState
:
function
(
minder
)
{
return
(
minder
.
_zoomValue
<
MAX_ZOOM
)
?
0
:
-
1
;
return
(
minder
.
_zoomValue
<
1
/
MIN_ZOOM
)
?
0
:
-
1
;
}
}
}
);
}
);
...
@@ -5091,26 +5092,30 @@ KityMinder.registerModule( 'Zoom', function () {
...
@@ -5091,26 +5092,30 @@ KityMinder.registerModule( 'Zoom', function () {
events
:
{
events
:
{
'normal.keydown'
:
function
(
e
)
{
'normal.keydown'
:
function
(
e
)
{
var
me
=
this
;
var
me
=
this
;
var
originEvent
=
e
.
originEvent
;
var
originEvent
=
e
.
originEvent
;
var
keyCode
=
originEvent
.
keyCode
||
originEvent
.
which
;
var
keyCode
=
originEvent
.
keyCode
||
originEvent
.
which
;
if
(
keymap
[
'='
]
==
keyCode
)
{
if
(
keymap
[
'='
]
==
keyCode
)
{
me
.
execCommand
(
'zoom-in'
);
me
.
execCommand
(
'zoom-in'
);
}
}
if
(
keymap
[
'-'
]
==
keyCode
)
{
if
(
keymap
[
'-'
]
==
keyCode
)
{
me
.
execCommand
(
'zoom-out'
);
me
.
execCommand
(
'zoom-out'
);
}
}
},
},
'ready'
:
function
()
{
'ready'
:
function
()
{
this
.
_zoomValue
=
1
;
this
.
_zoomValue
=
1
;
},
},
// disable mouse wheel
'normal.mousewheel'
:
function
(
e
)
{
'mousewheel_'
:
function
(
e
)
{
if
(
!
e
.
originEvent
.
ctrlKey
)
return
;
var
delta
=
e
.
originEvent
.
wheelDelta
;
var
delta
=
e
.
originEvent
.
wheelDelta
;
var
me
=
this
;
var
me
=
this
;
if
(
!
kity
.
Browser
.
mac
)
{
delta
=
-
delta
;
}
// 稀释
// 稀释
if
(
Math
.
abs
(
delta
)
>
100
)
{
if
(
Math
.
abs
(
delta
)
>
100
)
{
clearTimeout
(
this
.
_wheelZoomTimeout
);
clearTimeout
(
this
.
_wheelZoomTimeout
);
...
@@ -5122,9 +5127,9 @@ KityMinder.registerModule( 'Zoom', function () {
...
@@ -5122,9 +5127,9 @@ KityMinder.registerModule( 'Zoom', function () {
var
value
;
var
value
;
var
lastValue
=
me
.
getPaper
().
_zoom
||
1
;
var
lastValue
=
me
.
getPaper
().
_zoom
||
1
;
if
(
delta
<
0
)
{
if
(
delta
<
0
)
{
me
.
execCommand
(
'zoom-in'
);
me
.
execCommand
(
'zoom-in'
);
}
else
if
(
delta
>
0
)
{
}
else
if
(
delta
>
0
)
{
me
.
execCommand
(
'zoom-out'
);
me
.
execCommand
(
'zoom-out'
);
}
}
},
100
);
},
100
);
...
...
dist/kityminder.all.min.js
View file @
8292538a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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