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
3cd99103
Commit
3cd99103
authored
Dec 23, 2013
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
merge from panzheng
parents
9a66a05c
3bf2700e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
33 deletions
+57
-33
dev.html
demo/dev.html
+4
-2
dev.php
dist/dev.php
+10
-3
minder.command.js
src/core/minder.command.js
+26
-23
minder.js
src/core/minder.js
+1
-0
minder.module.js
src/core/minder.module.js
+14
-3
minder.node.js
src/core/minder.node.js
+1
-1
node.js
src/core/node.js
+1
-1
No files found.
demo/dev.html
View file @
3cd99103
...
@@ -9,7 +9,9 @@
...
@@ -9,7 +9,9 @@
</body>
</body>
<script>
<script>
minder
=
new
km
.
KityMinder
();
minder
=
new
KityMinder
.
Minder
(
null
,{
});
minder
.
importData
({
minder
.
importData
({
data
:
{
data
:
{
...
@@ -38,6 +40,6 @@
...
@@ -38,6 +40,6 @@
}]
}]
}]
}]
});
});
minder
.
update
(
);
minder
.
execCommand
(
'renderroot'
);
</script>
</script>
</html>
</html>
\ No newline at end of file
dist/dev.php
View file @
3cd99103
...
@@ -3,9 +3,16 @@
...
@@ -3,9 +3,16 @@
$dependency
=
Array
(
$dependency
=
Array
(
'src/core/km.js'
,
'src/core/km.js'
,
'src/core/command.js'
,
'src/core/command.js'
,
'src/core/mindernode.js'
,
'src/core/node.js'
,
'src/core/minderevent.js'
,
'src/core/module.js'
,
'src/core/kityminder.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/connect.js'
,
'src/module/history.js'
,
'src/module/history.js'
,
'src/module/icon.js'
,
'src/module/icon.js'
,
...
...
src/core/minder.command.js
View file @
3cd99103
kity
.
extendClass
(
Minder
,
{
kity
.
extendClass
(
Minder
,
{
_getCommand
:
function
(
name
)
{
return
this
.
_commands
[
name
.
toLowerCase
()
];
},
_getQuery
:
function
(
name
)
{
if
(
!
this
.
_query
[
name
]
)
{
var
Cmd
=
this
.
_getCommand
(
name
);
this
.
_query
[
name
]
=
new
Cmd
();
}
return
this
.
_query
[
name
];
},
_queryCommand
:
function
(
name
,
type
)
{
var
me
=
this
;
var
query
=
this
.
_getQuery
(
name
);
var
queryFunc
=
query
[
name
][
"state"
+
type
];
if
(
queryFunc
)
{
return
queryFunc
(
me
);
}
else
{
return
0
;
}
},
execCommand
:
function
(
name
)
{
execCommand
:
function
(
name
)
{
var
TargetCommand
,
command
,
cmdArgs
,
eventParams
,
stoped
;
var
TargetCommand
,
command
,
cmdArgs
,
eventParams
,
stoped
;
TargetCommand
=
this
.
_getCommand
(
name
);
TargetCommand
=
this
.
_getCommand
(
name
);
if
(
!
TargetCommand
)
{
return
false
;
}
command
=
new
TargetCommand
();
command
=
new
TargetCommand
();
cmdArgs
=
Array
.
prototype
.
slice
.
call
(
arguments
,
1
);
cmdArgs
=
Array
.
prototype
.
slice
.
call
(
arguments
,
1
);
...
@@ -33,6 +56,7 @@ kity.extendClass( Minder, {
...
@@ -33,6 +56,7 @@ kity.extendClass( Minder, {
if
(
command
.
isSelectionChanged
()
)
{
if
(
command
.
isSelectionChanged
()
)
{
this
.
_firePharse
(
new
MinderEvent
(
'selectionchange'
)
);
this
.
_firePharse
(
new
MinderEvent
(
'selectionchange'
)
);
}
}
this
.
_firePharse
(
new
MinderEvent
(
'interactchange'
)
);
}
}
this
.
_executingCommand
=
null
;
this
.
_executingCommand
=
null
;
...
@@ -42,31 +66,10 @@ kity.extendClass( Minder, {
...
@@ -42,31 +66,10 @@ kity.extendClass( Minder, {
},
},
queryCommandState
:
function
(
name
)
{
queryCommandState
:
function
(
name
)
{
if
(
!
_commands
[
name
.
toLowerCase
()
]
)
{
return
this
.
_queryCommand
(
name
,
"State"
);
return
false
;
}
if
(
!
_query
[
name
]
)
{
_query
[
name
]
=
new
_commands
[
name
]();
}
if
(
_query
[
name
].
queryState
)
{
return
_query
[
name
].
queryState
(
this
);
}
else
{
return
0
;
}
},
},
queryCommandValue
:
function
(
name
)
{
queryCommandValue
:
function
(
name
)
{
if
(
!
_commands
[
name
.
toLowerCase
()
]
)
{
return
this
.
_queryCommand
(
name
,
"Value"
);
return
false
;
}
if
(
!
_query
[
name
]
)
{
_query
[
name
]
=
new
_commands
[
name
]();
}
if
(
_query
[
name
].
queryValue
)
{
return
_query
[
name
].
queryValue
(
this
);
}
else
{
return
0
;
}
}
}
}
);
}
);
\ No newline at end of file
src/core/minder.js
View file @
3cd99103
...
@@ -16,6 +16,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
...
@@ -16,6 +16,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
options
=
Utils
.
extend
(
KITYMINDER_CONFIG
||
{},
MinderDefaultOptions
,
options
||
{}
);
options
=
Utils
.
extend
(
KITYMINDER_CONFIG
||
{},
MinderDefaultOptions
,
options
||
{}
);
// 初始化
// 初始化
this
.
_initMinder
(
options
);
this
.
_initMinder
(
options
);
this
.
_initEvents
();
this
.
_initModules
(
options
);
this
.
_initModules
(
options
);
},
},
...
...
src/core/minder.module.js
View file @
3cd99103
// 模块声明周期维护
// 模块声明周期维护
kity
.
extendClass
(
Minder
,
{
kity
.
extendClass
(
Minder
,
{
_initModules
:
function
()
{
_initModules
:
function
(
option
)
{
this
.
_commands
=
{};
this
.
_query
=
{};
var
_modules
=
KityMinder
.
getModules
();
var
_modules
=
KityMinder
.
getModules
();
var
_modulesList
=
(
function
()
{
var
_list
=
[];
for
(
var
key
in
_modules
)
{
_list
.
push
(
key
);
}
return
_list
;
}
)();
var
_configModules
=
option
.
modules
||
_modulesList
;
if
(
_modules
)
{
if
(
_modules
)
{
var
me
=
this
;
var
me
=
this
;
for
(
var
key
in
_modules
)
{
for
(
var
i
=
0
;
i
<
_configModules
.
length
;
i
++
)
{
var
key
=
_configModules
[
i
];
//执行模块初始化,抛出后续处理对象
//执行模块初始化,抛出后续处理对象
var
moduleDeals
=
_modules
[
key
].
call
(
me
);
var
moduleDeals
=
_modules
[
key
].
call
(
me
);
...
@@ -16,7 +27,7 @@ kity.extendClass( Minder, {
...
@@ -16,7 +27,7 @@ kity.extendClass( Minder, {
var
moduleDealsCommands
=
moduleDeals
.
commands
;
var
moduleDealsCommands
=
moduleDeals
.
commands
;
if
(
moduleDealsCommands
)
{
if
(
moduleDealsCommands
)
{
for
(
var
_keyC
in
moduleDealsCommands
)
{
for
(
var
_keyC
in
moduleDealsCommands
)
{
_commands
[
_keyC
]
=
moduleDealsCommands
[
_keyC
];
this
.
_commands
[
_keyC
]
=
moduleDealsCommands
[
_keyC
];
}
}
}
}
...
...
src/core/minder.node.js
View file @
3cd99103
...
@@ -25,7 +25,7 @@ kity.extendClass( Minder, {
...
@@ -25,7 +25,7 @@ kity.extendClass( Minder, {
},
},
update
:
function
(
node
)
{
update
:
function
(
node
)
{
this
.
execCommand
(
'renderroot'
,
node
);
return
this
;
return
this
;
}
}
}
);
}
);
\ No newline at end of file
src/core/node.js
View file @
3cd99103
var
MinderNode
=
km
.
MinderNode
=
kity
.
createClass
(
"MinderNode"
,
{
var
MinderNode
=
KityMinder
.
MinderNode
=
kity
.
createClass
(
"MinderNode"
,
{
constructor
:
function
(
treeNotifyHandler
)
{
constructor
:
function
(
treeNotifyHandler
)
{
this
.
parent
=
null
;
this
.
parent
=
null
;
this
.
children
=
[];
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