Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
33f81781
Z
zui
项目概览
易企天创
/
zui
大约 1 年 前同步成功
通知
6
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
37
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
37
Issue
37
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
33f81781
编写于
7月 02, 2014
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* added callEvent function to mindmap.
* updated document.
上级
c6d09674
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
168 addition
and
114 deletion
+168
-114
assets/js/mindmap.js
assets/js/mindmap.js
+130
-92
dist/js/zui.min.js
dist/js/zui.min.js
+19
-11
src/js/mindmap.js
src/js/mindmap.js
+19
-11
未找到文件。
assets/js/mindmap.js
浏览文件 @
33f81781
...
...
@@ -14,166 +14,204 @@ $(function()
{
data
:
{
text
:
"
ZUI
"
,
text
:
"
灵光闪现
"
,
type
:
"
root
"
,
theme
:
"
default
"
,
caption
:
"
一个开源免费的前端框架,用于快速构建禅道系列跨屏应用
。
"
,
id
:
"
zui
"
,
caption
:
"
非常美观非常易用的web脑图
。
"
,
id
:
"
mindmap
"
,
children
:
[
{
id
:
'
start
'
,
text
:
"
开始
"
,
id
:
'
feature
'
,
text
:
"
特色
"
,
type
:
"
sub
"
,
readonly
:
true
,
children
:
[
{
id
:
'
about
'
,
text
:
"
框架说明
"
,
sort
:
1
id
:
'
beautiful
'
,
text
:
"
美观简洁 令人舒心
"
,
caption
:
'
无需担心排版
'
},
{
id
:
'
files
'
,
text
:
"
文件目录结构
"
,
sort
:
3
id
:
'
easy
'
,
text
:
"
非常易用 快速展现你的想法
"
},
{
id
:
'
browsers
'
,
text
:
"
受支持的平台
"
,
sort
:
2
id
:
'
lite
'
,
text
:
"
轻量 小巧 使用HTML5
"
},
{
id
:
'
extension
'
,
text
:
'
易于扩展 节点即div
'
}
]
},
{
id
:
'
basic
'
,
text
:
"
基础
"
,
id
:
'
mouse
'
,
text
:
"
鼠标操作
"
,
type
:
"
sub
"
,
caption
:
"
了解基础内容
"
,
caption
:
"
通告鼠标来操作
"
,
children
:
[
{
id
:
'
globalcss
'
,
text
:
"
全局样式表
"
,
text
:
"
选择
"
,
children
:
[
{
text
:
'
单击节点来选中
'
},
{
text
:
'
单击画布来取消选择
'
}
]
},
{
id
:
'
ie
'
,
text
:
"
兼容IE浏览器
"
,
text
:
"
开始编辑
"
,
children
:
[
{
text
:
'
单击一个选中的节点
'
},
{
text
:
'
双击一个未选中的节点
'
}
]
},
{
id
:
'
responsive
'
,
text
:
"
响应式设计
"
,
text
:
"
排序
"
,
children
:
[
{
text
:
'
单击节点并拖动到新的位置
'
}
]
},
{
id
:
'
grid
'
,
text
:
"
栅格系统
"
,
text
:
"
更改父节点
"
,
children
:
[
{
text
:
'
单击并拖动到另一个节点上
'
}
]
},
{
id
:
'
types
'
,
text
:
"
文字排版
"
,
text
:
"
删除
"
,
children
:
[
{
accent
:
'
danger
'
,
text
:
'
单击并拖动到另一个节点上 (未完成)
'
}
]
},
{
id
:
'
colorset
'
,
text
:
"
配色
"
,
text
:
"
移动画布
"
,
children
:
[
{
accent
:
'
danger
'
,
text
:
'
单击空白位置来移动画布 (未完成)
'
}
]
}
]
},
{
id
:
'
controls
'
,
text
:
"
控件
"
,
text
:
"
快捷键操作
"
,
type
:
"
sub
"
,
caption
:
"
一些常用的基本控件
"
,
caption
:
"
使用键盘来操作
"
,
children
:
[
{
id
:
'
icons
'
,
text
:
"
图标
"
,
text
:
"
选择及导航
"
,
children
:
[
{
id
:
'
howtouseicons
'
,
text
:
'
如何使用图标
'
},
{
id
:
'
iconfont
'
,
text
:
'
图标字体
'
}
{
text
:
'
向上选择一个相邻节点 <span class="label"><i class="icon-arrow-up"></i></span>
'
},
{
text
:
'
向下选择一个相邻节点 <span class="label"><i class="icon-arrow-down"></i></span>
'
},
{
text
:
'
向左选择一个相邻节点 <span class="label"><i class="icon-arrow-left"></i></span>
'
},
{
text
:
'
向右选择一个相邻节点 <span class="label"><i class="icon-arrow-right"></i></span>
'
}
]
},
{
id
:
'
button
'
,
text
:
"
按钮
"
,
text
:
'
删除节点 <span class="label">Delete</span> / <span class="label">Backspace</span>
'
},
{
id
:
'
progressbar
'
,
text
:
"
进度条
"
,
text
:
'
新增节点
'
,
children
:
[
{
text
:
'
增加子节点 <span class="label">Tab</span> / <span class="label">Insert</span>
'
},
{
text
:
'
增加兄弟节点 <span class="label">Enter</span>
'
},
]
},
{
id
:
'
labels
'
,
text
:
"
标签
"
,
text
:
'
编辑 <span class="label">A-Z</span> / <span class="label">0-9</span>
'
}
]
},
{
id
:
'
components
'
,
text
:
"
组件
"
,
text
:
"
启动参数
"
,
type
:
"
sub
"
,
caption
:
"
一些组合控件
"
,
caption
:
"
初始化脑图的参数
"
,
children
:
[
{
id
:
'
alerts
'
,
text
:
"
消息框
"
,
children
:
[
{
id
:
'
alertstypes
'
,
text
:
'
消息框类型
'
},
{
id
:
'
alertsicons
'
,
text
:
'
在消息框中使用图标
'
},
{
id
:
'
alertsblocks
'
,
text
:
'
块级消息框
'
},
{
id
:
'
alertslinks
'
,
text
:
'
消息框中的链接
'
},
{
id
:
'
alertsclose
'
,
text
:
'
可关闭的消息框
'
}
]
text
:
"
<code>hotkeyEnable</code> 启用或禁用快捷键
"
// ,
// children:
// [
// {text: '<code>true</code> 启用(默认)'},
// {text: '<code>false</code> 禁用'}
// ]
},
{
text
:
"
<code>hotkeys</code> 快捷键配置表
"
},
{
text
:
"
<code>lang</code> 选择界面语言
"
},
{
text
:
"
<code>langs</code> 更改或增加新的备选语言
"
},
{
text
:
"
<code>nodeTeamplate</code> 节点DOM模版
"
},
{
text
:
"
<code>hSpace</code> 节点布局水平空间大小
"
},
{
text
:
"
<code>vSpace</code> 节点布局垂直空间大小
"
},
{
text
:
"
<code>removingNodeTip</code> 删除一个节点前确认提示语
"
},
{
text
:
"
<code>lineCurvature</code> 节点连接线弯曲程度
"
},
{
text
:
"
<code>subLineWidth</code> 二级节点连接线宽度
"
},
{
text
:
"
<code>lineOpacity</code> 连接线透明度
"
},
{
text
:
"
<code>lineSaturation</code> 连接线颜色饱和度
"
},
{
text
:
"
<code>lineLightness</code> 连接线颜色亮度
"
},
{
text
:
"
<code>nodeLineWidth</code> 一般节点连接线宽度
"
}
]
},
{
id
:
'
javascript
'
,
text
:
"
Javascript插件
"
,
text
:
"
事件接口
"
,
type
:
"
sub
"
,
caption
:
"
Javascript增强的插件
"
,
children
:
[
{
id
:
'
javascriptmodal
'
,
text
:
'
模态框
'
,
sort
:
2
,
children
:
[
{
id
:
'
javascriptmodaliframe
'
,
text
:
'
框架对话框
'
}
]
text
:
"
<code>afterLoad</code> 节点数据加载完毕后触发
"
},
{
text
:
"
<code>afterShow</code> 绘制完毕后触发
"
},
{
text
:
"
<code>onChange</code> 脑图数据发生更改后触发
"
},
{
text
:
"
<code>onNodeClick</code> 用户点击一个节点时触发
"
},
{
text
:
"
<code>onNodeActive</code> 当节点被选中时
"
},
{
id
:
'
javascriptdropdown
'
,
text
:
'
下拉菜单
'
,
sort
:
1
text
:
"
<code>onNodeFocus</code> 当节点进入编辑状态时
"
}
]
}
...
...
dist/js/zui.min.js
浏览文件 @
33f81781
...
...
@@ -4706,7 +4706,7 @@ Date.prototype.format = function(format)
selectRight
:
'
right
'
,
deleteNode
:
'
del backspace
'
,
addBorther
:
'
return
'
,
addChild
:
'
tab
'
addChild
:
'
tab
insert
'
},
lang
:
'
zh_cn
'
,
langs
:
...
...
@@ -4831,6 +4831,15 @@ Date.prototype.format = function(format)
if
(
!
this
.
dirtyData
)
this
.
showNode
();
};
Mindmap
.
prototype
.
callEvent
=
function
(
name
,
params
)
{
if
(
$
.
isFunction
(
this
.
options
[
name
]))
{
// this.options[name](params);
$
.
proxy
(
this
.
options
[
name
],
this
)(
params
);
}
}
/* compute position with offset */
Mindmap
.
prototype
.
computePosition
=
function
(
pos
,
inverse
)
{
...
...
@@ -5072,9 +5081,9 @@ Date.prototype.format = function(format)
if
(
forceLoad
)
this
.
loadNode
();
if
(
forceShow
)
this
.
showNode
();
if
(
changed
&&
$
.
isFunction
(
options
[
'
onChange
'
])
)
if
(
changed
)
{
options
[
'
onChange
'
](
{
changes
:
changes
,
data
:
this
.
data
});
this
.
callEvent
(
'
onChange
'
,
{
changes
:
changes
,
data
:
this
.
data
});
}
};
...
...
@@ -5258,9 +5267,9 @@ Date.prototype.format = function(format)
this
.
dirtyData
=
false
;
if
(
nodeData
.
type
===
'
root
'
&&
$
.
isFunction
(
options
[
'
afterLoad
'
])
)
if
(
nodeData
.
type
===
'
root
'
)
{
options
[
'
afterLoad
'
]({
data
:
nodeData
});
this
.
callEvent
(
'
afterLoad
'
,
{
data
:
nodeData
})
}
};
...
...
@@ -5346,9 +5355,9 @@ Date.prototype.format = function(format)
}
}
if
(
nodeData
.
type
===
'
root
'
&&
$
.
isFunction
(
options
[
'
afterShow
'
])
)
if
(
nodeData
.
type
===
'
root
'
)
{
options
[
'
afterShow
'
]({
data
:
nodeData
});
this
.
callEvent
(
'
afterShow
'
,
{
data
:
nodeData
})
}
};
...
...
@@ -5484,10 +5493,7 @@ Date.prototype.format = function(format)
this
.
activeNode
(
$node
);
}
if
(
$
.
isFunction
(
this
.
options
[
'
onNodeClick
'
]))
{
this
.
options
[
'
onNodeClick
'
]();
}
this
.
callEvent
(
'
onNodeClick
'
,
{
node
:
$node
});
event
.
stopPropagation
();
};
...
...
@@ -5510,6 +5516,8 @@ Date.prototype.format = function(format)
$node
.
addClass
(
'
active
'
);
this
.
activedNode
=
$node
;
this
.
isActive
=
true
;
this
.
callEvent
(
'
onNodeActive
'
,
{
node
:
$node
});
};
Mindmap
.
prototype
.
focusNode
=
function
(
$node
)
...
...
src/js/mindmap.js
浏览文件 @
33f81781
...
...
@@ -25,7 +25,7 @@
selectRight
:
'
right
'
,
deleteNode
:
'
del backspace
'
,
addBorther
:
'
return
'
,
addChild
:
'
tab
'
addChild
:
'
tab
insert
'
},
lang
:
'
zh_cn
'
,
langs
:
...
...
@@ -150,6 +150,15 @@
if
(
!
this
.
dirtyData
)
this
.
showNode
();
};
Mindmap
.
prototype
.
callEvent
=
function
(
name
,
params
)
{
if
(
$
.
isFunction
(
this
.
options
[
name
]))
{
// this.options[name](params);
$
.
proxy
(
this
.
options
[
name
],
this
)(
params
);
}
}
/* compute position with offset */
Mindmap
.
prototype
.
computePosition
=
function
(
pos
,
inverse
)
{
...
...
@@ -391,9 +400,9 @@
if
(
forceLoad
)
this
.
loadNode
();
if
(
forceShow
)
this
.
showNode
();
if
(
changed
&&
$
.
isFunction
(
options
[
'
onChange
'
])
)
if
(
changed
)
{
options
[
'
onChange
'
](
{
changes
:
changes
,
data
:
this
.
data
});
this
.
callEvent
(
'
onChange
'
,
{
changes
:
changes
,
data
:
this
.
data
});
}
};
...
...
@@ -577,9 +586,9 @@
this
.
dirtyData
=
false
;
if
(
nodeData
.
type
===
'
root
'
&&
$
.
isFunction
(
options
[
'
afterLoad
'
])
)
if
(
nodeData
.
type
===
'
root
'
)
{
options
[
'
afterLoad
'
]({
data
:
nodeData
});
this
.
callEvent
(
'
afterLoad
'
,
{
data
:
nodeData
})
}
};
...
...
@@ -665,9 +674,9 @@
}
}
if
(
nodeData
.
type
===
'
root
'
&&
$
.
isFunction
(
options
[
'
afterShow
'
])
)
if
(
nodeData
.
type
===
'
root
'
)
{
options
[
'
afterShow
'
]({
data
:
nodeData
});
this
.
callEvent
(
'
afterShow
'
,
{
data
:
nodeData
})
}
};
...
...
@@ -803,10 +812,7 @@
this
.
activeNode
(
$node
);
}
if
(
$
.
isFunction
(
this
.
options
[
'
onNodeClick
'
]))
{
this
.
options
[
'
onNodeClick
'
]();
}
this
.
callEvent
(
'
onNodeClick
'
,
{
node
:
$node
});
event
.
stopPropagation
();
};
...
...
@@ -829,6 +835,8 @@
$node
.
addClass
(
'
active
'
);
this
.
activedNode
=
$node
;
this
.
isActive
=
true
;
this
.
callEvent
(
'
onNodeActive
'
,
{
node
:
$node
});
};
Mindmap
.
prototype
.
focusNode
=
function
(
$node
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录