Commit cc79a59d authored by Akikonata's avatar Akikonata

dev

parent 599d15fc
...@@ -10,6 +10,12 @@ var mindermoduleDefaultTest = function () { ...@@ -10,6 +10,12 @@ var mindermoduleDefaultTest = function () {
"execute": function ( km, arg1, arg2, arg3 ) { "execute": function ( km, arg1, arg2, arg3 ) {
console.log( arg1, arg2, arg3 ); console.log( arg1, arg2, arg3 );
} }
} ),
"testCommand2": kity.createClass( "testCommand", {
base: Command,
"execute": function ( km, arg1, arg2, arg3 ) {
console.log( arg1, arg2, arg3 );
}
} ) } )
}, },
...@@ -23,7 +29,7 @@ var mindermoduleDefaultTest = function () { ...@@ -23,7 +29,7 @@ var mindermoduleDefaultTest = function () {
}, },
"beforecommand": function ( e ) { "beforecommand": function ( e ) {
console.log( "precommand:", e ); console.log( "precommand:", e );
//e.cancel(); e.cancel();
}, },
"command": function ( e ) { "command": function ( e ) {
console.log( "command exec!", e ); console.log( "command exec!", e );
......
var mindermoduleTest = function(){ var mindermoduleTest = function () {
console.log("test loaded"); console.log( "test loaded" );
var stroredData="stored"; var stroredData = "stored";
return { return {
"ready": function(){ "ready": function () {
//todo:基本的初始化工作 //todo:基本的初始化工作
console.log(stroredData); console.log( stroredData );
}, },
"commands": { "commands": {
//todo:command字典,name-action 键值对模式编写 //todo:command字典,name-action 键值对模式编写
"testCommand":function(km,arg){ "testCommand1": function ( km, arg ) {
console.log(arg); console.log( "testCommand1" );
} }
}, },
"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
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
KityMinder.registerModule("defaulttest",mindermoduleDefaultTest); KityMinder.registerModule("defaulttest",mindermoduleDefaultTest);
var myMinder = new KityMinder(); var myMinder = new KityMinder();
myMinder.execCommand("testCommand","test1",function(){alert(a)},{a:1,b:2}); myMinder.execCommand("testCommand","test1",function(){alert(a)},{a:1,b:2});
myMinder.execCommand("testCommand1");
console.log(myMinder.queryCommandState("testCommand")); console.log(myMinder.queryCommandState("testCommand"));
console.log(myMinder.queryCommandValue("testCommand")); console.log(myMinder.queryCommandValue("testCommand"));
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment