Commit 79881238 authored by techird's avatar techird

Merge pull request #100 from fex-team/release-1.2.0

Release 1.2.0
parents 9a2f191c 3e04f19a
......@@ -5,7 +5,7 @@ Kity Minder
KityMinder 是百度 FEX 团队的 f-cube 小组(原 UEditor 小组)的又一力作。作为一款在线的脑图编辑工具,它有着不亚于 native 脑图工具的交互体验。同时,它充分发挥了 Web 云存储的优势,可以直接将编辑中的脑图同步到云端。此外,借由独创的 “云盘分享”功能,用户可以一键将当前编辑的脑图直接生成在线链接共享给其他用户,实现无缝沟通。
![KityMinder](summary.jpg "KityMinder 界面")
![KityMinder](snap.png "KityMinder 界面")
KityMinder 基于 SVG 技术实现,支持绝大多数的主流浏览器,包括:
......
......@@ -21,10 +21,10 @@ if (isset($_REQUEST['content'])) {
$filename = "kikyminder";
}
header("Content-type: application/octet-stream; charset=utf-8; name=".$filename);
header("Content-type: application/octet-stream; charset=utf8; name=".urlencode($filename));
header("Accept-Length: ".strlen($content));
header("Content-Length: ".strlen($content));
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Disposition: attachment; filename=".urlencode($filename));
header('Content-Description: File Transfer');
echo $content;
......
......@@ -2,30 +2,31 @@
<html>
<head>
<meta charset="utf-8">
<meta name="title" content="百度脑图">
<meta name="keyword" content="图,kity,svg,minder,百度,fex,前端,在线">
<meta name="title" content="百度脑图(KityMinder)">
<meta name="keyword" content="kityminder,脑图,思维导图,kity,svg,minder,百度,fex,前端,在线">
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src="lib/jquery-2.1.0.min.js?_=1404368767190" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1404368767190" charset="utf-8"></script>
<script src="lib/jquery-2.1.0.min.js?_=1404922397905" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1404922397905" charset="utf-8"></script>
<script type="text/javascript">
ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } );
</script>
<script src="lib/kity.min.js?_=1404368767190" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1404368767190" charset="utf-8"></script>
<script src="kityminder.config.js?_=1404368767190" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1404368767190" charset="utf-8"></script>
<script src="lib/kity.min.js?_=1404922397905" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1404922397905" charset="utf-8"></script>
<script src="kityminder.config.js?_=1404922397905" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1404922397905" charset="utf-8"></script>
<script src="lib/zip.js?_=1404368767190" charset="utf-8"></script>
<script src="lib/zip.js?_=1404922397905" charset="utf-8"></script>
<script>
zip.inflateJSPath = 'lib/inflate.js';
</script>
<script src="lib/jquery.xml2json.js?_=1404368767190" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1404368767190" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1404368767190" charset="utf-8"></script>
<script src="social/social.js?_=1404368767190" charset="utf-8"></script>
<script src="lib/jquery.xml2json.js?_=1404922397905" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1404922397905" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1404922397905" charset="utf-8"></script>
<script src="social/social.js?_=1404922397905" charset="utf-8"></script>
<link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
......@@ -34,11 +35,12 @@
</head>
<body>
<div id="content-wrapper">
<div id="panel"></div>
<div id="kityminder" onselectstart="return false"></div>
<div id="share-dialog" >
<div id="share-dialog">
<h3>URL分享:</h3>
<p>
<input id="share-url" type="url" value="http://naotu.baidu.com/?shareId=kcev3dd" />
......@@ -94,6 +96,7 @@
target="_blank">Contact Us
</a>
</div>
</div>
</body>
<!--脑图启动代码-->
......@@ -114,16 +117,20 @@
});
km.on('unziperror', function(ev) {
alert('unziperror');
alert('文件解析错误,文件可能已损坏!');
});
km.on('parseerror', function(ev) {
alert('parseerror');
alert('文件解析错误,文件可能已损坏!');
});
km.on('unknownprotocal', function(ev) {
alert('unknownprotocal');
alert('不支持的文件格式!');
});
document.body.ontouchmove = function(e) {
//e.preventDefault();
}
</script>
<!--社会分享代码-->
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
KityMinder.LANG['zh-cn'] = {
'template': {
'default': '思维导图',
'structure': '组织结构图'
'structure': '组织结构图',
'filetree': '文件夹'
},
'theme': {
'classic': '脑图经典',
......@@ -28,16 +29,15 @@ KityMinder.LANG['zh-cn'] = {
'saveto': '另存为',
'hand': '允许拖拽',
'zoom': '放大缩小',
'markers': '添加标签',
'resource': '分配资源',
'switchlayout': '切换主题',
'markers': '标签',
'resource': '资源',
'help': '帮助',
'preference': '偏好设置',
'image': '插入图片',
'hyperlink': '插入链接',
'unhyperlink': '删除链接',
'expandnode': '展开节点',
'collapsenode': '收起节点',
'expandnode': '展开到叶子',
'collapsenode': '收起到一级节点',
'template': '模板',
'theme': '皮肤'
},
......@@ -58,14 +58,14 @@ KityMinder.LANG['zh-cn'] = {
'none': '无',
'progress': {
'title': '进度',
'notdone': "未完成",
'done1': '完成1/8',
'done2': '完成1/4',
'done3': '完成3/8',
'done4': '完成1/2',
'done5': '完成5/8',
'done6': '完成3/4',
'done7': '完成7/8',
'notdone': '未完成',
'done1': '完成 1/8',
'done2': '完成 1/4',
'done3': '完成 3/8',
'done4': '完成 1/2',
'done5': '完成 5/8',
'done6': '完成 3/4',
'done7': '完成 7/8',
'done': '已完成'
}
},
......@@ -77,28 +77,24 @@ KityMinder.LANG['zh-cn'] = {
'resource': {}
},
'node': {
'appendsiblingnode': '插入同级节点',
'appendsiblingnode': '插入兄弟节点',
'appendchildnode': '插入子节点',
'removenode': '删除节点',
'editnode': '编辑节点'
},
'layout': {
'default': '左右展开',
'bottom': '向下展开'
'removenode': '删除',
'editnode': '编辑'
},
'hyperlink': {
'hyperlink': '插入超链接',
'unhyperlink': '取消超链接'
'hyperlink': '链接...',
'unhyperlink': '移除链接'
},
'image': {
'image': '插入图片',
'removeimage': '除图片'
'image': '图片...',
'removeimage': '除图片'
},
'marker': {
'marker': '进度/优先级'
'marker': '进度/优先级...'
},
'resource': {
'resource': '分配资源'
'resource': '资源...'
}
};
\ No newline at end of file
/*!
* ====================================================
* kity - v2.0.0 - 2014-07-01
* kity - v2.0.0 - 2014-07-08
* https://github.com/fex-team/kity
* GitHub: https://github.com/fex-team/kity.git
* Copyright (c) 2014 Baidu FEX; Licensed BSD
......@@ -2984,7 +2984,7 @@ define("graphic/geometry", [ "core/utils", "graphic/point", "core/class", "graph
* 转换后的 PathSegment,每一段都是 'C'
*/
g.pathToCurve = cacher(function(path) {
var i, command, param;
var i, j, command, param;
var initPoint, currentPoint, endPoint, shouldClose, lastControlPoint, aussumedControlPoint;
var controlPoint1, controlPoint2;
var res = [];
......@@ -3054,12 +3054,21 @@ define("graphic/geometry", [ "core/utils", "graphic/point", "core/class", "graph
case "A":
param = a2c.apply(null, currentPoint.concat(param));
controlPoint1 = param.slice(0, 2);
controlPoint2 = param.slice(2, 4);
j = 0;
while (j in param) {
controlPoint1 = param.slice(j, j + 2);
controlPoint2 = param.slice(j + 2, j + 4);
endPoint = param.slice(j + 4, j + 6);
// 写入当前一段曲线
res.push([ "C" ].concat(controlPoint1).concat(controlPoint2).concat(endPoint));
j += 6;
}
break;
}
// 写入当前一段曲线
res.push([ "C" ].concat(controlPoint1).concat(controlPoint2).concat(endPoint));
if (command != "A") {
// 写入当前一段曲线
res.push([ "C" ].concat(controlPoint1).concat(controlPoint2).concat(endPoint));
}
// 为下次循环准备当前位置
currentPoint = endPoint;
// 二次贝塞尔曲线自己已经记录了上个控制点的位置,其它的记录控制点 2 的位置
......@@ -5931,6 +5940,7 @@ define("graphic/textcontent", [ "graphic/shape", "graphic/svg", "core/utils", "g
// call shape constructor
this.callBase(nodeType);
this.shapeNode = this.shapeNode || this.node;
this.shapeNode.setAttribute("text-rendering", "geometricPrecision");
},
clearContent: function() {
while (this.shapeNode.firstChild) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
.niceblue{color:#fff;background:-moz-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #0099f2), color-stop(0, #4096ee), color-stop(100%, #0076dd));background:-webkit-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-o-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-ms-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:linear-gradient(to bottom, #0099f2 0, #4096ee 0, #0076dd 100%);}
.dropdown{padding-right:28px;position:relative}.dropdown:after{content:' ';display:block;position:absolute;right:10px;top:12px;width:0;height:0;border:solid;border-width:4px 5px;border-color:#333 transparent transparent transparent}
.dropdown:active:after,.dropdown.active:after{border-color:#fff transparent transparent transparent}
button{font-family:Arial,"Heiti SC","Microsoft Yahei";outline:none;display:inline-block;vertical-align:middle;/* font-size: 12px; */padding:0 15px;height:30px;font-size: 12px;line-height:30px;text-align:center;color:#000;text-decoration:none;border:none;margin-left:5px;background:none;border-radius: 0px;color:#fff;background:-moz-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #0099f2), color-stop(0, #4096ee), color-stop(100%, #0076dd));background:-webkit-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-o-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-ms-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:linear-gradient(to bottom, #0099f2 0, #4096ee 0, #0076dd 100%);}button:hover,button.hover{background:#009fff}
button{font-family:Arial,"Heiti SC","Microsoft Yahei";outline:none;display:inline-block;vertical-align:middle;padding:0 15px;height:30px;font-size:13px;line-height:30px;text-align:center;color:#000;text-decoration:none;border:none;margin-left:5px;background:none;color:#fff;background:-moz-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #0099f2), color-stop(0, #4096ee), color-stop(100%, #0076dd));background:-webkit-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-o-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-ms-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:linear-gradient(to bottom, #0099f2 0, #4096ee 0, #0076dd 100%);}button:hover,button.hover{background:#009fff}
button:active,button.active{background:#007fcc;box-shadow:inset 0 2px 3px rgba(0,0,0,0.2)}
button[disabled]{cursor:default;background:#ccc}
.draft-menu.kmui-dropdown-menu{margin-top:24px;margin-left:1px}.draft-menu.kmui-dropdown-menu span.update-time{float:right;color:#ccc;margin-left:20px;padding-right:16px}
.draft-menu.kmui-dropdown-menu{margin-top:24px;margin-left:1px}.draft-menu.kmui-dropdown-menu span.update-time{float:right;color:#ccc;margin-left:40px;padding-right:16px}
.draft-menu.kmui-dropdown-menu li.draft-item a{position:relative}.draft-menu.kmui-dropdown-menu li.draft-item a:before{content:' ';display:block;width:24px;height:24px;background:url(../themes/default/images/draft.png) no-repeat 0 -24px;position:absolute;left:4px;top:2px}
.draft-menu.kmui-dropdown-menu li.draft-item:hover a:before{background-position:0 -48px}
.draft-menu.kmui-dropdown-menu li.draft-item{position:relative}.draft-menu.kmui-dropdown-menu li.draft-item:hover a.delete{display:block}
......@@ -13,13 +13,13 @@ button[disabled]{cursor:default;background:#ccc}
.draft-menu.kmui-dropdown-menu.kmui-combobox-menu .kmui-combobox-checked{overflow:hidden;opacity:1;color:#ccc}.draft-menu.kmui-dropdown-menu.kmui-combobox-menu .kmui-combobox-checked .kmui-combobox-icon{float:left;margin:5px 0;width:28px;background-position:center 0;opacity:.3}
.draft-menu.kmui-dropdown-menu.kmui-combobox-menu .kmui-combobox-checked .kmui-combobox-item-label{display:block;margin-left:28px}
.draft-menu.kmui-dropdown-menu.kmui-combobox-menu .kmui-combobox-checked:hover{color:#ccc}.draft-menu.kmui-dropdown-menu.kmui-combobox-menu .kmui-combobox-checked:hover .kmui-combobox-icon{background-position:center 0}
.file-menu.kmui-dropdown-menu{margin-top:24px;margin-left:1px;border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,0.3)}.file-menu.kmui-dropdown-menu #save-button,.file-menu.kmui-dropdown-menu #manage-file-button{display:none}
.file-menu.kmui-dropdown-menu{margin-top:24px;margin-left:1px;box-shadow:0 1px 5px rgba(0,0,0,0.3)}.file-menu.kmui-dropdown-menu #save-button,.file-menu.kmui-dropdown-menu #manage-file-button{display:none}
.file-menu.kmui-dropdown-menu.logined #save-button,.file-menu.kmui-dropdown-menu.logined #manage-file-button{display:block}
.file-menu.kmui-dropdown-menu.logined #net-hint-buttom{display:none}
.user-menu.kmui-dropdown-menu{margin-top:24px;margin-left:-25px;min-width:130px;border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,0.3)}.user-menu.kmui-dropdown-menu li a{padding-left:40px}
#share-dialog{position:absolute;padding:20px;border-radius:4px;left:50%;top:40%;margin-left:-175px;margin-top:-100px;background:#fff;width:350px;box-shadow:1px 2px 16px rgba(0,0,0,0.5);display:none}#share-dialog h3{margin:0;font-size:16px;color:#666}
#share-dialog input{width:260px;height:22px;line-height:22px;padding:4px 4px 0;border:1px solid #999;vertical-align:middle;margin-right:3px;background:#eee}#share-dialog input:focus{border:1px solid #99f;outline:none}
.user-menu.kmui-dropdown-menu{margin-top:24px;margin-left:-25px;min-width:130px;box-shadow:0 1px 5px rgba(0,0,0,0.3)}.user-menu.kmui-dropdown-menu li a{padding-left:40px}
#share-dialog{position:absolute;padding:20px;left:50%;top:40%;margin-left:-175px;margin-top:-100px;background:#fff;width:350px;box-shadow:1px 2px 16px rgba(0,0,0,0.5);display:none}#share-dialog h3{margin:0;font-size:16px;color:#666}
#share-dialog input{width:255px;height:22px;line-height:22px;padding:4px 4px 0;border:1px solid #999;vertical-align:middle;margin-right:3px;background:#eee}#share-dialog input:focus{border:1px solid #99f;outline:none}
#share-dialog p,#share-dialog #share-platform{margin:20px 0 30px}
#share-dialog #copy-share-url{display:inline-block;margin:0;width:70px;height:28px;line-height:28px;border-radius:2px;vertical-align:middle;border-radius:5px;color:#fff;background:-moz-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #0099f2), color-stop(0, #4096ee), color-stop(100%, #0076dd));background:-webkit-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-o-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-ms-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:linear-gradient(to bottom, #0099f2 0, #4096ee 0, #0076dd 100%);}#share-dialog #copy-share-url:hover,#share-dialog #copy-share-url.hover{background:#009fff}
#share-dialog #copy-share-url{display:inline-block;margin:0;width:75px;height:28px;line-height:28px;vertical-align:middle;color:#fff;background:-moz-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #0099f2), color-stop(0, #4096ee), color-stop(100%, #0076dd));background:-webkit-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-o-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:-ms-linear-gradient(top, #0099f2 0, #4096ee 0, #0076dd 100%);background:linear-gradient(to bottom, #0099f2 0, #4096ee 0, #0076dd 100%);}#share-dialog #copy-share-url:hover,#share-dialog #copy-share-url.hover{background:#009fff}
#share-dialog #copy-share-url:active,#share-dialog #copy-share-url.active{background:#007fcc;box-shadow:inset 0 2px 3px rgba(0,0,0,0.2)}
#share-dialog #share-platform{margin-bottom:0}
{"version":3,"file":"social.css","sources":["social.less"],"names":[],"mappings":"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"}
\ No newline at end of file
......@@ -86,7 +86,12 @@ $(function() {
notice = (function() {
return window.alert;
})();
})(),
wordLimit = function(word, limit) {
limit = limit || 15;
return word.length > limit ? (word.substr(0, limit - 3) + '...') : word;
};
start();
......@@ -105,7 +110,7 @@ $(function() {
function createFileMenu() {
var menus = [{
label: '新建 (Ctrl + N)',
label: '新建',
click: newFile
}, {
divider: true
......@@ -119,16 +124,24 @@ $(function() {
acceptFiles.push(p.fileExtension);
}
});
menus = menus.concat([{
label: '导入本地文件',
click: function() {
function importUseEncoding(encoding) {
return function() {
$('<input type="file" />')
.attr('accept', acceptFiles.join(','))
.on('change', function(e) {
e = e.originalEvent;
minder.importFile(e.target.files[0]);
minder.importFile(e.target.files[0], encoding);
}).click();
}
};
}
menus = menus.concat([{
label: '导入...',
click: importUseEncoding('utf8')
}, {
label: '以 GBK 编码导入...',
click: importUseEncoding('gbk')
}, {
divider: true
}]);
......@@ -150,7 +163,7 @@ $(function() {
menus = menus.concat([{
divider: true,
}, {
label: '登陆',
label: '请登录',
click: login,
id: 'net-hint-buttom'
}, {
......@@ -174,7 +187,9 @@ $(function() {
$file_btn = $('<button id="file-btn">文件</button>').addClass('dropdown').appendTo($menu);
$file_menu = $.kmuidropmenu({ data: createFileMenu() })
$file_menu = $.kmuidropmenu({
data: createFileMenu()
})
.addClass('file-menu')
.appendTo('body');
......@@ -234,6 +249,10 @@ $(function() {
e.stopPropagation();
});
$('body').delegate('#global-zeroclipboard-html-bridge', 'mousedown', function(e) {
e.stopPropagation();
});
var copyTrickTimer = 0;
$('body').on('mousedown', function(e) {
copyTrickTimer = setTimeout(function() {
......@@ -333,19 +352,14 @@ $(function() {
function setRemotePath(path, saved) {
var filename;
remotePath = path;
if (remotePath) {
filename = getFileName(remotePath);
if (!saved) {
filename = '* ' + filename;
}
$title.text(filename);
} else if (currentAccount) {
$title.text('* ' + minder.getMinderTitle());
} else {
$title.text(filename || minder.getMinderTitle());
}
document.title = [filename || minder.getMinderTitle(), titleSuffix].join(' - ');
filename = remotePath ? getFileName(remotePath) : minder.getMinderTitle();
if (!saved) filename = '* ' + filename;
$title.text(filename)
document.title = [filename, titleSuffix].join(' - ');
}
// 检查是否在 Cookie 中登录过了
......@@ -432,7 +446,7 @@ $(function() {
addToRecentMenu(result.list.filter(function(file) {
return getFileFormat(file.path) in fileLoader;
}));
syncPreference(result.list);
//syncPreference(result.list);
}
},
error: loadUserFiles
......@@ -712,13 +726,26 @@ $(function() {
minder.execCommand('camera', minder.getRoot(), 300);
}
function generateRemotePath() {
var filename = window.prompt("请输入文件名: ", minder.getMinderTitle()) || minder.getMinderTitle();
function generateRemotePath(filename) {
return '/apps/kityminder/' + filename + '.km';
}
function save() {
if (!currentAccount || save.busy) return;
if (!currentAccount) return alert('请先登录!');
if (save.busy) {
return;
}
var uploadPath, filename;
// 确定上传文件名
if (!remotePath) {
filename = window.prompt('请输入文件名: ', minder.getMinderTitle());
if (!filename) return;
uploadPath = generateRemotePath(filename);
} else {
uploadPath = remotePath;
}
save.busy = true;
......@@ -745,7 +772,7 @@ $(function() {
upload.tryCount = 0;
return;
}
var uploadPath = remotePath || generateRemotePath();
$title.loading('正在保存 “' + getFileName(uploadPath) + '” ...');
sto.uploadTextFile(data, uploadPath, {
ondup: remotePath ? sto.constant.ONDUP_OVERWRITE : sto.constant.ONDUP_NEWCOPY,
......@@ -840,16 +867,20 @@ $(function() {
switch (keyCode) {
//保存
case KM.keymap.s:
e.preventDefault();
if (e.shiftKey) {
share();
} else {
save();
setTimeout(function() {
save();
});
}
e.preventDefault();
break;
case KM.keymap.n:
newFile();
e.preventDefault();
setTimeout(function() {
newFile();
});
break;
}
}
......@@ -861,9 +892,7 @@ $(function() {
minder.on('contentchange', function() {
if (!watchingChanges || lastContent == minder.exportData('json')) return;
var current = draftManager.save();
if (currentAccount) {
setRemotePath(remotePath, current.sync);
}
setRemotePath(remotePath, current.sync);
lastContent = minder.exportData('json');
});
}
......@@ -882,7 +911,7 @@ $(function() {
$draft_menu.append('<li disabled="disabled" class="current-draft kmui-combobox-item kmui-combobox-item-disabled kmui-combobox-checked">' +
'<span class="kmui-combobox-icon"></span>' +
'<label class="kmui-combobox-item-label">' +
'<span class="update-time">' + getFriendlyTimeSpan(+new Date(draft.update), +new Date()) + '</span>' + draft.name +
'<span class="update-time">' + getFriendlyTimeSpan(+new Date(draft.update), +new Date()) + '</span>' + wordLimit(draft.name) +
'</label>' +
'</li>');
$draft_menu.append('<li class="kmui-divider"></li>');
......@@ -894,7 +923,7 @@ $(function() {
while (list.length) {
draft = list.shift();
$draft = $('<li class="draft-item">' +
'<a href="#">' + '<span class="update-time">' + getFriendlyTimeSpan(+new Date(draft.update), +new Date()) + '</span>' + draft.name + '</a><a class="delete" title="删除该草稿"></a></li>');
'<a href="#">' + '<span class="update-time">' + getFriendlyTimeSpan(+new Date(draft.update), +new Date()) + '</span>' + wordLimit(draft.name) + '</a><a class="delete" title="删除该草稿"></a></li>');
$draft.data('draft-index', index++);
$draft.appendTo($draft_menu);
}
......
......@@ -45,7 +45,6 @@ button {
border: none;
margin-left: 5px;
background: none;
border-radius: 2px;
.niceblue;
......@@ -70,7 +69,7 @@ button {
span.update-time {
float: right;
color: #CCC;
margin-left: 20px;
margin-left: 40px;
padding-right: 16px;
}
li.draft-item a {
......@@ -139,7 +138,6 @@ button {
.file-menu.kmui-dropdown-menu {
margin-top: 24px;
margin-left: 1px;
border-radius: 4px;
box-shadow: 0px 1px 5px rgba(0,0,0, .3);
#save-button, #manage-file-button {
......@@ -159,7 +157,6 @@ button {
margin-top: 24px;
margin-left: -25px;
min-width: 130px;
border-radius: 4px;
box-shadow: 0px 1px 5px rgba(0,0,0, .3);
li a {
......@@ -170,7 +167,6 @@ button {
#share-dialog {
position: absolute;
padding: 20px;
border-radius: 4px;
left: 50%;
top: 40%;
margin-left: -175px;
......@@ -187,7 +183,7 @@ button {
}
input {
width: 260px;
width: 255px;
height: 22px;
line-height: 22px;
padding: 4px 4px 0;
......@@ -208,14 +204,12 @@ button {
#copy-share-url {
display: inline-block;
margin: 0;
width: 70px;
width: 75px;
height: 28px;
line-height: 28px;
border-radius: 2px;
vertical-align: middle;
color: white;
border-radius: 5px;
.niceblue;
......
......@@ -7,12 +7,13 @@
padding: 5px 0;
background-color: #ffffff;
font-size: 12px;
box-shadow: 2px 5px 15px rgba(0, 0, 0, .5);
border-radius: 3px;
box-shadow: 0 1px 5px hsla(0, 0%, 0%, 0.3);
/* border-radius: 3px; */
min-width: 160px;
_width: 160px;
-webkit-transform: translateX(2px);
font-family: Arial, "Heiti SC", "Microsoft Yahei";
/* border-top: 3px solid hsl(224, 16%, 27%); */
}
.kmui-combobox-menu .kmui-combobox-item {
......@@ -47,6 +48,7 @@
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0099f2', endColorstr='#0076dd',GradientType=0 ); /* IE6-8 */
color: white;
background: hsl(222, 14%, 41%);
/*border: 1px solid #a3bde3;*/
}
......
......@@ -4,7 +4,7 @@
right:10px;
background-color: #fff;
outline: 0;
border-radius: 5px;
/* border-radius: 5px; */
box-shadow: 3px 3px 8px rgba(0,0,0, .5);
}
.kmui-modal input[type=text] {
......
......@@ -7,8 +7,8 @@
font-size: 12px;
list-style: none;
background-color: #ffffff;
border-radius: 3px;
box-shadow: 2px 5px 15px rgba(0, 0, 0, .5);
border-radius: 0;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
background-clip: padding-box;
font-family: Arial, "Heiti SC", "Microsoft Yahei";
}
......@@ -51,7 +51,7 @@
background: -webkit-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #0099f2 0%,#4096ee 0%,#0076dd 100%); /* IE10+ */
background: #5a6378; /* W3C */
background: hsl(222, 14%, 41%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0099f2', endColorstr='#0076dd',GradientType=0 ); /* IE6-8 */
color: white;
......
......@@ -2,15 +2,23 @@
html, body, div {
margin: 0;
padding: 0;
/* background: #FFFFFF; */
margin-top: 0 !important;
}
html, body, #kityminder, div.kmui-editor-body {
overflow: hidden;
-moz-user-select: none;
width: 100%;
}
#content-wrapper {
overflow: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#title, #panel {
background: #393F4F;
background: hsl(224, 16%, 27%);
font-family: 'Hiragino Sans GB', 'Arial', 'Microsoft Yahei';
/* -webkit-font-smoothing: antialiased; */
}
......@@ -26,6 +34,10 @@ html, body, #kityminder, div.kmui-editor-body {
text-align: center;
font-weight: 300;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
white-space: nowrap;
}
#panel {
......@@ -57,7 +69,6 @@ html, body, #kityminder, div.kmui-editor-body {
#menu {
float: left;
flo
}
#panel button:hover, #panel button.active {
......@@ -114,6 +125,7 @@ button#tool-btn {
#panel button#tool-btn {
padding-right: 20px;
position: relative;
overflow: visible;
}
#panel button#tool-btn.active:before {
......@@ -253,7 +265,7 @@ svg, body {
font-family: Arial, "Microsoft Yahei", "Heiti SC", sans-serif;
}
#about {
position:absolute;
position: absolute;
bottom: 0;
right: 0;
height: 40px;
......@@ -261,21 +273,27 @@ svg, body {
background: #5d697a;
color: #eee;
font-family:Arial;
font-size:13px;
font-size: 13px;
font-weight:normal;
margin:0;
text-align: right;
padding: 0 15px 0 60px;
border-bottom: 5px solid #393F4F;
-webkit-font-smoothing: antialiased;
position: absolute;
transition: all ease .3s 0.3s;
-webkit-transform: translate(100%);
-moz-transform: translate(100%);
-ms-transform: translate(100%);
-o-transform: translate(100%);
transform: translate(100%);
}
#about:hover {
#about:hover, #about:hover #km-cat {
-webkit-transform: translate(0);
-moz-transform: translate(0);
-ms-transform: translate(0);
-o-transform: translate(0);
transform: translate(0);
}
#about a {
color: #eee;
......@@ -286,11 +304,12 @@ svg, body {
top: 5px;
transition: all ease 1.3s 0.3s;
-webkit-transform: translate(-60px, 0);
-moz-transform: translate(-60px, 0);
-ms-transform: translate(-60px, 0);
-o-transform: translate(-60px, 0);
transform: translate(-60px, 0);
cursor: pointer;
}
#about:hover #km-cat {
-webkit-transform: translate(0);
}
#about #cat-face {
fill: #393F4F;
}
......
......@@ -5,6 +5,7 @@
<meta name="title" content="百度脑图(KityMinder)">
<meta name="keyword" content="kityminder,脑图,思维导图,kity,svg,minder,百度,fex,前端,在线">
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src="lib/jquery-2.1.0.min.js" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js" charset="utf-8"></script>
......@@ -34,11 +35,12 @@
</head>
<body>
<div id="content-wrapper">
<div id="panel"></div>
<div id="kityminder" onselectstart="return false"></div>
<div id="share-dialog" >
<div id="share-dialog">
<h3>URL分享:</h3>
<p>
<input id="share-url" type="url" value="http://naotu.baidu.com/?shareId=kcev3dd" />
......@@ -94,6 +96,7 @@
target="_blank">Contact Us
</a>
</div>
</div>
</body>
<!--脑图启动代码-->
......@@ -124,6 +127,10 @@
km.on('unknownprotocal', function(ev) {
alert('不支持的文件格式!');
});
document.body.ontouchmove = function(e) {
//e.preventDefault();
}
</script>
<!--社会分享代码-->
......
Subproject commit 5a3fc4422c0d3f1c2d812dd810d8ae7693fa3c93
Subproject commit 47c11b5d7977c81df1c2f1d779933d38ac6edb0e
KityMinder.LANG['zh-cn'] = {
'template': {
'default': '思维导图',
'structure': '组织结构图'
'structure': '组织结构图',
'filetree': '文件夹'
},
'theme': {
'classic': '脑图经典',
......@@ -35,8 +36,8 @@ KityMinder.LANG['zh-cn'] = {
'image': '插入图片',
'hyperlink': '插入链接',
'unhyperlink': '删除链接',
'expandnode': '展开节点',
'collapsenode': '收起节点',
'expandnode': '展开到叶子',
'collapsenode': '收起到一级节点',
'template': '模板',
'theme': '皮肤'
},
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src="lib/jquery-2.1.0.min.js" charset="utf-8"></script>
<script src="kity/dist/kitygraph.all.js" charset="utf-8"></script>
<script src="import.js" charset="utf-8"></script>
<script src="kityminder.config.js" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js" charset="utf-8"></script>
<script src="lib/zip.js" charset="utf-8"></script>
<script>
zip.inflateJSPath = 'lib/inflate.js';
</script>
<script src="lib/jquery.xml2json.js" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js" charset="utf-8"></script>
<script src="social/social.js" charset="utf-8"></script>
<link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="favicon.ico" type="image/x-icon" rel="apple-touch-icon-precomposed">
<style>
.kmui-toolbar, #social button#save-btn, #draft-btn, .user-file-menu li:first-child {
display: none;
}
</style>
</head>
<body>
<div id="kityminder" onselectstart="return false"></div>
<div id="share-dialog" >
<h3>URL分享:</h3>
<p>
<input id="share-url" type="url" value="http://naotu.baidu.com/?shareId=kcev3dd" />
<button id="copy-share-url" data-clipboard-target="share-url" type="button">复制</button>
</p>
<h3>社交分享:</h3>
<p id="share-platform" class="bdsharebuttonbox">
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
<a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
<a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a>
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
</p>
</div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdMini":"2","bdMiniList":[],"bdPic":"","bdStyle":"1","bdSize":"32"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
</body>
<script>
// create km instance
window.km = KM.getKityMinder('kityminder');
//km.setDisabled();
km.execCommand('hand');
</script>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -249,6 +249,10 @@ $(function() {
e.stopPropagation();
});
$('body').delegate('#global-zeroclipboard-html-bridge', 'mousedown', function(e) {
e.stopPropagation();
});
var copyTrickTimer = 0;
$('body').on('mousedown', function(e) {
copyTrickTimer = setTimeout(function() {
......
......@@ -183,7 +183,7 @@ button {
}
input {
width: 260px;
width: 255px;
height: 22px;
line-height: 22px;
padding: 4px 4px 0;
......@@ -204,7 +204,7 @@ button {
#copy-share-url {
display: inline-block;
margin: 0;
width: 70px;
width: 75px;
height: 28px;
line-height: 28px;
vertical-align: middle;
......
......@@ -62,9 +62,13 @@ KM.registerUI( 'contextmenu', function () {
if(item.divider){
data.pop();
}
var pos = e.getPosition('screen');
var offset = $(me.getPaper().container).offset();
pos.y -= offset.top;
pos.x -= offset.left;
$menu.kmui().setData({
data:data
}).position(e.getPosition()).show();
}).position(pos).show();
}
});
......
......@@ -45,7 +45,7 @@ var keymap = KityMinder.keymap = (function(origin) {
'NumLock': 144,
'Cmd': 91,
'CmdFF':224,
'F2': 113,
'F3': 114,
'F4': 115,
......@@ -69,25 +69,42 @@ var keymap = KityMinder.keymap = (function(origin) {
'n': 78,
'/': 191,
'.': 190,
'notContentInput': {
8: 1,
46: 1,
controlKeys:{
16:1,
17:1,
18:1,
20:1,
91:1,
224:1
},
'notContentChange': {
13: 1,
9: 1,
33: 1,
34: 1,
35: 1,
36: 1,
16: 1,
17: 1,
18: 1,
20: 1,
91: 1,
//上下左右
37: 1,
38: 1,
39: 1,
40: 1,
113: 1
113: 1,
114: 1,
115: 1,
144: 1,
27: 1
},
'isSelectedNodeKey': {
//上下左右
37: 1,
......@@ -96,5 +113,7 @@ var keymap = KityMinder.keymap = (function(origin) {
40: 1,
13: 1,
9: 1
}
},
'a':65
});
\ No newline at end of file
......@@ -112,6 +112,30 @@ kity.extendClass(MinderNode, {
return this;
},
setVertexIn: function(p) {
this._vertexIn = p;
},
setVertexOut: function(p) {
this._vertexOut = p;
},
getVertexIn: function() {
return this._vertexIn || new kity.Point();
},
getVertexOut: function() {
return this._vertexOut || new kity.Point();
},
getLayoutVertexIn: function() {
return this.getGlobalLayoutTransform().transformPoint(this.getVertexIn());
},
getLayoutVertexOut: function() {
return this.getGlobalLayoutTransform().transformPoint(this.getVertexOut());
},
getLayoutRoot: function() {
if (this.isLayoutRoot()) {
return this;
......@@ -292,21 +316,27 @@ var Layout = kity.createClass('Layout', {
},
/**
* 工具方法:计算给节点的子树所占的布局区域
* 工具方法:计算给定的节点的子树所占的布局区域
*
* @param {MinderNode} nodes 需要计算的节点
*
* @return {Box} 计算的结果
*/
getTreeBox: function(nodes) {
var i, node, matrix, treeBox;
var g = KityMinder.Geometry;
var box = {
x: 0,
y: 0,
height: 0,
width: 0
};
var g = KityMinder.Geometry;
var i, node, matrix, treeBox;
if (!(nodes instanceof Array)) nodes = [nodes];
for (i = 0; i < nodes.length; i++) {
node = nodes[i];
matrix = node.getLayoutTransform();
......@@ -319,6 +349,7 @@ var Layout = kity.createClass('Layout', {
box = g.mergeBox(box, matrix.transformBox(treeBox));
}
return box;
},
......
/* global Layout:true */
window.layoutSwitch = true;
KityMinder.registerLayout('bottom', kity.createClass({
base: Layout,
doLayout: function(node) {
var layout = this;
if (node.isLayoutRoot()) {
this.doLayoutRoot(node);
} else {
this.arrange(node);
}
},
doLayoutRoot: function(root) {
this.arrange(root);
},
arrange: function(node) {
var children = node.getChildren();
var _this = this;
if (!children.length) {
return false;
} else {
var totalTreeWidth = 0;
// 计算每个 child 的树所占的矩形区域
var childTreeBoxes = children.map(function(node, index, children) {
var box = _this.getTreeBox([node]);
totalTreeWidth += box.width;
if (index > 0) {
totalTreeWidth += children[index - 1].getStyle('margin-left');
totalTreeWidth += node.getStyle('margin-right');
}
return box;
});
var nodeContentBox = node.getContentBox();
node.setLayoutVector(new kity.Vector(nodeContentBox.cx, nodeContentBox.bottom));
var i, x, y, child, childTreeBox, childContentBox;
var transform = new kity.Matrix();
x = -totalTreeWidth / 2;
for (i = 0; i < children.length; i++) {
child = children[i];
childTreeBox = childTreeBoxes[i];
childContentBox = child.getContentBox();
if (!childContentBox.width) continue;
//水平方向上的布局
x += childTreeBox.width / 2;
if (i > 0) {
x += children[i].getStyle('margin-left');
}
y = nodeContentBox.height + node.getStyle('margin-bottom') + children[i].getStyle('margin-top');
children[i].setLayoutTransform(new kity.Matrix().translate(x, y));
x += childTreeBox.width / 2 + children[i].getStyle('margin-right');
}
}
var me = this;
// 子树的总宽度(包含间距)
var totalTreeWidth = 0;
// 父亲所占的区域
var nodeContentBox = node.getContentBox();
// 为每一颗子树准备的迭代变量
var i, x0, x, y, child, childTreeBox, childContentBox, matrix;
// 先最左对齐
x0 = x = nodeContentBox.left;
for (i = 0; i < children.length; i++) {
child = children[i];
childContentBox = child.getContentBox();
childTreeBox = this.getTreeBox(child);
matrix = new kity.Matrix();
if (node.isRoot()) {
var branchBox = this.getBranchBox(children);
var dx = branchBox.cx - nodeContentBox.cx;
// 忽略无宽度的节点(收起的)
if (!childContentBox.width) continue;
children.forEach(function(child) {
child.getLayoutTransform().translate(-dx, 0);
});
if (i > 0) {
x += child.getStyle('margin-left');
}
x -= childTreeBox.left;
// arrange x
matrix.translate(x, 0);
// 为下个位置准备
x += childTreeBox.right;
if (i < children.length - 1) x += child.getStyle('margin-right');
y = nodeContentBox.bottom - childTreeBox.top +
node.getStyle('margin-bottom') + child.getStyle('margin-top');
matrix.translate(0, y);
// 设置结果
child.setLayoutTransform(matrix);
child.setVertexIn(new kity.Point(childContentBox.cx, childContentBox.top));
}
// 设置布局矢量为向下
node.setLayoutVector(new kity.Vector(0, 1));
// 设置流出顶点
node.setVertexOut(new kity.Point(nodeContentBox.cx, nodeContentBox.bottom));
var dx = (x - x0 - nodeContentBox.width) / 2;
children.forEach(function(child) {
child.getLayoutTransform().translate(-dx, 0);
});
},
getOrderHint: function(node) {
......@@ -98,13 +107,14 @@ KityMinder.registerLayout('bottom', kity.createClass({
}));
KityMinder.registerConnectProvider('bottom', function(node, parent, connection) {
var box = node.getLayoutBox(),
pBox = parent.getLayoutBox();
var pout = parent.getLayoutVertexOut(),
pin = node.getLayoutVertexIn();
var pathData = [];
pathData.push('M', new kity.Point(pBox.cx, pBox.bottom));
pathData.push('L', new kity.Point(pBox.cx, pBox.bottom + parent.getStyle('margin-bottom')));
pathData.push('L', new kity.Point(box.cx, pBox.bottom + parent.getStyle('margin-bottom')));
pathData.push('L', new kity.Point(box.cx, box.top));
var r = Math.round;
pathData.push('M', new kity.Point(r(pout.x), pout.y));
pathData.push('L', new kity.Point(r(pout.x), pout.y + parent.getStyle('margin-bottom')));
pathData.push('L', new kity.Point(r(pin.x), pout.y + parent.getStyle('margin-bottom')));
pathData.push('L', new kity.Point(r(pin.x), pin.y));
connection.setMarker(null);
connection.setPathData(pathData);
});
\ No newline at end of file
......@@ -67,9 +67,11 @@ KityMinder.registerLayout('default', kity.createClass({
y = -totalTreeHeight / 2;
if (side != 'left') {
parent.setLayoutVector(new kity.Vector(nodeContentBox.right, nodeContentBox.cy));
parent.setVertexOut(new kity.Point(nodeContentBox.right, nodeContentBox.cy));
parent.setLayoutVector(new kity.Vector(1, 0));
} else {
parent.setLayoutVector(new kity.Vector(nodeContentBox.left, nodeContentBox.cy));
parent.setVertexOut(new kity.Point(nodeContentBox.left, nodeContentBox.cy));
parent.setLayoutVector(new kity.Vector(-1, 0));
}
for (i = 0; i < children.length; i++) {
......
......@@ -27,10 +27,12 @@ KityMinder.registerLayout('filetree', kity.createClass({
return box;
});
var nodeContentBox = node.getContentBox();
node.setLayoutVector(new kity.Vector(0, nodeContentBox.bottom));
var i, x, y, child, childTreeBox, childContentBox;
var transform = new kity.Matrix();
node.setVertexOut(new kity.Point(0, nodeContentBox.bottom));
node.setLayoutVector(new kity.Vector(0, 1));
y = nodeContentBox.bottom + node.getStyle('margin-bottom');
for (i = 0; i < children.length; i++) {
......
......@@ -38,6 +38,7 @@ var DropHinter = kity.createClass('DropHinter', {
target.getStyle('drop-hint-color') || 'yellow',
target.getStyle('drop-hint-width') || 2
);
this.bringTop();
}
}
});
......@@ -299,7 +300,12 @@ var TreeDragger = kity.createClass('TreeDragger', {
function area(box) {
return box.width * box.height;
}
return intersectBox && area(intersectBox) > 0.5 * Math.min(area(sourceBox), area(targetBox));
if (!intersectBox) return false;
// 面积判断
if (area(intersectBox) > 0.5 * Math.min(area(sourceBox), area(targetBox))) return true;
if (intersectBox.width + 1 >= Math.min(sourceBox.width, targetBox.width)) return true;
if (intersectBox.height + 1 >= Math.min(sourceBox.height, targetBox.height)) return true;
return false;
});
this._renderDropHint(this._dropSucceedTarget);
return !!this._dropSucceedTarget;
......@@ -320,7 +326,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
_renderOrderHint: function(hint) {
this._orderHinter.render(hint);
},
preventDragMove:function(){
preventDragMove: function() {
this._startPosition = null;
}
});
......@@ -348,8 +354,8 @@ KityMinder.registerModule('DragTree', function() {
e.stopPropagation();
this.fire('contentchange');
},
'statuschange':function(e){
if(e.lastStatus == 'textedit' && e.currentStatus == 'normal'){
'statuschange': function(e) {
if (e.lastStatus == 'textedit' && e.currentStatus == 'normal') {
dragger.preventDragMove();
}
}
......
......@@ -31,11 +31,22 @@ KityMinder.registerModule('TextEditModule', function() {
.setColor(color);
receiver
.setMinderNode(node)
.updateContainerRangeBySel();
if(browser.ie ){
var timer = setInterval(function(){
var nativeRange = range.nativeSel.getRangeAt(0);
if(!nativeRange || nativeRange.collapsed){
range.select();
}else {
clearInterval(timer);
}
});
}
receiver.minderNode.setTmpData('_lastTextContent',receiver.textShape.getContent());
km.setStatus('inputready');
......@@ -108,7 +119,7 @@ KityMinder.registerModule('TextEditModule', function() {
if(selectionReadyShow){
textShape.setStyle('cursor', 'text');
sel.clearBaseOffset();
receiver.updateSelection();
setTimeout(function() {
sel.setShow();
......@@ -123,7 +134,8 @@ KityMinder.registerModule('TextEditModule', function() {
}
//模拟光标没有准备好
receiver.clearReady();
//当点击空白处时,光标需要消失
receiver.clear();
},
'inputready.keyup':function(e){
......@@ -162,7 +174,7 @@ KityMinder.registerModule('TextEditModule', function() {
sel.setColor(node.getStyle('text-selection-color'));
sel.clearBaseOffset();
node.getTextShape().setStyle('cursor', 'text');
......@@ -191,7 +203,7 @@ KityMinder.registerModule('TextEditModule', function() {
}else {
//当有光标时,要同步选区
if(!sel.collapsed){
sel.clearBaseOffset();
receiver.updateContainerRangeBySel();
}
......@@ -215,7 +227,8 @@ KityMinder.registerModule('TextEditModule', function() {
var offset = e.getPosition(this.getRenderContainer());
dir = offset.x > lastEvtPosition.x ? 1 : (offset.x < lastEvtPosition.x ? -1 : dir);
receiver.updateSelectionByMousePosition(offset, dir)
.updateSelectionShow(dir);
.updateSelectionShow(dir)
.updateContainerRangeBySel();
lastEvtPosition = e.getPosition(this.getRenderContainer());
......@@ -261,9 +274,8 @@ KityMinder.registerModule('TextEditModule', function() {
}
receiver.clear();
if (this.getStatus() == 'textedit') {
this.setStatus('normal');
if(sel.isShow()){
receiver.updateTextOffsetData().updateSelection();
}
},
'layoutfinish':function(e){
......@@ -271,12 +283,18 @@ KityMinder.registerModule('TextEditModule', function() {
receiver
.setBaseOffset()
.setContainerStyle();
}
},
'selectionclear': function() {
km.setStatus('normal');
receiver.clear();
var node = km.getSelectedNode();
if(node){
inputStatusReady(node);
}else{
km.setStatus('normal');
receiver.clear();
}
},
'blur': function() {
receiver.clear();
......@@ -288,6 +306,7 @@ KityMinder.registerModule('TextEditModule', function() {
'textedit.mousewheel': function() {
receiver.setContainerStyle();
}
}
};
});
\ No newline at end of file
......@@ -43,11 +43,19 @@ Minder.Range = kity.createClass('Range',{
startOffset:range.startOffset
};
},
getStartOffset:function(){
return this.nativeRange.startOffset;
},
getEndOffset:function(){
return this.nativeRange.endOffset;
},
collapse:function(toStart){
this.nativeRange.collapse(toStart === true);
return this;
},
isCollapsed:function(){
return this.nativeRange.collapsed;
},
insertNode:function(node){
this.nativeRange.insertNode(node);
return this;
......@@ -57,4 +65,5 @@ Minder.Range = kity.createClass('Range',{
this.nativeRange = this.nativeSel.getRangeAt(0);
return this;
}
});
\ No newline at end of file
This diff is collapsed.
......@@ -109,8 +109,5 @@ Minder.Selection = kity.createClass( 'Selection', {
},
isHide:function(){
return !this._show;
},
clearBaseOffset:function(){
this.baseOffset = this.currentEndOffset = null;
}
} );
\ No newline at end of file
......@@ -117,8 +117,7 @@ KityMinder.registerModule('Expand', function() {
var ExpandNodeCommand = kity.createClass('ExpandNodeCommand', {
base: Command,
execute: function(km) {
var nodes = km.getSelectedNodes();
if (!nodes.length) nodes.push(km.getRoot());
var nodes = km.getRoot().getChildren();
nodes.forEach(function(node) {
node.expand(EXPAND_POLICY.DEEP_TO_LEAF);
});
......@@ -163,6 +162,10 @@ KityMinder.registerModule('Expand', function() {
e.stopPropagation();
e.preventDefault();
});
this.on('dblclick click mouseup', function(e) {
e.stopPropagation();
e.preventDefault();
});
},
setState: function(state) {
......@@ -202,22 +205,13 @@ KityMinder.registerModule('Expand', function() {
expander.setState(visible && node.children.length ? node.getData(EXPAND_STATE_DATA) : 'hide');
var x, y;
var pos = node.getLayoutVector();
pos = new kity.Vector(pos.x, pos.y);
var vector = node.getLayoutVector().normalize(expander.radius + node.getStyle('stroke-width'));
var position = node.getVertexOut().offset(vector);
pos = pos.normalize(pos.length() + expander.radius + 1);
this.expander.setTranslate(pos);
this.expander.setTranslate(position);
}
});
return {
addShortcutKeys: {
'ExpandNode': 'ctrl+/', //expand
'CollapseNode': 'ctrl+.' //collapse
},
commands: {
'ExpandNode': ExpandNodeCommand,
'CollapseNode': CollapseNodeCommand
......@@ -229,14 +223,23 @@ KityMinder.registerModule('Expand', function() {
r.update(r.getRenderShape(), e.node);
}
},
'preimport': function(e) {
var json = e.json;
},
'beforerender': function(e) {
var node = e.node;
var visible = !node.parent || node.parent.isExpanded();
node.getRenderContainer().setVisible(visible);
if (!visible) e.stopPropagation();
},
'normal.keydown': function(e) {
if (this.getStatus() == 'textedit') return;
if (e.originEvent.keyCode == keymap['/']) {
var expanded = this.getSelectedNode().isExpanded();
this.getSelectedNodes().forEach(function(node) {
if (expanded) node.collapse();
else node.expand();
});
e.preventDefault();
e.stopPropagationImmediately();
}
}
},
renderers: {
......
......@@ -102,8 +102,9 @@ KityMinder.registerModule("HistoryModule", function() {
if (compareNode(srcNode, tagNode) === false) {
srcNode.setValue(tagNode);
srcNode.render();
}
//todo,这里有性能问题,变成全部render了
srcNode.render();
if (srcNode.isSelected()) {
selectedNodes.push(srcNode);
}
......
......@@ -24,8 +24,8 @@ KityMinder.registerModule('image', function() {
}
return {
width: width,
height: height
width: width | 0,
height: height | 0
};
}
......@@ -46,6 +46,7 @@ KityMinder.registerModule('image', function() {
n.setData('imageSize', size);
n.render();
});
km.fire("saveScene");
km.layout(300);
});
......@@ -118,14 +119,17 @@ KityMinder.registerModule('image', function() {
if (!size) return;
var x = box.cx - size.width / 2;
var y = box.y - size.height - spaceTop;
image
.setUrl(url)
.setX(box.cx - size.width / 2)
.setY(box.y - size.height - spaceTop)
.setWidth(size.width)
.setHeight(size.height);
.setX(x | 0)
.setY(y | 0)
.setWidth(size.width | 0)
.setHeight(size.height | 0);
return new kity.Box(image.getX(), image.getY(), size.width, size.height);
return new kity.Box(x | 0, y | 0, size.width | 0, size.height | 0);
}
});
......
......@@ -183,8 +183,8 @@ KityMinder.registerModule("KeyboardModule", function() {
}
},
'normal.keyup':function(e){
if(browser.ipad){
'normal.keyup': function(e) {
if (browser.ipad) {
var keys = KityMinder.keymap;
var node = e.getTargetNode();
var lang = this.getLang();
......
......@@ -202,9 +202,9 @@ KityMinder.registerModule('Resource', function() {
rect = this.rect;
rect.setPosition(0, box.y - paddingY);
rect.setSize(
this.width = box.width + paddingX * 2,
this.height = box.height + paddingY * 2);
this.width = Math.round(box.width + paddingX * 2);
this.height = Math.round(box.height + paddingY * 2);
rect.setSize(this.width, this.height);
rect.fill(color);
}
});
......@@ -244,7 +244,7 @@ KityMinder.registerModule('Resource', function() {
}
overlay.setVisible(true);
overlay.setValue(resource[i], minder.getResourceColor(resource[i]));
overlay.setTranslate(x, 0);
overlay.setTranslate(x, -1);
x += overlay.width;
}
......@@ -255,7 +255,7 @@ KityMinder.registerModule('Resource', function() {
return {
x: box.right,
y: -overlays[0].height / 2,
y: Math.round(-overlays[0].height / 2),
width: x,
height: overlays[0].height
};
......
......@@ -81,6 +81,9 @@ KityMinder.registerModule('Select', function() {
// 应用选中范围
minder.select(selectedNodes, true);
// 清除多余的东西
window.getSelection().removeAllRanges()
},
selectEnd: function(e) {
if (startPosition) {
......@@ -98,6 +101,11 @@ KityMinder.registerModule('Select', function() {
var lastDownNode = null, lastDownPosition = null;
return {
'init': function() {
window.addEventListener('mouseup', function() {
marqueeActivator.selectEnd();
});
},
'events': {
'normal.mousedown textedit.mousedown inputready.mousedown': function(e) {
......@@ -146,6 +154,22 @@ KityMinder.registerModule('Select', function() {
// 清理一下选择状态
marqueeActivator.selectEnd(e);
},
//全选操作
'normal.keydown inputready.keydown':function(e){
var keyEvent = e.originEvent;
if ( (keyEvent.ctrlKey || keyEvent.metaKey) && keymap.a == keyEvent.keyCode){
var selectedNodes = [];
this.getRoot().traverse(function(node){
selectedNodes.push(node);
});
this.select(selectedNodes,true);
e.preventDefault();
}
}
}
};
......
......@@ -28,8 +28,11 @@ var ViewDragger = kity.createClass("ViewDragger", {
lastPosition = null,
currentPosition = null;
this._minder.on('normal.mousedown readonly.mousedown readonly.touchstart', function (e) {
e.originEvent.preventDefault(); // 阻止中键拉动
this._minder.on('normal.mousedown normal.touchstart readonly.mousedown readonly.touchstart', function(e) {
if (e.originEvent.button == 2) {
e.originEvent.preventDefault(); // 阻止中键拉动
}
// 点击未选中的根节点临时开启
if (e.getTargetNode() == this.getRoot() || e.originEvent.button == 2) {
lastPosition = e.getPosition();
......@@ -37,13 +40,13 @@ var ViewDragger = kity.createClass("ViewDragger", {
}
})
.on('normal.mousemove normal.touchmove', function(e) {
.on('normal.mousemove normal.touchmove readonly.touchmove readonly.mousemove', function(e) {
if (!isTempDrag) return;
var offset = kity.Vector.fromPoints(lastPosition, e.getPosition());
if (offset.length() > 3) this.setStatus('hand');
})
.on('hand.beforemousedown hand.beforetouchend', function(e) {
.on('hand.beforemousedown hand.beforetouchstart', function(e) {
// 已经被用户打开拖放模式
if (dragger.isEnabled()) {
lastPosition = e.getPosition();
......@@ -65,7 +68,7 @@ var ViewDragger = kity.createClass("ViewDragger", {
}
})
.on('mouseup', function(e) {
.on('mouseup touchend', function(e) {
lastPosition = null;
// 临时拖动需要还原状态
......@@ -86,8 +89,7 @@ KityMinder.registerModule('View', function() {
base: Command,
execute: function(minder) {
minder._viewDragger.setEnabled(!minder._viewDragger.isEnabled());
if (minder._viewDragger.isEnabled()) {
if (minder.getStatus() != 'hand') {
minder.setStatus('hand');
} else {
minder.rollbackStatus();
......@@ -96,7 +98,7 @@ KityMinder.registerModule('View', function() {
},
queryState: function(minder) {
return minder._viewDragger.isEnabled() ? 1 : 0;
return minder.getStatus() == 'hand' ? 1 : 0;
},
enableReadOnly: false
});
......@@ -156,7 +158,10 @@ KityMinder.registerModule('View', function() {
e.preventDefault();
}
},
mousewheel: function (e) {
statuschange: function(e) {
this._viewDragger.setEnabled(e.currentStatus == 'hand');
},
mousewheel: function(e) {
var dx, dy;
e = e.originEvent;
if (e.ctrlKey || e.shiftKey) return;
......
......@@ -3,49 +3,54 @@ KityMinder.registerModule('Zoom', function() {
var timeline;
me.setDefaultOptions('zoom', [50, 80, 100, 120, 150, 200]);
function fixPaperCTM() {
var paper = me.getPaper();
me.setDefaultOptions('zoom', [10, 20, 30, 50, 80, 100, 120, 150, 200]);
function fixPaperCTM(paper) {
var node = paper.shapeNode;
var ctm = node.getCTM();
var matrix = new kity.Matrix(ctm.a, ctm.b, ctm.c, ctm.d, (ctm.e | 0) + 0.5, (ctm.f | 0) + 0.5);
node.setAttribute('transform', 'matrix(' + matrix.toString() + ')');
}
function zoomMinder(minder, zoom) {
kity.extendClass(Minder, {
zoom: function(value) {
var paper = this.getPaper();
var viewport = paper.getViewPort();
viewport.zoom = value / 100;
viewport.center = {
x: viewport.center.x,
y: viewport.center.y
};
paper.setViewPort(viewport);
if (value == 100) fixPaperCTM(paper);
}
});
function zoomMinder(minder, value) {
var paper = minder.getPaper();
var viewport = paper.getViewPort();
if (!zoom) return;
if (!value) return;
var animator = new kity.Animator({
beginValue: viewport.zoom,
finishValue: zoom / 100,
beginValue: minder._zoomValue,
finishValue: value,
setter: function(target, value) {
viewport.zoom = value;
viewport.center = {
x: viewport.center.x,
y: viewport.center.y
};
target.setViewPort(viewport);
fixPaperCTM();
target.zoom(value);
}
});
minder.zoom = zoom;
minder._zoomValue = value;
if (timeline) {
timeline.pause();
}
timeline = animator.start(paper, 500, 'ease', function() {
minder.refresh(500);
});
timeline = animator.start(minder, 300, 'easeInOutSine');
}
var ZoomCommand = kity.createClass('Zoom', {
base: Command,
execute: zoomMinder,
queryValue: function(minder) {
return minder.zoom;
return minder._zoomValue;
}
});
......@@ -61,7 +66,7 @@ KityMinder.registerModule('Zoom', function() {
var stack = minder.getOptions('zoom'),
i;
for (i = 0; i < stack.length; i++) {
if (stack[i] > minder.zoom) return stack[i];
if (stack[i] > minder._zoomValue) return stack[i];
}
return 0;
},
......@@ -80,7 +85,7 @@ KityMinder.registerModule('Zoom', function() {
var stack = minder.getOptions('zoom'),
i;
for (i = stack.length - 1; i >= 0; i--) {
if (stack[i] < minder.zoom) return stack[i];
if (stack[i] < minder._zoomValue) return stack[i];
}
return 0;
},
......@@ -89,7 +94,7 @@ KityMinder.registerModule('Zoom', function() {
return {
init: function() {
this.zoom = 100;
this._zoomValue = 100;
},
commands: {
'zoom-in': ZoomInCommand,
......@@ -113,9 +118,6 @@ KityMinder.registerModule('Zoom', function() {
}
},
'ready': function() {
this._zoomValue = 1;
},
'normal.mousewheel readonly.mousewheel': function(e) {
if (!e.originEvent.ctrlKey) return;
var delta = e.originEvent.wheelDelta;
......
......@@ -10,14 +10,11 @@ if (!kity.Browser.ie) {
fileDescription: 'PNG 图片',
fileExtension: '.png',
encode: function(json, km) {
var paper = km.getPaper();
var viewport = paper.getViewPort();
var originZoom = viewport.zoom;
var originZoom = km._zoomValue;
viewport.zoom = 1;
paper.setViewPort(viewport);
var domContainer = km.getPaper().container,
var paper = km.getPaper(),
paperTransform = paper.shapeNode.getAttribute('transform'),
domContainer = paper.container,
svgXml,
$svg,
......@@ -27,27 +24,27 @@ if (!kity.Browser.ie) {
renderContainer = km.getRenderContainer(),
renderBox = renderContainer.getRenderBox(),
transform = renderContainer.getTransform(),
width = renderBox.width,
height = renderBox.height,
width = renderBox.width + 1,
height = renderBox.height + 1,
padding = 20,
canvas = document.createElement('canvas'),
ctx = canvas.getContext('2d'),
blob, DomURL, url, img, finishCallback;
paper.shapeNode.setAttribute('transform', 'translate(0.5, 0.5)');
renderContainer.translate(-renderBox.x, -renderBox.y);
svgXml = km.getPaper().container.innerHTML;
svgXml = paper.container.innerHTML;
renderContainer.translate(renderBox.x, renderBox.y);
viewport.zoom = originZoom;
paper.setViewPort(viewport);
paper.shapeNode.setAttribute('transform', paperTransform);
$svg = $(svgXml).filter('svg');
$svg.attr({
width: renderBox.width,
height: renderBox.height,
width: renderBox.width + 1,
height: renderBox.height + 1,
style: 'font-family: Arial, "Microsoft Yahei","Heiti SC";'
});
......
......@@ -6,14 +6,9 @@ if (!kity.Browser.ie) {
fileExtension: '.svg',
mineType: 'image/svg+xml',
encode: function(json, km) {
var paper = km.getPaper();
var viewport = paper.getViewPort();
var originZoom = viewport.zoom;
viewport.zoom = 1;
paper.setViewPort(viewport);
var domContainer = km.getPaper().container,
var paper = km.getPaper(),
paperTransform = paper.shapeNode.getAttribute('transform'),
svgXml,
$svg,
......@@ -24,13 +19,15 @@ if (!kity.Browser.ie) {
height = renderBox.height,
padding = 20;
paper.shapeNode.setAttribute('transform', 'translate(0.5, 0.5)');
svgXml = km.getPaper().container.innerHTML;
paper.shapeNode.setAttribute('transform', paperTransform);
$svg = $(svgXml).filter('svg');
$svg.attr({
width: width + padding * 2 | 0,
height: height + padding * 2 | 0,
style: 'font-family: Arial, "Microsoft Yahei", "Heiti SC";'
style: 'font-family: Arial, "Microsoft Yahei", "Heiti SC"; background: ' + km.getStyle('background')
});
$svg[0].setAttribute('viewBox', [renderBox.x - padding | 0,
renderBox.y - padding | 0,
......@@ -42,8 +39,6 @@ if (!kity.Browser.ie) {
svgXml = $('<div></div>').append($svg).html();
svgXml = $('<div></div>').append($svg).html();
viewport.zoom = originZoom;
paper.setViewPort(viewport);
// svg 含有 &nbsp; 符号导出报错 Entity 'nbsp' not defined
svgXml = svgXml.replace(/&nbsp;/g, '&#xa0;');
......
KityMinder.registerTemplate('structure', {
name: '组织结构图',
getLayout: function(node) {
return 'bottom';
}
});
KityMinder.registerTemplate('filetree', {
getLayout: function(node) {
if (node.getData('layout')) return node.getData('layout');
if (node.isRoot()) return 'bottom';
......
KityMinder.registerTheme('classic', {
'background': 'url(themes/default/images/grid.png) repeat',
'background': '#3A4144 url(themes/default/images/grid.png) repeat',
'root-color': '#430',
'root-background': '#e9df98',
......
......@@ -50,7 +50,7 @@
'drop-hint-color': hsl(h, 26, 35),
'drop-hint-width': 5,
'order-hint-area-color': hsl(h, 100, 95).set('a', 0.5),
'order-hint-area-color': hsl(h, 100, 30).set('a', 0.5),
'order-hint-path-color': hsl(h, 100, 25),
'order-hint-path-width': 1,
......
KityMinder.registerTheme('snow', {
'background': 'url(themes/default/images/grid.png) repeat',
'background': '#3A4144 url(themes/default/images/grid.png) repeat',
'root-color': '#430',
'root-background': '#e9df98',
......@@ -41,9 +41,7 @@ KityMinder.registerTheme('snow', {
'marquee-stroke': 'white',
'drop-hint-color': 'yellow',
'sub-drop-hint-width': 2,
'main-drop-hint-width': 4,
'root-drop-hint-width': 4,
'drop-hint-width': 4,
'order-hint-area-color': 'rgba(0, 255, 0, .5)',
'order-hint-path-color': '#0f0',
......
......@@ -2,13 +2,21 @@
html, body, div {
margin: 0;
padding: 0;
/* background: #FFFFFF; */
margin-top: 0 !important;
}
html, body, #kityminder, div.kmui-editor-body {
overflow: hidden;
-moz-user-select: none;
width: 100%;
}
#content-wrapper {
overflow: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#title, #panel {
background: hsl(224, 16%, 27%);
font-family: 'Hiragino Sans GB', 'Arial', 'Microsoft Yahei';
......@@ -61,7 +69,6 @@ html, body, #kityminder, div.kmui-editor-body {
#menu {
float: left;
flo
}
#panel button:hover, #panel button.active {
......@@ -258,7 +265,7 @@ svg, body {
font-family: Arial, "Microsoft Yahei", "Heiti SC", sans-serif;
}
#about {
position:absolute;
position: absolute;
bottom: 0;
right: 0;
height: 40px;
......@@ -266,14 +273,12 @@ svg, body {
background: #5d697a;
color: #eee;
font-family:Arial;
font-size:13px;
font-size: 13px;
font-weight:normal;
margin:0;
text-align: right;
padding: 0 15px 0 60px;
border-bottom: 5px solid #393F4F;
-webkit-font-smoothing: antialiased;
position: absolute;
transition: all ease .3s 0.3s;
......
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