@dualbox/editor 1.0.40 → 1.0.41

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.
package/html/editor.html CHANGED
@@ -1,22 +1,27 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html>
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
7
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8
- <meta name="viewport" content="width=device-width">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7
+ <meta name="viewport" content="width=device-width" />
9
8
  <script src="../lib/jquery.min.js"></script>
10
9
  <script src="../lib/jquery.autocomplete.min.js"></script>
11
10
  <script src="../lib/popper.min.js"></script>
12
- <link rel="stylesheet" href="../css/plumb.css">
11
+ <link rel="stylesheet" href="../css/plumb.css" />
13
12
 
14
13
  <!-- Bootstrap -->
15
- <link href="../lib/bootstrap-4.0.0-dist/css/bootstrap.min.css" rel="stylesheet">
14
+ <link
15
+ href="../lib/bootstrap-4.0.0-dist/css/bootstrap.min.css"
16
+ rel="stylesheet"
17
+ />
16
18
  <script src="../lib/bootstrap-4.0.0-dist/js/bootstrap.min.js"></script>
17
19
 
18
20
  <!-- Font awesome -->
19
- <link href="../lib/fontawesome-free-5.0.6/web-fonts-with-css/css/fontawesome-all.min.css" rel="stylesheet">
21
+ <link
22
+ href="../lib/fontawesome-free-5.0.6/web-fonts-with-css/css/fontawesome-all.min.css"
23
+ rel="stylesheet"
24
+ />
20
25
 
21
26
  <!-- lodash -->
22
27
  <script src="../lib/lodash.js"></script>
@@ -25,25 +30,28 @@
25
30
  <script src="../lib/fuse.min.js"></script>
26
31
 
27
32
  <!-- Bootstrap-select (see: ) -->
28
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.10/dist/css/bootstrap-select.min.css">
33
+ <link
34
+ rel="stylesheet"
35
+ href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.10/dist/css/bootstrap-select.min.css"
36
+ />
29
37
  <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.10/dist/js/bootstrap-select.min.js"></script>
30
38
 
31
39
  <!-- Vue.js -->
32
40
  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
33
41
  <script>
34
- Vue.config.devtools = true;
42
+ Vue.config.devtools = true;
35
43
  </script>
36
44
 
37
45
  <style>
38
- .html,
39
- body {
40
- margin: 0;
41
- padding: 0;
42
- }
46
+ .html,
47
+ body {
48
+ margin: 0;
49
+ padding: 0;
50
+ }
43
51
  </style>
44
- </head>
52
+ </head>
45
53
 
46
- <body id="superbody" bgcolor="#e3e4e6" style="height: 100vh;">
54
+ <body id="superbody" bgcolor="#e3e4e6" style="height: 100vh;">
47
55
  <div id="editor" style="width: 100%; height: 100vh;"></div>
48
56
 
49
57
  <!--
@@ -57,105 +65,102 @@
57
65
  <!--<script src="../lib/jsPlumb-2.1.8.js"></script> -->
58
66
  <script src="../js/dist/GraphEditor.js"></script>
59
67
  <script src="../require/index.js"></script>
60
- <script>
61
- THREE = {}; // for debug
62
- </script>
63
- <script src="../../../Personnels/webgl-modelers/node_modules/three-js-debug-rendertarget/dist/browser/three-js-debug-rendertarget.js"></script>
64
68
  <script>
