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
08cee6c9
Commit
08cee6c9
authored
Dec 17, 2013
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed module define
parent
d7b40a5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
14 deletions
+30
-14
Architecture.md
doc/Architecture.md
+30
-14
No files found.
doc/Architecture.md
View file @
08cee6c9
...
...
@@ -44,17 +44,36 @@
## `abstract` Module
Module定义一个模块,表示控制脑图中一个功能的模块(布局、渲染、输入文字、图标叠加等)
### `method` load(Minder minder) : this
模块装载的时候被调用,此时应该进行一些基本的初始化工作。
### `method` registerCommands(Minder minder) : this
模块注册命令的时候被调用,此时应该注册一些模块中需要调用的命令。
### `method` bindEvents(Minder minder) : this
模块绑定事件的时候被调用,此时应该在Minder上绑定模块相关的事件响应,通过事件响应来触发命令,达到对Minder的控制。
### `method` destroy() : this
模块卸载时被调用,此时可以回收模块资源。
## 定义模式:
### function(){
return {
"init":function(){
//todo:基本的初始化工作
},
"commands":{
//todo:command字典,name-action键值对模式编写
"name":function(km,args){
},
"name1":function(km,args){
}
},
"events":{
//todo:事件响应函数绑定列表,事件名->响应函数键值对模式编写
"click":function(e){
},
"keydown":function(e){
}
},
"unload":function(){
//todo:模块unload时的一些处理
}
}
###}//处理顺序为 init->commands->events顺次执行,在模块卸载时执行unload函数
## MinderNode
...
...
@@ -116,9 +135,6 @@ MinderTreeNode 维护的树关系和数据只是作为一个脑图的结构和
### `constructor` KityMinder()
创建脑图画布。KityMinder 实例化的时候,会从模块池中取出模块,并且实例化这些模块,然后加载。
### `method` registerCommand( name, commandClass )
注册一个命令
### `method` getRoot() : MinderNode
获取脑图根节点
...
...
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