Commit 1c209bfb8a2d0a6a7bab17f33a08dba3b92609fc

Authored by ww
1 parent 4252778e

fix: fix prod env script import sort

1 -<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5" ><![endif]--> 1 +<!--[if IE]>
  2 +<meta http-equiv="X-UA-Compatible" content="IE=5"><![endif]-->
2 <!DOCTYPE html> 3 <!DOCTYPE html>
3 <html> 4 <html>
4 <head> 5 <head>
5 -<!-- <title>Flowchart Maker &amp; Online Diagram Software</title>-->  
6 - <title>thingskit 云组态</title>  
7 - <meta charset="utf-8">  
8 - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
9 - <meta name="Description" content="diagrams.net is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams">  
10 - <meta name="Keywords" content="diagram, online, flow chart, flowchart maker, uml, erd">  
11 - <meta itemprop="name" content="diagrams.net - free flowchart maker and diagrams online">  
12 - <meta itemprop="description" content="diagrams.net is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship, 6 + <!-- <title>Flowchart Maker &amp; Online Diagram Software</title>-->
  7 + <title>thingskit 云组态</title>
  8 + <meta charset="utf-8">
  9 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  10 + <meta name="Description"
  11 + content="diagrams.net is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams">
  12 + <meta name="Keywords" content="diagram, online, flow chart, flowchart maker, uml, erd">
  13 + <meta itemprop="name" content="diagrams.net - free flowchart maker and diagrams online">
  14 + <meta itemprop="description" content="diagrams.net is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship,
