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
0c2f404e
Commit
0c2f404e
authored
Dec 19, 2013
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/kitygraph/kityminder
into dev
parents
4b354b10
6a6855a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
33 deletions
+23
-33
kity
kity
+1
-1
module.default.test.js
minder_module/module.default.test.js
+13
-20
kityminder.js
src/core/kityminder.js
+9
-12
No files found.
kity
@
7f8b3b27
Subproject commit
b6f3e9996353a089e7b78f603a66668a6a7354a3
Subproject commit
7f8b3b2743aa0ce609a3e8406d9efe8aa117accc
minder_module/module.default.test.js
View file @
0c2f404e
...
...
@@ -2,32 +2,25 @@ var mindermoduleDefaultTest = function(){
console
.
log
(
"test loaded"
);
var
stroredData
=
"stored"
;
var
TestCommand
=
kity
.
createClass
({
});
TestCommand
.
queryState
=
function
()
{};
return
{
"commands"
:
{
"commands"
:
{
//todo:command字典,name-action 键值对模式编写
"testCommand"
:
kity
.
createClass
(
"testCommand"
,{
base
:
Command
,
"execute"
:
function
(
km
,
arg1
,
arg2
,
arg3
){
console
.
log
(
arg1
,
arg2
,
arg3
);
}
}
)
},
"testCommand"
:
kity
.
createClass
(
"testCommand"
,{
base
:
Command
,
"execute"
:
function
(
km
,
arg1
,
arg2
,
arg3
){
console
.
log
(
arg1
,
arg2
,
arg3
);
}
})
},
"events"
:
{
//todo:事件响应函数绑定列表,事件名-响应函数 键值对模式编写
"events"
:
{
//todo:事件响应函数绑定列表,事件名-响应函数 键值对模式编写
"click"
:
function
(
e
){
},
"keydown keyup"
:
function
(
e
){
}
}
}
}
\ No newline at end of file
}
};
};
\ No newline at end of file
src/core/kityminder.js
View file @
0c2f404e
...
...
@@ -4,8 +4,8 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
constructor
:
function
(
id
,
option
)
{
// 初始化
this
.
_initMinder
(
id
,
option
||
{});
this
.
_initModules
();
this
.
_initEvents
();
this
.
_initModules
();
},
_initMinder
:
function
(
id
,
option
)
{
...
...
@@ -22,9 +22,10 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
//模块注册&暴露模块接口
(
function
(){
var
_modules
=
{}
;
var
_modules
;
KityMinder
.
registerModule
=
function
(
name
,
module
)
{
//初始化模块列表
if
(
!
_modules
){
_modules
=
{};}
_modules
[
name
]
=
module
;
};
KityMinder
.
getModules
=
function
(){
...
...
@@ -36,7 +37,6 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
kity
.
extendClass
(
KityMinder
,
(
function
(){
var
_commands
=
{};
//command池子
var
_query
=
{};
//query池子
return
{
_initModules
:
function
()
{
var
_modules
=
KityMinder
.
getModules
();
...
...
@@ -64,11 +64,7 @@ kity.extendClass(KityMinder, (function(){
var
moduleDealsEvents
=
moduleDeals
.
events
;
if
(
moduleDealsEvents
){
for
(
var
_keyE
in
moduleDealsEvents
){
var
bindEvs
=
_keyE
.
split
(
" "
);
var
func
=
moduleDealsEvents
[
_keyE
];
for
(
var
_i
=
0
;
_i
<
bindEvs
.
length
;
_i
++
){
me
.
on
(
bindEvs
[
_i
],
func
);
}
me
.
on
(
_keyE
,
moduleDealsEvents
[
_keyE
]);
}
}
...
...
@@ -76,15 +72,16 @@ kity.extendClass(KityMinder, (function(){
}
},
execCommand
:
function
(
name
)
{
var
me
=
this
;
var
_action
=
new
_commands
[
name
]();
console
.
log
(
_action
);
var
args
=
arguments
;
args
[
0
]
=
this
;
if
(
_action
.
execute
){
_action
.
fire
(
"beforecommand"
);
_action
.
on
(
"precommand"
,
function
(
e
){
_action
.
execute
.
apply
(
null
,
args
);
_action
.
fire
(
"command"
);
me
.
fire
(
"beforecommand"
,
_action
);
me
.
on
(
"precommand"
,
function
(
e
){
if
(
e
.
target
===
_action
){
_action
.
execute
.
apply
(
null
,
args
);}
me
.
fire
(
"command"
,
_action
);
});
}
},
...
...
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