index.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5" ><![endif]-->
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <title>drawio文件预览</title>
  6. <meta charset="utf-8">
  7. <meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
  8. <script type="text/javascript">
  9. var urlParams = (function()
  10. {
  11. var result = new Object();
  12. var params = window.location.search.slice(1).split('&');
  13. for (var i = 0; i < params.length; i++)
  14. {
  15. var idx = params[i].indexOf('=');
  16. if (idx > 0)
  17. {
  18. result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
  19. }
  20. }
  21. return result;
  22. })();
  23. if (window.location.hash != null && window.location.hash.substring(0, 2) == '#P')
  24. {
  25. try
  26. {
  27. urlParams = JSON.parse(decodeURIComponent(window.location.hash.substring(2)));
  28. if (urlParams.hash != null)
  29. {
  30. window.location.hash = urlParams.hash;
  31. }
  32. }
  33. catch (e)
  34. {
  35. // ignore
  36. }
  37. }
  38. // Global variable for desktop
  39. var mxIsElectron = window && window.process && window.process.type;
  40. /**
  41. * Synchronously adds scripts to the page.
  42. */
  43. function mxscript(src, onLoad, id, dataAppKey, noWrite, onError)
  44. {
  45. var defer = onLoad == null && !noWrite;
  46. if ((urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function") ||
  47. onLoad != null || noWrite)
  48. {
  49. var s = document.createElement('script');
  50. s.setAttribute('type', 'text/javascript');
  51. s.setAttribute('defer', 'true');
  52. s.setAttribute('src', src);
  53. if (id != null)
  54. {
  55. s.setAttribute('id', id);
  56. }
  57. if (onLoad != null)
  58. {
  59. var r = false;
  60. s.onload = s.onreadystatechange = function()
  61. {
  62. if (!r && (!this.readyState || this.readyState == 'complete'))
  63. {
  64. r = true;
  65. onLoad();
  66. }
  67. };
  68. }
  69. if (onError != null)
  70. {
  71. s.onerror = function(e)
  72. {
  73. onError('Failed to load ' + src, e);
  74. };
  75. }
  76. var t = document.getElementsByTagName('script')[0];
  77. if (t != null)
  78. {
  79. t.parentNode.insertBefore(s, t);
  80. }
  81. }
  82. };
  83. /**
  84. * Asynchronously adds scripts to the page.
  85. */
  86. function mxinclude(src)
  87. {
  88. var g = document.createElement('script');
  89. g.type = 'text/javascript';
  90. g.async = true;
  91. g.src = src;
  92. var s = document.getElementsByTagName('script')[0];
  93. s.parentNode.insertBefore(g, s);
  94. };
  95. // Checks for local storage
  96. var isLocalStorage = false;
  97. try
  98. {
  99. isLocalStorage = urlParams['local'] != '1' && typeof(localStorage) != 'undefined';
  100. }
  101. catch (e)
  102. {
  103. // ignored
  104. }
  105. var mxScriptsLoaded = false, mxWinLoaded = false;
  106. function checkAllLoaded()
  107. {
  108. if (mxScriptsLoaded && mxWinLoaded)
  109. {
  110. App.main();
  111. }
  112. };
  113. var t0 = new Date();
  114. // Changes paths for local development environment
  115. if (urlParams['dev'] == '1')
  116. {
  117. mxForceIncludes = false;
  118. mxscript(drawDevUrl + 'js/PreConfig.js');
  119. mxscript(drawDevUrl + 'js/diagramly/Init.js');
  120. mxscript(geBasePath + '/Init.js');
  121. mxscript(mxBasePath + '/mxClient.js');
  122. mxscript(drawDevUrl + 'js/PostConfig.js');
  123. }
  124. else
  125. {
  126. (function()
  127. {
  128. var hostName = window.location.hostname;
  129. // Supported domains are *.draw.io and the packaged version in Quip
  130. var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') ||
  131. (hostName.substring(hostName.length - 13, hostName.length) === '.kkview.cn');
  132. function loadAppJS()
  133. {
  134. mxscript('js/app.min.js', function()
  135. {
  136. mxScriptsLoaded = true;
  137. checkAllLoaded();
  138. // Electron
  139. if (mxIsElectron)
  140. {
  141. mxscript('js/diagramly/DesktopLibrary.js', function()
  142. {
  143. mxscript('js/diagramly/ElectronApp.js', function()
  144. {
  145. mxscript('js/extensions.min.js', function()
  146. {
  147. mxscript('js/stencils.min.js', function()
  148. {
  149. mxscript('js/shapes-14-6-5.min.js', function()
  150. {
  151. mxscript('js/PostConfig.js');
  152. });
  153. });
  154. });
  155. });
  156. });
  157. }
  158. else if (!supportedDomain)
  159. {
  160. mxscript('js/PostConfig.js');
  161. }
  162. });
  163. };
  164. if (!supportedDomain || mxIsElectron)
  165. {
  166. mxscript('js/PreConfig.js', loadAppJS);
  167. }
  168. else
  169. {
  170. loadAppJS();
  171. }
  172. })();
  173. }
  174. // Adds basic error handling
  175. window.onerror = function()
  176. {
  177. var status = document.getElementById('geStatus');
  178. if (status != null)
  179. {
  180. status.innerHTML = 'Page could not be loaded. Please try refreshing.';
  181. }
  182. };
  183. </script>
  184. <link rel="stylesheet" type="text/css" href="styles/grapheditor.css">
  185. <link rel="shortcut icon" href="favicon.ico">
  186. <style type="text/css">
  187. body { overflow:hidden; }
  188. div.picker { z-index: 10007; }
  189. .geSidebarContainer .geTitle input {
  190. font-size:8pt;
  191. color:#606060;
  192. }
  193. .geBlock {
  194. z-index:-3;
  195. margin:100px;
  196. margin-top:40px;
  197. margin-bottom:30px;
  198. padding:20px;
  199. text-align:center;
  200. min-width:50%;
  201. }
  202. .geBlock h1, .geBlock h2 {
  203. margin-top:0px;
  204. padding-top:0px;
  205. }
  206. .geEditor *:not(.geScrollable)::-webkit-scrollbar {
  207. width:10px;
  208. height:10px;
  209. }
  210. .geEditor ::-webkit-scrollbar-track {
  211. background-clip:padding-box;
  212. border:solid transparent;
  213. border-width:1px;
  214. }
  215. .geEditor ::-webkit-scrollbar-corner {
  216. background-color:transparent;
  217. }
  218. .geEditor ::-webkit-scrollbar-thumb {
  219. background-color:rgba(0,0,0,.1);
  220. background-clip:padding-box;
  221. border:solid transparent;
  222. border-radius:10px;
  223. }
  224. .geEditor ::-webkit-scrollbar-thumb:hover {
  225. background-color:rgba(0,0,0,.4);
  226. }
  227. .geTemplate {
  228. border:1px solid transparent;
  229. display:inline-block;
  230. _display:inline;
  231. vertical-align:top;
  232. border-radius:3px;
  233. overflow:hidden;
  234. font-size:14pt;
  235. cursor:pointer;
  236. margin:5px;
  237. }
  238. </style>
  239. <!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->
  240. <!--[if (IE 9)|(IE 10)]><!-->
  241. <script type="text/vbscript">
  242. Function mxUtilsBinaryToArray(Binary)
  243. Dim i
  244. ReDim byteArray(LenB(Binary))
  245. For i = 1 To LenB(Binary)
  246. byteArray(i-1) = AscB(MidB(Binary, i, 1))
  247. Next
  248. mxUtilsBinaryToArray = byteArray
  249. End Function
  250. </script>
  251. <!--<![endif]-->
  252. </head>
  253. <body class="geEditor">
  254. <script type="text/javascript">
  255. /**
  256. * Main
  257. */
  258. if (urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function")
  259. {
  260. window.addEventListener('load', function()
  261. {
  262. mxWinLoaded = true;
  263. checkAllLoaded();
  264. });
  265. }
  266. else
  267. {
  268. App.main();
  269. }
  270. </script>
  271. </body>
  272. </html>