Commit 407ba01864716713e51fb9a5375720f4d8b7488a

Authored by xp.Huang
2 parents b044fb58 b75acf1a

Merge branch 'sqy_dev' into 'main'

'fix:修改drawIO的一些初始化地方'

See merge request huang/thingskit-drawio!1
  1 +{
  2 + "name": "drawio-dev",
  3 + "version": "1.0.0",
  4 + "main": "src/main/webapp/index.html",
  5 + "scripts": {
  6 + "start": "cd src/main/webapp && serve",
  7 + "build": "cd etc/build && ant"
  8 + },
  9 + "license": "MIT",
  10 + "dependencies": {
  11 + "serve": "^13.0.2"
  12 + }
  13 +}
@@ -261,7 +261,12 @@ @@ -261,7 +261,12 @@
261 // Forces includes for dev environment in node.js 261 // Forces includes for dev environment in node.js
262 mxForceIncludes = true; 262 mxForceIncludes = true;
263 } 263 }
264 - 264 + if (location.hostname == 'localhost' || location.hostname == '127.0.0.1') {
  265 + drawDevUrl = `http://${location.host}/`;
  266 + geBasePath = `http://${location.host}/js/grapheditor`;
  267 + mxBasePath = `http://${location.host}/mxgraph`;
  268 + mxForceIncludes = true;
  269 + }
265 mxForceIncludes = false; 270 mxForceIncludes = false;
266 271
267 mxscript(drawDevUrl + 'js/PreConfig.js'); 272 mxscript(drawDevUrl + 'js/PreConfig.js');
@@ -428,18 +433,18 @@ @@ -428,18 +433,18 @@
428 </head> 433 </head>
429 <body class="geEditor"> 434 <body class="geEditor">
430 <div id="geInfo"> 435 <div id="geInfo">
431 - <div class="geBlock">  
432 - <h1>Flowchart Maker and Online Diagram Software</h1>  
433 - <p> 436 + <div class="geBlock">
  437 + <h1>云组态启动中 ...</h1>
  438 + <!-- <p>
434 diagrams.net (formerly draw.io) is free online diagram software. You can use it as a flowchart maker, network diagram software, to create UML online, as an ER diagram tool, 439 diagrams.net (formerly draw.io) is free online diagram software. You can use it as a flowchart maker, network diagram software, to create UML online, as an ER diagram tool,
435 to design database schema, to build BPMN online, as a circuit diagram maker, and more. draw.io can import .vsdx, Gliffy&trade; and Lucidchart&trade; files . 440 to design database schema, to build BPMN online, as a circuit diagram maker, and more. draw.io can import .vsdx, Gliffy&trade; and Lucidchart&trade; files .
436 </p> 441 </p>
437 <h2 id="geStatus">Loading...</h2> 442 <h2 id="geStatus">Loading...</h2>
438 <p> 443 <p>
439 Please ensure JavaScript is enabled. 444 Please ensure JavaScript is enabled.
440 - </p> 445 + </p> -->
441 </div> 446 </div>
442 -</div> 447 + </div>
443 <script type="text/javascript"> 448 <script type="text/javascript">
444 /** 449 /**
445 * Main 450 * Main
@@ -3,11 +3,22 @@ @@ -3,11 +3,22 @@
3 * Copyright (c) 2006-2020, draw.io AG 3 * Copyright (c) 2006-2020, draw.io AG
4 */ 4 */
5 // Overrides of global vars need to be pre-loaded 5 // Overrides of global vars need to be pre-loaded
6 -window.EXPORT_URL = 'REPLACE_WITH_YOUR_IMAGE_SERVER';  
7 -window.PLANT_URL = 'REPLACE_WITH_YOUR_PLANTUML_SERVER';  
8 -window.DRAWIO_BASE_URL = null; // Replace with path to base of deployment, e.g. https://www.example.com/folder  
9 -window.DRAWIO_VIEWER_URL = null; // Replace your path to the viewer js, e.g. https://www.example.com/js/viewer.min.js  
10 -window.DRAWIO_LIGHTBOX_URL = null; // Replace with your lightbox URL, eg. https://www.example.com  
11 -window.DRAW_MATH_URL = 'math'; 6 +window.DRAW_MATH_URL = "math";
12 window.DRAWIO_CONFIG = null; // Replace with your custom draw.io configurations. For more details, https://www.diagrams.net/doc/faq/configure-diagram-editor 7 window.DRAWIO_CONFIG = null; // Replace with your custom draw.io configurations. For more details, https://www.diagrams.net/doc/faq/configure-diagram-editor
13 -urlParams['sync'] = 'manual'; 8 +
  9 +window.EXPORT_URL = "REPLACE_WITH_YOUR_IMAGE_SERVER";
  10 +window.PLANT_URL = "REPLACE_WITH_YOUR_PLANTUML_SERVER";
  11 +window.DRAWIO_BASE_URL = window.location.protocol + "//" + window.location.host; // Replace with path to base of deployment, e.g. https://www.example.com/folder
  12 +window.DRAWIO_VIEWER_URL =
  13 + window.location.protocol + "//" + window.location.host + "/js/viewer.min.js"; // Replace your path to the viewer js, e.g. https://www.example.com/js/viewer.min.js
  14 +window.DRAWIO_LIGHTBOX_URL =null; // Replace with your lightbox URL, eg. https://www.example.com
  15 +urlParams["sync"] = "manual";
  16 +urlParams["lang"] = "zh";
  17 +urlParams["browser"] = 0;
  18 +urlParams["gapi"] = 0;
  19 +urlParams["db"] = 0;
  20 +urlParams["od"] = 0;
  21 +urlParams["tr"] = 0;
  22 +urlParams["gh"] = 0;
  23 +urlParams["gl"] = 0;
  24 +urlParams["mode"] = "browser";
