jsmind 0.5.7 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,95 @@
1
+ {
2
+ "meta": {
3
+ "name": "jsMind remote",
4
+ "author": "hizzgdev@163.com",
5
+ "version": "0.2"
6
+ },
7
+ "format": "node_tree",
8
+ "data": {
9
+ "id": "root",
10
+ "topic": "jsMind",
11
+ "children": [
12
+ {
13
+ "id": "easy",
14
+ "topic": "Easy",
15
+ "direction": "left",
16
+ "expanded": false,
17
+ "children": [
18
+ { "id": "easy1", "topic": "Easy to show" },
19
+ { "id": "easy2", "topic": "Easy to edit" },
20
+ { "id": "easy3", "topic": "Easy to store" },
21
+ {
22
+ "id": "easy4",
23
+ "topic": "Easy to embed",
24
+ "children": [
25
+ { "id": "easy41", "topic": "Easy to show" },
26
+ { "id": "easy42", "topic": "Easy to edit" },
27
+ { "id": "easy43", "topic": "Easy to store" },
28
+ {
29
+ "id": "open44",
30
+ "topic": "BSD License",
31
+ "children": [
32
+ { "id": "open441", "topic": "on GitHub" },
33
+ { "id": "open442", "topic": "BSD License" }
34
+ ]
35
+ },
36
+ { "id": "easy45", "topic": "Easy to embed" }
37
+ ]
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ "id": "open",
43
+ "topic": "Open Source",
44
+ "direction": "right",
45
+ "children": [
46
+ { "id": "open1", "topic": "on GitHub" },
47
+ {
48
+ "id": "open2",
49
+ "topic": "BSD License",
50
+ "children": [
51
+ { "id": "open21", "topic": "on GitHub" },
52
+ {
53
+ "id": "open22",
54
+ "topic": "BSD License",
55
+ "children": [
56
+ { "id": "open221", "topic": "on GitHub" },
57
+ { "id": "open222", "topic": "BSD License" }
58
+ ]
59
+ }
60
+ ]
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "id": "powerful",
66
+ "topic": "Powerful",
67
+ "direction": "right",
68
+ "expanded": false,
69
+ "children": [
70
+ { "id": "powerful1", "topic": "Base on Javascript" },
71
+ { "id": "powerful2", "topic": "Base on HTML5" },
72
+ {
73
+ "id": "powerful3",
74
+ "topic": "Depends on you",
75
+ "expanded": false,
76
+ "children": [
77
+ { "id": "powerful31", "topic": "Base on Javascript" },
78
+ { "id": "powerful32", "topic": "Base on HTML5" },
79
+ { "id": "powerful33", "topic": "Depends on you" }
80
+ ]
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "id": "other",
86
+ "topic": "test node",
87
+ "direction": "left",
88
+ "children": [
89
+ { "id": "other1", "topic": "I'm from ajax" },
90
+ { "id": "other2", "topic": "I can do everything" }
91
+ ]
92
+ }
93
+ ]
94
+ }
95
+ }
@@ -0,0 +1,103 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>jsMind</title>
7
+ <link type="text/css" rel="stylesheet" href="../style/jsmind.css" />
8
+ <style type="text/css">
9
+ #jsmind_container {
10
+ width: 800px;
11
+ height: 500px;
12
+ border: solid 1px #ccc;
13
+ /*background:#f4f4f4;*/
14
+ background: #f4f4f4;
15
+ }
16
+ </style>
17
+ </head>
18
+ <body>
19
+ <input type="file" onchange="load_file(this);" />
20
+ <button onclick="save_nodetree();">nodetree</button>
21
+ <button onclick="replay();">replay</button>
22
+ <div id="jsmind_container"></div>
23
+ <script type="text/javascript" src="../es6/jsmind.js"></script>
24
+ <script type="text/javascript" src="../es6/jsmind.draggable-node.js"></script>
25
+ <script type="text/javascript" src="../features/jsmind.shell.js"></script>
26
+ <script type="text/javascript">
27
+ var _jm = null;
28
+ function load_jsmind() {
29
+ var mind = {
30
+ meta: {
31
+ name: 'demo',
32
+ author: 'hizzgdev@163.com',
33
+ version: '0.2',
34
+ },
35
+ format: 'node_array',
36
+ data: [
37
+ { id: 'root', isroot: true, topic: 'jsMind' },
38
+
39
+ { id: 'sub1', parentid: 'root', topic: 'sub1' },
40
+ { id: 'sub11', parentid: 'sub1', topic: 'sub11' },
41
+ { id: 'sub12', parentid: 'sub1', topic: 'sub12' },
42
+ { id: 'sub13', parentid: 'sub1', topic: 'sub13' },
43
+
44
+ { id: 'sub2', parentid: 'root', topic: 'sub2' },
45
+ { id: 'sub21', parentid: 'sub2', topic: 'sub21' },
46
+ { id: 'sub22', parentid: 'sub2', topic: 'sub22' },
47
+
48
+ { id: 'sub3', parentid: 'root', topic: 'sub3' },
49
+ ],
50
+ };
51
+ var options = {
52
+ container: 'jsmind_container',
53
+ editable: true,
54
+ theme: 'primary',
55
+ shortcut: {
56
+ handles: {
57
+ test: function (j, e) {
58
+ console.log(j);
59
+ },
60
+ },
61
+ mapping: {
62
+ test: 89,
63
+ },
64
+ },
65
+ };
66
+ _jm = new jsMind(options);
67
+ _jm.show(mind);
68
+ // jm.set_readonly(true);
69
+ // var mind_data = jm.get_data();
70
+ // alert(mind_data);
71
+ }
72
+
73
+ function load_file(fi) {
74
+ var files = fi.files;
75
+ if (files.length > 0) {
76
+ var file_data = files[0];
77
+ jsMind.util.file.read(file_data, function (freemind_data, jsmind_name) {
78
+ var mind = jsmind_data;
79
+ if (!!mind) {
80
+ _jm.show(mind);
81
+ } else {
82
+ console.error('can not open this file as mindmap');
83
+ }
84
+ });
85
+ }
86
+ }
87
+
88
+ function save_nodetree() {
89
+ var mind_data = _jm.get_data('node_tree');
90
+ console.log(mind_data);
91
+ }
92
+
93
+ function replay() {
94
+ var shell = _jm.shell;
95
+ if (!!shell) {
96
+ shell.replay();
97
+ }
98
+ }
99
+
100
+ load_jsmind();
101
+ </script>
102
+ </body>
103
+ </html>
@@ -8,6 +8,7 @@
8
8
 
9
9
  (function ($w) {
10
10
  'use strict';
11
+ console.warn("The version is outdated. see details: https://hizzgdev.github.io/jsmind/es6/README.md")
11
12
  var $d = $w.document;
12
13
  var __name__ = 'jsMind';
13
14
  var jsMind = $w[__name__];
package/js/jsmind.js CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  ; (function ($w) {
10
10
  'use strict';
11
+ console.warn("The version is outdated. see details: https://hizzgdev.github.io/jsmind/es6/README.md")
11
12
  // set 'jsMind' as the library name.
12
13
  // __name__ should be a const value, Never try to change it easily.
13
14
  var __name__ = 'jsMind';
@@ -8,7 +8,7 @@
8
8
 
9
9
  (function ($w) {
10
10
  'use strict';
11
-
11
+ console.warn("The version is outdated. see details: https://hizzgdev.github.io/jsmind/es6/README.md")
12
12
  var __name__ = 'jsMind';
13
13
  var jsMind = $w[__name__];
14
14
  if (!jsMind) { return; }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "jsmind",
3
- "version": "0.5.7",
3
+ "version": "0.6.1",
4
4
  "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.",
5
- "main": "js/jsmind.js",
5
+ "main": "es6/jsmind.js",
6
6
  "directories": {
7
7
  "doc": "docs",
8
8
  "example": "example"