Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] add demo with requirejs, update to v0.6.5 #493

Merged
merged 2 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions example/1_basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
width: 800px;
height: 500px;
border: solid 1px #ccc;
/*background:#f4f4f4;*/
background: #f4f4f4;
}
</style>
</head>

<body>
<div id="jsmind_container"></div>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind/es6/jsmind.js"></script>
<script
type="text/javascript"
src="//cdn.jsdelivr.net/npm/jsmind/es6/jsmind.draggable-node.js"
></script>
<script src="//cdn.jsdelivr.net/npm/jsmind/es6/jsmind.js"></script>
<script src="//cdn.jsdelivr.net/npm/jsmind/es6/jsmind.draggable-node.js"></script>
<script type="text/javascript">
function load_jsmind() {
var mind = {
Expand Down
8 changes: 2 additions & 6 deletions example/1_basic_cn.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@
width: 800px;
height: 500px;
border: solid 1px #ccc;
/*background:#f4f4f4;*/
background: #f4f4f4;
}
</style>
</head>

<body>
<div id="jsmind_container"></div>
<script type="text/javascript" src="//jsd.onmicrosoft.cn/npm/jsmind/es6/jsmind.js"></script>
<script
type="text/javascript"
src="//jsd.onmicrosoft.cn/npm/jsmind/es6/jsmind.draggable-node.js"
></script>
<script src="//jsd.onmicrosoft.cn/npm/jsmind/es6/jsmind.js"></script>
<script src="//jsd.onmicrosoft.cn/npm/jsmind/es6/jsmind.draggable-node.js"></script>
<script type="text/javascript">
function load_jsmind() {
var mind = {
Expand Down
61 changes: 61 additions & 0 deletions example/3_requirejs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsMind</title>
<link
type="text/css"
rel="stylesheet"
href="https://unpkg.com/jsmind@latest/style/jsmind.css"
/>
<style type="text/css">
#jsmind_container {
width: 900px;
height: 600px;
border: solid 1px #ccc;
background: #f4f4f4;
}
</style>
</head>

<body>
<p>查看页面源文件了解具体写法</p>
<p>See the page source for details</p>
<div id="jsmind_container"></div>
</body>

<script src="https://requirejs.org/docs/release/2.3.6/minified/require.js"></script>
<script type="text/javascript">
require.config({
paths: {
// note: replace `latest` with a specific version on production
'jsmind': 'https://unpkg.com/jsmind@latest/es6/jsmind',
'jsmind/draggable_node':
'https://unpkg.com/jsmind@latest/es6/jsmind.draggable-node',
},
});
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);
});
</script>
</html>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion src/jsmind.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down