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
04bc3453
Commit
04bc3453
authored
Dec 19, 2013
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed grammar with JSLint
parent
d38e61b3
Changes
4
Show 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 @
04bc3453
...
...
@@ -11,6 +11,8 @@
"kity",
"MinderNode",
"require",
"km"
"km",
"console",
"Command"
]
}
\ No newline at end of file
minder_module/module.default.test.js
View file @
04bc3453
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 @
04bc3453
...
...
@@ -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 @
04bc3453
...
...
@@ -40,22 +40,25 @@ kity.extendClass(KityMinder, {
_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
);
}
...
...
@@ -145,17 +148,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