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
fe365417
Commit
fe365417
authored
Dec 19, 2013
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
f2d230d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
16 deletions
+32
-16
.jshintrc
.jshintrc
+3
-1
module.default.test.js
minder_module/module.default.test.js
+8
-0
command.js
src/core/command.js
+2
-2
kityminder.js
src/core/kityminder.js
+19
-13
No files found.
.jshintrc
View file @
fe365417
...
...
@@ -12,6 +12,8 @@
"MinderNode",
"MinderEvent",
"require",
"km"
"km",
"console",
"Command"
]
}
\ No newline at end of file
minder_module/module.default.test.js
View file @
fe365417
var
mindermoduleDefaultTest
=
function
(){
console
.
log
(
"test loaded"
);
var
stroredData
=
"stored"
;
var
TestCommand
=
kity
.
createClass
({
});
TestCommand
.
queryState
=
function
()
{};
return
{
"commands"
:
{
//todo:command字典,name-action 键值对模式编写
"testCommand"
:
kity
.
createClass
(
"testCommand"
,{
base
:
Command
,
"execute"
:
function
(
km
,
arg1
,
arg2
,
arg3
){
console
.
log
(
arg1
,
arg2
,
arg3
);
}
...
...
src/core/command.js
View file @
fe365417
...
...
@@ -29,10 +29,10 @@ var Command = kity.createClass( "Command", {
}
});
Command
.
queryState
:
function
(
km
)
{
Command
.
queryState
=
function
(
km
)
{
return
0
;
}
Command
.
queryValue
:
function
(
km
)
{
Command
.
queryValue
=
function
(
km
)
{
return
0
;
}
\ No newline at end of file
src/core/kityminder.js
View file @
fe365417
...
...
@@ -36,26 +36,29 @@ kity.extendClass(KityMinder, {
if
(
_modules
){
for
(
var
key
in
_modules
){
//执行模块初始化,抛出后续处理对象
var
moduleDeals
=
var
moduleDeals
=
_modules
[
key
].
call
(
me
);
console
.
log
(
moduleDeals
);
moduleDeals
[
"ready"
]
&&
moduleDeals
[
"ready"
].
call
(
this
);
if
(
moduleDeals
.
ready
)
{
moduleDeals
.
ready
.
call
(
me
);
}
//command加入命令池子
var
moduleDealsCommands
=
moduleDeals
[
"commands"
]
;
var
moduleDealsCommands
=
moduleDeals
.
commands
;
if
(
moduleDealsCommands
){
for
(
var
_key
in
moduleDealsCommands
){
me
.
commands
[
_key
]
=
moduleDealsCommands
[
_key
];
for
(
var
_key
C
in
moduleDealsCommands
){
me
.
commands
[
_key
C
]
=
moduleDealsCommands
[
_keyC
];
}
}
//绑定事件
var
moduleDealsEvents
=
moduleDeals
[
"events"
]
;
var
moduleDealsEvents
=
moduleDeals
.
events
;
if
(
moduleDealsEvents
){
for
(
var
_key
in
moduleDealsEvents
){
var
bindEvs
=
_key
.
split
(
" "
);
var
func
=
moduleDealsEvents
[
_key
];
for
(
var
_key
E
in
moduleDealsEvents
){
var
bindEvs
=
_key
E
.
split
(
" "
);
var
func
=
moduleDealsEvents
[
_key
E
];
for
(
var
_i
=
0
;
_i
<
bindEvs
.
length
;
_i
++
){
me
.
on
(
bindEvs
[
_i
],
func
);
}
...
...
@@ -223,17 +226,20 @@ kity.extendClass(KityMinder, {
var
_action
=
new
this
.
commands
[
name
]();
console
.
log
(
_action
);
var
args
=
arguments
;
arguments
[
0
]
=
this
;
_action
[
"execute"
]
&&
_action
[
"execute"
].
apply
(
null
,
args
);
args
[
0
]
=
this
;
if
(
_action
.
execute
){
_action
.
execute
.
apply
(
null
,
args
);
}
this
.
actions
.
push
(
_action
);
},
queryCommandState
:
function
(
name
)
{
this
.
commands
[
name
].
queryState
(
this
);
console
.
log
(
this
.
commands
[
name
]);
(
this
.
commands
[
name
].
queryState
||
Command
.
queryState
)(
this
);
},
queryCommandValue
:
function
(
name
)
{
this
.
commands
[
name
].
queryValue
(
this
);
(
this
.
commands
[
name
].
queryValue
||
Command
.
queryValue
)
(
this
);
}
});
...
...
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