From 292946c31c1d09269ae2b850a66afbfa3666ed5d Mon Sep 17 00:00:00 2001 From: hizzgdev Date: Sun, 27 Aug 2023 00:38:09 +0800 Subject: [PATCH 1/2] add demo for requirejs --- README.md | 1 + example/1_basic.html | 9 ++---- example/1_basic_cn.html | 8 ++---- example/3_requirejs.html | 59 ++++++++++++++++++++++++++++++++++++++++ package-lock.json | 4 +-- package.json | 4 +-- src/jsmind.common.js | 2 +- 7 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 example/3_requirejs.html diff --git a/README.md b/README.md index c40a11d7..ff84099f 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ The ES6 version of jsMind has been launched. see details from [es6/README-en.md] - Demo : - [显示一个脑图 Render a mindmap](https://hizzgdev.github.io/jsmind/example/1_basic.html) [[国内版](https://hizzgdev.github.io/jsmind/example/1_basic_cn.html)] - [试用所有功能 Features simple](https://hizzgdev.github.io/jsmind/example/2_features.html) [[国内版](https://hizzgdev.github.io/jsmind/example/2_features_cn.html)] + - [requirejs + jsMind](https://hizzgdev.github.io/jsmind/example/3_requirejs.html) ## Donate diff --git a/example/1_basic.html b/example/1_basic.html index 4e51d419..3370133c 100644 --- a/example/1_basic.html +++ b/example/1_basic.html @@ -14,18 +14,15 @@ width: 800px; height: 500px; border: solid 1px #ccc; - /*background:#f4f4f4;*/ background: #f4f4f4; } +
- - + + - + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e4e6aa51..60d1009a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jsmind", - "version": "0.6.5-preview", + "version": "0.6.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "jsmind", - "version": "0.6.5-preview", + "version": "0.6.5", "license": "BSD-3-Clause", "devDependencies": { "http-server": "^14.1.1", diff --git a/package.json b/package.json index 7b2cd1f4..346d9d23 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "jsmind", - "version": "0.6.5-preview", + "version": "0.6.5", "description": "jsMind is a pure javascript library for mindmap, it base on html5 canvas. jsMind was released under BSD license, you can embed it in any project, if only you observe the license.", "main": "es6/jsmind.js", "exports": { - ".": "es6/jsmind.js", + ".": "./es6/jsmind.js", "draggable-node": "./es6/jsmind.draggable-node.js", "screenshot": "./es6/jsmind.screenshot.js" }, diff --git a/src/jsmind.common.js b/src/jsmind.common.js index efd663f8..18d7d70d 100644 --- a/src/jsmind.common.js +++ b/src/jsmind.common.js @@ -6,7 +6,7 @@ * https://github.com/hizzgdev/jsmind/ */ -export const __version__ = '0.6.5-preview'; +export const __version__ = '0.6.5'; export const __author__ = 'hizzgdev@163.com'; if (typeof String.prototype.startsWith != 'function') { From 20d00ece39a87c2fd4bed7f7921cf3ca8cac6ef1 Mon Sep 17 00:00:00 2001 From: hizzgdev Date: Sun, 27 Aug 2023 00:41:19 +0800 Subject: [PATCH 2/2] format --- example/3_requirejs.html | 110 ++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/example/3_requirejs.html b/example/3_requirejs.html index 068cfb75..5eff4235 100644 --- a/example/3_requirejs.html +++ b/example/3_requirejs.html @@ -1,59 +1,61 @@ + + + + jsMind + + + - - - - jsMind - - - + +

查看页面源文件了解具体写法

+

See the page source for details

+
+ - -

查看页面源文件了解具体写法

-

See the page source for details

-
- - - - + - - \ No newline at end of file + }); + require(['jsmind', 'jsmind/draggable_node'], function (jsMind, _) { + let mind = { + meta: { + name: 'jsMind example', + author: 'hizzgdev@163.com', + version: '0.6.5', + }, + format: 'node_tree', + data: { + id: 'root', + topic: 'jsMind', + children: [], + }, + }; + let options = { + container: 'jsmind_container', + editable: true, + theme: 'primary', + }; + let jm = new jsMind(options); + jm.show(mind); + }); + +