ssindex.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]-->
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <title>Flowchart Maker &amp; Online Diagram Software</title>
  6. <meta charset="utf-8">
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  8. <meta name="Description" content="draw.io is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams">
  9. <meta name="Keywords" content="diagram, online, flow chart, flowchart maker, uml, erd">
  10. <meta itemprop="name" content="draw.io - free flowchart maker and diagrams online">
  11. <meta itemprop="description" content="draw.io is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship,
  12. org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic
  13. circuit and social network diagrams.">
  14. <meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png">
  15. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  16. <meta name="mobile-web-app-capable" content="yes">
  17. <meta name="apple-mobile-web-app-capable" content="yes">
  18. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  19. <link rel="canonical" href="https://www.draw.io">
  20. <style type="text/css">
  21. body { _overflow: hidden; }
  22. .geSidebarContainer .geTitle { color:#505050; }
  23. .geSidebarContainer .geTitle input {
  24. font-size:8pt;
  25. color:#606060;
  26. }
  27. .geBlock {
  28. z-index: -3;
  29. margin:100px;
  30. margin-top:40px;
  31. margin-bottom:30px;
  32. padding:20px;
  33. border-radius:6px;
  34. -webkit-box-shadow:0px 0px 4px 4px #e5e5e5;
  35. -moz-box-shadow:0px 0px 4px 4px #e5e5e5;
  36. box-shadow:0px 0px 4px 4px #e5e5e5;
  37. _filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=4, OffY=4, Color='#e5e5e5', Positive='true');
  38. border:1px solid gray;
  39. background-color:white;
  40. }
  41. .geBlock h1, .geBlock h2 {
  42. margin-top:0px;
  43. padding-top:0px;
  44. }
  45. .geEditor {
  46. background-color:whiteSmoke;
  47. }
  48. .geEditor ::-webkit-scrollbar {
  49. width:12px;
  50. height:12px;
  51. }
  52. .geEditor ::-webkit-scrollbar-track {
  53. background:whiteSmoke;
  54. -webkit-box-shadow:inset 0 0 4px rgba(0,0,0,0.1);
  55. }
  56. .geEditor ::-webkit-scrollbar-thumb {
  57. background:#c5c5c5;
  58. border-radius:10px;
  59. border:whiteSmoke solid 3px;
  60. }
  61. .geEditor ::-webkit-scrollbar-thumb:hover {
  62. background:#b5b5b5;
  63. }
  64. .geTemplate {
  65. border:1px solid transparent;
  66. display:inline-block;
  67. _display:inline;
  68. vertical-align:top;
  69. border-radius:3px;
  70. overflow:hidden;
  71. font-size:14pt;
  72. cursor:pointer;
  73. margin:5px;
  74. }
  75. .geFooterContainer {
  76. z-index:100;
  77. }
  78. </style>
  79. <!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->
  80. <!--[if (IE 9)|(IE 10)]><!-->
  81. <script type="text/vbscript">
  82. Function mxUtilsBinaryToArray(Binary)
  83. Dim i
  84. ReDim byteArray(LenB(Binary))
  85. For i = 1 To LenB(Binary)
  86. byteArray(i-1) = AscB(MidB(Binary, i, 1))
  87. Next
  88. mxUtilsBinaryToArray = byteArray
  89. End Function
  90. </script>
  91. <!--<![endif]-->
  92. <script type="text/javascript">
  93. /**
  94. * Parses URL parameters. Supported parameters are (precedence in given order):
  95. *
  96. * - lang=xy: Specifies the language of the user interface
  97. * - touch=1: Enables a touch-style user interface
  98. * - libs=key1;key2;...;keyN: Specifies the libraries
  99. * - clibs=key1;key2;key;...;keyN: Specifies custom libraries
  100. * - picker=0: Disables Google picker
  101. * - picker=1: Enables Google picker
  102. * - storage=device: Adds device storage option for touch devices
  103. * - mode=google/dropobox/device/browser: Switch to given mode
  104. * - chrome=0: Chromeless read-only viewer with no analytics
  105. * - nav=1: Enables folding in chromeless mode
  106. * - https=0: Disables/enables SSL
  107. * - save=local/remote: Uses/disables saving files locally (local is default)
  108. * - stealth=1: Runs in offline mode but without storing the app in local cache
  109. * - math=0: Disables MathJax support
  110. * - drive=0: Simulates www.draw.io (using old app ID)
  111. * - url=url: Opens diagram from URL (URL should be encoded)
  112. * - analytics=0: Disables Google Analytics
  113. * - plugins=0: Do not load Plugins
  114. * - p=id1;id2;...;idN: Select plugins to load
  115. * - gapi=0: Do not load Google APIs
  116. * - db=0: Do not load Dropbox APIs
  117. * - od=0: Do not load OneDrive APIs
  118. * - local=1: Uses device mode only.
  119. * - format=0: Disables the format panel.
  120. * - photos=1: Adds the photos scopes in Drive.
  121. * - thumb=0: Disables creation of thumbnails in Drive.
  122. * - client=1: Runs in client mode. This will run a normal UI and send a "ready"
  123. * message to the opener or parent when the page is loaded. After receiving
  124. * a message with XML or compressed XML, a local file is created. The file is then
  125. * set to modified so the connection to the window can be closed after sending the
  126. * initial XML. The XML will not be loaded again after a refresh. The window will
  127. * stay empty in this case.
  128. * - embed=1: Runs in embedded mode. This will send a "ready" message to the
  129. * opener or parent when the page is loaded. After receiving the ready message
  130. * the data can be sent as XML or compressed XML. It will send back XML or an empty
  131. * string if apply or cancel are pressed, respectively.
  132. * - spin=1: Shows a spinner while waiting for the diagram data in embed mode.
  133. * - modified=0: Disables update of the modified state in embed mode after save is pressed.
  134. * And enables update of the status message after changes. If 0 is used, the status bar
  135. * is cleared after changes. Else the value of this is used as the resource key.
  136. * - saveAndExit: Displays an additional save and exit button (see below).
  137. * - proto=json: Uses JSON for message passing in embed and client mode. The protocol is
  138. * as follows: When the client is ready, it sends {event: 'init'} and expects {action: 'load',
  139. * xml: '...'}. An optional autosave: 1 can be specified in this message to enabled autosave.
  140. * If autosave is enabled the editor will send the current XML in an {event: 'autosave'...}.
  141. * The XML in the load message is displayed and an {event: 'load'...} is returned with some
  142. * data about the size of the graph. Optionally, instead of xml, xmlpng can be used in the
  143. * load message with a base64 encoded PNG with embedded XML. (The XML in this message can
  144. * be any supported XML represenation of the graph including SVG with embedded XML.)
  145. * If save is clicked, the same message as load is sent but with an additional event: 'save'
  146. * and xml: '...' containing the XML of the diagram. If save and exit is clicked the message
  147. * has an additional exit: true.
  148. * If exit is clicked, an {event: 'exit', modified: boolean} is sent.
  149. * {action: 'dialog', title: '...', message: '...', button: '...', modified: bool} can be sent
  150. * at any time to display a dialog in the editor window. To translate the dialog, titleKey,
  151. * messageKey and buttonKey can be used instead.
  152. * {action: 'status', message: '...', modified: bool} can be sent at any time to display a message
  153. * in the status bar. The optional modified flag is used to update the modified state. Instead of
  154. * message, messageKey can be used to specify a resource key for the message.
  155. * {action: 'export', format: '...'} can be sent at any time to return {event: 'export',
  156. * format: '...', data: '...', xml: '...'} with the data and XML used for the given format.
  157. * Supported formats are html, svg (default), xmlsvg (SVG with embeddded XML), png and xmlpng
  158. * (PNG with embedded XML). For png and xmlpng, an additional spin (or spinKey) parameter
  159. * can be used to enable a spinner and specify a message (or message key) while the image
  160. * is being generated. An optional xml parameter can be used to specify the XML of the
  161. * diagram to be exported for all supported formats. An optional embedImages: false can be
  162. * specified for the svg and xmlsvg formats to disable embedded images in the SVG output.
  163. * - returnbounds=1: Returns a JSON structure with the graph bounds in embed and client
  164. * mode. This message is dispatched immediately after receiving the graph XML.
  165. * - ui=atlas: Uses the atlas theme for the UI
  166. * - ready=message: The message to send in embed or client mode. Default is 'ready'. If
  167. * JSON protocol is used then this is ignored.
  168. * - create=url/name: Creates new file from template URL. If the value is not an
  169. * URL and is not empty the script will try to use window.opener[url]. In embed
  170. * mode, window.opener[name] will be used to get the initial XML. Note that this
  171. * needs same origin policy in the opener/parent for reading the variable.
  172. * - title=title: New file title (used with create)
  173. * - offline=1: Shortcut for db=0&gapi=0&math=0&picker=0&analytics=0
  174. * and disables all remote operations and features, such as i18n (english only),
  175. * remote images, google/dropbox integration, plugins and bitmap and PDF export.
  176. * - demo=1: Shortcut for db=0&gapi=0&math=0&picker=0&analytics=0, disables the
  177. * splash screen and creates an empty, local file.
  178. * - splash=0: Bypasses the splash screen and starts with an empty file.
  179. * - rev=id: Selects a specific revision of a Google Drive file.
  180. * - pv=0: Sets default pageVisible to false.
  181. * - sb=0: Starts with scrollbars disabled.
  182. * --
  183. * - dev=1: For developers only
  184. * - test=1: For developers only
  185. * - drawdev=1: For developers only
  186. * - export=URL for export: For developers only
  187. * - ignoremime=1: For developers only (see DriveClient.js). Use Cmd-S to override mime.
  188. * - createindex=1: For depelopers only (see etc/build/README)
  189. * - filesupport=0: For developers only (see Editor.js in core)
  190. * - savesidebar=1: For developers only (see Sidebar.js)
  191. * --
  192. * - networkshapes=1: For testing network shapes (temporary)
  193. */
  194. var urlParams = (function()
  195. {
  196. var result = new Object();
  197. var params = window.location.search.slice(1).split('&');
  198. for (var i = 0; i < params.length; i++)
  199. {
  200. idx = params[i].indexOf('=');
  201. if (idx > 0)
  202. {
  203. result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
  204. }
  205. }
  206. return result;
  207. })();
  208. /**
  209. * Synchronously adds scripts to the page.
  210. */
  211. function mxscript(src)
  212. {
  213. document.write('<script src="'+src+'"></scr' + 'ipt>');
  214. };
  215. /**
  216. * Asynchronously adds scripts to the page.
  217. */
  218. function mxinclude(src)
  219. {
  220. var g = document.createElement('script'); g.type = 'text/javascript'; g.async = true; g.src = src;
  221. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(g, s);
  222. };
  223. // Checks for local storage and SVG support
  224. var isSvgBrowser = true;
  225. var isLocalStorage = false; // No local storage in sandstorm because of subdomains - typeof(localStorage) != 'undefined';
  226. var t0 = new Date();
  227. // Public global variables
  228. var SANDSTORM = true;
  229. var MAX_REQUEST_SIZE = 10485760;
  230. var MAX_AREA = 10000 * 10000;
  231. // CUSTOM_PARAMETERS - URLs for save and export
  232. var EXPORT_URL = 'https://exp.draw.io/ImageExport4/export';
  233. var SAVE_URL = 'save';
  234. var OPEN_URL = 'open';
  235. var PROXY_URL = 'proxy';
  236. // Paths and files
  237. var STENCIL_PATH = 'stencils';
  238. var SHAPES_PATH = 'shapes';
  239. var IMAGE_PATH = 'images';
  240. // Path for images inside the diagram
  241. var GRAPH_IMAGE_PATH = 'img';
  242. var ICONFINDER_PATH = (navigator.userAgent.indexOf('MSIE') >= 0) ? 'iconfinder' : 'https://www.draw.io/iconfinder';
  243. var STYLE_PATH = 'styles';
  244. var CSS_PATH = 'styles';
  245. var OPEN_FORM = 'open.html';
  246. var TEMPLATE_PATH = '/templates';
  247. // Directory for i18 files and basename for main i18n file
  248. var RESOURCES_PATH = 'resources';
  249. var RESOURCE_BASE = RESOURCES_PATH + '/dia';
  250. /**
  251. * Global function for loading local files via servlet
  252. */
  253. function setCurrentXml(data, filename)
  254. {
  255. if (window.parent != null && window.parent.openFile != null)
  256. {
  257. window.parent.openFile.setData(data, filename);
  258. }
  259. };
  260. /**
  261. * Returns the global language
  262. */
  263. function getLanguage()
  264. {
  265. var lang = (urlParams['offline'] == '1') ? 'en' : urlParams['lang'];
  266. // Known issue: No JSON object at this point in quirks in IE8
  267. if (lang == null && typeof(JSON) != 'undefined')
  268. {
  269. // Cannot use mxSettings here
  270. if (isLocalStorage)
  271. {
  272. try
  273. {
  274. var value = localStorage.getItem('.drawio-config');
  275. if (value != null)
  276. {
  277. lang = JSON.parse(value).language || null;
  278. }
  279. }
  280. catch (e)
  281. {
  282. // cookies are disabled, attempts to use local storage will cause
  283. // a DOM error at a minimum on Chrome
  284. isLocalStorage = false;
  285. }
  286. }
  287. }
  288. return lang;
  289. };
  290. // Sets the base path, the UI language via URL param and configures the
  291. // supported languages to avoid 404s. The loading of all core language
  292. // resources is disabled as all required resources are in grapheditor.
  293. // properties. Note that in this example the loading of two resource
  294. // files (the special bundle and the default bundle) is disabled to
  295. // save a GET request. This requires that all resources be present in
  296. // the special bundle.
  297. var mxLoadResources = false;
  298. var mxLanguage = getLanguage();
  299. // Add new languages here. First entry is translated to [Automatic]
  300. // in the menu defintion in Diagramly.js.
  301. var mxLanguageMap = {'i18n': '', 'id' : 'Bahasa Indonesia', 'ms' : 'Bahasa Melayu', 'bs' : 'Bosanski', 'ca' : 'Català', 'cs' : 'Čeština', 'da' : 'Dansk', 'de' : 'Deutsch', 'et' : 'Eesti', 'en' : 'English', 'es' : 'Español',
  302. 'fil' : 'Filipino', 'fr' : 'Français', 'it' : 'Italiano', 'hu' : 'Magyar', 'nl' : 'Nederlands', 'no' : 'Norsk',
  303. 'pl' : 'Polski', 'pt-br' : 'Português (Brasil)', 'pt' : 'Português (Portugal)', 'ro' : 'Română', 'fi' : 'Suomi', 'sv' : 'Svenska', 'vi' : 'Tiếng Việt', 'tr' : 'Türkçe',
  304. 'el' : 'Ελληνικά', 'ru' : 'Русский', 'sr' : 'Српски', 'uk' : 'Українська', 'he' : 'עברית',
  305. 'ar' : 'العربية', 'th' : 'ไทย', 'ko' : '한국어', 'ja' : '日本語', 'zh' : '中文(中国)', 'zh-tw' : '中文(台灣)'};
  306. var geBasePath = 'js';
  307. var mxBasePath = 'mxgraph';
  308. var mxLanguages = [];
  309. // Populates the list of supported special language bundles
  310. for (var lang in mxLanguageMap)
  311. {
  312. // Empty means default (ie. browser language), "en" means English (default for unsupported languages)
  313. // Since "en" uses no extension this must not be added to the array of supported language bundles.
  314. if (lang != 'en')
  315. {
  316. mxLanguages.push(lang);
  317. }
  318. }
  319. /**
  320. * Returns the global UI setting before runngin static draw.io code
  321. */
  322. var uiTheme = (function()
  323. {
  324. var ui = urlParams['ui'];
  325. // Known issue: No JSON object at this point in quirks in IE8
  326. if (ui == null && typeof(JSON) != 'undefined')
  327. {
  328. // Cannot use mxSettings here
  329. if (isLocalStorage)
  330. {
  331. try
  332. {
  333. var value = localStorage.getItem('.drawio-config');
  334. if (value != null)
  335. {
  336. ui = JSON.parse(value).ui || null;
  337. }
  338. }
  339. catch (e)
  340. {
  341. // cookies are disabled, attempts to use local storage will cause
  342. // a DOM error at a minimum on Chrome
  343. isLocalStorage = false;
  344. }
  345. }
  346. }
  347. return ui;
  348. })();
  349. // Used to request grapheditor/mxgraph sources in dev mode
  350. var mxDevUrl = document.location.protocol + '//devhost.jgraph.com/mxgraph2';
  351. // Used to request draw.io sources in dev mode
  352. var drawDevUrl = '';
  353. if (urlParams['drawdev'] == '1')
  354. {
  355. drawDevUrl = document.location.protocol + '//drawhost.jgraph.com/';
  356. }
  357. // Customizes export URL
  358. var ex = urlParams['export'];
  359. if (ex != null)
  360. {
  361. EXPORT_URL = ex;
  362. }
  363. urlParams['analytics'] = '0';
  364. urlParams['picker'] = '0';
  365. urlParams['gapi'] = '0';
  366. urlParams['db'] = '0';
  367. urlParams['od'] = '0';
  368. urlParams['embed'] = '1';
  369. // Changes paths for local development environment
  370. if (urlParams['dev'] == '1')
  371. {
  372. geBasePath = mxDevUrl + '/javascript/examples/grapheditor/www/js';
  373. mxBasePath = mxDevUrl + '/javascript/src';
  374. mxscript(mxBasePath + '/js/mxClient.js');
  375. // Adds external dependencies
  376. mxscript(drawDevUrl + 'js/spin/spin.min.js');
  377. mxscript(drawDevUrl + 'js/deflate/pako.min.js');
  378. mxscript(drawDevUrl + 'js/deflate/base64.js');
  379. mxscript(drawDevUrl + 'js/sanitizer/sanitizer.min.js');
  380. // Adds all JS code that depends on mxClient. This indirection via Devel.js is
  381. // required in some browsers to make sure mxClient.js (and the files that it
  382. // loads asynchronously) are available when the code loaded in Devel.js runs.
  383. mxscript(drawDevUrl + 'js/diagramly/Devel.js');
  384. //mxscript(drawDevUrl + 'js/sandstorm/SandstormFile.js');
  385. }
  386. else
  387. {
  388. mxscript('js/app.min.js');
  389. //mxscript('js/sandstorm/SandstormFile.js');
  390. }
  391. // Loads JSON for older browsers
  392. if (typeof(JSON) == 'undefined')
  393. {
  394. mxscript('js/json/json2.min.js');
  395. }
  396. // Adds basic error handling
  397. window.onerror = function()
  398. {
  399. var status = document.getElementById('geStatus');
  400. if (status != null)
  401. {
  402. status.innerHTML = 'Page could not be loaded. Please try refreshing.';
  403. }
  404. };
  405. </script>
  406. </head>
  407. <body class="geEditor">
  408. <div id="geInfo">
  409. <div class="geBlock" style="text-align:center;">
  410. <h1>Flowchart Maker and Online Diagram Software</h1>
  411. <p>
  412. draw.io (formerly Diagramly) 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,
  413. to design database schema, to build BPMN online, as a circuit diagram maker, and more.
  414. </p>
  415. </div>
  416. <div class="geBlock" style="text-align:center;">
  417. <h3 id="geStatus">Loading... Please ensure JavaScript is enabled</h2>
  418. </div>
  419. </div>
  420. <script type="text/javascript">
  421. (function()
  422. {
  423. EditorUi.prototype.footerHeight = 0;
  424. EditorUi.prototype.initializeEmbedMode = function()
  425. {
  426. mxUtils.get('var/drawiodiagram.xml', mxUtils.bind(this, function(req)
  427. {
  428. if (req.getStatus() == 200)
  429. {
  430. this.spinner.stop();
  431. this.fileLoaded(new SandstormFile(this, req.getText(), null));
  432. }
  433. else if (req.getStatus() == 404)
  434. {
  435. this.fileLoaded(null);
  436. }
  437. else
  438. {
  439. this.handleError(null, mxResources.get('errorLoadingFile'), reconnect);
  440. }
  441. }), mxUtils.bind(this, function()
  442. {
  443. this.handleError(null, mxResources.get('errorLoadingFile'), reconnect);
  444. }));
  445. };
  446. App.prototype.showSplash = function()
  447. {
  448. this.hideDialog();
  449. this.actions.get('new').funct();
  450. };
  451. App.prototype.createFile = function(title, data, libs, mode, done)
  452. {
  453. data = (data != null) ? data : '';
  454. var error = mxUtils.bind(this, function(resp)
  455. {
  456. if (resp == null && this.getCurrentFile() == null && this.dialog == null)
  457. {
  458. this.showSplash();
  459. }
  460. else if (resp != null)
  461. {
  462. this.handleError(resp);
  463. }
  464. });
  465. if (done != null)
  466. {
  467. done();
  468. }
  469. this.fileCreated(new SandstormFile(this, data, title), libs);
  470. };
  471. //////////////// Sandstorm File ///////////////////
  472. SandstormFile = function(ui, data, title)
  473. {
  474. DrawioFile.call(this, ui, data);
  475. this.title = title;
  476. };
  477. mxUtils.extend(SandstormFile, DrawioFile);
  478. SandstormFile.prototype.isAutosave = function() { return true; };
  479. SandstormFile.prototype.getMode = function() { return App.MODE_DEVICE; };
  480. SandstormFile.prototype.getTitle = function() { return this.title; };
  481. SandstormFile.prototype.isRenamable = function() { return true; };
  482. /**
  483. *
  484. */
  485. SandstormFile.prototype.save = function(revision, success, error)
  486. {
  487. this.saveAs(this.title, success, error);
  488. };
  489. /**
  490. *
  491. */
  492. SandstormFile.prototype.saveAs = function(title, success, error)
  493. {
  494. DrawioFile.prototype.save.apply(this, arguments);
  495. this.saveFile(this.title, null, success, error);
  496. };
  497. /**
  498. *
  499. */
  500. SandstormFile.prototype.saveFile = function(title, revision, success, error, unloading)
  501. {
  502. var data = this.getData();
  503. this.title = title;
  504. var request = new mxXmlRequest('var/drawiodiagram.xml', data, 'PUT');
  505. request.send(mxUtils.bind(this, function(req)
  506. {
  507. }), mxUtils.bind(this, function()
  508. {
  509. }));
  510. this.contentChanged();
  511. if (success != null)
  512. {
  513. success();
  514. }
  515. };
  516. //////////////// End Sandstorm File ///////////////////
  517. //////////////// Custom menu actions //////////////////
  518. //////////////// End custom menu actions //////////////////
  519. /**
  520. * Color dialog - Do not add to app.min.js due to path issues!
  521. */
  522. if (urlParams['chrome'] != '0')
  523. {
  524. mxscript('js/jscolor/jscolor.js');
  525. }
  526. if (uiTheme == 'atlas')
  527. {
  528. mxClient.link('stylesheet', 'styles/atlas.css');
  529. }
  530. /**
  531. * Asynchronous MathJax extension.
  532. */
  533. /* if (urlParams['math'] != '0')
  534. {
  535. var mathJaxQueue = [];
  536. // Disables global typesetting and messages on startup, adds queue for
  537. // asynchronous rendering while MathJax is loading
  538. window.MathJax =
  539. {
  540. skipStartupTypeset: true,
  541. showMathMenu: false,
  542. messageStyle: 'none',
  543. AuthorInit: function ()
  544. {
  545. MathJax.Hub.Register.StartupHook('Begin', function()
  546. {
  547. for (var i = 0; i < mathJaxQueue.length; i++)
  548. {
  549. MathJax.Hub.Queue(['Typeset', MathJax.Hub, mathJaxQueue[i]]);
  550. }
  551. });
  552. }
  553. };
  554. // Adds global enqueue method for async rendering
  555. window.MathJaxRender = function(container)
  556. {
  557. // Initial rendering when MathJax finished loading
  558. if (typeof(MathJax) !== 'undefined' && typeof(MathJax.Hub) !== 'undefined')
  559. {
  560. MathJax.Hub.Queue(['Typeset', MathJax.Hub, container]);
  561. }
  562. else
  563. {
  564. mathJaxQueue.push(container);
  565. }
  566. }
  567. mxscript('js/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML');
  568. } */
  569. /**
  570. * For developers only
  571. */
  572. if (urlParams['chrome'] != '0' && (urlParams['test'] == '1' || urlParams['dev'] == '1'))
  573. {
  574. mxLog.show();
  575. mxLog.debug('Started in ' + (new Date().getTime() - t0.getTime()) + 'ms');
  576. mxLog.debug('Export:', EXPORT_URL);
  577. mxLog.debug('Development mode:', (urlParams['dev'] == '1') ? 'active' : 'inactive');
  578. mxLog.debug('Test mode:', (urlParams['test'] == '1') ? 'active' : 'inactive');
  579. }
  580. /**
  581. * Main
  582. */
  583. var ui = new App(new Editor());
  584. App.prototype.enableLogging = false;
  585. ui.actions.get('save').visible = false;
  586. ui.actions.get('exit').visible = false;
  587. ui.actions.get('feedback').visible = false;
  588. // Changes support link in Help menu
  589. ui.actions.addAction('support...', function()
  590. {
  591. window.open('https://support.draw.io/display/DFS/draw.io+for+Sandstorm+Home');
  592. });
  593. EditorUi.prototype.isExportToCanvas = function()
  594. {
  595. // LATER: Fix security error caused by foreignObjects in Safari for toDataUri (tainted canvas)
  596. return false;
  597. };
  598. // Loads and executes the plugins
  599. if (urlParams['offline'] != '1')
  600. {
  601. var plugins = mxSettings.getPlugins();
  602. if (plugins != null && plugins.length > 0 && urlParams['plugins'] != '0')
  603. {
  604. // Global entry point for plugins is Draw.loadPlugin. This is the only
  605. // long-term supported solution for access to the EditorUi instance.
  606. window.Draw = new Object();
  607. window.Draw.loadPlugin = function(callback)
  608. {
  609. callback(ui);
  610. };
  611. if (plugins.length == 1 && (plugins[0].charAt(0) == '/' ||
  612. plugins[0].indexOf(window.location.protocol + '//' + window.location.host) == 0))
  613. {
  614. mxscript(plugins[0]);
  615. }
  616. // Loads plugins asynchronously
  617. else if (mxUtils.confirm(mxResources.get('pluginWarning', [plugins.join('\n')]).replace(/\\n/g, '\n')))
  618. {
  619. for (var i = 0; i < plugins.length; i++)
  620. {
  621. mxscript(plugins[i]);
  622. }
  623. }
  624. }
  625. }
  626. })();
  627. </script>
  628. </body>
  629. </html>