@@ -13,6 +13,11 @@ @@ -13,6 +13,11 @@
13 */ 13 */
14 App = function(editor, container, lightbox) 14 App = function(editor, container, lightbox)
15 { 15 {
  16 + if (urlParams["dev"] === "1") {
  17 + alert("欢迎~开发环境");
  18 + } else {
  19 + alert("欢迎~生产环境");
  20 + }
16 EditorUi.call(this, editor, container, (lightbox != null) ? lightbox : 21 EditorUi.call(this, editor, container, (lightbox != null) ? lightbox :
17 (urlParams['lightbox'] == '1' || (uiTheme == 'min' && 22 (urlParams['lightbox'] == '1' || (uiTheme == 'min' &&
18 urlParams['chrome'] != '0'))); 23 urlParams['chrome'] != '0')));
@@ -1904,10 +1909,10 @@ App.prototype.showNameConfBanner = function() @@ -1904,10 +1909,10 @@ App.prototype.showNameConfBanner = function()
1904 */ 1909 */
1905 App.prototype.showDownloadDesktopBanner = function() 1910 App.prototype.showDownloadDesktopBanner = function()
1906 { 1911 {
1907 - this.showBanner('DesktopFooter', mxResources.get('downloadDesktop'), mxUtils.bind(this, function()  
1908 - {  
1909 - this.openLink('https://get.diagrams.net/');  
1910 - })); 1912 + // this.showBanner('DesktopFooter', mxResources.get('downloadDesktop'), mxUtils.bind(this, function()
  1913 + // {
  1914 + // this.openLink('https://get.diagrams.net/');
  1915 + // }));
1911 }; 1916 };
1912 1917
1913 /** 1918 /**
@@ -6131,7 +6136,7 @@ App.prototype.showNotification = function(notifs, lsReadFlag) @@ -6131,7 +6136,7 @@ App.prototype.showNotification = function(notifs, lsReadFlag)
6131 App.prototype.save = function(name, done) 6136 App.prototype.save = function(name, done)
6132 { 6137 {
6133 var file = this.getCurrentFile(); 6138 var file = this.getCurrentFile();
6134 - 6139 + console.log('file',file)
6135 if (file != null && this.spinner.spin(document.body, mxResources.get('saving'))) 6140 if (file != null && this.spinner.spin(document.body, mxResources.get('saving')))
6136 { 6141 {
6137 this.editor.setStatus(''); 6142 this.editor.setStatus('');
@@ -116,44 +116,44 @@ window.mxLanguage = window.mxLanguage || (function() @@ -116,44 +116,44 @@ window.mxLanguage = window.mxLanguage || (function()
116 // in the menu defintion in Diagramly.js. 116 // in the menu defintion in Diagramly.js.
117 window.mxLanguageMap = window.mxLanguageMap || 117 window.mxLanguageMap = window.mxLanguageMap ||
118 { 118 {
119 - 'i18n': '',  
120 - 'id' : 'Bahasa Indonesia',  
121 - 'ms' : 'Bahasa Melayu',  
122 - 'bs' : 'Bosanski',  
123 - 'bg' : 'Bulgarian',  
124 - 'ca' : 'Català',  
125 - 'cs' : 'Čeština',  
126 - 'da' : 'Dansk',  
127 - 'de' : 'Deutsch',  
128 - 'et' : 'Eesti', 119 + // 'i18n': '',
  120 + // 'id' : 'Bahasa Indonesia',
  121 + // 'ms' : 'Bahasa Melayu',
  122 + // 'bs' : 'Bosanski',
  123 + // 'bg' : 'Bulgarian',
  124 + // 'ca' : 'Català',
  125 + // 'cs' : 'Čeština',
  126 + // 'da' : 'Dansk',
  127 + // 'de' : 'Deutsch',
  128 + // 'et' : 'Eesti',
129 'en' : 'English', 129 'en' : 'English',
130 - 'es' : 'Español',  
131 - 'eu' : 'Euskara',  
132 - 'fil' : 'Filipino',  
133 - 'fr' : 'Français',  
134 - 'gl' : 'Galego',  
135 - 'it' : 'Italiano',  
136 - 'hu' : 'Magyar',  
137 - 'nl' : 'Nederlands',  
138 - 'no' : 'Norsk',  
139 - 'pl' : 'Polski',  
140 - 'pt-br' : 'Português (Brasil)',  
141 - 'pt' : 'Português (Portugal)',  
142 - 'ro' : 'Română',  
143 - 'fi' : 'Suomi',  
144 - 'sv' : 'Svenska',  
145 - 'vi' : 'Tiếng Việt',  
146 - 'tr' : 'Türkçe',  
147 - 'el' : 'Ελληνικά',  
148 - 'ru' : 'Русский',  
149 - 'sr' : 'Српски',  
150 - 'uk' : 'Українська',  
151 - 'he' : 'עברית',  
152 - 'ar' : 'العربية',  
153 - 'fa' : 'فارسی',  
154 - 'th' : 'ไทย',  
155 - 'ko' : '한국어',  
156 - 'ja' : '日本語', 130 + // 'es' : 'Español',
  131 + // 'eu' : 'Euskara',
  132 + // 'fil' : 'Filipino',
  133 + // 'fr' : 'Français',
  134 + // 'gl' : 'Galego',
  135 + // 'it' : 'Italiano',
  136 + // 'hu' : 'Magyar',
  137 + // 'nl' : 'Nederlands',
  138 + // 'no' : 'Norsk',
  139 + // 'pl' : 'Polski',
  140 + // 'pt-br' : 'Português (Brasil)',
  141 + // 'pt' : 'Português (Portugal)',
  142 + // 'ro' : 'Română',
  143 + // 'fi' : 'Suomi',
  144 + // 'sv' : 'Svenska',
  145 + // 'vi' : 'Tiếng Việt',
  146 + // 'tr' : 'Türkçe',
  147 + // 'el' : 'Ελληνικά',
  148 + // 'ru' : 'Русский',
  149 + // 'sr' : 'Српски',
  150 + // 'uk' : 'Українська',
  151 + // 'he' : 'עברית',
  152 + // 'ar' : 'العربية',
  153 + // 'fa' : 'فارسی',
  154 + // 'th' : 'ไทย',
  155 + // 'ko' : '한국어',
  156 + // 'ja' : '日本語',
157 'zh' : '简体中文', 157 'zh' : '简体中文',
158 'zh-tw' : '繁體中文' 158 'zh-tw' : '繁體中文'
159 }; 159 };
@@ -3090,6 +3090,7 @@ @@ -3090,6 +3090,7 @@
3090 { 3090 {
3091 editorUi.openLink('https://get.draw.io/') 3091 editorUi.openLink('https://get.draw.io/')
3092 })); 3092 }));
  3093 + // 禁用掉菜单中某一项功能 -- 分享
3093 3094
3094 this.editorUi.actions.addAction('share...', mxUtils.bind(this, function() 3095 this.editorUi.actions.addAction('share...', mxUtils.bind(this, function()
3095 { 3096 {