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
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 @
04bc3453
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
"kity",
"kity",
"MinderNode",
"MinderNode",
"require",
"require",
"km"
"km",
"console",
"Command"
]
]
}
}
\ No newline at end of file
minder_module/module.default.test.js
View file @
04bc3453
var
mindermoduleDefaultTest
=
function
(){
var
mindermoduleDefaultTest
=
function
(){
console
.
log
(
"test loaded"
);
console
.
log
(
"test loaded"
);
var
stroredData
=
"stored"
;
var
stroredData
=
"stored"
;
var
TestCommand
=
kity
.
createClass
({
});
TestCommand
.
queryState
=
function
()
{};
return
{
return
{
"commands"
:
{
"commands"
:
{
//todo:command字典,name-action 键值对模式编写
//todo:command字典,name-action 键值对模式编写
"testCommand"
:
kity
.
createClass
(
"testCommand"
,{
"testCommand"
:
kity
.
createClass
(
"testCommand"
,{
base
:
Command
,
"execute"
:
function
(
km
,
arg1
,
arg2
,
arg3
){
"execute"
:
function
(
km
,
arg1
,
arg2
,
arg3
){
console
.
log
(
arg1
,
arg2
,
arg3
);
console
.
log
(
arg1
,
arg2
,
arg3
);
}
}
...
...
src/core/command.js
View file @
04bc3453
...
@@ -29,10 +29,10 @@ var Command = kity.createClass( "Command", {
...
@@ -29,10 +29,10 @@ var Command = kity.createClass( "Command", {
}
}
});
});
Command
.
queryState
:
function
(
km
)
{
Command
.
queryState
=
function
(
km
)
{
return
0
;
return
0
;
}
}
Command
.
queryValue
:
function
(
km
)
{
Command
.
queryValue
=
function
(
km
)
{
return
0
;
return
0
;
}
}
\ No newline at end of file
src/core/kityminder.js
View file @
04bc3453
...
@@ -36,26 +36,29 @@ kity.extendClass(KityMinder, {
...
@@ -36,26 +36,29 @@ kity.extendClass(KityMinder, {
if
(
_modules
){
if
(
_modules
){
for
(
var
key
in
_modules
){
for
(
var
key
in
_modules
){
//执行模块初始化,抛出后续处理对象
//执行模块初始化,抛出后续处理对象
var
moduleDeals
=
var
moduleDeals
=
_modules
[
key
].
call
(
me
);
_modules
[
key
].
call
(
me
);
console
.
log
(
moduleDeals
);
console
.
log
(
moduleDeals
);
moduleDeals
[
"ready"
]
&&
moduleDeals
[
"ready"
].
call
(
this
);
if
(
moduleDeals
.
ready
)
{
moduleDeals
.
ready
.
call
(
me
);
}
//command加入命令池子
//command加入命令池子
var
moduleDealsCommands
=
moduleDeals
[
"commands"
]
;
var
moduleDealsCommands
=
moduleDeals
.
commands
;
if
(
moduleDealsCommands
){
if
(
moduleDealsCommands
){
for
(
var
_key
in
moduleDealsCommands
){
for
(
var
_key
C
in
moduleDealsCommands
){
me
.
commands
[
_key
]
=
moduleDealsCommands
[
_key
];
me
.
commands
[
_key
C
]
=
moduleDealsCommands
[
_keyC
];
}
}
}
}
//绑定事件
//绑定事件
var
moduleDealsEvents
=
moduleDeals
[
"events"
]
;
var
moduleDealsEvents
=
moduleDeals
.
events
;
if
(
moduleDealsEvents
){
if
(
moduleDealsEvents
){
for
(
var
_key
in
moduleDealsEvents
){
for
(
var
_key
E
in
moduleDealsEvents
){
var
bindEvs
=
_key
.
split
(
" "
);
var
bindEvs
=
_key
E
.
split
(
" "
);
var
func
=
moduleDealsEvents
[
_key
];
var
func
=
moduleDealsEvents
[
_key
E
];
for
(
var
_i
=
0
;
_i
<
bindEvs
.
length
;
_i
++
){
for
(
var
_i
=
0
;
_i
<
bindEvs
.
length
;
_i
++
){
me
.
on
(
bindEvs
[
_i
],
func
);
me
.
on
(
bindEvs
[
_i
],
func
);
}
}
...
@@ -145,17 +148,20 @@ kity.extendClass(KityMinder, {
...
@@ -145,17 +148,20 @@ kity.extendClass(KityMinder, {
var
_action
=
new
this
.
commands
[
name
]();
var
_action
=
new
this
.
commands
[
name
]();
console
.
log
(
_action
);
console
.
log
(
_action
);
var
args
=
arguments
;
var
args
=
arguments
;
arguments
[
0
]
=
this
;
args
[
0
]
=
this
;
_action
[
"execute"
]
&&
_action
[
"execute"
].
apply
(
null
,
args
);
if
(
_action
.
execute
){
_action
.
execute
.
apply
(
null
,
args
);
}
this
.
actions
.
push
(
_action
);
this
.
actions
.
push
(
_action
);
},
},
queryCommandState
:
function
(
name
)
{
queryCommandState
:
function
(
name
)
{
this
.
commands
[
name
].
queryState
(
this
);
console
.
log
(
this
.
commands
[
name
]);
(
this
.
commands
[
name
].
queryState
||
Command
.
queryState
)(
this
);
},
},
queryCommandValue
:
function
(
name
)
{
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