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(){
...
@@ -2,32 +2,25 @@ 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
,
base
:
Command
,
"execute"
:
function
(
km
,
arg1
,
arg2
,
arg3
){
"execute"
:
function
(
km
,
arg1
,
arg2
,
arg3
){
console
.
log
(
arg1
,
arg2
,
arg3
);
console
.
log
(
arg1
,
arg2
,
arg3
);
}
}
}
})
)
},
},
"events"
:
{
"events"
:
{
//todo:事件响应函数绑定列表,事件名-响应函数 键值对模式编写
//todo:事件响应函数绑定列表,事件名-响应函数 键值对模式编写
"click"
:
function
(
e
){
"click"
:
function
(
e
){
},
},
"keydown keyup"
:
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", {
...
@@ -4,8 +4,8 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
constructor
:
function
(
id
,
option
)
{
constructor
:
function
(
id
,
option
)
{
// 初始化
// 初始化
this
.
_initMinder
(
id
,
option
||
{});
this
.
_initMinder
(
id
,
option
||
{});
this
.
_initModules
();
this
.
_initEvents
();
this
.
_initEvents
();
this
.
_initModules
();
},
},
_initMinder
:
function
(
id
,
option
)
{
_initMinder
:
function
(
id
,
option
)
{
...
@@ -22,9 +22,10 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
...
@@ -22,9 +22,10 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
//模块注册&暴露模块接口
//模块注册&暴露模块接口
(
function
(){
(
function
(){
var
_modules
=
{}
;
var
_modules
;
KityMinder
.
registerModule
=
function
(
name
,
module
)
{
KityMinder
.
registerModule
=
function
(
name
,
module
)
{
//初始化模块列表
//初始化模块列表
if
(
!
_modules
){
_modules
=
{};}
_modules
[
name
]
=
module
;
_modules
[
name
]
=
module
;
};
};
KityMinder
.
getModules
=
function
(){
KityMinder
.
getModules
=
function
(){
...
@@ -36,7 +37,6 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
...
@@ -36,7 +37,6 @@ var KityMinder = km.KityMinder = kity.createClass("KityMinder", {
kity
.
extendClass
(
KityMinder
,
(
function
(){
kity
.
extendClass
(
KityMinder
,
(
function
(){
var
_commands
=
{};
//command池子
var
_commands
=
{};
//command池子
var
_query
=
{};
//query池子
var
_query
=
{};
//query池子
return
{
return
{
_initModules
:
function
()
{
_initModules
:
function
()
{
var
_modules
=
KityMinder
.
getModules
();
var
_modules
=
KityMinder
.
getModules
();
...
@@ -64,11 +64,7 @@ kity.extendClass(KityMinder, (function(){
...
@@ -64,11 +64,7 @@ kity.extendClass(KityMinder, (function(){
var
moduleDealsEvents
=
moduleDeals
.
events
;
var
moduleDealsEvents
=
moduleDeals
.
events
;
if
(
moduleDealsEvents
){
if
(
moduleDealsEvents
){
for
(
var
_keyE
in
moduleDealsEvents
){
for
(
var
_keyE
in
moduleDealsEvents
){
var
bindEvs
=
_keyE
.
split
(
" "
);
me
.
on
(
_keyE
,
moduleDealsEvents
[
_keyE
]);
var
func
=
moduleDealsEvents
[
_keyE
];
for
(
var
_i
=
0
;
_i
<
bindEvs
.
length
;
_i
++
){
me
.
on
(
bindEvs
[
_i
],
func
);
}
}
}
}
}
...
@@ -76,15 +72,16 @@ kity.extendClass(KityMinder, (function(){
...
@@ -76,15 +72,16 @@ kity.extendClass(KityMinder, (function(){
}
}
},
},
execCommand
:
function
(
name
)
{
execCommand
:
function
(
name
)
{
var
me
=
this
;
var
_action
=
new
_commands
[
name
]();
var
_action
=
new
_commands
[
name
]();
console
.
log
(
_action
);
console
.
log
(
_action
);
var
args
=
arguments
;
var
args
=
arguments
;
args
[
0
]
=
this
;
args
[
0
]
=
this
;
if
(
_action
.
execute
){
if
(
_action
.
execute
){
_action
.
fire
(
"beforecommand"
);
me
.
fire
(
"beforecommand"
,
_action
);
_action
.
on
(
"precommand"
,
function
(
e
){
me
.
on
(
"precommand"
,
function
(
e
){
_action
.
execute
.
apply
(
null
,
args
);
if
(
e
.
target
===
_action
){
_action
.
execute
.
apply
(
null
,
args
);}
_action
.
fire
(
"command"
);
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