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
a3b39ce9
Commit
a3b39ce9
authored
Jul 08, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/release-1.2.0' into release-1.2.0
parents
87e22a53
08f6a8dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
18 deletions
+28
-18
index.html
index.html
+1
-1
zh-cn.js
lang/zh-cn/zh-cn.js
+2
-2
dragtree.js
src/module/dragtree.js
+10
-4
expand.js
src/module/expand.js
+12
-6
keyboard.js
src/module/keyboard.js
+2
-2
snow.js
src/theme/snow.js
+1
-3
No files found.
index.html
View file @
a3b39ce9
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<div
id=
"kityminder"
onselectstart=
"return false"
></div>
<div
id=
"kityminder"
onselectstart=
"return false"
></div>
<div
id=
"share-dialog"
>
<div
id=
"share-dialog"
>
<h3>
URL分享:
</h3>
<h3>
URL分享:
</h3>
<p>
<p>
<input
id=
"share-url"
type=
"url"
value=
"http://naotu.baidu.com/?shareId=kcev3dd"
/>
<input
id=
"share-url"
type=
"url"
value=
"http://naotu.baidu.com/?shareId=kcev3dd"
/>
...
...
lang/zh-cn/zh-cn.js
View file @
a3b39ce9
...
@@ -35,8 +35,8 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -35,8 +35,8 @@ KityMinder.LANG['zh-cn'] = {
'image'
:
'插入图片'
,
'image'
:
'插入图片'
,
'hyperlink'
:
'插入链接'
,
'hyperlink'
:
'插入链接'
,
'unhyperlink'
:
'删除链接'
,
'unhyperlink'
:
'删除链接'
,
'expandnode'
:
'展开
节点
'
,
'expandnode'
:
'展开
到叶子
'
,
'collapsenode'
:
'收起节点'
,
'collapsenode'
:
'收起
到一级
节点'
,
'template'
:
'模板'
,
'template'
:
'模板'
,
'theme'
:
'皮肤'
'theme'
:
'皮肤'
},
},
...
...
src/module/dragtree.js
View file @
a3b39ce9
...
@@ -38,6 +38,7 @@ var DropHinter = kity.createClass('DropHinter', {
...
@@ -38,6 +38,7 @@ var DropHinter = kity.createClass('DropHinter', {
target
.
getStyle
(
'drop-hint-color'
)
||
'yellow'
,
target
.
getStyle
(
'drop-hint-color'
)
||
'yellow'
,
target
.
getStyle
(
'drop-hint-width'
)
||
2
target
.
getStyle
(
'drop-hint-width'
)
||
2
);
);
this
.
bringTop
();
}
}
}
}
});
});
...
@@ -299,7 +300,12 @@ var TreeDragger = kity.createClass('TreeDragger', {
...
@@ -299,7 +300,12 @@ var TreeDragger = kity.createClass('TreeDragger', {
function
area
(
box
)
{
function
area
(
box
)
{
return
box
.
width
*
box
.
height
;
return
box
.
width
*
box
.
height
;
}
}
return
intersectBox
&&
area
(
intersectBox
)
>
0.5
*
Math
.
min
(
area
(
sourceBox
),
area
(
targetBox
));
if
(
!
intersectBox
)
return
false
;
// 面积判断
if
(
area
(
intersectBox
)
>
0.5
*
Math
.
min
(
area
(
sourceBox
),
area
(
targetBox
)))
return
true
;
if
(
intersectBox
.
width
+
1
>=
Math
.
min
(
sourceBox
.
width
,
targetBox
.
width
))
return
true
;
if
(
intersectBox
.
height
+
1
>=
Math
.
min
(
sourceBox
.
height
,
targetBox
.
height
))
return
true
;
return
false
;
});
});
this
.
_renderDropHint
(
this
.
_dropSucceedTarget
);
this
.
_renderDropHint
(
this
.
_dropSucceedTarget
);
return
!!
this
.
_dropSucceedTarget
;
return
!!
this
.
_dropSucceedTarget
;
...
@@ -320,7 +326,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
...
@@ -320,7 +326,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
_renderOrderHint
:
function
(
hint
)
{
_renderOrderHint
:
function
(
hint
)
{
this
.
_orderHinter
.
render
(
hint
);
this
.
_orderHinter
.
render
(
hint
);
},
},
preventDragMove
:
function
()
{
preventDragMove
:
function
()
{
this
.
_startPosition
=
null
;
this
.
_startPosition
=
null
;
}
}
});
});
...
@@ -348,8 +354,8 @@ KityMinder.registerModule('DragTree', function() {
...
@@ -348,8 +354,8 @@ KityMinder.registerModule('DragTree', function() {
e
.
stopPropagation
();
e
.
stopPropagation
();
this
.
fire
(
'contentchange'
);
this
.
fire
(
'contentchange'
);
},
},
'statuschange'
:
function
(
e
)
{
'statuschange'
:
function
(
e
)
{
if
(
e
.
lastStatus
==
'textedit'
&&
e
.
currentStatus
==
'normal'
)
{
if
(
e
.
lastStatus
==
'textedit'
&&
e
.
currentStatus
==
'normal'
)
{
dragger
.
preventDragMove
();
dragger
.
preventDragMove
();
}
}
}
}
...
...
src/module/expand.js
View file @
a3b39ce9
...
@@ -117,8 +117,7 @@ KityMinder.registerModule('Expand', function() {
...
@@ -117,8 +117,7 @@ KityMinder.registerModule('Expand', function() {
var
ExpandNodeCommand
=
kity
.
createClass
(
'ExpandNodeCommand'
,
{
var
ExpandNodeCommand
=
kity
.
createClass
(
'ExpandNodeCommand'
,
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
)
{
execute
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getRoot
().
getChildren
();
if
(
!
nodes
.
length
)
nodes
.
push
(
km
.
getRoot
());
nodes
.
forEach
(
function
(
node
)
{
nodes
.
forEach
(
function
(
node
)
{
node
.
expand
(
EXPAND_POLICY
.
DEEP_TO_LEAF
);
node
.
expand
(
EXPAND_POLICY
.
DEEP_TO_LEAF
);
});
});
...
@@ -218,10 +217,6 @@ KityMinder.registerModule('Expand', function() {
...
@@ -218,10 +217,6 @@ KityMinder.registerModule('Expand', function() {
}
}
});
});
return
{
return
{
addShortcutKeys
:
{
'ExpandNode'
:
'ctrl+/'
,
//expand
'CollapseNode'
:
'ctrl+.'
//collapse
},
commands
:
{
commands
:
{
'ExpandNode'
:
ExpandNodeCommand
,
'ExpandNode'
:
ExpandNodeCommand
,
'CollapseNode'
:
CollapseNodeCommand
'CollapseNode'
:
CollapseNodeCommand
...
@@ -241,6 +236,17 @@ KityMinder.registerModule('Expand', function() {
...
@@ -241,6 +236,17 @@ KityMinder.registerModule('Expand', function() {
var
visible
=
!
node
.
parent
||
node
.
parent
.
isExpanded
();
var
visible
=
!
node
.
parent
||
node
.
parent
.
isExpanded
();
node
.
getRenderContainer
().
setVisible
(
visible
);
node
.
getRenderContainer
().
setVisible
(
visible
);
if
(
!
visible
)
e
.
stopPropagation
();
if
(
!
visible
)
e
.
stopPropagation
();
},
'beforekeydown'
:
function
(
e
)
{
if
(
e
.
originEvent
.
keyCode
==
keymap
[
'/'
])
{
var
expanded
=
this
.
getSelectedNode
().
isExpanded
();
this
.
getSelectedNodes
().
forEach
(
function
(
node
)
{
if
(
expanded
)
node
.
collapse
();
else
node
.
expand
();
});
e
.
preventDefault
();
e
.
stopPropagationImmediately
();
}
}
}
},
},
renderers
:
{
renderers
:
{
...
...
src/module/keyboard.js
View file @
a3b39ce9
...
@@ -183,8 +183,8 @@ KityMinder.registerModule("KeyboardModule", function() {
...
@@ -183,8 +183,8 @@ KityMinder.registerModule("KeyboardModule", function() {
}
}
},
},
'normal.keyup'
:
function
(
e
)
{
'normal.keyup'
:
function
(
e
)
{
if
(
browser
.
ipad
)
{
if
(
browser
.
ipad
)
{
var
keys
=
KityMinder
.
keymap
;
var
keys
=
KityMinder
.
keymap
;
var
node
=
e
.
getTargetNode
();
var
node
=
e
.
getTargetNode
();
var
lang
=
this
.
getLang
();
var
lang
=
this
.
getLang
();
...
...
src/theme/snow.js
View file @
a3b39ce9
...
@@ -41,9 +41,7 @@ KityMinder.registerTheme('snow', {
...
@@ -41,9 +41,7 @@ KityMinder.registerTheme('snow', {
'marquee-stroke'
:
'white'
,
'marquee-stroke'
:
'white'
,
'drop-hint-color'
:
'yellow'
,
'drop-hint-color'
:
'yellow'
,
'sub-drop-hint-width'
:
2
,
'drop-hint-width'
:
4
,
'main-drop-hint-width'
:
4
,
'root-drop-hint-width'
:
4
,
'order-hint-area-color'
:
'rgba(0, 255, 0, .5)'
,
'order-hint-area-color'
:
'rgba(0, 255, 0, .5)'
,
'order-hint-path-color'
:
'#0f0'
,
'order-hint-path-color'
:
'#0f0'
,
...
...
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