13 org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic 15 org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic
14 circuit and social network diagrams."> 16 circuit and social network diagrams.">
15 - <meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png">  
16 - <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">  
17 - <meta name="msapplication-config" content="images/browserconfig.xml">  
18 - <meta name="mobile-web-app-capable" content="yes">  
19 - <meta name="theme-color" content="#d89000">  
20 - <!-- crypto-js -->  
21 - <script src="./js/plugin/crypto-js/crypto-js.js"></script>  
22 -<!-- <script src="./js/plugin/crypto-js/aes.js"></script>-->  
23 -<!-- <script src="./js/plugin/crypto-js/enc-utf8.js"></script>-->  
24 -<!-- <script src="./js/plugin/crypto-js/pad-pkcs7.js"></script>-->  
25 -<!-- <script src="./js/plugin/crypto-js/mode-ecb.js"></script>-->  
26 -<!-- <script src="./js/plugin/crypto-js/md5.js"></script>-->  
27 -<!-- <script src="./js/plugin/crypto-js/enc-utf8.js"></script>-->  
28 -<!-- <script src="./js/plugin/crypto-js/enc-base64.js"></script>-->  
29 - <!-- 全局变量 -->  
30 - <script src="./js/const/const.js"></script>  
31 -  
32 - <!-- echarts -->  
33 - <script src="./js/plugin/echarts/echarts.js"></script>  
34 -  
35 - <script src="./plugins/axios.min.js"></script>  
36 -<!-- <script src="./js/jquery/jquery-3.3.1.min.js"></script>-->  
37 -<!-- <script src="./js/jquery.easyui.min.js"></script>-->  
38 - <link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/css/layui.min.css" integrity="sha512-iQBJbsNHXUcgEIgWThd2dr8tOdKPvICwqjPEZYY81z3eMya44A5MiAqfWSCh+Ee1YzNYkdrI982Qhwgr8LEYOQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />  
39 - <script src="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/layui.min.js" integrity="sha512-EKrFvch3qTzLFQgjbcjpsRmF8T3UCtc9ojtMAu6dvvP+bV8qYUDOaQ84nwYCkSLT7lbqGoya/Kf+8fyCBE0vRg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>  
40 -  
41 - <!-- 引入修改样式 -->  
42 - <link rel="stylesheet" href="./styles/formatChange.css">  
43 -  
44 - <!-- 引入select.zTree及相关依赖 -->  
45 -<!-- <link rel="stylesheet" href="./styles/zTreeStyle.css" type="text/css">-->  
46 -<!-- <link rel="stylesheet" href="./styles/jquery.select.zTree.v1.5.css" type="text/css">-->  
47 -<!-- <script type="text/javascript" src="./js/jquery.ztree.core.min.js"></script>-->  
48 -<!-- <script type="text/javascript" src="./js/jquery.ztree.exhide.min.js"></script>-->  
49 -<!-- <script type="text/javascript" src="./js/jquery.select.zTree.v1.5.min.js"></script>-->  
50 -  
51 - <!-- Axios -->  
52 - <script src="./plugins/DefHttp.js"></script>  
53 -  
54 - <script src="./js/api/index.js"></script>  
55 -  
56 - <!-- act editor -->  
57 - <script src="./js/plugin/ace/ace.js"></script>  
58 -  
59 - <script type="text/javascript"> 17 + <meta itemprop="image"
  18 + content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png">
  19 + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  20 + <meta name="msapplication-config" content="images/browserconfig.xml">
  21 + <meta name="mobile-web-app-capable" content="yes">
  22 + <meta name="theme-color" content="#d89000">
  23 + <!-- crypto-js -->
  24 + <script src="./js/plugin/crypto-js/crypto-js.js"></script>
  25 + <!-- 持续话存储 -->
  26 + <script src="./js/const/persistentStorage.js"></script>
  27 + <!-- 全局变量 -->
  28 + <script src="./js/const/const.js"></script>
  29 + <!-- echarts -->
  30 + <script src="./js/plugin/echarts/echarts.js"></script>
  31 +
  32 + <script src="./plugins/axios.min.js"></script>
  33 + <!-- <script src="./js/jquery/jquery-3.3.1.min.js"></script>-->
  34 + <!-- <script src="./js/jquery.easyui.min.js"></script>-->
  35 + <link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/css/layui.min.css"
  36 + integrity="sha512-iQBJbsNHXUcgEIgWThd2dr8tOdKPvICwqjPEZYY81z3eMya44A5MiAqfWSCh+Ee1YzNYkdrI982Qhwgr8LEYOQ=="
  37 + crossorigin="anonymous" referrerpolicy="no-referrer"/>
  38 + <script src="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/layui.min.js"
  39 + integrity="sha512-EKrFvch3qTzLFQgjbcjpsRmF8T3UCtc9ojtMAu6dvvP+bV8qYUDOaQ84nwYCkSLT7lbqGoya/Kf+8fyCBE0vRg=="
  40 + crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  41 +
  42 + <!-- 引入修改样式 -->
  43 + <link rel="stylesheet" href="./styles/formatChange.css">
  44 +
  45 + <!-- 引入select.zTree及相关依赖 -->
  46 + <!-- <link rel="stylesheet" href="./styles/zTreeStyle.css" type="text/css">-->
  47 + <!-- <link rel="stylesheet" href="./styles/jquery.select.zTree.v1.5.css" type="text/css">-->
  48 + <!-- <script type="text/javascript" src="./js/jquery.ztree.core.min.js"></script>-->
  49 + <!-- <script type="text/javascript" src="./js/jquery.ztree.exhide.min.js"></script>-->
  50 + <!-- <script type="text/javascript" src="./js/jquery.select.zTree.v1.5.min.js"></script>-->
  51 +
  52 + <!-- Axios -->
  53 + <script src="./plugins/DefHttp.js"></script>
  54 +
  55 + <script src="./js/api/index.js"></script>
  56 +
  57 + <!-- act editor -->
  58 + <script src="./js/plugin/ace/ace.js"></script>
  59 +
  60 + <script type="text/javascript">
