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
3cb3e8bc
Commit
3cb3e8bc
authored
Dec 23, 2013
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev
parent
94ba87d1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
64 additions
and
16 deletions
+64
-16
dev.html
demo/dev.html
+3
-3
dev.php
dist/dev.php
+10
-3
minder.command.js
src/core/minder.command.js
+4
-2
minder.data.js
src/core/minder.data.js
+1
-1
minder.event.js
src/core/minder.event.js
+1
-1
minder.js
src/core/minder.js
+1
-1
minder.module.js
src/core/minder.module.js
+3
-3
minder.select.js
src/core/minder.select.js
+1
-1
minderevent.js
src/core/minderevent.js
+39
-0
node.js
src/core/node.js
+1
-1
No files found.
demo/dev.html
View file @
3cb3e8bc
...
...
@@ -9,8 +9,8 @@
</body>
<script>
minder
=
new
km
.
Kity
Minder
(
null
,{
modules
:[
"
test"
,
"test1"
,
"test2
"
]
minder
=
new
KityMinder
.
Minder
(
null
,{
modules
:[
"
ExampleModule
"
]
});
minder
.
importData
({
...
...
@@ -40,6 +40,6 @@
}]
}]
});
minder
.
execCommand
(
'render
tree'
,
node
);
minder
.
execCommand
(
'render
root'
);
</script>
</html>
\ No newline at end of file
dist/dev.php
View file @
3cb3e8bc
...
...
@@ -3,9 +3,16 @@
$dependency
=
Array
(
'src/core/km.js'
,
'src/core/command.js'
,
'src/core/mindernode.js'
,
'src/core/minderevent.js'
,
'src/core/kityminder.js'
,
'src/core/node.js'
,
'src/core/module.js'
,
'src/core/event.js'
,
'src/core/minder.js'
,
'src/core/minder.data.js'
,
'src/core/minder.event.js'
,
'src/core/minder.module.js'
,
'src/core/minder.command.js'
,
'src/core/minder.node.js'
,
'src/core/minder.select.js'
,
'src/module/connect.js'
,
'src/module/history.js'
,
'src/module/icon.js'
,
...
...
src/core/minder.command.js
View file @
3cb3e8bc
...
...
@@ -21,8 +21,10 @@ kity.extendClass( Minder, {
},
execCommand
:
function
(
name
)
{
var
me
=
this
;
var
_commands
=
this
.
_commands
;
var
_action
=
new
_commands
[
name
.
toLowerCase
()
]();
var
_action
=
this
.
_getCommand
(
name
);
if
(
!
_action
)
{
return
false
;
}
var
cmdArgs
=
Array
.
prototype
.
slice
.
call
(
arguments
,
1
);
...
...
src/core/minder.data.js
View file @
3cb3e8bc
// 导入导出
kity
.
extendClass
(
Kity
Minder
,
{
kity
.
extendClass
(
Minder
,
{
exportData
:
function
(
node
)
{
var
exported
=
{};
node
=
node
||
this
.
getRoot
();
...
...
src/core/minder.event.js
View file @
3cb3e8bc
// 事件机制
kity
.
extendClass
(
Kity
Minder
,
{
kity
.
extendClass
(
Minder
,
{
_initEvents
:
function
()
{
this
.
_eventCallbacks
=
{};
this
.
_bindPaperEvents
();
...
...
src/core/minder.js
View file @
3cb3e8bc
...
...
@@ -3,7 +3,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
// 初始化
this
.
_initMinder
(
id
,
option
||
{}
);
this
.
_initEvents
();
this
.
_initModules
();
this
.
_initModules
(
option
);
},
_initMinder
:
function
(
id
,
option
)
{
...
...
src/core/minder.module.js
View file @
3cb3e8bc
// 模块声明周期维护
kity
.
extendClass
(
Minder
,
{
_initModules
:
function
()
{
_initModules
:
function
(
option
)
{
this
.
_commands
=
{};
this
.
_query
=
{};
var
_modules
=
Minder
.
getModules
();
var
_modules
=
Kity
Minder
.
getModules
();
var
_modulesList
=
(
function
()
{
var
_list
=
[];
for
(
var
key
in
_modules
)
{
_list
.
push
(
key
);
}
}
)();
var
_configModules
=
this
.
option
.
modules
||
_modulesList
;
var
_configModules
=
option
.
modules
||
_modulesList
;
if
(
_modules
)
{
var
me
=
this
;
for
(
var
i
=
0
;
i
<
_configModules
.
length
;
i
++
)
{
...
...
src/core/minder.select.js
View file @
3cb3e8bc
// 选区管理
kity
.
extendClass
(
Kity
Minder
,
{
kity
.
extendClass
(
Minder
,
{
getSelectedNodes
:
function
()
{
return
this
.
_selectedNodes
||
(
this
.
_selectedNodes
=
[]
);
},
...
...
src/core/minderevent.js
0 → 100644
View file @
3cb3e8bc
var
MinderEvent
=
kity
.
createClass
(
'MindEvent'
,
{
constructor
:
function
(
type
,
params
,
cancelable
)
{
params
=
params
||
{};
if
(
params
.
getType
&&
params
.
getType
()
==
'ShapeEvent'
)
{
this
.
kityEvent
=
params
;
this
.
getPosition
=
params
.
getPosition
.
bind
(
params
);
}
else
{
kity
.
Utils
.
extend
(
this
,
params
);
}
this
.
type
=
type
;
this
.
_cancelable
=
cancelable
||
false
;
if
(
params
.
targetShape
)
{
this
.
getTargetNode
=
function
()
{
var
findShape
=
params
.
targetShape
;
while
(
!
findShape
.
minderNode
&&
findShape
.
container
)
{
findShape
=
findShape
.
container
;
}
return
findShape
.
minderNode
||
null
;
};
}
},
cancel
:
function
()
{
this
.
_canceled
=
true
;
},
cancelImmediately
:
function
()
{
this
.
_immediatelyCanceld
=
true
;
this
.
_canceled
=
true
;
},
shouldCancel
:
function
()
{
return
this
.
_cancelable
&&
this
.
_canceled
;
},
shouldCancelImmediately
:
function
()
{
return
this
.
_cancelable
&&
this
.
_immediatelyCanceld
;
}
}
);
\ No newline at end of file
src/core/node.js
View file @
3cb3e8bc
var
MinderNode
=
km
.
MinderNode
=
kity
.
createClass
(
"MinderNode"
,
{
var
MinderNode
=
KityMinder
.
MinderNode
=
kity
.
createClass
(
"MinderNode"
,
{
constructor
:
function
(
treeNotifyHandler
)
{
this
.
parent
=
null
;
this
.
children
=
[];
...
...
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