Commit 16c41390 authored by hy's avatar hy

Merge branch 'dev' of github.com:fex-team/kityminder-core into dev

parents 3d944d41 8207d32a
...@@ -18,7 +18,7 @@ KityMinder 是一款强大的脑图可视化/编辑工具,由百度 FEX 团队 ...@@ -18,7 +18,7 @@ KityMinder 是一款强大的脑图可视化/编辑工具,由百度 FEX 团队
```js ```js
<div id="minder-container"></div> <div id="minder-container"></div>
<script type="text/javascript" src="kityminder.all.min.js"></script> <script type="text/javascript" src="kityminder.core.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var minder = new kityminder.Minder({ var minder = new kityminder.Minder({
renderTo: 'minder-container' renderTo: 'minder-container'
...@@ -37,34 +37,19 @@ KityMinder 基于 SVG 技术实现,支持绝大多数的 HTML5 浏览器,包 ...@@ -37,34 +37,19 @@ KityMinder 基于 SVG 技术实现,支持绝大多数的 HTML5 浏览器,包
3. Safari 3. Safari
4. Internet Explorer 10 或以上 4. Internet Explorer 10 或以上
## 依赖说明 ## 使用说明
kityminder-core 依赖 [Kity](https://github.com/fex-team/kity)库。需要二次开发 kityminder-core,需要初始化并更新子模块: kityminder-core 依赖于 [kity](https://github.com/fex-team/kity),开发中用到 seajs 进行异步加载。
例子中 dev.html 使用 seajs 进行包加载,example.html 使用同步加载的方式。
使用步骤如下:
```bash 1. 安装 [bower](http://bower.io/#install-bower)
git submodule init 2. 切换到 kityminder-core 目录下,运行:
git submodule update
```
kityminder-core 的 example 使用 seajs 进行包加载,seajs 可以使用 bower 获取:
```bash ```bash
bower install bower install
``` ```
kityminder-core 使用 grunt 进行打包,安装 npm 组件后直接 grunt 即可打包:
```bash
npm install
grunt
```
想偷懒?可以用下面这个一行安装脚本:
```bash
https://gist.githubusercontent.com/techird/72b420c7ea05154ce821/raw/6416f2709ce82a3a0d86a50763de1ce3ca7f3ca2/setup-km-core
```
## 联系我们 ## 联系我们
问题和建议反馈:[Github Issues](https://github.com/fex-team/kityminder-core/issues) 问题和建议反馈:[Github Issues](https://github.com/fex-team/kityminder-core/issues)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "kityminder-core", "name": "kityminder-core",
"title": "Kity Minder Core", "title": "Kity Minder Core",
"description": "Powerful online mind graphic visualization and editor (command based)", "description": "Powerful online mind graphic visualization and editor (command based)",
"version": "1.4.20", "version": "1.4.21",
"main": [ "main": [
"dist/kityminder.core.min.js", "dist/kityminder.core.min.js",
"dist/kityminder.core.css" "dist/kityminder.core.css"
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "kityminder", "name": "kityminder",
"title": "kityminder", "title": "kityminder",
"description": "KityMinder Core Implement", "description": "KityMinder Core Implement",
"version": "1.4.20", "version": "1.4.21",
"homepage": "https://github.com/fex-team/kityminder-core", "homepage": "https://github.com/fex-team/kityminder-core",
"author": { "author": {
"name": "Baidu FEX", "name": "Baidu FEX",
......
...@@ -30,7 +30,7 @@ define(function(require, exports, module) { ...@@ -30,7 +30,7 @@ define(function(require, exports, module) {
} }
}); });
Minder.version = '1.4.20'; Minder.version = '1.4.21';
Minder.registerInitHook = function(hook) { Minder.registerInitHook = function(hook) {
_initHooks.push(hook); _initHooks.push(hook);
......
...@@ -186,6 +186,13 @@ define(function(require, exports, module) { ...@@ -186,6 +186,13 @@ define(function(require, exports, module) {
drawImage(ctx, $images[i].element, $images[i].x, $images[i].y, $images[i].width, $images[i].height); drawImage(ctx, $images[i].element, $images[i].x, $images[i].y, $images[i].width, $images[i].height);
} }
DomURL.revokeObjectURL(svgDataUrl);
document.body.appendChild(canvas);
return generateDataUrl(canvas);
}, function(err) {
// 这里处理 reject,出错基本上是因为跨域,
// 出错后依然导出,只不过没有图片。
alert('脑图的节点中包含跨域图片,导出的 png 中节点图片不显示,你可以替换掉这些跨域的图片并重试。');
DomURL.revokeObjectURL(svgDataUrl); DomURL.revokeObjectURL(svgDataUrl);
document.body.appendChild(canvas); document.body.appendChild(canvas);
return generateDataUrl(canvas); return generateDataUrl(canvas);
......
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