mxClient.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. /**
  2. * Copyright (c) 2006-2017, JGraph Ltd
  3. * Copyright (c) 2006-2017, Gaudenz Alder
  4. */
  5. var mxClient =
  6. {
  7. /**
  8. * Class: mxClient
  9. *
  10. * Bootstrapping mechanism for the mxGraph thin client. The production version
  11. * of this file contains all code required to run the mxGraph thin client, as
  12. * well as global constants to identify the browser and operating system in
  13. * use. You may have to load chrome://global/content/contentAreaUtils.js in
  14. * your page to disable certain security restrictions in Mozilla.
  15. *
  16. * Variable: VERSION
  17. *
  18. * Contains the current version of the mxGraph library. The strings that
  19. * communicate versions of mxGraph use the following format.
  20. *
  21. * versionMajor.versionMinor.buildNumber.revisionNumber
  22. *
  23. * Current version is 4.1.1.
  24. */
  25. VERSION: '4.1.1',
  26. /**
  27. * Variable: IS_IE
  28. *
  29. * True if the current browser is Internet Explorer 10 or below. Use <mxClient.IS_IE11>
  30. * to detect IE 11.
  31. */
  32. IS_IE: navigator.userAgent != null && navigator.userAgent.indexOf('MSIE') >= 0,
  33. /**
  34. * Variable: IS_IE6
  35. *
  36. * True if the current browser is Internet Explorer 6.x.
  37. */
  38. IS_IE6: navigator.userAgent != null && navigator.userAgent.indexOf('MSIE 6') >= 0,
  39. /**
  40. * Variable: IS_IE11
  41. *
  42. * True if the current browser is Internet Explorer 11.x.
  43. */
  44. IS_IE11: navigator.userAgent != null && !!navigator.userAgent.match(/Trident\/7\./),
  45. /**
  46. * Variable: IS_EDGE
  47. *
  48. * True if the current browser is Microsoft Edge.
  49. */
  50. IS_EDGE: navigator.userAgent != null && !!navigator.userAgent.match(/Edge\//),
  51. /**
  52. * Variable: IS_QUIRKS
  53. *
  54. * True if the current browser is Internet Explorer and it is in quirks mode.
  55. */
  56. IS_QUIRKS: navigator.userAgent != null && navigator.userAgent.indexOf('MSIE') >= 0 &&
  57. (document.documentMode == null || document.documentMode == 5),
  58. /**
  59. * Variable: IS_EM
  60. *
  61. * True if the browser is IE11 in enterprise mode (IE8 standards mode).
  62. */
  63. IS_EM: 'spellcheck' in document.createElement('textarea') && document.documentMode == 8,
  64. /**
  65. * Variable: VML_PREFIX
  66. *
  67. * Prefix for VML namespace in node names. Default is 'v'.
  68. */
  69. VML_PREFIX: 'v',
  70. /**
  71. * Variable: OFFICE_PREFIX
  72. *
  73. * Prefix for VML office namespace in node names. Default is 'o'.
  74. */
  75. OFFICE_PREFIX: 'o',
  76. /**
  77. * Variable: IS_NS
  78. *
  79. * True if the current browser is Netscape (including Firefox).
  80. */
  81. IS_NS: navigator.userAgent != null &&
  82. navigator.userAgent.indexOf('Mozilla/') >= 0 &&
  83. navigator.userAgent.indexOf('MSIE') < 0 &&
  84. navigator.userAgent.indexOf('Edge/') < 0,
  85. /**
  86. * Variable: IS_OP
  87. *
  88. * True if the current browser is Opera.
  89. */
  90. IS_OP: navigator.userAgent != null &&
  91. (navigator.userAgent.indexOf('Opera/') >= 0 ||
  92. navigator.userAgent.indexOf('OPR/') >= 0),
  93. /**
  94. * Variable: IS_OT
  95. *
  96. * True if -o-transform is available as a CSS style, ie for Opera browsers
  97. * based on a Presto engine with version 2.5 or later.
  98. */
  99. IS_OT: navigator.userAgent != null &&
  100. navigator.userAgent.indexOf('Presto/') >= 0 &&
  101. navigator.userAgent.indexOf('Presto/2.4.') < 0 &&
  102. navigator.userAgent.indexOf('Presto/2.3.') < 0 &&
  103. navigator.userAgent.indexOf('Presto/2.2.') < 0 &&
  104. navigator.userAgent.indexOf('Presto/2.1.') < 0 &&
  105. navigator.userAgent.indexOf('Presto/2.0.') < 0 &&
  106. navigator.userAgent.indexOf('Presto/1.') < 0,
  107. /**
  108. * Variable: IS_SF
  109. *
  110. * True if the current browser is Safari.
  111. */
  112. IS_SF: /constructor/i.test(window.HTMLElement) || (function (p) {
  113. return p.toString() === "[object SafariRemoteNotification]";
  114. })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)),
  115. /**
  116. * Variable: IS_ANDROID
  117. *
  118. * Returns true if the user agent contains Android.
  119. */
  120. IS_ANDROID: navigator.appVersion.indexOf('Android') >= 0,
  121. /**
  122. * Variable: IS_IOS
  123. *
  124. * Returns true if the user agent is an iPad, iPhone or iPod.
  125. */
  126. IS_IOS: (/iP(hone|od|ad)/.test(navigator.platform)),
  127. /**
  128. * Variable: IOS_VERSION
  129. *
  130. * Returns the major version number for iOS devices or 0 if the
  131. * device is not an iOS device.
  132. */
  133. IOS_VERSION: (function()
  134. {
  135. if ((/iP(hone|od|ad)/.test(navigator.platform)))
  136. {
  137. var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
  138. if (v != null && v.length > 0)
  139. {
  140. return parseInt(v[1]);
  141. }
  142. }
  143. return 0;
  144. })(),
  145. /**
  146. * Variable: IS_GC
  147. *
  148. * True if the current browser is Google Chrome.
  149. */
  150. IS_GC: /Google Inc/.test(navigator.vendor),
  151. /**
  152. * Variable: IS_CHROMEAPP
  153. *
  154. * True if the this is running inside a Chrome App.
  155. */
  156. IS_CHROMEAPP: window.chrome != null && chrome.app != null && chrome.app.runtime != null,
  157. /**
  158. * Variable: IS_FF
  159. *
  160. * True if the current browser is Firefox.
  161. */
  162. IS_FF: typeof InstallTrigger !== 'undefined',
  163. /**
  164. * Variable: IS_MT
  165. *
  166. * True if -moz-transform is available as a CSS style. This is the case
  167. * for all Firefox-based browsers newer than or equal 3, such as Camino,
  168. * Iceweasel, Seamonkey and Iceape.
  169. */
  170. IS_MT: (navigator.userAgent.indexOf('Firefox/') >= 0 &&
  171. navigator.userAgent.indexOf('Firefox/1.') < 0 &&
  172. navigator.userAgent.indexOf('Firefox/2.') < 0) ||
  173. (navigator.userAgent.indexOf('Iceweasel/') >= 0 &&
  174. navigator.userAgent.indexOf('Iceweasel/1.') < 0 &&
  175. navigator.userAgent.indexOf('Iceweasel/2.') < 0) ||
  176. (navigator.userAgent.indexOf('SeaMonkey/') >= 0 &&
  177. navigator.userAgent.indexOf('SeaMonkey/1.') < 0) ||
  178. (navigator.userAgent.indexOf('Iceape/') >= 0 &&
  179. navigator.userAgent.indexOf('Iceape/1.') < 0),
  180. /**
  181. * Variable: IS_VML
  182. *
  183. * True if the browser supports VML.
  184. */
  185. IS_VML: navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER',
  186. /**
  187. * Variable: IS_SVG
  188. *
  189. * True if the browser supports SVG.
  190. */
  191. IS_SVG: navigator.appName.toUpperCase() != 'MICROSOFT INTERNET EXPLORER',
  192. /**
  193. * Variable: NO_FO
  194. *
  195. * True if foreignObject support is not available. This is the case for
  196. * Opera, older SVG-based browsers and all versions of IE.
  197. */
  198. NO_FO: !document.createElementNS || document.createElementNS('http://www.w3.org/2000/svg',
  199. 'foreignObject') != '[object SVGForeignObjectElement]' || navigator.userAgent.indexOf('Opera/') >= 0,
  200. /**
  201. * Variable: IS_WIN
  202. *
  203. * True if the client is a Windows.
  204. */
  205. IS_WIN: navigator.appVersion.indexOf('Win') > 0,
  206. /**
  207. * Variable: IS_MAC
  208. *
  209. * True if the client is a Mac.
  210. */
  211. IS_MAC: navigator.appVersion.indexOf('Mac') > 0,
  212. /**
  213. * Variable: IS_CHROMEOS
  214. *
  215. * True if the client is a Chrome OS.
  216. */
  217. IS_CHROMEOS: /\bCrOS\b/.test(navigator.appVersion),
  218. /**
  219. * Variable: IS_TOUCH
  220. *
  221. * True if this device supports touchstart/-move/-end events (Apple iOS,
  222. * Android, Chromebook and Chrome Browser on touch-enabled devices).
  223. */
  224. IS_TOUCH: 'ontouchstart' in document.documentElement,
  225. /**
  226. * Variable: IS_POINTER
  227. *
  228. * True if this device supports Microsoft pointer events (always false on Macs).
  229. */
  230. IS_POINTER: window.PointerEvent != null && !(navigator.appVersion.indexOf('Mac') > 0),
  231. /**
  232. * Variable: IS_LOCAL
  233. *
  234. * True if the documents location does not start with http:// or https://.
  235. */
  236. IS_LOCAL: document.location.href.indexOf('http://') < 0 &&
  237. document.location.href.indexOf('https://') < 0,
  238. /**
  239. * Variable: defaultBundles
  240. *
  241. * Contains the base names of the default bundles if mxLoadResources is false.
  242. */
  243. defaultBundles: [],
  244. /**
  245. * Function: isBrowserSupported
  246. *
  247. * Returns true if the current browser is supported, that is, if
  248. * <mxClient.IS_VML> or <mxClient.IS_SVG> is true.
  249. *
  250. * Example:
  251. *
  252. * (code)
  253. * if (!mxClient.isBrowserSupported())
  254. * {
  255. * mxUtils.error('Browser is not supported!', 200, false);
  256. * }
  257. * (end)
  258. */
  259. isBrowserSupported: function()
  260. {
  261. return mxClient.IS_VML || mxClient.IS_SVG;
  262. },
  263. /**
  264. * Function: link
  265. *
  266. * Adds a link node to the head of the document. Use this
  267. * to add a stylesheet to the page as follows:
  268. *
  269. * (code)
  270. * mxClient.link('stylesheet', filename);
  271. * (end)
  272. *
  273. * where filename is the (relative) URL of the stylesheet. The charset
  274. * is hardcoded to ISO-8859-1 and the type is text/css.
  275. *
  276. * Parameters:
  277. *
  278. * rel - String that represents the rel attribute of the link node.
  279. * href - String that represents the href attribute of the link node.
  280. * doc - Optional parent document of the link node.
  281. * id - unique id for the link element to check if it already exists
  282. */
  283. link: function(rel, href, doc, id)
  284. {
  285. doc = doc || document;
  286. // Workaround for Operation Aborted in IE6 if base tag is used in head
  287. if (mxClient.IS_IE6)
  288. {
  289. doc.write('<link rel="' + rel + '" href="' + href + '" charset="UTF-8" type="text/css"/>');
  290. }
  291. else
  292. {
  293. var link = doc.createElement('link');
  294. link.setAttribute('rel', rel);
  295. link.setAttribute('href', href);
  296. link.setAttribute('charset', 'UTF-8');
  297. link.setAttribute('type', 'text/css');
  298. if (id)
  299. {
  300. link.setAttribute('id', id);
  301. }
  302. var head = doc.getElementsByTagName('head')[0];
  303. head.appendChild(link);
  304. }
  305. },
  306. /**
  307. * Function: loadResources
  308. *
  309. * Helper method to load the default bundles if mxLoadResources is false.
  310. *
  311. * Parameters:
  312. *
  313. * fn - Function to call after all resources have been loaded.
  314. * lan - Optional string to pass to <mxResources.add>.
  315. */
  316. loadResources: function(fn, lan)
  317. {
  318. var pending = mxClient.defaultBundles.length;
  319. function callback()
  320. {
  321. if (--pending == 0)
  322. {
  323. fn();
  324. }
  325. }
  326. for (var i = 0; i < mxClient.defaultBundles.length; i++)
  327. {
  328. mxResources.add(mxClient.defaultBundles[i], lan, callback);
  329. }
  330. },
  331. /**
  332. * Function: include
  333. *
  334. * Dynamically adds a script node to the document header.
  335. *
  336. * In production environments, the includes are resolved in the mxClient.js
  337. * file to reduce the number of requests required for client startup. This
  338. * function should only be used in development environments, but not in
  339. * production systems.
  340. */
  341. include: function(src)
  342. {
  343. document.write('<script src="'+src+'"></script>');
  344. }
  345. };
  346. /**
  347. * Detects desktop mode on iPad Pro which should block event handling like iOS 12.
  348. */
  349. if (mxClient.IS_SF && mxClient.IS_TOUCH && !mxClient.IS_IOS)
  350. {
  351. mxClient.IOS_VERSION = 13;
  352. mxClient.IOS = true;
  353. }
  354. /**
  355. * Variable: mxLoadResources
  356. *
  357. * Optional global config variable to toggle loading of the two resource files
  358. * in <mxGraph> and <mxEditor>. Default is true. NOTE: This is a global variable,
  359. * not a variable of mxClient. If this is false, you can use <mxClient.loadResources>
  360. * with its callback to load the default bundles asynchronously.
  361. *
  362. * (code)
  363. * <script type="text/javascript">
  364. * var mxLoadResources = false;
  365. * </script>
  366. * <script type="text/javascript" src="/path/to/core/directory/js/mxClient.js"></script>
  367. * (end)
  368. */
  369. if (typeof(mxLoadResources) == 'undefined')
  370. {
  371. mxLoadResources = true;
  372. }
  373. /**
  374. * Variable: mxForceIncludes
  375. *
  376. * Optional global config variable to force loading the JavaScript files in
  377. * development mode. Default is undefined. NOTE: This is a global variable,
  378. * not a variable of mxClient.
  379. *
  380. * (code)
  381. * <script type="text/javascript">
  382. * var mxLoadResources = true;
  383. * </script>
  384. * <script type="text/javascript" src="/path/to/core/directory/js/mxClient.js"></script>
  385. * (end)
  386. */
  387. if (typeof(mxForceIncludes) == 'undefined')
  388. {
  389. mxForceIncludes = false;
  390. }
  391. /**
  392. * Variable: mxResourceExtension
  393. *
  394. * Optional global config variable to specify the extension of resource files.
  395. * Default is true. NOTE: This is a global variable, not a variable of mxClient.
  396. *
  397. * (code)
  398. * <script type="text/javascript">
  399. * var mxResourceExtension = '.txt';
  400. * </script>
  401. * <script type="text/javascript" src="/path/to/core/directory/js/mxClient.js"></script>
  402. * (end)
  403. */
  404. if (typeof(mxResourceExtension) == 'undefined')
  405. {
  406. mxResourceExtension = '.txt';
  407. }
  408. /**
  409. * Variable: mxLoadStylesheets
  410. *
  411. * Optional global config variable to toggle loading of the CSS files when
  412. * the library is initialized. Default is true. NOTE: This is a global variable,
  413. * not a variable of mxClient.
  414. *
  415. * (code)
  416. * <script type="text/javascript">
  417. * var mxLoadStylesheets = false;
  418. * </script>
  419. * <script type="text/javascript" src="/path/to/core/directory/js/mxClient.js"></script>
  420. * (end)
  421. */
  422. if (typeof(mxLoadStylesheets) == 'undefined')
  423. {
  424. mxLoadStylesheets = true;
  425. }
  426. /**
  427. * Variable: basePath
  428. *
  429. * Basepath for all URLs in the core without trailing slash. Default is '.'.
  430. * Set mxBasePath prior to loading the mxClient library as follows to override
  431. * this setting:
  432. *
  433. * (code)
  434. * <script type="text/javascript">
  435. * mxBasePath = '/path/to/core/directory';
  436. * </script>
  437. * <script type="text/javascript" src="/path/to/core/directory/js/mxClient.js"></script>
  438. * (end)
  439. *
  440. * When using a relative path, the path is relative to the URL of the page that
  441. * contains the assignment. Trailing slashes are automatically removed.
  442. */
  443. if (typeof(mxBasePath) != 'undefined' && mxBasePath.length > 0)
  444. {
  445. // Adds a trailing slash if required
  446. if (mxBasePath.substring(mxBasePath.length - 1) == '/')
  447. {
  448. mxBasePath = mxBasePath.substring(0, mxBasePath.length - 1);
  449. }
  450. mxClient.basePath = mxBasePath;
  451. }
  452. else
  453. {
  454. mxClient.basePath = '.';
  455. }
  456. /**
  457. * Variable: imageBasePath
  458. *
  459. * Basepath for all images URLs in the core without trailing slash. Default is
  460. * <mxClient.basePath> + '/images'. Set mxImageBasePath prior to loading the
  461. * mxClient library as follows to override this setting:
  462. *
  463. * (code)
  464. * <script type="text/javascript">
  465. * mxImageBasePath = '/path/to/image/directory';
  466. * </script>
  467. * <script type="text/javascript" src="/path/to/core/directory/js/mxClient.js"></script>
  468. * (end)
  469. *
  470. * When using a relative path, the path is relative to the URL of the page that
  471. * contains the assignment. Trailing slashes are automatically removed.
  472. */
  473. if (typeof(mxImageBasePath) != 'undefined' && mxImageBasePath.length > 0)
  474. {
  475. // Adds a trailing slash if required
  476. if (mxImageBasePath.substring(mxImageBasePath.length - 1) == '/')
  477. {
  478. mxImageBasePath = mxImageBasePath.substring(0, mxImageBasePath.length - 1);
  479. }
  480. mxClient.imageBasePath = mxImageBasePath;
  481. }
  482. else
  483. {
  484. mxClient.imageBasePath = mxClient.basePath + '/images';
  485. }
  486. /**
  487. * Variable: language
  488. *
  489. * Defines the language of the client, eg. en for english, de for german etc.
  490. * The special value 'none' will disable all built-in internationalization and
  491. * resource loading. See <mxResources.getSpecialBundle> for handling identifiers
  492. * with and without a dash.
  493. *
  494. * Set mxLanguage prior to loading the mxClient library as follows to override
  495. * this setting:
  496. *
  497. * (code)
  498. * <script type="text/javascript">
  499. * mxLanguage = 'en';
  500. * </script>
  501. * <script type="text/javascript" src="js/mxClient.js"></script>
  502. * (end)
  503. *
  504. * If internationalization is disabled, then the following variables should be
  505. * overridden to reflect the current language of the system. These variables are
  506. * cleared when i18n is disabled.
  507. * <mxEditor.askZoomResource>, <mxEditor.lastSavedResource>,
  508. * <mxEditor.currentFileResource>, <mxEditor.propertiesResource>,
  509. * <mxEditor.tasksResource>, <mxEditor.helpResource>, <mxEditor.outlineResource>,
  510. * <mxElbowEdgeHandler.doubleClickOrientationResource>, <mxUtils.errorResource>,
  511. * <mxUtils.closeResource>, <mxGraphSelectionModel.doneResource>,
  512. * <mxGraphSelectionModel.updatingSelectionResource>, <mxGraphView.doneResource>,
  513. * <mxGraphView.updatingDocumentResource>, <mxCellRenderer.collapseExpandResource>,
  514. * <mxGraph.containsValidationErrorsResource> and
  515. * <mxGraph.alreadyConnectedResource>.
  516. */
  517. if (typeof(mxLanguage) != 'undefined' && mxLanguage != null)
  518. {
  519. mxClient.language = mxLanguage;
  520. }
  521. else
  522. {
  523. mxClient.language = (mxClient.IS_IE) ? navigator.userLanguage : navigator.language;
  524. }
  525. /**
  526. * Variable: defaultLanguage
  527. *
  528. * Defines the default language which is used in the common resource files. Any
  529. * resources for this language will only load the common resource file, but not
  530. * the language-specific resource file. Default is 'en'.
  531. *
  532. * Set mxDefaultLanguage prior to loading the mxClient library as follows to override
  533. * this setting:
  534. *
  535. * (code)
  536. * <script type="text/javascript">
  537. * mxDefaultLanguage = 'de';
  538. * </script>
  539. * <script type="text/javascript" src="js/mxClient.js"></script>
  540. * (end)
  541. */
  542. if (typeof(mxDefaultLanguage) != 'undefined' && mxDefaultLanguage != null)
  543. {
  544. mxClient.defaultLanguage = mxDefaultLanguage;
  545. }
  546. else
  547. {
  548. mxClient.defaultLanguage = 'en';
  549. }
  550. // Adds all required stylesheets and namespaces
  551. if (mxLoadStylesheets)
  552. {
  553. mxClient.link('stylesheet', mxClient.basePath + '/css/common.css');
  554. }
  555. /**
  556. * Variable: languages
  557. *
  558. * Defines the optional array of all supported language extensions. The default
  559. * language does not have to be part of this list. See
  560. * <mxResources.isLanguageSupported>.
  561. *
  562. * (code)
  563. * <script type="text/javascript">
  564. * mxLanguages = ['de', 'it', 'fr'];
  565. * </script>
  566. * <script type="text/javascript" src="js/mxClient.js"></script>
  567. * (end)
  568. *
  569. * This is used to avoid unnecessary requests to language files, ie. if a 404
  570. * will be returned.
  571. */
  572. if (typeof(mxLanguages) != 'undefined' && mxLanguages != null)
  573. {
  574. mxClient.languages = mxLanguages;
  575. }
  576. // Adds required namespaces, stylesheets and memory handling for older IE browsers
  577. if (mxClient.IS_VML)
  578. {
  579. if (mxClient.IS_SVG)
  580. {
  581. mxClient.IS_VML = false;
  582. }
  583. else
  584. {
  585. // Enables support for IE8 standards mode. Note that this requires all attributes for VML
  586. // elements to be set using direct notation, ie. node.attr = value, not setAttribute.
  587. if (document.namespaces != null)
  588. {
  589. if (document.documentMode == 8)
  590. {
  591. document.namespaces.add(mxClient.VML_PREFIX, 'urn:schemas-microsoft-com:vml', '#default#VML');
  592. document.namespaces.add(mxClient.OFFICE_PREFIX, 'urn:schemas-microsoft-com:office:office', '#default#VML');
  593. }
  594. else
  595. {
  596. document.namespaces.add(mxClient.VML_PREFIX, 'urn:schemas-microsoft-com:vml');
  597. document.namespaces.add(mxClient.OFFICE_PREFIX, 'urn:schemas-microsoft-com:office:office');
  598. }
  599. }
  600. // Workaround for limited number of stylesheets in IE (does not work in standards mode)
  601. if (mxClient.IS_QUIRKS && document.styleSheets.length >= 30)
  602. {
  603. (function()
  604. {
  605. var node = document.createElement('style');
  606. node.type = 'text/css';
  607. node.styleSheet.cssText = mxClient.VML_PREFIX + '\\:*{behavior:url(#default#VML)}' +
  608. mxClient.OFFICE_PREFIX + '\\:*{behavior:url(#default#VML)}';
  609. document.getElementsByTagName('head')[0].appendChild(node);
  610. })();
  611. }
  612. else
  613. {
  614. document.createStyleSheet().cssText = mxClient.VML_PREFIX + '\\:*{behavior:url(#default#VML)}' +
  615. mxClient.OFFICE_PREFIX + '\\:*{behavior:url(#default#VML)}';
  616. }
  617. if (mxLoadStylesheets)
  618. {
  619. mxClient.link('stylesheet', mxClient.basePath + '/css/explorer.css');
  620. }
  621. }
  622. }
  623. // PREPROCESSOR-REMOVE-START
  624. // If script is loaded via CommonJS, do not write <script> tags to the page
  625. // for dependencies. These are already included in the build.
  626. if (mxForceIncludes || !(typeof module === 'object' && module.exports != null))
  627. {
  628. // PREPROCESSOR-REMOVE-END
  629. mxClient.include(mxClient.basePath+'/js/util/mxLog.js');
  630. mxClient.include(mxClient.basePath+'/js/util/mxObjectIdentity.js');
  631. mxClient.include(mxClient.basePath+'/js/util/mxDictionary.js');
  632. mxClient.include(mxClient.basePath+'/js/util/mxResources.js');
  633. mxClient.include(mxClient.basePath+'/js/util/mxPoint.js');
  634. mxClient.include(mxClient.basePath+'/js/util/mxRectangle.js');
  635. mxClient.include(mxClient.basePath+'/js/util/mxEffects.js');
  636. mxClient.include(mxClient.basePath+'/js/util/mxUtils.js');
  637. mxClient.include(mxClient.basePath+'/js/util/mxConstants.js');
  638. mxClient.include(mxClient.basePath+'/js/util/mxEventObject.js');
  639. mxClient.include(mxClient.basePath+'/js/util/mxMouseEvent.js');
  640. mxClient.include(mxClient.basePath+'/js/util/mxEventSource.js');
  641. mxClient.include(mxClient.basePath+'/js/util/mxEvent.js');
  642. mxClient.include(mxClient.basePath+'/js/util/mxXmlRequest.js');
  643. mxClient.include(mxClient.basePath+'/js/util/mxClipboard.js');
  644. mxClient.include(mxClient.basePath+'/js/util/mxWindow.js');
  645. mxClient.include(mxClient.basePath+'/js/util/mxForm.js');
  646. mxClient.include(mxClient.basePath+'/js/util/mxImage.js');
  647. mxClient.include(mxClient.basePath+'/js/util/mxDivResizer.js');
  648. mxClient.include(mxClient.basePath+'/js/util/mxDragSource.js');
  649. mxClient.include(mxClient.basePath+'/js/util/mxToolbar.js');
  650. mxClient.include(mxClient.basePath+'/js/util/mxUndoableEdit.js');
  651. mxClient.include(mxClient.basePath+'/js/util/mxUndoManager.js');
  652. mxClient.include(mxClient.basePath+'/js/util/mxUrlConverter.js');
  653. mxClient.include(mxClient.basePath+'/js/util/mxPanningManager.js');
  654. mxClient.include(mxClient.basePath+'/js/util/mxPopupMenu.js');
  655. mxClient.include(mxClient.basePath+'/js/util/mxAutoSaveManager.js');
  656. mxClient.include(mxClient.basePath+'/js/util/mxAnimation.js');
  657. mxClient.include(mxClient.basePath+'/js/util/mxMorphing.js');
  658. mxClient.include(mxClient.basePath+'/js/util/mxImageBundle.js');
  659. mxClient.include(mxClient.basePath+'/js/util/mxImageExport.js');
  660. mxClient.include(mxClient.basePath+'/js/util/mxAbstractCanvas2D.js');
  661. mxClient.include(mxClient.basePath+'/js/util/mxXmlCanvas2D.js');
  662. mxClient.include(mxClient.basePath+'/js/util/mxSvgCanvas2D.js');
  663. mxClient.include(mxClient.basePath+'/js/util/mxVmlCanvas2D.js');
  664. mxClient.include(mxClient.basePath+'/js/util/mxGuide.js');
  665. mxClient.include(mxClient.basePath+'/js/shape/mxShape.js');
  666. mxClient.include(mxClient.basePath+'/js/shape/mxStencil.js');
  667. mxClient.include(mxClient.basePath+'/js/shape/mxStencilRegistry.js');
  668. mxClient.include(mxClient.basePath+'/js/shape/mxMarker.js');
  669. mxClient.include(mxClient.basePath+'/js/shape/mxActor.js');
  670. mxClient.include(mxClient.basePath+'/js/shape/mxCloud.js');
  671. mxClient.include(mxClient.basePath+'/js/shape/mxRectangleShape.js');
  672. mxClient.include(mxClient.basePath+'/js/shape/mxEllipse.js');
  673. mxClient.include(mxClient.basePath+'/js/shape/mxDoubleEllipse.js');
  674. mxClient.include(mxClient.basePath+'/js/shape/mxRhombus.js');
  675. mxClient.include(mxClient.basePath+'/js/shape/mxPolyline.js');
  676. mxClient.include(mxClient.basePath+'/js/shape/mxArrow.js');
  677. mxClient.include(mxClient.basePath+'/js/shape/mxArrowConnector.js');
  678. mxClient.include(mxClient.basePath+'/js/shape/mxText.js');
  679. mxClient.include(mxClient.basePath+'/js/shape/mxTriangle.js');
  680. mxClient.include(mxClient.basePath+'/js/shape/mxHexagon.js');
  681. mxClient.include(mxClient.basePath+'/js/shape/mxLine.js');
  682. mxClient.include(mxClient.basePath+'/js/shape/mxImageShape.js');
  683. mxClient.include(mxClient.basePath+'/js/shape/mxLabel.js');
  684. mxClient.include(mxClient.basePath+'/js/shape/mxCylinder.js');
  685. mxClient.include(mxClient.basePath+'/js/shape/mxConnector.js');
  686. mxClient.include(mxClient.basePath+'/js/shape/mxSwimlane.js');
  687. mxClient.include(mxClient.basePath+'/js/layout/mxGraphLayout.js');
  688. mxClient.include(mxClient.basePath+'/js/layout/mxStackLayout.js');
  689. mxClient.include(mxClient.basePath+'/js/layout/mxPartitionLayout.js');
  690. mxClient.include(mxClient.basePath+'/js/layout/mxCompactTreeLayout.js');
  691. mxClient.include(mxClient.basePath+'/js/layout/mxRadialTreeLayout.js');
  692. mxClient.include(mxClient.basePath+'/js/layout/mxFastOrganicLayout.js');
  693. mxClient.include(mxClient.basePath+'/js/layout/mxCircleLayout.js');
  694. mxClient.include(mxClient.basePath+'/js/layout/mxParallelEdgeLayout.js');
  695. mxClient.include(mxClient.basePath+'/js/layout/mxCompositeLayout.js');
  696. mxClient.include(mxClient.basePath+'/js/layout/mxEdgeLabelLayout.js');
  697. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js');
  698. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/model/mxGraphHierarchyNode.js');
  699. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/model/mxGraphHierarchyEdge.js');
  700. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/model/mxGraphHierarchyModel.js');
  701. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/model/mxSwimlaneModel.js');
  702. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js');
  703. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js');
  704. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/stage/mxMinimumCycleRemover.js');
  705. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/stage/mxCoordinateAssignment.js');
  706. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/stage/mxSwimlaneOrdering.js');
  707. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/mxHierarchicalLayout.js');
  708. mxClient.include(mxClient.basePath+'/js/layout/hierarchical/mxSwimlaneLayout.js');
  709. mxClient.include(mxClient.basePath+'/js/model/mxGraphModel.js');
  710. mxClient.include(mxClient.basePath+'/js/model/mxCell.js');
  711. mxClient.include(mxClient.basePath+'/js/model/mxGeometry.js');
  712. mxClient.include(mxClient.basePath+'/js/model/mxCellPath.js');
  713. mxClient.include(mxClient.basePath+'/js/view/mxPerimeter.js');
  714. mxClient.include(mxClient.basePath+'/js/view/mxPrintPreview.js');
  715. mxClient.include(mxClient.basePath+'/js/view/mxStylesheet.js');
  716. mxClient.include(mxClient.basePath+'/js/view/mxCellState.js');
  717. mxClient.include(mxClient.basePath+'/js/view/mxGraphSelectionModel.js');
  718. mxClient.include(mxClient.basePath+'/js/view/mxCellEditor.js');
  719. mxClient.include(mxClient.basePath+'/js/view/mxCellRenderer.js');
  720. mxClient.include(mxClient.basePath+'/js/view/mxEdgeStyle.js');
  721. mxClient.include(mxClient.basePath+'/js/view/mxStyleRegistry.js');
  722. mxClient.include(mxClient.basePath+'/js/view/mxGraphView.js');
  723. mxClient.include(mxClient.basePath+'/js/view/mxGraph.js');
  724. mxClient.include(mxClient.basePath+'/js/view/mxCellOverlay.js');
  725. mxClient.include(mxClient.basePath+'/js/view/mxOutline.js');
  726. mxClient.include(mxClient.basePath+'/js/view/mxMultiplicity.js');
  727. mxClient.include(mxClient.basePath+'/js/view/mxLayoutManager.js');
  728. mxClient.include(mxClient.basePath+'/js/view/mxSwimlaneManager.js');
  729. mxClient.include(mxClient.basePath+'/js/view/mxTemporaryCellStates.js');
  730. mxClient.include(mxClient.basePath+'/js/view/mxCellStatePreview.js');
  731. mxClient.include(mxClient.basePath+'/js/view/mxConnectionConstraint.js');
  732. mxClient.include(mxClient.basePath+'/js/handler/mxGraphHandler.js');
  733. mxClient.include(mxClient.basePath+'/js/handler/mxPanningHandler.js');
  734. mxClient.include(mxClient.basePath+'/js/handler/mxPopupMenuHandler.js');
  735. mxClient.include(mxClient.basePath+'/js/handler/mxCellMarker.js');
  736. mxClient.include(mxClient.basePath+'/js/handler/mxSelectionCellsHandler.js');
  737. mxClient.include(mxClient.basePath+'/js/handler/mxConnectionHandler.js');
  738. mxClient.include(mxClient.basePath+'/js/handler/mxConstraintHandler.js');
  739. mxClient.include(mxClient.basePath+'/js/handler/mxRubberband.js');
  740. mxClient.include(mxClient.basePath+'/js/handler/mxHandle.js');
  741. mxClient.include(mxClient.basePath+'/js/handler/mxVertexHandler.js');
  742. mxClient.include(mxClient.basePath+'/js/handler/mxEdgeHandler.js');
  743. mxClient.include(mxClient.basePath+'/js/handler/mxElbowEdgeHandler.js');
  744. mxClient.include(mxClient.basePath+'/js/handler/mxEdgeSegmentHandler.js');
  745. mxClient.include(mxClient.basePath+'/js/handler/mxKeyHandler.js');
  746. mxClient.include(mxClient.basePath+'/js/handler/mxTooltipHandler.js');
  747. mxClient.include(mxClient.basePath+'/js/handler/mxCellTracker.js');
  748. mxClient.include(mxClient.basePath+'/js/handler/mxCellHighlight.js');
  749. mxClient.include(mxClient.basePath+'/js/editor/mxDefaultKeyHandler.js');
  750. mxClient.include(mxClient.basePath+'/js/editor/mxDefaultPopupMenu.js');
  751. mxClient.include(mxClient.basePath+'/js/editor/mxDefaultToolbar.js');
  752. mxClient.include(mxClient.basePath+'/js/editor/mxEditor.js');
  753. mxClient.include(mxClient.basePath+'/js/io/mxCodecRegistry.js');
  754. mxClient.include(mxClient.basePath+'/js/io/mxCodec.js');
  755. mxClient.include(mxClient.basePath+'/js/io/mxObjectCodec.js');
  756. mxClient.include(mxClient.basePath+'/js/io/mxCellCodec.js');
  757. mxClient.include(mxClient.basePath+'/js/io/mxModelCodec.js');
  758. mxClient.include(mxClient.basePath+'/js/io/mxRootChangeCodec.js');
  759. mxClient.include(mxClient.basePath+'/js/io/mxChildChangeCodec.js');
  760. mxClient.include(mxClient.basePath+'/js/io/mxTerminalChangeCodec.js');
  761. mxClient.include(mxClient.basePath+'/js/io/mxGenericChangeCodec.js');
  762. mxClient.include(mxClient.basePath+'/js/io/mxGraphCodec.js');
  763. mxClient.include(mxClient.basePath+'/js/io/mxGraphViewCodec.js');
  764. mxClient.include(mxClient.basePath+'/js/io/mxStylesheetCodec.js');
  765. mxClient.include(mxClient.basePath+'/js/io/mxDefaultKeyHandlerCodec.js');
  766. mxClient.include(mxClient.basePath+'/js/io/mxDefaultToolbarCodec.js');
  767. mxClient.include(mxClient.basePath+'/js/io/mxDefaultPopupMenuCodec.js');
  768. mxClient.include(mxClient.basePath+'/js/io/mxEditorCodec.js');
  769. // PREPROCESSOR-REMOVE-START
  770. }
  771. // PREPROCESSOR-REMOVE-END