60 /** 61 /**
61 * URL Parameters and protocol description are here: 62 * URL Parameters and protocol description are here:
62 * 63 *
@@ -76,17 +77,14 @@ @@ -76,17 +77,14 @@
76 * -- 77 * --
77 * - networkshapes=1: For testing network shapes (temporary) 78 * - networkshapes=1: For testing network shapes (temporary)
78 */ 79 */
79 - var urlParams = (function()  
80 - { 80 + var urlParams = (function () {
81 var result = new Object(); 81 var result = new Object();
82 var params = window.location.search.slice(1).split('&'); 82 var params = window.location.search.slice(1).split('&');
83 83
84 - for (var i = 0; i < params.length; i++)  
85 - { 84 + for (var i = 0; i < params.length; i++) {
86 var idx = params[i].indexOf('='); 85 var idx = params[i].indexOf('=');
87 86
88 - if (idx > 0)  
89 - { 87 + if (idx > 0) {
90 result[params[i].substring(0, idx)] = params[i].substring(idx + 1); 88 result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
91 } 89 }
92 } 90 }
@@ -95,19 +93,14 @@ @@ -95,19 +93,14 @@
95 })(); 93 })();
96 94
97 // Forces CDN caches by passing URL parameters via URL hash 95 // Forces CDN caches by passing URL parameters via URL hash
98 - if (window.location.hash != null && window.location.hash.substring(0, 2) == '#P')  
99 - {  
100 - try  
101 - { 96 + if (window.location.hash != null && window.location.hash.substring(0, 2) == '#P') {
  97 + try {
102 urlParams = JSON.parse(decodeURIComponent(window.location.hash.substring(2))); 98 urlParams = JSON.parse(decodeURIComponent(window.location.hash.substring(2)));
103 99
104 - if (urlParams.hash != null)  
105 - { 100 + if (urlParams.hash != null) {
106 window.location.hash = urlParams.hash; 101 window.location.hash = urlParams.hash;
107 } 102 }
108 - }  
109 - catch (e)  
110 - { 103 + } catch (e) {
111 // ignore 104 // ignore
112 } 105 }
113 } 106 }
@@ -116,29 +109,24 @@ @@ -116,29 +109,24 @@
116 var mxIsElectron = window && window.process && window.process.type; 109 var mxIsElectron = window && window.process && window.process.type;
117 110
118 // Redirects page if required 111 // Redirects page if required
119 - if (urlParams['dev'] != '1')  
120 - {  
121 - (function()  
122 - { 112 + if (urlParams['dev'] != '1') {
  113 + (function () {
123 var proto = window.location.protocol; 114 var proto = window.location.protocol;
124 115
125 - if (!mxIsElectron)  
126 - { 116 + if (!mxIsElectron) {
127 var host = window.location.host; 117 var host = window.location.host;
128 118
129 // Redirects apex, drive and rt to www 119 // Redirects apex, drive and rt to www
130 - if (host === 'draw.io' || host === 'rt.draw.io' || host === 'drive.draw.io')  
131 - { 120 + if (host === 'draw.io' || host === 'rt.draw.io' || host === 'drive.draw.io') {
132 host = 'www.draw.io'; 121 host = 'www.draw.io';
133 } 122 }
134 123
135 var href = proto + '//' + host + window.location.href.substring( 124 var href = proto + '//' + host + window.location.href.substring(
136 - window.location.protocol.length +  
137 - window.location.host.length + 2); 125 + window.location.protocol.length +
  126 + window.location.host.length + 2);
138 127
139 // Redirects if href changes 128 // Redirects if href changes
140 - if (href != window.location.href)  
141 - { 129 + if (href != window.location.href) {
142 window.location.href = href; 130 window.location.href = href;
143 } 131 }
144 } 132 }
@@ -148,29 +136,23 @@ @@ -148,29 +136,23 @@
148 /** 136 /**
149 * Adds meta tag to the page. 137 * Adds meta tag to the page.
150 */ 138 */
151 - function mxmeta(name, content, httpEquiv)  
152 - {  
153 - try  
154 - { 139 + function mxmeta(name, content, httpEquiv) {
  140 + try {
155 var s = document.createElement('meta'); 141 var s = document.createElement('meta');
156 142
157 - if (name != null)  
158 - { 143 + if (name != null) {
159 s.setAttribute('name', name); 144 s.setAttribute('name', name);
160 } 145 }
161 146
162 s.setAttribute('content', content); 147 s.setAttribute('content', content);
163 148
164 - if (httpEquiv != null)  
165 - { 149 + if (httpEquiv != null) {
166 s.setAttribute('http-equiv', httpEquiv); 150 s.setAttribute('http-equiv', httpEquiv);
167 } 151 }
168 152
169 - var t = document.getElementsByTagName('meta')[0];  
170 - t.parentNode.insertBefore(s, t);  
171 - }  
172 - catch (e)  
173 - { 153 + var t = document.getElementsByTagName('meta')[0];
  154 + t.parentNode.insertBefore(s, t);
  155 + } catch (e) {
174 // ignore 156 // ignore
175 } 157 }
176 }; 158 };
@@ -178,81 +160,68 @@ @@ -178,81 +160,68 @@
178 /** 160 /**
179 * Synchronously adds scripts to the page. 161 * Synchronously adds scripts to the page.
180 */ 162 */
181 - function mxscript(src, onLoad, id, dataAppKey, noWrite)  
182 - { 163 + function mxscript(src, onLoad, id, dataAppKey, noWrite) {
183 var defer = onLoad == null && !noWrite; 164 var defer = onLoad == null && !noWrite;
184 165
185 if ((urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function") || 166 if ((urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function") ||
186 - onLoad != null || noWrite)  
187 - { 167 + onLoad != null || noWrite) {
188 var s = document.createElement('script'); 168 var s = document.createElement('script');
189 s.setAttribute('type', 'text/javascript'); 169 s.setAttribute('type', 'text/javascript');
190 s.setAttribute('defer', 'true'); 170 s.setAttribute('defer', 'true');
191 s.setAttribute('src', src); 171 s.setAttribute('src', src);
192 172
193 - if (id != null)  
194 - { 173 + if (id != null) {
195 s.setAttribute('id', id); 174 s.setAttribute('id', id);
196 } 175 }
197 176
198 - if (dataAppKey != null)  
199 - { 177 + if (dataAppKey != null) {
200 s.setAttribute('data-app-key', dataAppKey); 178 s.setAttribute('data-app-key', dataAppKey);
201 } 179 }
202 180
203 - if (onLoad != null)  
204 - { 181 + if (onLoad != null) {
205 var r = false; 182 var r = false;
206 183
207 - s.onload = s.onreadystatechange = function()  
208 - {  
209 - if (!r && (!this.readyState || this.readyState == 'complete'))  
210 - {  
211 - r = true;  
212 - onLoad(); 184 + s.onload = s.onreadystatechange = function () {
  185 + if (!r && (!this.readyState || this.readyState == 'complete')) {
  186 + r = true;
  187 + onLoad();
213 } 188 }
214 - }; 189 + };
215 } 190 }
216 191
217 - var t = document.getElementsByTagName('script')[0]; 192 + var t = document.getElementsByTagName('script')[0];
218 193
219 - if (t != null)  
220 - {  
221 - t.parentNode.insertBefore(s, t);  
222 - }  
223 - }  
224 - else  
225 - {  
226 - document.write('<script src="' + src + '"' + ((id != null) ? ' id="' + id +'" ' : '') +  
227 - ((dataAppKey != null) ? ' data-app-key="' + dataAppKey +'" ' : '') + '></scr' + 'ipt>'); 194 + if (t != null) {
  195 + t.parentNode.insertBefore(s, t);
  196 + }
  197 + } else {
  198 + document.write('<script src="' + src + '"' + ((id != null) ? ' id="' + id + '" ' : '') +
  199 + ((dataAppKey != null) ? ' data-app-key="' + dataAppKey + '" ' : '') + '></scr' + 'ipt>');
228 } 200 }
229 }; 201 };
230 202
231 /** 203 /**
232 * Asynchronously adds scripts to the page. 204 * Asynchronously adds scripts to the page.
233 */ 205 */
234 - function mxinclude(src)  
235 - { 206 + function mxinclude(src) {
236 var g = document.createElement('script'); 207 var g = document.createElement('script');
237 g.type = 'text/javascript'; 208 g.type = 'text/javascript';
238 g.async = true; 209 g.async = true;
239 g.src = src; 210 g.src = src;
240 211
241 - var s = document.getElementsByTagName('script')[0];  
242 - s.parentNode.insertBefore(g, s); 212 + var s = document.getElementsByTagName('script')[0];
  213 + s.parentNode.insertBefore(g, s);
243 }; 214 };
244 215
245 /** 216 /**
246 * Adds meta tags with application name (depends on offline URL parameter) 217 * Adds meta tags with application name (depends on offline URL parameter)
247 */ 218 */
248 - (function()  
249 - { 219 + (function () {
250 var name = 'diagrams.net'; 220 var name = 'diagrams.net';
251 mxmeta('apple-mobile-web-app-title', name); 221 mxmeta('apple-mobile-web-app-title', name);
252 mxmeta('application-name', name); 222 mxmeta('application-name', name);
253 223
254 - if (mxIsElectron)  
255 - { 224 + if (mxIsElectron) {
256 mxmeta(null, 'default-src \'self\' \'unsafe-inline\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src-elem \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy'); 225 mxmeta(null, 'default-src \'self\' \'unsafe-inline\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src-elem \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy');
257 } 226 }
258 })(); 227 })();
@@ -260,21 +229,16 @@ @@ -260,21 +229,16 @@
260 // Checks for local storage 229 // Checks for local storage
261 var isLocalStorage = false; 230 var isLocalStorage = false;
262 231
263 - try  
264 - {  
265 - isLocalStorage = urlParams['local'] != '1' && typeof(localStorage) != 'undefined';  
266 - }  
267 - catch (e)  
268 - { 232 + try {
  233 + isLocalStorage = urlParams['local'] != '1' && typeof (localStorage) != 'undefined';
  234 + } catch (e) {
269 // ignored 235 // ignored
270 } 236 }
271 237
272 var mxScriptsLoaded = false, mxWinLoaded = false; 238 var mxScriptsLoaded = false, mxWinLoaded = false;
273 239
274 - function checkAllLoaded()  
275 - {  
276 - if (mxScriptsLoaded && mxWinLoaded)  
277 - { 240 + function checkAllLoaded() {
  241 + if (mxScriptsLoaded && mxWinLoaded) {
278 App.main(); 242 App.main();
279 } 243 }
280 }; 244 };
@@ -282,8 +246,7 @@ @@ -282,8 +246,7 @@
282 var t0 = new Date(); 246 var t0 = new Date();
283 247
284 // Changes paths for local development environment 248 // Changes paths for local development environment
285 - if (urlParams['dev'] == '1')  
286 - { 249 + if (urlParams['dev'] == '1') {
287 // Used to request grapheditor/mxgraph sources in dev mode 250 // Used to request grapheditor/mxgraph sources in dev mode
288 var mxDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main'; 251 var mxDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main';
289 252
@@ -292,8 +255,7 @@ @@ -292,8 +255,7 @@
292 var geBasePath = drawDevUrl + '/js/grapheditor'; 255 var geBasePath = drawDevUrl + '/js/grapheditor';
293 var mxBasePath = mxDevUrl + '/mxgraph'; 256 var mxBasePath = mxDevUrl + '/mxgraph';
294 257
295 - if (document.location.protocol == 'file:')  
296 - { 258 + if (document.location.protocol == 'file:') {
297 geBasePath = './js/grapheditor'; 259 geBasePath = './js/grapheditor';
298 mxBasePath = './mxgraph'; 260 mxBasePath = './mxgraph';
299 drawDevUrl = './'; 261 drawDevUrl = './';
@@ -302,9 +264,9 @@ @@ -302,9 +264,9 @@
302 mxForceIncludes = true; 264 mxForceIncludes = true;
303 } 265 }
304 if (location.hostname == 'localhost' || location.hostname == '127.0.0.1' || location.hostname == '192.168.10.111') { 266 if (location.hostname == 'localhost' || location.hostname == '127.0.0.1' || location.hostname == '192.168.10.111') {
305 - drawDevUrl = `http://${location.hostname}:3000/`;  
306 - geBasePath = `http://${location.hostname}:3000/js/grapheditor`;  
307 - mxBasePath = `http://${location.hostname}:3000/mxgraph`; 267 + drawDevUrl = `http://${ location.hostname }:3000/`;
  268 + geBasePath = `http://${ location.hostname }:3000/js/grapheditor`;
  269 + mxBasePath = `http://${ location.hostname }:3000/mxgraph`;
308 mxForceIncludes = true; 270 mxForceIncludes = true;
309 } 271 }
310 mxForceIncludes = false; 272 mxForceIncludes = false;
@@ -320,150 +282,145 @@ @@ -320,150 +282,145 @@
320 mxscript(drawDevUrl + 'js/diagramly/Devel.js'); 282 mxscript(drawDevUrl + 'js/diagramly/Devel.js');
321 283
322 // Electron 284 // Electron
323 - if (mxIsElectron)  
324 - { 285 + if (mxIsElectron) {
325 mxscript('js/diagramly/DesktopLibrary.js'); 286 mxscript('js/diagramly/DesktopLibrary.js');
326 mxscript('js/diagramly/ElectronApp.js'); 287 mxscript('js/diagramly/ElectronApp.js');
327 } 288 }
328 289
329 mxscript(drawDevUrl + 'js/PostConfig.js'); 290 mxscript(drawDevUrl + 'js/PostConfig.js');
330 - }  
331 - else  
332 - {  
333 - (function()  
334 - { 291 + } else {
  292 + (function () {
335 var hostName = window.location.hostname; 293 var hostName = window.location.hostname;
336 294
337 // Supported domains are *.draw.io and the packaged version in Quip 295 // Supported domains are *.draw.io and the packaged version in Quip
338 var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') || 296 var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') ||
339 (hostName.substring(hostName.length - 13, hostName.length) === '.diagrams.net'); 297 (hostName.substring(hostName.length - 13, hostName.length) === '.diagrams.net');
340 298
341 - function loadAppJS()  
342 - {  
343 - mxscript('js/app.min.js', function()  
344 - { 299 + function loadAppJS() {
  300 + mxscript('js/app.min.js', function () {
345 mxScriptsLoaded = true; 301 mxScriptsLoaded = true;
346 checkAllLoaded(); 302 checkAllLoaded();
347 303
348 // Electron 304 // Electron
349 - if (mxIsElectron)  
350 - {  
351 - mxscript('js/diagramly/DesktopLibrary.js', function()  
352 - {  
353 - mxscript('js/diagramly/ElectronApp.js', function()  
354 - {  
355 - mxscript('js/extensions.min.js', function()  
356 - {  
357 - mxscript('js/stencils.min.js', function()  
358 - {  
359 - mxscript('js/shapes-14-6-5.min.js', function()  
360 - { 305 + if (mxIsElectron) {
  306 + mxscript('js/diagramly/DesktopLibrary.js', function () {
  307 + mxscript('js/diagramly/ElectronApp.js', function () {
  308 + mxscript('js/extensions.min.js', function () {
  309 + mxscript('js/stencils.min.js', function () {
  310 + mxscript('js/shapes-14-6-5.min.js', function () {
361 mxscript('js/PostConfig.js'); 311 mxscript('js/PostConfig.js');
362 }); 312 });
363 }); 313 });
364 }); 314 });
365 }); 315 });
366 }); 316 });
367 - }  
368 - else if (!supportedDomain)  
369 - { 317 + } else if (!supportedDomain) {
370 mxscript('js/PostConfig.js'); 318 mxscript('js/PostConfig.js');
371 } 319 }
372 }); 320 });
373 }; 321 };
374 322
375 - if (!supportedDomain || mxIsElectron)  
376 - { 323 + if (!supportedDomain || mxIsElectron) {
377 mxscript('js/PreConfig.js', loadAppJS); 324 mxscript('js/PreConfig.js', loadAppJS);
378 - }  
379 - else  
380 - { 325 + } else {
381 loadAppJS(); 326 loadAppJS();
382 } 327 }
383 })(); 328 })();
384 } 329 }
385 330
386 // Adds basic error handling 331 // Adds basic error handling
387 - window.onerror = function()  
388 - { 332 + window.onerror = function () {
389 var status = document.getElementById('geStatus'); 333 var status = document.getElementById('geStatus');
390 334
391 - if (status != null)  
392 - { 335 + if (status != null) {
393 status.innerHTML = 'Page could not be loaded. Please try refreshing.'; 336 status.innerHTML = 'Page could not be loaded. Please try refreshing.';
394 } 337 }
395 }; 338 };
396 - </script> 339 + </script>
397 <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm"> 340 <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm">
398 - <link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png">  
399 -<!-- <link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">-->  
400 - <link rel="icon" type="image/png" sizes="32x32" href="images/logo-32x32.png">  
401 - <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">  
402 -<!-- <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">-->  
403 - <link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#d89000">  
404 - <link rel="stylesheet" type="text/css" href="styles/grapheditor.css">  
405 - <link rel="stylesheet" type="text/css" href="styles/easyui.css">  
406 - <link rel="preconnect" href="https://storage.googleapis.com">  
407 - <link rel="canonical" href="https://app.diagrams.net">  
408 - <link rel="manifest" href="images/manifest.json">  
409 -<!-- <link rel="shortcut icon" href="favicon.ico">-->  
410 - <link rel="shortcut icon" href="images/logo-16x16.ico">  
411 - <style type="text/css">  
412 - body { overflow:hidden; }  
413 - div.picker { z-index: 10007; }  
414 - .geSidebarContainer .geTitle input {  
415 - font-size:8pt;  
416 - color:#606060;  
417 - }  
418 - .geBlock {  
419 - z-index:-3;  
420 - margin:100px;  
421 - margin-top:40px;  
422 - margin-bottom:30px;  
423 - padding:20px;  
424 - text-align:center;  
425 - min-width:50%;  
426 - }  
427 - .geBlock h1, .geBlock h2 {  
428 - margin-top:0px;  
429 - padding-top:0px;  
430 - }  
431 - .geEditor *:not(.geScrollable)::-webkit-scrollbar {  
432 - width:14px;  
433 - height:14px;  
434 - }  
435 - .geEditor ::-webkit-scrollbar-track {  
436 - background-clip:padding-box;  
437 - border:solid transparent;  
438 - border-width:1px;  
439 - }  
440 - .geEditor ::-webkit-scrollbar-corner {  
441 - background-color:transparent;  
442 - }  
443 - .geEditor ::-webkit-scrollbar-thumb {  
444 - background-color:rgba(0,0,0,.1);  
445 - background-clip:padding-box;  
446 - border:solid transparent;  
447 - border-radius:10px;  
448 - }  
449 - .geEditor ::-webkit-scrollbar-thumb:hover {  
450 - background-color:rgba(0,0,0,.4);  
451 - }  
452 - .geTemplate {  
453 - border:1px solid transparent;  
454 - display:inline-block;  
455 - _display:inline;  
456 - vertical-align:top;  
457 - border-radius:3px;  
458 - overflow:hidden;  
459 - font-size:14pt;  
460 - cursor:pointer;  
461 - margin:5px;  
462 - }  
463 - </style>  
464 - <!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->  
465 - <!--[if (IE 9)|(IE 10)]><!-->  
466 - <script type="text/vbscript"> 341 + <link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png">
  342 + <!-- <link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">-->
  343 + <link rel="icon" type="image/png" sizes="32x32" href="images/logo-32x32.png">
  344 + <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
  345 + <!-- <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">-->
  346 + <link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#d89000">
  347 + <link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
  348 + <link rel="stylesheet" type="text/css" href="styles/easyui.css">
  349 + <link rel="preconnect" href="https://storage.googleapis.com">
  350 + <link rel="canonical" href="https://app.diagrams.net">
  351 + <link rel="manifest" href="images/manifest.json">
  352 + <!-- <link rel="shortcut icon" href="favicon.ico">-->
  353 + <link rel="shortcut icon" href="images/logo-16x16.ico">
  354 + <style type="text/css">
  355 + body {
  356 + overflow: hidden;
  357 + }
  358 +
  359 + div.picker {
  360 + z-index: 10007;
  361 + }
  362 +
  363 + .geSidebarContainer .geTitle input {
  364 + font-size: 8pt;
  365 + color: #606060;
  366 + }
  367 +
  368 + .geBlock {
  369 + z-index: -3;
  370 + margin: 100px;
  371 + margin-top: 40px;
  372 + margin-bottom: 30px;
  373 + padding: 20px;
  374 + text-align: center;
  375 + min-width: 50%;
  376 + }
  377 +
  378 + .geBlock h1, .geBlock h2 {
  379 + margin-top: 0px;
  380 + padding-top: 0px;
  381 + }
  382 +
  383 + .geEditor *:not(.geScrollable)::-webkit-scrollbar {
  384 + width: 14px;
  385 + height: 14px;
  386 + }
  387 +
  388 + .geEditor ::-webkit-scrollbar-track {
  389 + background-clip: padding-box;
  390 + border: solid transparent;
  391 + border-width: 1px;
  392 + }
  393 +
  394 + .geEditor ::-webkit-scrollbar-corner {
  395 + background-color: transparent;
  396 + }
  397 +
  398 + .geEditor ::-webkit-scrollbar-thumb {
  399 + background-color: rgba(0, 0, 0, .1);
  400 + background-clip: padding-box;
  401 + border: solid transparent;
  402 + border-radius: 10px;
  403 + }
  404 +
  405 + .geEditor ::-webkit-scrollbar-thumb:hover {
  406 + background-color: rgba(0, 0, 0, .4);
  407 + }
  408 +
  409 + .geTemplate {
  410 + border: 1px solid transparent;
  411 + display: inline-block;
  412 + _display: inline;
  413 + vertical-align: top;
  414 + border-radius: 3px;
  415 + overflow: hidden;
  416 + font-size: 14pt;
  417 + cursor: pointer;
  418 + margin: 5px;
  419 + }
  420 + </style>
  421 + <!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->
  422 + <!--[if (IE 9)|(IE 10)]><!-->
  423 + <script type="text/vbscript">
467 Function mxUtilsBinaryToArray(Binary) 424 Function mxUtilsBinaryToArray(Binary)
468 Dim i 425 Dim i
469 ReDim byteArray(LenB(Binary)) 426 ReDim byteArray(LenB(Binary))
@@ -472,46 +429,38 @@ @@ -472,46 +429,38 @@
472 Next 429 Next
473 mxUtilsBinaryToArray = byteArray 430 mxUtilsBinaryToArray = byteArray
474 End Function 431 End Function
475 - </script>  
476 - <!--<![endif]--> 432 +
  433 + </script>
  434 + <!--<![endif]-->
477 </head> 435 </head>
478 <body class="geEditor"> 436 <body class="geEditor">
479 <div id="geInfo"> 437 <div id="geInfo">
480 - <div class="geBlock">  
481 - <h1>ThingsKit云组态启动中.......</h1>  
482 - </div>  
483 - </div> 438 + <div class="geBlock">
  439 + <h1>ThingsKit云组态启动中.......</h1>
  440 + </div>
  441 +</div>
484 <script type="text/javascript"> 442 <script type="text/javascript">
485 -/**  
486 - * Main  
487 - */  
488 -if (navigator.userAgent != null && navigator.userAgent.toLowerCase().  
489 - indexOf(' electron/') >= 0 && typeof process !== 'undefined' && process.versions.electron < 5)  
490 -{  
491 - // Redirects old Electron app to latest version  
492 - var div = document.getElementById('geInfo');  
493 -  
494 - if (div != null)  
495 - {  
496 - div.innerHTML = '<center><h2>You are using an out of date version of this app.<br>Please download the latest version ' +  
497 - '<a href="https://github.com/jgraph/drawio-desktop/releases/latest" target="_blank">here</a>.</h2></center>';  
498 - }  
499 -}  
500 -else  
501 -{  
502 - if (urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function")  
503 - {  
504 - window.addEventListener('load', function()  
505 - {  
506 - mxWinLoaded = true;  
507 - checkAllLoaded();  
508 - });  
509 - }  
510 - else  
511 - {  
512 - App.main(); 443 + /**
  444 + * Main
  445 + */
  446 + if (navigator.userAgent != null && navigator.userAgent.toLowerCase().indexOf(' electron/') >= 0 && typeof process !== 'undefined' && process.versions.electron < 5) {
  447 + // Redirects old Electron app to latest version
  448 + var div = document.getElementById('geInfo');
  449 +
  450 + if (div != null) {
  451 + div.innerHTML = '<center><h2>You are using an out of date version of this app.<br>Please download the latest version ' +
  452 + '<a href="https://github.com/jgraph/drawio-desktop/releases/latest" target="_blank">here</a>.</h2></center>';
  453 + }
  454 + } else {
  455 + if (urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function") {
  456 + window.addEventListener('load', function () {
  457 + mxWinLoaded = true;
  458 + checkAllLoaded();
  459 + });
  460 + } else {
  461 + App.main();
  462 + }
513 } 463 }
514 -}  
515 </script> 464 </script>
516 </body> 465 </body>
517 </html> 466 </html>
1 const GLOBAL_STORAGE_KEY = (() => { 1 const GLOBAL_STORAGE_KEY = (() => {
  2 + const isDEV = location.href.includes('dev=1')
2 const DEVELOPMENT = 'DEVELOPMENT' 3 const DEVELOPMENT = 'DEVELOPMENT'
3 const PRODUCTION = 'PRODUCTION' 4 const PRODUCTION = 'PRODUCTION'
4 return `UNDEFINED__${ isDEV ? DEVELOPMENT : PRODUCTION }__2.7.1__COMMON__LOCAL__KEY__` 5 return `UNDEFINED__${ isDEV ? DEVELOPMENT : PRODUCTION }__2.7.1__COMMON__LOCAL__KEY__`
@@ -662,7 +662,7 @@ App.main = function(callback, createUi) @@ -662,7 +662,7 @@ App.main = function(callback, createUi)
662 var content = mxUtils.getTextContent(scripts[scripts.length - 1]); 662 var content = mxUtils.getTextContent(scripts[scripts.length - 1]);
663 663
664 // if (CryptoJS.MD5(content).toString() != 'd53805dd6f0bbba2da4966491ca0a505') 664 // if (CryptoJS.MD5(content).toString() != 'd53805dd6f0bbba2da4966491ca0a505')
665 - if (CryptoJS.MD5(content).toString() != '4559a92176e60ec27e523711c8ea01ac') 665 + if (CryptoJS.MD5(content).toString() != 'ce6aa7729ae06957ca56e510739b70b3')
666 { 666 {
667 console.log('Change main script MD5 in the previous line:', CryptoJS.MD5(content).toString()); 667 console.log('Change main script MD5 in the previous line:', CryptoJS.MD5(content).toString());
668 alert('[Dev] Main script change requires update of CSP'); 668 alert('[Dev] Main script change requires update of CSP');