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
1ad7b1d1
Commit
1ad7b1d1
authored
Feb 28, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
0ec90d2d
0b314a0c
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
186 additions
and
143 deletions
+186
-143
dev.html
demo/dev.html
+0
-35
markers.js
dialogs/markers/markers.js
+1
-1
dev.js
dist/dev.js
+100
-69
social.js
dist/social.js
+16
-4
kity
kity
+1
-1
saveto.js
src/adapter/saveto.js
+2
-2
node.js
src/core/node.js
+1
-1
hand.js
src/module/hand.js
+22
-3
layout.bottom.js
src/module/layout.bottom.js
+11
-2
layout.default.js
src/module/layout.default.js
+10
-2
layout.js
src/module/layout.js
+22
-23
No files found.
demo/dev.html
deleted
100644 → 0
View file @
0ec90d2d
<!DOCTYPE html>
<html>
<head>
<script
src=
"../dist/jquery-2.1.0.min.js"
></script>
<script
src=
"../kity/dist/kitygraph.all.js"
></script>
<script
src=
"../configure.js"
></script>
<script
src=
"../dist/dev.js"
></script>
<script
src=
"../lang/zh-cn/zh-cn.js"
charset=
"utf-8"
></script>
<link
href=
"../themes/default/css/import.css"
type=
"text/css"
rel=
"stylesheet"
>
<style>
.km_receiver
{
width
:
0
;
height
:
0
;
}
.km-minderNode
{
cursor
:
default
;
}
.kmui-container
{
height
:
100%
;
}
html
,
body
,
div
{
margin
:
0
;
padding
:
0
;
}
</style>
</head>
<body
>
<div
id=
"kityminder"
style=
"height:100%;width:100%"
onselectstart=
"return false"
>
</div>
</body>
<script>
window
.
km
=
KM
.
getKityMinder
(
'kityminder'
);
</script>
</html>
\ No newline at end of file
dialogs/markers/markers.js
View file @
1ad7b1d1
...
...
@@ -60,7 +60,7 @@
},
'cancel'
:
{}
},
width
:
200
,
width
:
200
}
)
}
)();
\ No newline at end of file
dist/dev.js
View file @
1ad7b1d1
This diff is collapsed.
Click to expand it.
dist/social.js
View file @
1ad7b1d1
...
...
@@ -91,7 +91,7 @@ $( function () {
var
options
=
{
response_type
:
'token'
,
media_type
:
'baidu'
,
redirect_uri
:
baseUrl
+
'index.html'
,
redirect_uri
:
window
.
location
.
href
,
client_type
:
'web'
};
baidu
.
frontia
.
social
.
login
(
options
);
...
...
@@ -129,7 +129,7 @@ $( function () {
by
:
'time'
,
success
:
function
(
result
)
{
if
(
result
.
list
.
length
)
{
if
(
!
isShareLink
)
{
if
(
!
isShareLink
&&
!
thisMapFilename
)
{
loadPersonal
(
result
.
list
[
0
].
path
);
}
else
{
$user_btn
.
loading
(
false
);
...
...
@@ -141,7 +141,7 @@ $( function () {
}
function
addToRecentMenu
(
list
)
{
list
.
splice
(
8
);
list
.
splice
(
8
);
list
.
forEach
(
function
(
file
)
{
$user_menu
.
appendItem
(
{
item
:
{
...
...
@@ -290,7 +290,7 @@ $( function () {
function
loadShare
()
{
var
pattern
=
/share_id=
(\w
+
)([
&#
]
|$
)
/
;
var
match
=
pattern
.
exec
(
window
.
location
.
href
);
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
if
(
!
match
)
return
;
var
shareId
=
match
[
1
];
var
query
=
new
baidu
.
frontia
.
storage
.
Query
();
...
...
@@ -308,11 +308,23 @@ $( function () {
}
);
isShareLink
=
true
;
}
function
loadPath
()
{
var
pattern
=
/path=
(
.+
?)([
&#
]
|$
)
/
;
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
if
(
!
match
)
return
;
thisMapFilename
=
decodeURIComponent
(
match
[
1
]
);
}
loadShare
();
currentUser
=
baidu
.
frontia
.
getCurrentAccount
();
if
(
currentUser
)
{
setCurrentUser
(
currentUser
);
loadPath
();
if
(
thisMapFilename
)
{
loadPersonal
(
thisMapFilename
);
}
}
else
{
$login_btn
.
appendTo
(
$panel
);
}
...
...
kity
@
ebccc80b
Subproject commit
a9630e638b29633f62cdc2df239bc702118b231a
Subproject commit
ebccc80ba41995fa718b1fb0b8f7d79938501ed1
src/adapter/saveto.js
View file @
1ad7b1d1
...
...
@@ -39,8 +39,8 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
var
transform
=
renderContainer
.
getTransform
();
renderContainer
.
resetTransform
();
var
svg
=
$
(
svghtml
).
attr
(
{
width
:
renderBox
.
x
+
renderBox
.
width
,
height
:
renderBox
.
y
+
renderBox
.
height
,
width
:
renderBox
.
width
,
height
:
renderBox
.
height
,
viewBox
:
null
}
);
var
div
=
$
(
"<div></div>"
).
append
(
svg
);
...
...
src/core/node.js
View file @
1ad7b1d1
...
...
@@ -180,7 +180,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
node
.
parent
.
removeChild
(
node
);
}
node
.
parent
=
this
;
node
.
root
=
parent
.
root
;
node
.
root
=
node
.
parent
.
root
;
this
.
children
.
splice
(
index
,
0
,
node
);
},
...
...
src/module/hand.js
View file @
1ad7b1d1
...
...
@@ -17,6 +17,9 @@ var ViewDragger = kity.createClass( "ViewDragger", {
paper
.
setStyle
(
'cursor'
,
value
?
'-webkit-grab'
:
'default'
);
this
.
_enabled
=
value
;
},
move
:
function
(
offset
)
{
this
.
_minder
.
getRenderContainer
().
translate
(
offset
.
x
,
offset
.
y
);
},
_bind
:
function
()
{
var
dragger
=
this
,
...
...
@@ -33,7 +36,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
}
// 点击未选中的根节点临时开启
else
if
(
e
.
getTargetNode
()
==
this
.
getRoot
()
&&
(
!
this
.
getRoot
().
isSelected
()
||
!
this
.
isSingleSelect
())
)
{
(
!
this
.
getRoot
().
isSelected
()
||
!
this
.
isSingleSelect
()
)
)
{
lastPosition
=
e
.
getPosition
();
dragger
.
setEnabled
(
true
);
isRootDrag
=
true
;
...
...
@@ -47,8 +50,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
// 当前偏移加上历史偏移
var
offset
=
kity
.
Vector
.
fromPoints
(
lastPosition
,
currentPosition
);
this
.
getRenderContainer
().
translate
(
offset
.
x
,
offset
.
y
);
dragger
.
move
(
offset
);
e
.
stopPropagation
();
lastPosition
=
currentPosition
;
}
...
...
@@ -100,6 +102,23 @@ KityMinder.registerModule( 'Hand', function () {
this
.
execCommand
(
'hand'
);
e
.
preventDefault
();
}
},
mousewheel
:
function
(
e
)
{
var
dx
=
e
.
originEvent
.
wheelDeltaX
||
0
,
dy
=
e
.
originEvent
.
wheelDeltaY
||
e
.
originEvent
.
wheelDelta
;
this
.
_viewDragger
.
move
(
{
x
:
dx
/
2.5
,
y
:
dy
/
2.5
}
);
e
.
originEvent
.
preventDefault
();
},
dblclick
:
function
()
{
var
viewport
=
this
.
getPaper
().
getViewPort
();
var
offset
=
this
.
getRoot
().
getRenderContainer
(
this
.
getRenderContainer
()).
getTransform
().
getTranslate
();
var
dx
=
viewport
.
center
.
x
-
offset
.
x
,
dy
=
viewport
.
center
.
y
-
offset
.
y
;
//this.getRenderContainer().fxTranslate(dx, dy, 300);
}
}
};
...
...
src/module/layout.bottom.js
View file @
1ad7b1d1
...
...
@@ -408,9 +408,11 @@ KityMinder.registerModule( "LayoutBottom", function () {
appendChildNode
:
function
(
parent
,
node
,
sibling
)
{
node
.
clearLayout
();
var
parentLayout
=
parent
.
getLayout
();
var
expand
=
parent
.
getData
(
"expand"
);
//设置分支类型
if
(
parent
.
getType
()
===
"root"
)
{
node
.
setType
(
"main"
);
node
.
setData
(
"expand"
,
true
);
minder
.
handelNodeInsert
(
node
);
}
else
{
node
.
setType
(
"sub"
);
...
...
@@ -490,8 +492,15 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
},
expandNode
:
function
(
ico
)
{
var
isExpand
=
ico
.
icon
.
switchState
();
var
node
=
ico
.
icon
.
_node
;
var
isExpand
,
node
;
if
(
ico
instanceof
MinderNode
)
{
node
=
ico
;
isExpand
=
node
.
getLayout
().
shicon
.
switchState
();
}
else
{
isExpand
=
ico
.
icon
.
switchState
();
node
=
ico
.
icon
.
_node
;
}
node
.
setData
(
"expand"
,
isExpand
);
var
_buffer
=
node
.
getChildren
();
var
_cleanbuffer
=
[];
...
...
src/module/layout.default.js
View file @
1ad7b1d1
...
...
@@ -537,6 +537,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
node
.
setType
(
"main"
);
}
else
{
node
.
setType
(
"sub"
);
//var isExpand = parent.getData( "expand" );
}
//计算位置等流程
updateBg
(
node
);
...
...
@@ -600,8 +601,15 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
},
expandNode
:
function
(
ico
)
{
var
isExpand
=
ico
.
icon
.
switchState
();
var
node
=
ico
.
icon
.
_node
;
var
isExpand
,
node
;
if
(
ico
instanceof
MinderNode
)
{
node
=
ico
;
isExpand
=
node
.
getLayout
().
shicon
.
switchState
();
}
else
{
isExpand
=
ico
.
icon
.
switchState
();
node
=
ico
.
icon
.
_node
;
}
node
.
setData
(
"expand"
,
isExpand
);
var
_buffer
=
node
.
getChildren
();
var
_cleanbuffer
=
[];
...
...
src/module/layout.js
View file @
1ad7b1d1
...
...
@@ -106,6 +106,9 @@ KityMinder.registerModule( "LayoutModule", function () {
base
:
Command
,
execute
:
function
(
km
,
node
)
{
var
parent
=
km
.
getSelectedNode
();
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
getData
(
"expand"
)
===
false
)
{
km
.
expandNode
(
parent
);
}
km
.
appendChildNode
(
parent
,
node
);
km
.
select
(
node
,
true
);
return
node
;
...
...
@@ -129,7 +132,6 @@ KityMinder.registerModule( "LayoutModule", function () {
node
.
setType
(
"main"
);
km
.
appendChildNode
(
selectedNode
,
node
);
}
else
{
node
.
setType
(
"sub"
);
km
.
appendSiblingNode
(
selectedNode
,
node
);
}
km
.
select
(
node
,
true
);
...
...
@@ -203,29 +205,26 @@ KityMinder.registerModule( "LayoutModule", function () {
this
.
initStyle
(
this
.
getRoot
()
);
}
},
'contextmenu'
:[
{
label
:
this
.
getLang
(
'node.appendsiblingnode'
),
exec
:
function
(){
this
.
execCommand
(
'appendsiblingnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)))
},
cmdName
:
'appendsiblingnode'
},
{
label
:
this
.
getLang
(
'node.appendchildnode'
),
exec
:
function
(){
this
.
execCommand
(
'appendchildnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)))
},
cmdName
:
'appendchildnode'
},
{
label
:
this
.
getLang
(
'node.removenode'
),
cmdName
:
'removenode'
},{
divider
:
1
}
'contextmenu'
:
[
{
label
:
this
.
getLang
(
'node.appendsiblingnode'
),
exec
:
function
()
{
this
.
execCommand
(
'appendsiblingnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)
)
)
},
cmdName
:
'appendsiblingnode'
},
{
label
:
this
.
getLang
(
'node.appendchildnode'
),
exec
:
function
()
{
this
.
execCommand
(
'appendchildnode'
,
new
MinderNode
(
this
.
getLang
(
'topic'
)
)
)
},
cmdName
:
'appendchildnode'
},
{
label
:
this
.
getLang
(
'node.removenode'
),
cmdName
:
'removenode'
},
{
divider
:
1
}
],
],
"defaultOptions"
:
{
"defaultlayoutstyle"
:
"default"
,
"node"
:
{
...
...
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