65
- // Useful for require.js to work
66
- var sources = {};
67
- window.DualBoxRessources = {};
68
- var addSource = function (pkgName, path, cb) {
69
- sources[path] = { ready: false, cb: cb };
70
-
71
- // log it into DualBox ressources
72
- var fileName = path.replace(/^.*[\\\/]/, '').replace('.js', '');
73
- var packageName = "@dualbox/" + fileName;
74
- window.DualBoxRessources[packageName] = new URL(path, window.location.href).href;
75
-
76
- var s = document.createElement('script');
77
- s.setAttribute('src', path);
78
- s.setAttribute('charset', 'utf-8');
79
- s.setAttribute('data-pkg', pkgName);
80
- sources[path]["script"] = s;
81
- s.onload = function () {
82
- sources[path].ready = true;
83
- sources[path].script.setAttribute('data-loaded', true);
84
-
85
- // check if all our sources are ready
86
- var keys = Object.keys(sources);
87
- for (var i = 0; i < keys.length; i++) {
88
- var s = sources[keys[i]];
89
- if (!s.ready) return false;
90
- }
91
-
92
- // we're here if all sources are ready
93
- for (var i = 0; i < keys.length; i++) {
94
- var s = sources[keys[i]];
95
- if (s.cb) s.cb();
96
- }
97
-
98
-
99
- };
100
- document.body.appendChild(s);
69
+ THREE = {}; // for debug
70
+ </script>
71
+ <script>
72
+ // Useful for require.js to work
73
+ var sources = {};
74
+ window.DualBoxRessources = {};
75
+ var addSource = function(pkgName, path, cb) {
76
+ sources[path] = { ready: false, cb: cb };
77
+
78
+ // log it into DualBox ressources
79
+ var fileName = path.replace(/^.*[\\\/]/, "").replace(".js", "");
80
+ var packageName = "@dualbox/" + fileName;
81
+ window.DualBoxRessources[packageName] = new URL(
82
+ path,
83
+ window.location.href
84
+ ).href;
85
+
86
+ var s = document.createElement("script");
87
+ s.setAttribute("src", path);
88
+ s.setAttribute("charset", "utf-8");
89
+ s.setAttribute("data-pkg", pkgName);
90
+ sources[path]["script"] = s;
91
+ s.onload = function() {
92
+ sources[path].ready = true;
93
+ sources[path].script.setAttribute("data-loaded", true);
94
+
95
+ // check if all our sources are ready
96
+ var keys = Object.keys(sources);
97
+ for (var i = 0; i < keys.length; i++) {
98
+ var s = sources[keys[i]];
99
+ if (!s.ready) return false;
100
+ }
101
+
102
+ // we're here if all sources are ready
103
+ for (var i = 0; i < keys.length; i++) {
104
+ var s = sources[keys[i]];
105
+ if (s.cb) s.cb();
106
+ }
101
107
  };
108
+ document.body.appendChild(s);
109
+ };
102
110
  </script>
103
111
  <script src="../require/require.js"></script>
104
112
 
105
113
  <script>
106
- var packages = _.map(pkgIndex, function (o) { return o.pkg });
107
-
108
- window.editor = new DualboxEditor($('#editor'), {
109
- showLoadButton: true,
110
- showSaveButton: true,
111
-
112
- search: function (text, cb) {
113
- var options = {
114
- shouldSort: true,
115
- threshold: 0.6,
116
- location: 0,
117
- distance: 100,
118
- maxPatternLength: 32,
119
- minMatchCharLength: 1,
120
- tokenize: true,
121
- matchAllTokens: true,
122
- keys: [
123
- "name",
124
- "description"
125
- ]
126
- };
127
- var fuse = new Fuse(packages, options); // "list" is the item array
128
- var result = fuse.search(text);
129
- cb(null, result);
130
- },
131
-
132
- find: function (name, version, cb) {
133
- // We don't handle version here, only the latest
134
- if (!pkgIndex[name]) {
135
- cb('No package with name ' + name + ' found!', null);
136
- }
137
- else {
138
- cb(null, pkgIndex[name].pkg);
139
- }
140
- }
141
- });
142
-
143
- // For debug purpose
144
- window.getApp = function () {
145
- return window.dualboxEditor.v.appManager.app;
146
- };
114
+ var packages = _.map(pkgIndex, function(o) {
115
+ return o.pkg;
116
+ });
117
+
118
+ window.editor = new DualboxEditor($("#editor"), {
119
+ showLoadButton: true,
120
+ showSaveButton: true,
121
+
122
+ search: function(text, cb) {
123
+ var options = {
124
+ shouldSort: true,
125
+ threshold: 0.6,
126
+ location: 0,
127
+ distance: 100,
128
+ maxPatternLength: 32,
129
+ minMatchCharLength: 1,
130
+ tokenize: true,
131
+ matchAllTokens: true,
132
+ keys: ["name", "description"]
133
+ };
134
+ var fuse = new Fuse(packages, options); // "list" is the item array
135
+ var result = fuse.search(text);
136
+ cb(null, result);
137
+ },
138
+
139
+ find: function(name, version, cb) {
140
+ // We don't handle version here, only the latest
141
+ if (!pkgIndex[name]) {
142
+ cb("No package with name " + name + " found!", null);
143
+ } else {
144
+ cb(null, pkgIndex[name].pkg);
145
+ }
146
+ }
147
+ });
148
+
149
+ // For debug purpose
150
+ window.getApp = function() {
151
+ return window.dualboxEditor.v.appManager.app;
152
+ };
147
153
  </script>
148
154
  <script>
149
- Vue.config.productionTip = false;
155
+ Vue.config.productionTip = false;
150
156
 
151
- Vue.config.errorHandler = function (err, vm, info) {
152
- console.error(err);
153
- }
157
+ Vue.config.errorHandler = function(err, vm, info) {
158
+ console.error(err);
159
+ };
154
160
 
155
- Vue.config.warnHandler = function (msg, vm, trace) {
156
- console.warn(`Vue Warn: ${msg}\nTrace: ${trace}`);
157
- }
161
+ Vue.config.warnHandler = function(msg, vm, trace) {
162
+ console.warn(`Vue Warn: ${msg}\nTrace: ${trace}`);
163
+ };
158
164
  </script>
159
- </body>
160
-
165
+ </body>
161
166
  </html>