Commit 5736e35c authored by techird's avatar techird

dist

parent 501b821c
...@@ -2,17 +2,19 @@ Kity Minder ...@@ -2,17 +2,19 @@ Kity Minder
========== ==========
## 简介 ## 简介
KityMinder 是百度 FEX 团队的 f-cube 小组(原UEditor小组)的又一力作。作为一款在线的脑图编辑工具,它有着很多Native编辑工具的交互体验。KM与UE有着一样的宗旨,就是注重最终用户的使用体验。同时,它充分发挥了Web云存储的优势,可以直接将编辑中的脑图同步到云端。此外,借由独创的 “云盘分享”功能,用户可以一键将当前编辑的脑图直接生成在线链接共享给其他用户,实现无缝沟通。
KityMinder 是百度 FEX 团队的 f-cube 小组(原 UEditor 小组)的又一力作。作为一款在线的脑图编辑工具,它有着不亚于 native 脑图工具的交互体验。同时,它充分发挥了 Web 云存储的优势,可以直接将编辑中的脑图同步到云端。此外,借由独创的 “云盘分享”功能,用户可以一键将当前编辑的脑图直接生成在线链接共享给其他用户,实现无缝沟通。
![KityMinder](summary.jpg "KityMinder 界面") ![KityMinder](summary.jpg "KityMinder 界面")
KM是基于SVG技术实现,使用JavaScript+html实现。支持绝大多数的主流浏览器。 KityMinder 基于 SVG 技术实现,支持绝大多数的主流浏览器,包括:
支持列表如下
1. Chrome 1. Chrome
2. Firefox 2. Firefox
3. Safari 3. Safari
4. IE9+ 4. IE9+<sup>*</sup>
*: IE9 不支持部分导出功能。
## 线上版本 ## 线上版本
...@@ -34,9 +36,9 @@ KM是基于SVG技术实现,使用JavaScript+html实现。支持绝大多数的 ...@@ -34,9 +36,9 @@ KM是基于SVG技术实现,使用JavaScript+html实现。支持绝大多数的
## 依赖说明 ## 依赖说明
KityMinder 依赖 Kity 库。刚下载的压缩包或者刚从 github 拉下来的代码会有一个空的 kity 目录。要运行调试,必须加载 Kity 的依赖: KityMinder 依赖 Kity 库。刚下载的压缩包或者刚从 github 拉下来的代码会有一个空的 Kity 目录。要运行调试,必须加载 Kity 的依赖:
1. 如果你下载的是 KityMinder 的压缩包,那么需要手动下载 [Kity](http://kitygraph.github.io/kityminder/kity/dist/kitygraph.all.js) 库到 kity/dist/kitygraph.all.js 1. 如果你下载的是 KityMinder 的压缩包,那么需要手动下载 [Kity](http://fex.baidu.com/kityminder/kity/dist/kity.js) 库到 kity/dist/kity.js
2. 如果你是从 github 上拉源代码下来的,那么可以更新一下子模块: 2. 如果你是从 github 上拉源代码下来的,那么可以更新一下子模块:
...@@ -47,5 +49,6 @@ git submodule update ...@@ -47,5 +49,6 @@ git submodule update
``` ```
## 联系我们 ## 联系我们
邮件: kity@baidu.com
邮件组: kity@baidu.com
讨论群: 374918234 讨论群: 374918234
( function ( utils ) { (function(utils) {
var content = '<div class="image-content" style="padding:20px;width:360px;">'; var content = '<div class="image-content" style="padding:20px;width:360px;">';
content += '<style>'; content += '<style>';
content += '.kmui-dialog-<%= container %> input{'; content += '.kmui-dialog-<%= container %> input{';
...@@ -36,39 +36,39 @@ ...@@ -36,39 +36,39 @@
KM.registerWidget( 'image', { KM.registerWidget('image', {
tpl: content, tpl: content,
initContent: function ( km ) { initContent: function(km) {
var lang = km.getLang( 'dialogs.image' ), var lang = km.getLang('dialogs.image'),
html; html;
if ( lang ) { if (lang) {
html = $.parseTmpl( this.tpl, utils.extend( { html = $.parseTmpl(this.tpl, utils.extend({
'container': 'image' 'container': 'image'
}, lang ) ); }, lang));
} }
this.root().html( html ); this.root().html(html);
}, },
initEvent: function ( km, $w ) { initEvent: function(km, $w) {
$w.find( '#image_insert' ).on( 'click', function () { $w.find('#image_insert').on('click', function() {
km.execCommand( 'image', $w.find( '#image_href' ).val() ); km.execCommand('image', $w.find('#image_href').val());
$w.kmui().hide(); $w.kmui().hide();
} ); });
$w.find( '#image_href' ).on( 'keydown', function ( e ) { $w.find('#image_href').on('keydown', function(e) {
if ( e.keyCode === 13 ) { if (e.keyCode === 13) {
km.execCommand( 'image', $w.find( '#image_href' ).val() ); km.execCommand('image', $w.find('#image_href').val());
$w.kmui().hide(); $w.kmui().hide();
} }
} ).on('input', function() { }).on('input', function() {
$w.find('#image_preview').attr('src', $w.find( '#image_href' ).val()); $w.find('#image_preview').attr('src', $w.find('#image_href').val());
}); });
var url = km.queryCommandValue( 'image' ); var url = km.queryCommandValue('image');
var $input = $w.find( '#image_href' ); var $input = $w.find('#image_href');
$input.val( url || 'http://' ); $input.val(url || 'http://');
if(url) $w.find('#image_preview').attr('src', url); if (url) $w.find('#image_preview').attr('src', url);
setTimeout( function () { setTimeout(function() {
$input.focus(); $input.focus();
} ); });
}, },
width: 400 width: 400
} ); });
} )( KM.Utils ); })(KM.Utils);
\ No newline at end of file \ No newline at end of file
(function (utils) { (function(utils) {
KM.registerWidget('resource', { KM.registerWidget('resource', {
tpl: tpl: '<div class="resource-container">' +
'<div class="resource-container">' + '<div class="add-resource">' +
'<div class="add-resource">' + '<input type="text" /><button class="button">添加</button>' +
'<input type="text" /><button class="button">添加</button>' + '<ul class="global-resource"></ul>' +
'<ul class="global-resource"></ul>' + '</div>' +
'</div>' +
'</div>' + '</div>' +
'<div class="no-selected">未选中节点</div>', '<div class="no-selected">未选中节点</div>',
initContent: function (km, $w) { initContent: function(km, $w) {
var lang = km.getLang('dialogs.resource'), var lang = km.getLang('dialogs.resource'),
html = $.parseTmpl(this.tpl, lang); html = $.parseTmpl(this.tpl, lang);
this.root().html(html); this.root().html(html);
}, },
initEvent: function (km, $w) { initEvent: function(km, $w) {
var $container = $w.find('.resource-container'); var $container = $w.find('.resource-container');
var $noSelected = $w.find('.no-selected'); var $noSelected = $w.find('.no-selected');
var $current = $w.find('.current-resource').hide(); var $current = $w.find('.current-resource').hide();
...@@ -43,7 +42,7 @@ ...@@ -43,7 +42,7 @@
$addInput.val(null); $addInput.val(null);
} }
$addInput.on('keydown', function (e) { $addInput.on('keydown', function(e) {
if (e.keyCode == 13) addResource(); if (e.keyCode == 13) addResource();
}); });
...@@ -51,25 +50,25 @@ ...@@ -51,25 +50,25 @@
switchDisplay(); switchDisplay();
$global.delegate('input[type=checkbox]', 'change', function () { $global.delegate('input[type=checkbox]', 'change', function() {
km.execCommand('resource', $global.find('input[type=checkbox]:checked').map(function (index, chk) { km.execCommand('resource', $global.find('input[type=checkbox]:checked').map(function(index, chk) {
return $(chk).data('resource'); return $(chk).data('resource');
}).toArray()); }).toArray());
}); });
km.on('interactchange', function (e) { km.on('interactchange', function(e) {
var resource = this.queryCommandValue("resource"); var resource = this.queryCommandValue("resource");
var used = this.getUsedResource(); var used = this.getUsedResource();
switchDisplay(); switchDisplay();
$global.empty().append(used.map(function (name) { $global.empty().append(used.map(function(name) {
var $li = $('<li></li>'), var $li = $('<li></li>'),
$label = $('<label></label>').appendTo($li), $label = $('<label></label>').appendTo($li),
$chk = $('<input type="checkbox" />') $chk = $('<input type="checkbox" />')
.data('resource', name) .data('resource', name)
.prop('checked', ~resource.indexOf(name)) .prop('checked', ~resource.indexOf(name))
.appendTo($label); .appendTo($label);
$label.append(name); $label.append(name);
var color = km.getResourceColor(name); var color = km.getResourceColor(name);
return $li.css({ return $li.css({
......
...@@ -7,26 +7,26 @@ ...@@ -7,26 +7,26 @@
<meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。"> <meta name="description" content="百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。">
<script src="lib/jquery-2.1.0.min.js?_=1401256332199" charset="utf-8"></script> <script src="lib/jquery-2.1.0.min.js?_=1403688582922" charset="utf-8"></script>
<script src="lib/ZeroClipboard.min.js?_=1401256332199" charset="utf-8"></script> <script src="lib/ZeroClipboard.min.js?_=1403688582922" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } ); ZeroClipboard.setDefaults( { moviePath: 'lib/ZeroClipboard.swf' } );
</script> </script>
<script src="lib/kitygraph.all.min.js?_=1401256332199" charset="utf-8"></script> <script src="lib/kity.min.js?_=1403688582922" charset="utf-8"></script>
<script src="kityminder.all.min.js?_=1401256332199" charset="utf-8"></script> <script src="kityminder.all.min.js?_=1403688582922" charset="utf-8"></script>
<script src="kityminder.config.js?_=1401256332199" charset="utf-8"></script> <script src="kityminder.config.js?_=1403688582922" charset="utf-8"></script>
<script src="lang/zh-cn/zh-cn.js?_=1401256332199" charset="utf-8"></script> <script src="lang/zh-cn/zh-cn.js?_=1403688582922" charset="utf-8"></script>
<script src="lib/zip.js?_=1401256332199" charset="utf-8"></script> <script src="lib/zip.js?_=1403688582922" charset="utf-8"></script>
<script> <script>
zip.inflateJSPath = 'lib/inflate.js'; zip.inflateJSPath = 'lib/inflate.js';
</script> </script>
<script src="lib/jquery.xml2json.js?_=1401256332199" charset="utf-8"></script> <script src="lib/jquery.xml2json.js?_=1403688582922" charset="utf-8"></script>
<script src="lib/baidu-frontia-js-full-1.0.0.js?_=1401256332199" charset="utf-8"></script> <script src="lib/baidu-frontia-js-full-1.0.0.js?_=1403688582922" charset="utf-8"></script>
<script src="social/draftmanager.js?_=1401256332199" charset="utf-8"></script> <script src="social/draftmanager.js?_=1403688582922" charset="utf-8"></script>
<script src="social/social.js?_=1401256332199" charset="utf-8"></script> <script src="social/social.js?_=1403688582922" charset="utf-8"></script>
<link href="social/social.css" rel="stylesheet"> <link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" /> <link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
</body> </body>
<script> <script>
// create km instance // create km instance
window.km = KM.getKityMinder('kityminder'); km = KM.getKityMinder('kityminder');
// New Version Notify // New Version Notify
$(function() { $(function() {
...@@ -75,6 +75,18 @@ ...@@ -75,6 +75,18 @@
localStorage.lastKMVersion = KM.version; localStorage.lastKMVersion = KM.version;
} }
}); });
km.on('unziperror', function(ev){
alert('unziperror');
});
km.on('parseerror', function(ev){
alert('parseerror');
});
km.on('unknownprotocal', function(ev){
alert('unknownprotocal');
});
</script> </script>
<!--Baidu Tongji Code--> <!--Baidu Tongji Code-->
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
(function () { (function() {
function getKMBasePath(docUrl, confUrl) { function getKMBasePath(docUrl, confUrl) {
return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath()); return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath());
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
'KITYMINDER_HOME_URL': getKMBasePath(), 'KITYMINDER_HOME_URL': getKMBasePath(),
//定义工具栏 //定义工具栏
toolbars: [ toolbars: [
'hand | zoom-in zoom zoom-out | collapsenode expandnode | undo redo | bold italic | fontfamily fontsize forecolor | saveto | switchlayout | hyperlink unhyperlink image removeimage | markers resource | node | help' 'hand | zoom-in zoom zoom-out | collapsenode expandnode | undo redo | bold italic | fontfamily fontsize forecolor | saveto | hyperlink unhyperlink image removeimage | markers resource | node | help'
] ]
//只读模式,默认是false //只读模式,默认是false
//readOnly: true //readOnly: true
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -716,11 +716,17 @@ ...@@ -716,11 +716,17 @@
function seekEOCDR(offset, entriesCallback) { function seekEOCDR(offset, entriesCallback) {
reader.readUint8Array(reader.size - offset, offset, function(bytes) { reader.readUint8Array(reader.size - offset, offset, function(bytes) {
var dataView = getDataHelper(bytes.length, bytes).view; var dataView = getDataHelper(bytes.length, bytes).view;
if (dataView.getUint32(0) != 0x504b0506) { try{
seekEOCDR(offset + 1, entriesCallback); if (dataView.getUint32(0) != 0x504b0506) {
} else { seekEOCDR(offset + 1, entriesCallback);
entriesCallback(dataView); } else {
entriesCallback(dataView);
}
}catch(e){
console.log(e);
onerror(ERR_READ);
} }
}, function() { }, function() {
onerror(ERR_READ); onerror(ERR_READ);
}); });
......
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