Sidebar.js 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. (function()
  2. {
  3. /**
  4. * Download from following URL as TSV and convert using https://jgraph.github.io/drawio-tools/tools/convert.html:
  5. * https://docs.google.com/spreadsheets/d/1sAL1zn-UtmJtKPH4cLApGjRX-TRSJa5dYdfZ9NKYfRs
  6. * Maps package and stencil names to additional tags.
  7. */
  8. Sidebar.prototype.tagIndex = 'vX3ZcttI0vXTTPz/XIihlrvb31xqt2YsWy3K9tw5QBISMSIBNhbL6qefczKrsJBYCosmgkGCJPJUoZasrNxq+/M69nbrmRfH0Uvyt+N/yAU+D16n1VtnZ36Y/u3k+KP/yI9TQ+aFTxt/hYs0i0NXjPvgaT0a5MuuhJDt2mH2Mc69zSbKCHMRZYuNX4JKXyJ8e/FeXRqlwPkj81YllMcoi3vArP0fcRSW6MMoXa7lYZLgKfQ2+CvobprzIF5mG48lW6AlftoE4ZNLNf6ZbXdHKMZSnxz/gvtif7fhUyy85TObOlxF8qt8uEOdDIUyI84L2b6VXo/idB09RWwex7HzyTTryfFcmrVcRbSV6QaHphrV3fONH658EuzNpuQ5CENChHZaJptg6wr2ICP3G+pQg7jScd4M3Yz7LVhxgjx4AafXuNo+xEGl4dJ17BPcseUOH/Hk+EMUB39FYSqjYF3+Mgjuqx+nwVLofxSXLVB/ZbE/O10u/SQB+TkKjyOSJP4yi4OUz/Xs8/3ghyasLI22XhrISPTwBR9PPmb18T825JyhTudlxPfHjZesW4DmqD+7Xe82MO2Pwnc2yAaPzxqAobBXwZKCRzSHqZgTxrmHObVXb1vjlZd6Cy/h36tFN9StFz/76W7jLUmxlW/CSoiZrCOuAN0o84t/8fboMX3x5IeV/8PfRLutLirPATGTZey/rOIA/e/6oPNsAapgZxpniVWBzHvnh8vgcPw0gHzzF0mQ8vEWWFfYXZtowa+t1Gdgplj/UAc//hFI69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GS1WMXcas9lK4R090+f0B6P+dhQTQBcQ4EmqhUpS8cQwD3ybKrZh3AQ/70pjtaTp9pJZbuGEosCY6GEksuo6HEkrbIlZhRjhyHpQkNr3694Cm2/QBmsH6LvGKbXq77VqOMIn0wGkU6YzSK9MpoFOme0SiSSWo0yvvhKDgT2HYydP4yUPI7BkFJT08DJd09DZT0+VgoeJnb5N3YzDl4fbegyMk3o1EkAfhoFDbOGBQe1whjpXhKPuJamli/9oG5hrOgqN8kC/geN2vosE7QuVpjEScsIhS+LfSyJ44xOcHVXn2B+Cn6eUeJbh8OFmi7fxk9Li3YJFPPgk0y+QDGWPSpnpJYEz0kh6dWbMTgsjCs0wQwbPIJYDidJ4DhAjcBDFe4CWC4xPWEMQJQgxGgiWSmzrXI78wzgHGsTLo+8jXmVr6Y615I33KkF+jo7Rdz3QdpzjohJK+ok3wZUKc566RIph7ypUedkK/hSTcDm8xeOZPGC3HFYQiX6FQQn9CRT64KwNQNcNKU5QJZbOAxKf6aBo8pHfJEEriE9sOFQRNZQ0kQ31d48GiOODcjgUGBgx/Cf/Qo3EDiNhwJJTJYvYBtuJYjpeiL7pDHQve7fTROBuHOhHqql5+EONacaFZPy4YXjZG2ep8W/7LDnjRQrxh7sff6Lw==';
  9. /**
  10. * See etc/build/README on how to update this file
  11. */
  12. Sidebar.prototype.searchFileUrl = 'search.xml';
  13. /**
  14. * Overrides gear image URL.
  15. */
  16. Sidebar.prototype.gearImage = GRAPH_IMAGE_PATH + '/clipart/Gear_128x128.png';
  17. /**
  18. *
  19. */
  20. Sidebar.prototype.defaultEntries = 'general;images;uml;er;bpmn;flowchart;basic;arrows2';
  21. /**
  22. *
  23. */
  24. Sidebar.prototype.signs = ['Animals', 'Food', 'Healthcare', 'Nature', 'People', 'Safety', 'Science', 'Sports', 'Tech', 'Transportation', 'Travel'];
  25. /**
  26. *
  27. */
  28. Sidebar.prototype.rack = ['General', 'APC', 'Cisco', 'Dell', 'F5', 'HP', 'IBM', 'Oracle'];
  29. /**
  30. *
  31. */
  32. Sidebar.prototype.pids = ['Agitators', 'Apparatus Elements', 'Centrifuges', 'Compressors', 'Compressors ISO', 'Crushers Grinding',
  33. 'Driers', 'Engines', 'Feeders', 'Filters', 'Fittings', 'Flow Sensors', 'Heat Exchangers', 'Instruments', 'Misc',
  34. 'Mixers', 'Piping', 'Pumps', 'Pumps DIN', 'Pumps ISO', 'Separators', 'Shaping Machines', 'Valves', 'Vessels'];
  35. /**
  36. *
  37. */
  38. Sidebar.prototype.cisco = ['Buildings', 'Computers and Peripherals', 'Controllers and Modules', 'Directors', 'Hubs and Gateways', 'Misc',
  39. 'Modems and Phones', 'People', 'Routers', 'Security', 'Servers', 'Storage', 'Switches', 'Wireless'];
  40. /**
  41. *
  42. */
  43. Sidebar.prototype.sysml = ['Model Elements', 'Blocks', 'Ports and Flows', 'Constraint Blocks', 'Activities', 'Interactions', 'State Machines',
  44. 'Use Cases', 'Allocations', 'Requirements', 'Profiles', 'Stereotypes'];
  45. /**
  46. *
  47. */
  48. Sidebar.prototype.eip = ['Message Construction', 'Message Routing', 'Message Transformation', 'Messaging Channels', 'Messaging Endpoints',
  49. 'Messaging Systems', 'System Management'];
  50. /**
  51. *
  52. */
  53. Sidebar.prototype.gmdl = ['Bottom Navigation', 'Bottom Sheets', 'Buttons', 'Cards', 'Chips', 'Dialogs', 'Dividers', 'Grid Lists', 'Icons', 'Lists', 'Menus', 'Misc', 'Pickers',
  54. 'Selection Controls', 'Sliders', 'Steppers', 'Tabs', 'Text Fields'];
  55. /**
  56. *
  57. */
  58. Sidebar.prototype.aws2 = ['Analytics', 'Application Services', 'Compute', 'Database', 'Developer Tools', 'Enterprise Applications', 'Game Development', 'General', 'Internet of Things',
  59. 'Management Tools', 'Mobile Services', 'Networking', 'On-Demand Workforce', 'SDKs', 'Security and Identity', 'Storage and Content Delivery', 'Groups'];
  60. /**
  61. *
  62. */
  63. Sidebar.prototype.office = ['Clouds', 'Communications', 'Concepts', 'Databases', 'Devices', 'Security', 'Servers', 'Services', 'Sites', 'Users'];
  64. /**
  65. *
  66. */
  67. Sidebar.prototype.veeam = ['2D', '3D'];
  68. /**
  69. *
  70. */
  71. Sidebar.prototype.archimate3 = ['Application', 'Business', 'Composite', 'Implementation and Migration', 'Motivation', 'Physical', 'Relationships', 'Strategy', 'Technology'];
  72. /**
  73. *
  74. */
  75. Sidebar.prototype.electrical = ['LogicGates', 'Resistors', 'Capacitors', 'Inductors', 'SwitchesRelays', 'Diodes', 'Sources', 'Transistors', 'Misc', 'Audio', 'PlcLadder', 'Abstract', 'Optical', 'VacuumTubes', 'Waveforms', 'Instruments', 'RotMech', 'Transmission'];
  76. /**
  77. *
  78. */
  79. Sidebar.prototype.configuration = [{id: 'general', libs: ['general', 'misc', 'advanced']}, {id: 'uml'}, {id: 'search'}, {id: 'er'},
  80. {id: 'ios', prefix: 'ios', libs: [''/*prefix is library*/, '7icons', '7ui']},
  81. {id: 'android', prefix: 'android', libs: [''/*prefix is library*/]}, {id: 'aws3d'},
  82. {id: 'flowchart'}, {id: 'basic'}, {id: 'arrows'}, {id: 'arrows2'}, {id: 'lean_mapping'}, {id: 'citrix'}, {id: 'azure'}, {id: 'network'},
  83. {id: 'mscae', prefix: 'mscae', libs: ['Cloud', 'Enterprise', 'General', 'Intune', 'Other', 'System Center', 'Deprecated']},
  84. {id: 'bpmn', prefix: 'bpmn', libs: [''/*prefix is library*/, 'Gateways', 'Events']},
  85. {id: 'clipart', prefix: null, libs: ['computer', 'finance', 'clipart', 'networking', 'people', 'telco']},
  86. {id: 'eip', prefix: 'eip', libs: Sidebar.prototype.eip},
  87. {id: 'mockups', prefix: 'mockup', libs: ['Buttons', 'Containers', 'Forms', 'Graphics', 'Markup', 'Misc', 'Navigation', 'Text']},
  88. {id: 'pid2', prefix: 'pid2', libs: ['Agitators', 'Apparatus Elements', 'Centrifuges', 'Compressors', 'Compressors ISO', 'Crushers Grinding',
  89. 'Driers', 'Engines', 'Feeders', 'Filters', 'Fittings', 'Flow Sensors', 'Heat Exchangers', 'Instruments', 'Misc',
  90. 'Mixers', 'Piping', 'Pumps', 'Pumps DIN', 'Pumps ISO', 'Separators', 'Shaping Machines', 'Valves', 'Vessels']},
  91. {id: 'signs', prefix: 'signs', libs: Sidebar.prototype.signs},
  92. {id: 'rack', prefix: 'rack', libs: Sidebar.prototype.rack},
  93. {id: 'electrical', prefix: 'electrical', libs: Sidebar.prototype.electrical},
  94. {id: 'aws2', prefix: 'aws2', libs: Sidebar.prototype.aws2},
  95. {id: 'pid', prefix: 'pid', libs: Sidebar.prototype.pids},
  96. {id: 'cisco', prefix: 'cisco', libs: Sidebar.prototype.cisco},
  97. {id: 'office', prefix: 'office', libs: Sidebar.prototype.office},
  98. {id: 'veeam', prefix: 'veeam', libs: Sidebar.prototype.veeam},
  99. {id: 'cabinets', libs: ['cabinets']},
  100. {id: 'floorplan', libs: ['floorplan']},
  101. {id: 'bootstrap', libs: ['bootstrap']},
  102. {id: 'gmdl', prefix: 'gmdl', libs: Sidebar.prototype.gmdl},
  103. {id: 'archimate3', prefix: 'archimate3', libs: Sidebar.prototype.archimate3},
  104. {id: 'archimate', libs: ['archimate']},
  105. {id: 'sysml', prefix: 'sysml', libs: Sidebar.prototype.sysml}];
  106. /**
  107. * Adds hint for quick tutorial video for certain search terms.
  108. */
  109. var siderbarInsertSearchHint = Sidebar.prototype.insertSearchHint;
  110. Sidebar.prototype.insertSearchHint = function(div, searchTerm, count, page, results, len, more, terms)
  111. {
  112. if (terms != null && page == 1)
  113. {
  114. var hintText = null;
  115. // Adds hint for text inserts
  116. if (mxUtils.indexOf(terms, 'text') >= 0)
  117. {
  118. hintText = 'Double click anywhere in the diagram to insert text.';
  119. }
  120. else
  121. {
  122. // Checks if any of the following keywords are in the search terms
  123. var words = ['line', 'lines', 'arrow', 'arrows', 'connect', 'connection', 'connections',
  124. 'connector', 'connectors', 'curve', 'curves', 'link', 'links'];
  125. for (var i = 0; i < words.length; i++)
  126. {
  127. if (mxUtils.indexOf(terms, words[i]) >= 0)
  128. {
  129. hintText = 'Need help with connections?';
  130. break;
  131. }
  132. }
  133. }
  134. if (hintText != null)
  135. {
  136. var link = document.createElement('a');
  137. link.setAttribute('href', 'https://www.youtube.com/watch?v=8OaMWa4R1SE&t=1');
  138. link.setAttribute('target', '_blank');
  139. link.className = 'geTitle';
  140. link.style.cssText = 'background-color:#ffd350;border-radius:6px;color:black;' +
  141. 'border:1px solid black !important;text-align:center;white-space:normal;' +
  142. 'padding:6px 0px 6px 0px !important;margin:4px 4px 8px 2px;';
  143. mxUtils.write(link, hintText);
  144. div.appendChild(link);
  145. }
  146. }
  147. siderbarInsertSearchHint.apply(this, arguments);
  148. };
  149. /**
  150. * Toggle palette.
  151. */
  152. Sidebar.prototype.togglePalettes = function(prefix, ids)
  153. {
  154. this.showPalettes(prefix, ids);
  155. };
  156. /**
  157. * Toggle palette.
  158. */
  159. Sidebar.prototype.togglePalette = function(id)
  160. {
  161. this.showPalette(id);
  162. };
  163. /**
  164. * Shows or hides palettes.
  165. */
  166. Sidebar.prototype.showPalettes = function(prefix, ids, visible)
  167. {
  168. for (var i = 0; i < ids.length; i++)
  169. {
  170. this.showPalette(prefix + ids[i], visible);
  171. }
  172. };
  173. /**
  174. * Shows or hides a palette.
  175. */
  176. Sidebar.prototype.showPalette = function(id, visible)
  177. {
  178. var elts = this.palettes[id];
  179. if (elts != null)
  180. {
  181. var vis = (visible != null) ? ((visible) ? 'block' : 'none') : (elts[0].style.display == 'none') ? 'block' : 'none';
  182. for (var i = 0; i < elts.length; i++)
  183. {
  184. elts[i].style.display = vis;
  185. }
  186. }
  187. };
  188. /**
  189. *
  190. */
  191. Sidebar.prototype.isEntryVisible = function(key)
  192. {
  193. for (var i = 0; i < this.configuration.length; i++)
  194. {
  195. if (this.configuration[i].id == key)
  196. {
  197. var id = (this.configuration[i].libs != null) ? ((this.configuration[i].prefix || '') + this.configuration[i].libs[0]) : key;
  198. var elts = this.palettes[id];
  199. if (elts != null)
  200. {
  201. return elts[0].style.display != 'none';
  202. }
  203. }
  204. }
  205. return false;
  206. };
  207. /**
  208. *
  209. */
  210. Sidebar.prototype.showEntries = function(stc, remember, force)
  211. {
  212. this.libs = (stc != null && (force || stc.length > 0)) ? stc : ((urlParams['libs'] != null &&
  213. urlParams['libs'].length > 0) ? decodeURIComponent(urlParams['libs']) : mxSettings.getLibraries());
  214. var tmp = this.libs.split(';');
  215. for (var i = 0; i < this.configuration.length; i++)
  216. {
  217. // Search has separate switch in Extras menu
  218. if (this.configuration[i].id != 'search')
  219. {
  220. this.showPalettes(this.configuration[i].prefix || '', this.configuration[i].libs || [this.configuration[i].id], mxUtils.indexOf(tmp, this.configuration[i].id) >= 0);
  221. }
  222. }
  223. if (remember)
  224. {
  225. mxSettings.setLibraries(stc);
  226. mxSettings.save();
  227. }
  228. };
  229. /**
  230. * Overrides the sidebar init.
  231. */
  232. Sidebar.prototype.init = function()
  233. {
  234. // Defines all entries for the sidebar. This is used in the MoreShapes dialog. Create screenshots using the savesidebar URL parameter and
  235. // http://www.alderg.com/merge.html for creating a vertical stack of PNG images if multiple sidebars are part of an entry.
  236. this.entries = [{title: mxResources.get('standard'),
  237. entries: [{title: mxResources.get('general'), id: 'general', image: IMAGE_PATH + '/sidebar-general.png'},
  238. {title: mxResources.get('arrows'), id: 'arrows2', image: IMAGE_PATH + '/sidebar-arrows2.png'},
  239. {title: mxResources.get('basic'), id: 'basic', image: IMAGE_PATH + '/sidebar-basic.png'},
  240. {title: mxResources.get('clipart'), id: 'clipart', image: IMAGE_PATH + '/sidebar-clipart.jpg'},
  241. {title: mxResources.get('flowchart'), id: 'flowchart', image: IMAGE_PATH + '/sidebar-flowchart.png'}]},
  242. {title: mxResources.get('software'),
  243. entries: [{title: mxResources.get('android'), id: 'android', image: IMAGE_PATH + '/sidebar-android.png'},
  244. {title: mxResources.get('bootstrap'), id: 'bootstrap', image: IMAGE_PATH + '/sidebar-bootstrap.png'},
  245. {title: mxResources.get('entityRelation'), id: 'er', image: IMAGE_PATH + '/sidebar-er.png'},
  246. {title: mxResources.get('ios'), id: 'ios', image: IMAGE_PATH + '/sidebar-ios.png'},
  247. {title: mxResources.get('mockups'), id: 'mockups', image: IMAGE_PATH + '/sidebar-mockups.png'},
  248. {title: mxResources.get('uml'), id: 'uml', image: IMAGE_PATH + '/sidebar-uml.png'}]},
  249. {title: mxResources.get('networking'),
  250. entries: [{title: mxResources.get('aws'), id: 'aws2', image: IMAGE_PATH + '/sidebar-aws.png'},
  251. // TODO: Add isometric containers
  252. {title: mxResources.get('aws3d'), id: 'aws3d', image: IMAGE_PATH + '/sidebar-aws3d.png'},
  253. {title: mxResources.get('azure'), id: 'azure', image: IMAGE_PATH + '/sidebar-azure.png'},
  254. {title: 'Cloud & Enterprise', id: 'mscae', image: IMAGE_PATH + '/sidebar-mscae.png'},
  255. {title: mxResources.get('cisco'), id: 'cisco', image: IMAGE_PATH + '/sidebar-cisco.png'},
  256. {title: 'Citrix', id: 'citrix', image: IMAGE_PATH + '/sidebar-citrix.png'},
  257. {title: 'Network', id: 'network', image: IMAGE_PATH + '/sidebar-network.png'},
  258. {title: 'Office', id: 'office', image: IMAGE_PATH + '/sidebar-office.png'},
  259. {title: mxResources.get('rack'), id: 'rack', image: IMAGE_PATH + '/sidebar-rack.png'},
  260. {title: 'Veeam', id: 'veeam', image: IMAGE_PATH + '/sidebar-veeam.png'}]},
  261. {title: mxResources.get('business'),
  262. entries: [{title: 'ArchiMate 3.0', id: 'archimate3', image: IMAGE_PATH + '/sidebar-archimate3.png'},
  263. {title: mxResources.get('archiMate21'), id: 'archimate', image: IMAGE_PATH + '/sidebar-archimate.png'},
  264. {title: mxResources.get('bpmn'), id: 'bpmn', image: IMAGE_PATH + '/sidebar-bpmn.png'},
  265. {title: mxResources.get('leanMapping'), id: 'lean_mapping', image: IMAGE_PATH + '/sidebar-leanmapping.png'},
  266. {title: mxResources.get('sysml'), id: 'sysml', image: IMAGE_PATH + '/sidebar-sysml.png'}]},
  267. {title: mxResources.get('other'),
  268. entries: [{title: mxResources.get('cabinets'), id: 'cabinets', image: IMAGE_PATH + '/sidebar-cabinets.png'},
  269. {title: mxResources.get('eip'), id: 'eip', image: IMAGE_PATH + '/sidebar-eip.png'},
  270. {title: mxResources.get('electrical'), id: 'electrical', image: IMAGE_PATH + '/sidebar-electrical.png'},
  271. {title: mxResources.get('floorplans'), id: 'floorplan', image: IMAGE_PATH + '/sidebar-floorplans.png'},
  272. {title: mxResources.get('gmdl'), id: 'gmdl', image: IMAGE_PATH + '/sidebar-gmdl.png'},
  273. {title: mxResources.get('procEng'), id: 'pid', image: IMAGE_PATH + '/sidebar-pid.png'},
  274. {title: mxResources.get('signs'), id: 'signs', image: IMAGE_PATH + '/sidebar-signs.png'}]}];
  275. // Uses server-side stencil search if online
  276. this.addStencilsToIndex = this.editorUi.isOffline();
  277. // Contains additional tags for shapes
  278. this.shapetags = {};
  279. // Adds tags from compressed text file for improved searches.
  280. if (this.tagIndex != null)
  281. {
  282. var text = this.editorUi.editor.graph.decompress(this.tagIndex);
  283. var lines = text.split('\n');
  284. for (var i = 0; i < lines.length; i++)
  285. {
  286. if (lines[i] != null)
  287. {
  288. var tags = lines[i].split('\t');
  289. if (tags.length > 1)
  290. {
  291. var key = tags[0].toLowerCase().replace(' ', '_');
  292. var value = mxUtils.trim(tags.slice(1, tags.length).join(' ').toLowerCase());
  293. if (value.length > 0)
  294. {
  295. this.shapetags[key] = value;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. this.initPalettes();
  302. // Loads search index to avoid having to pre-parse the stencil files
  303. // before they are used for stencils that are not programmatically added
  304. if (!this.editorUi.isOffline())
  305. {
  306. mxUtils.get(this.searchFileUrl, mxUtils.bind(this, function(req)
  307. {
  308. var node = req.getDocumentElement();
  309. if (node != null)
  310. {
  311. var shapes = node.getElementsByTagName('shape');
  312. for (var i = 0; i < shapes.length; i++)
  313. {
  314. var style = shapes[i].getAttribute('style');
  315. var shapeStyle = this.extractShapeStyle(style);
  316. if (style != null && shapeStyle != null)
  317. {
  318. var lastDot = shapeStyle.lastIndexOf('.');
  319. if (lastDot > 0)
  320. {
  321. var pkg = shapeStyle.substring(0, lastDot);
  322. var stc = shapeStyle.substring(lastDot + 1, shapeStyle.length);
  323. var tags = this.getTagsForStencil(pkg, stc, shapes[i].getAttribute('tags'));
  324. // TODO: Use shapetags for programmatic stencils
  325. if (tags != null)
  326. {
  327. // Converts stencil name to lowercase
  328. var semi = style.indexOf(';');
  329. style = 'shape=' + pkg + '.' + stc.toLowerCase() + ';' +
  330. ((semi < 0) ? '' : style.substring(semi + 1));
  331. this.createVertexTemplateEntry(style, parseInt(shapes[i].getAttribute('w')),
  332. parseInt(shapes[i].getAttribute('h')), '', stc.replace(/_/g, ' '),
  333. null, null, this.filterTags(tags.join(' ')));
  334. }
  335. }
  336. }
  337. }
  338. }
  339. }));
  340. }
  341. }
  342. /**
  343. * Overridden to add image export via servlet
  344. */
  345. if (urlParams['savesidebar'] == '1')
  346. {
  347. Sidebar.prototype.addFoldingHandler = function(title, content, funct)
  348. {
  349. var initialized = false;
  350. // Avoids mixed content warning in IE6-8
  351. if (!mxClient.IS_IE || document.documentMode >= 8)
  352. {
  353. title.style.backgroundImage = (content.style.display == 'none') ?
  354. 'url(\'' + this.collapsedImage + '\')' : 'url(\'' + this.expandedImage + '\')';
  355. }
  356. title.style.backgroundRepeat = 'no-repeat';
  357. title.style.backgroundPosition = '0% 50%';
  358. var btn = document.createElement('button');
  359. btn.style.marginLeft = '4px';
  360. mxUtils.write(btn, 'Save');
  361. mxEvent.addListener(title, 'click', mxUtils.bind(this, function(evt)
  362. {
  363. if (mxEvent.getSource(evt).nodeName == 'BUTTON')
  364. {
  365. var title2 = title.cloneNode(true);
  366. title2.style.backgroundImage = '';
  367. title2.style.textDecoration = 'none';
  368. title2.style.fontWeight = 'bold';
  369. title2.style.fontSize = '14px';
  370. title2.style.color = 'rgb(80, 80, 80)';
  371. title2.style.width = '456px';
  372. title2.style.backgroundColor = '#ffffff';
  373. title2.style.paddingLeft = '6px';
  374. var btn2 = title2.getElementsByTagName('button')[0];
  375. btn2.parentNode.removeChild(btn2);
  376. var clone = content.cloneNode(true);
  377. clone.style.backgroundColor = '#ffffff';
  378. clone.style.borderColor = 'transparent';
  379. clone.style.width = '456px';
  380. var html = '<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="https://www.draw.io/styles/grapheditor.css">' +
  381. '</head><body style="background:#ffffff;font-family:Helvetica,Arial;">' +
  382. title2.outerHTML + clone.outerHTML + '</body></html>';
  383. clone.style.position = 'absolute';
  384. window.document.body.appendChild(clone);
  385. var h = clone.clientHeight + 18;
  386. clone.parentNode.removeChild(clone);
  387. new mxXmlRequest(EXPORT_URL, 'w=456&h=' + h + '&html=' + encodeURIComponent(
  388. this.editorUi.editor.graph.compress(html))).simulate(document, '_blank');
  389. return;
  390. }
  391. if (content.style.display == 'none')
  392. {
  393. if (!initialized)
  394. {
  395. initialized = true;
  396. if (funct != null)
  397. {
  398. if (btn.parentNode != null)
  399. {
  400. btn.parentNode.removeChild(btn);
  401. }
  402. // Wait cursor does not show up on Mac
  403. title.style.cursor = 'wait';
  404. var prev = title.innerHTML;
  405. title.innerHTML = mxResources.get('loading') + '...';
  406. window.setTimeout(function()
  407. {
  408. funct(content);
  409. title.style.cursor = '';
  410. title.innerHTML = prev;
  411. title.appendChild(btn);
  412. }, 0);
  413. }
  414. else
  415. {
  416. title.appendChild(btn);
  417. }
  418. }
  419. else
  420. {
  421. title.appendChild(btn);
  422. }
  423. title.style.backgroundImage = 'url(\'' + this.expandedImage + '\')';
  424. content.style.display = 'block';
  425. }
  426. else
  427. {
  428. title.style.backgroundImage = 'url(\'' + this.collapsedImage + '\')';
  429. content.style.display = 'none';
  430. if (btn.parentNode != null)
  431. {
  432. btn.parentNode.removeChild(btn);
  433. }
  434. }
  435. mxEvent.consume(evt);
  436. }));
  437. };
  438. }
  439. /**
  440. * Overridden to use shapetags to improve search results.
  441. */
  442. Sidebar.prototype.extractShapeStyle = function(style)
  443. {
  444. if (style != null && style.substring(0, 6) == 'shape=')
  445. {
  446. var semi = style.indexOf(';');
  447. if (semi < 0)
  448. {
  449. semi = style.length;
  450. }
  451. return style.substring(6, semi);
  452. }
  453. return null;
  454. };
  455. /**
  456. * Overridden to use shapetags to improve search results.
  457. */
  458. var sidebarGetTagsForStencil = Sidebar.prototype.getTagsForStencil;
  459. Sidebar.prototype.getTagsForStencil = function(pkg, stc, moreTags)
  460. {
  461. var tags = sidebarGetTagsForStencil.apply(this, arguments);
  462. // Adds tags from tags file
  463. if (this.shapetags != null)
  464. {
  465. pkg = pkg.toLowerCase();
  466. stc = stc.toLowerCase();
  467. if (this.shapetags[pkg] != null)
  468. {
  469. tags.push(this.shapetags[pkg]);
  470. }
  471. stc = pkg + '.' + stc;
  472. if (this.shapetags[stc] != null)
  473. {
  474. tags.push(this.shapetags[stc]);
  475. }
  476. }
  477. return tags;
  478. };
  479. /**
  480. * Overrides the sidebar init.
  481. */
  482. Sidebar.prototype.initPalettes = function()
  483. {
  484. var imgDir = GRAPH_IMAGE_PATH;
  485. var dir = STENCIL_PATH;
  486. var signs = this.signs;
  487. var rack = this.rack;
  488. var pids = this.pids;
  489. var cisco = this.cisco;
  490. var sysml = this.sysml;
  491. var eip = this.eip;
  492. var gmdl = this.gmdl;
  493. var office = this.office;
  494. var veeam = this.veeam;
  495. var archimate3 = this.archimate3;
  496. var electrical = this.electrical;
  497. if (urlParams['createindex'] == '1')
  498. {
  499. mxLog.textarea.value = '';
  500. }
  501. this.addSearchPalette(true);
  502. this.addGeneralPalette(true);
  503. this.addMiscPalette(false);
  504. this.addAdvancedPalette(false);
  505. this.addUmlPalette(false);
  506. this.addErPalette();
  507. this.addBasicPalette();
  508. this.addFlowchartPalette();
  509. this.addNetworkPalette();
  510. this.addAzurePalette();
  511. this.addCitrixPalette();
  512. this.addMSCAEPalette();
  513. this.addBpmnPalette(dir, false);
  514. this.addAWSPalette();
  515. this.addAWS3DPalette();
  516. this.addLeanMappingPalette();
  517. this.addIos7Palette();
  518. this.addIosPalette();
  519. this.addAndroidPalette();
  520. this.addMockupPalette();
  521. this.addElectricalPalette();
  522. this.addOfficePalette();
  523. this.addVeeamPalette();
  524. this.addStencilPalette('arrows', mxResources.get('arrows'), dir + '/arrows.xml',
  525. ';html=1;' + mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;' + mxConstants.STYLE_STROKEWIDTH + '=2;strokeColor=#000000;');
  526. this.addArrows2Palette();
  527. this.addImagePalette('computer', 'Clipart / Computer', imgDir
  528. + '/lib/clip_art/computers/', '_128x128.png', ['Antivirus',
  529. 'Data_Filtering', 'Database', 'Database_Add', 'Database_Minus',
  530. 'Database_Move_Stack', 'Database_Remove', 'Fujitsu_Tablet',
  531. 'Harddrive', 'IBM_Tablet', 'iMac', 'iPad', 'Laptop', 'MacBook',
  532. 'Mainframe', 'Monitor', 'Monitor_Tower',
  533. 'Monitor_Tower_Behind', 'Netbook', 'Network', 'Network_2',
  534. 'Printer', 'Printer_Commercial', 'Secure_System', 'Server',
  535. 'Server_Rack', 'Server_Rack_Empty', 'Server_Rack_Partial',
  536. 'Server_Tower', 'Software', 'Stylus', 'Touch', 'USB_Hub',
  537. 'Virtual_Application', 'Virtual_Machine', 'Virus',
  538. 'Workstation' ], [ 'Antivirus', 'Data Filtering', 'Database',
  539. 'Database Add', 'Database Minus', 'Database Move Stack',
  540. 'Database Remove', 'Fujitsu Tablet', 'Harddrive', 'IBMTablet',
  541. 'iMac', 'iPad', 'Laptop', 'MacBook', 'Mainframe', 'Monitor',
  542. 'Monitor Tower', 'Monitor Tower Behind', 'Netbook', 'Network',
  543. 'Network 2', 'Printer', 'Printer Commercial', 'Secure System',
  544. 'Server', 'Server Rack', 'Server Rack Empty', 'Server Rack Partial',
  545. 'Server Tower', 'Software', 'Stylus', 'Touch', 'USB Hub',
  546. 'Virtual Application', 'Virtual Machine', 'Virus', 'Workstation']);
  547. this.addImagePalette('finance', 'Clipart / Finance', imgDir
  548. + '/lib/clip_art/finance/', '_128x128.png', [ 'Arrow_Down',
  549. 'Arrow_Up', 'Coins', 'Credit_Card', 'Dollar', 'Graph',
  550. 'Pie_Chart', 'Piggy_Bank', 'Safe', 'Shopping_Cart',
  551. 'Stock_Down', 'Stock_Up'], ['Arrow_Down', 'Arrow Up',
  552. 'Coins', 'Credit Card', 'Dollar', 'Graph', 'Pie Chart',
  553. 'Piggy Bank', 'Safe', 'Shopping Basket', 'Stock Down', 'Stock Up']);
  554. this.addImagePalette('clipart', 'Clipart / Various', imgDir
  555. + '/lib/clip_art/general/', '_128x128.png', [ 'Battery_0',
  556. 'Battery_100', 'Battery_50', 'Battery_75', 'Battery_allstates',
  557. 'Bluetooth', 'Earth_globe', 'Empty_Folder', 'Full_Folder',
  558. 'Gear', 'Keys', 'Lock', 'Mouse_Pointer', 'Plug', 'Ships_Wheel',
  559. 'Star', 'Tire' ], [ 'Battery 0%', 'Battery 100%', 'Battery 50%',
  560. 'Battery 75%', 'Battery', 'Bluetooth', 'Globe',
  561. 'Empty Folder', 'Full Folder', 'Gear', 'Keys', 'Lock', 'Mousepointer',
  562. 'Plug', 'Ships Wheel', 'Star', 'Tire']);
  563. this.addImagePalette('networking', 'Clipart / Networking', imgDir
  564. + '/lib/clip_art/networking/', '_128x128.png', ['Bridge',
  565. 'Certificate', 'Certificate_Off', 'Cloud', 'Cloud_Computer',
  566. 'Cloud_Computer_Private', 'Cloud_Rack', 'Cloud_Rack_Private',
  567. 'Cloud_Server', 'Cloud_Server_Private', 'Cloud_Storage',
  568. 'Concentrator', 'Email', 'Firewall_02', 'Firewall',
  569. 'Firewall-page1', 'Ip_Camera', 'Modem',
  570. 'power_distribution_unit', 'Print_Server',
  571. 'Print_Server_Wireless', 'Repeater', 'Router', 'Router_Icon',
  572. 'Switch', 'UPS', 'Wireless_Router', 'Wireless_Router_N'],
  573. ['Bridge', 'Certificate', 'Certificate Off', 'Cloud', 'Cloud Computer',
  574. 'Cloud Computer Private', 'Cloud Rack', 'Cloud Rack Private',
  575. 'Cloud Server', 'Cloud Server Private', 'Cloud Storage',
  576. 'Concentrator', 'Email', 'Firewall 1', 'Firewall 2',
  577. 'Firewall', 'Camera', 'Modem',
  578. 'Power Distribution Unit', 'Print Server',
  579. 'Print Server Wireless', 'Repeater', 'Router', 'Router Icon',
  580. 'Switch', 'UPS', 'Wireless Router', 'Wireless Router N'],
  581. {'Wireless_Router': 'wireless router switch wap wifi access point wlan',
  582. 'Wireless_Router_N': 'wireless router switch wap wifi access point wlan',
  583. 'Router': 'router switch',
  584. 'Router_Icon': 'router switch'});
  585. this.addImagePalette('people', 'Clipart / People', imgDir
  586. + '/lib/clip_art/people/', '_128x128.png', ['Suit_Man',
  587. 'Suit_Man_Black', 'Suit_Man_Blue', 'Suit_Man_Green',
  588. 'Suit_Man_Green_Black', 'Suit_Woman', 'Suit_Woman_Black',
  589. 'Suit_Woman_Blue', 'Suit_Woman_Green',
  590. 'Suit_Woman_Green_Black', 'Construction_Worker_Man',
  591. 'Construction_Worker_Man_Black', 'Construction_Worker_Woman',
  592. 'Construction_Worker_Woman_Black', 'Doctor_Man',
  593. 'Doctor_Man_Black', 'Doctor_Woman', 'Doctor_Woman_Black',
  594. 'Farmer_Man', 'Farmer_Man_Black', 'Farmer_Woman',
  595. 'Farmer_Woman_Black', 'Nurse_Man', 'Nurse_Man_Black',
  596. 'Nurse_Man_Green', 'Nurse_Man_Red', 'Nurse_Woman',
  597. 'Nurse_Woman_Black', 'Nurse_Woman_Green', 'Nurse_Woman_Red',
  598. 'Military_Officer', 'Military_Officer_Black',
  599. 'Military_Officer_Woman', 'Military_Officer_Woman_Black',
  600. 'Pilot_Man', 'Pilot_Man_Black', 'Pilot_Woman',
  601. 'Pilot_Woman_Black', 'Scientist_Man', 'Scientist_Man_Black',
  602. 'Scientist_Woman', 'Scientist_Woman_Black', 'Security_Man',
  603. 'Security_Man_Black', 'Security_Woman', 'Security_Woman_Black',
  604. 'Soldier', 'Soldier_Black', 'Tech_Man', 'Tech_Man_Black',
  605. 'Telesales_Man', 'Telesales_Man_Black', 'Telesales_Woman',
  606. 'Telesales_Woman_Black', 'Waiter', 'Waiter_Black',
  607. 'Waiter_Woman', 'Waiter_Woman_Black', 'Worker_Black',
  608. 'Worker_Man', 'Worker_Woman', 'Worker_Woman_Black']);
  609. this.addImagePalette('telco', 'Clipart / Telecommunication', imgDir
  610. + '/lib/clip_art/telecommunication/', '_128x128.png', [
  611. 'BlackBerry', 'Cellphone', 'HTC_smartphone', 'iPhone',
  612. 'Palm_Treo', 'Signal_tower_off', 'Signal_tower_on' ],
  613. ['BlackBerry', 'Cellphone', 'HTC smartphone', 'iPhone',
  614. 'Palm Treo', 'Signaltower off', 'Signaltower on']);
  615. for (var i = 0; i < signs.length; i++)
  616. {
  617. this.addStencilPalette('signs' + signs[i], 'Signs / ' + signs[i],
  618. dir + '/signs/' + signs[i].toLowerCase() + '.xml',
  619. ';html=1;fillColor=#000000;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;');
  620. }
  621. for (var i = 0; i < rack.length; i++)
  622. {
  623. if (rack[i].toLowerCase() === 'general')
  624. {
  625. this.addRackGeneralPalette();
  626. }
  627. else if (rack[i].toLowerCase() === 'f5')
  628. {
  629. this.addRackF5Palette();
  630. }
  631. else
  632. {
  633. this.addStencilPalette('rack' + rack[i], 'Rack / ' + rack[i],
  634. dir + '/rack/' + rack[i].toLowerCase() + '.xml',
  635. ';html=1;labelPosition=right;align=left;spacingLeft=15;dashed=0;shadow=0;fillColor=#ffffff;');
  636. }
  637. }
  638. for (var i = 0; i < pids.length; i++)
  639. {
  640. if (pids[i] == 'Instruments')
  641. {
  642. this.addPidInstrumentsPalette();
  643. }
  644. else if (pids[i] == 'Misc')
  645. {
  646. this.addPidMiscPalette();
  647. }
  648. else if (pids[i] == 'Valves')
  649. {
  650. this.addPidValvesPalette();
  651. }
  652. else if (pids[i] == 'Compressors')
  653. {
  654. this.addPidCompressorsPalette();
  655. }
  656. else if (pids[i] == 'Engines')
  657. {
  658. this.addPidEnginesPalette();
  659. }
  660. else if (pids[i] == 'Filters')
  661. {
  662. this.addPidFiltersPalette();
  663. }
  664. else if (pids[i] == 'Flow Sensors')
  665. {
  666. this.addPidFlowSensorsPalette();
  667. }
  668. else if (pids[i] == 'Piping')
  669. {
  670. this.addPidPipingPalette();
  671. }
  672. else
  673. {
  674. this.addStencilPalette('pid' + pids[i], 'Proc. Eng. / ' + pids[i],
  675. dir + '/pid/' + pids[i].toLowerCase().replace(' ', '_') + '.xml',
  676. ';html=1;align=center;' + mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;dashed=0;');
  677. }
  678. }
  679. for (var i = 0; i < sysml.length; i++)
  680. {
  681. if (sysml[i] == 'Model Elements')
  682. {
  683. this.addSysMLModelElementsPalette();
  684. }
  685. else if (sysml[i] == 'Blocks')
  686. {
  687. this.addSysMLBlocksPalette();
  688. }
  689. else if (sysml[i] == 'Ports and Flows')
  690. {
  691. this.addSysMLPortsAndFlowsPalette();
  692. }
  693. else if (sysml[i] == 'Constraint Blocks')
  694. {
  695. this.addSysMLConstraintBlocksPalette();
  696. }
  697. else if (sysml[i] == 'Activities')
  698. {
  699. this.addSysMLActivitiesPalette();
  700. }
  701. else if (sysml[i] == 'Interactions')
  702. {
  703. this.addSysMLInteractionsPalette();
  704. }
  705. else if (sysml[i] == 'State Machines')
  706. {
  707. this.addSysMLStateMachinesPalette();
  708. }
  709. else if (sysml[i] == 'Use Cases')
  710. {
  711. this.addSysMLUseCasesPalette();
  712. }
  713. else if (sysml[i] == 'Allocations')
  714. {
  715. this.addSysMLAllocationsPalette();
  716. }
  717. else if (sysml[i] == 'Requirements')
  718. {
  719. this.addSysMLRequirementsPalette();
  720. }
  721. else if (sysml[i] == 'Profiles')
  722. {
  723. this.addSysMLProfilesPalette();
  724. }
  725. else if (sysml[i] == 'Stereotypes')
  726. {
  727. this.addSysMLStereotypesPalette();
  728. }
  729. }
  730. for (var i = 0; i < eip.length; i++)
  731. {
  732. if (eip[i] == 'Message Construction')
  733. {
  734. this.addEipMessageConstructionPalette();
  735. }
  736. else if (eip[i] == 'Message Routing')
  737. {
  738. this.addEipMessageRoutingPalette();
  739. }
  740. else if (eip[i] == 'Message Transformation')
  741. {
  742. this.addEipMessageTransformationPalette();
  743. }
  744. else if (eip[i] == 'Messaging Channels')
  745. {
  746. this.addEipMessagingChannelsPalette();
  747. }
  748. else if (eip[i] == 'Messaging Endpoints')
  749. {
  750. this.addEipMessagingEndpointsPalette();
  751. }
  752. else if (eip[i] == 'Messaging Systems')
  753. {
  754. this.addEipMessagingSystemsPalette();
  755. }
  756. else if (eip[i] == 'System Management')
  757. {
  758. this.addEipSystemManagementPalette();
  759. }
  760. }
  761. for (var i = 0; i < cisco.length; i++)
  762. {
  763. this.addStencilPalette('cisco' + cisco[i], 'Cisco / ' + cisco[i],
  764. dir + '/cisco/' + cisco[i].toLowerCase().replace(/ /g, '_') + '.xml',
  765. ';html=1;dashed=0;fillColor=#036897;strokeColor=#ffffff;strokeWidth=2;verticalLabelPosition=bottom;verticalAlign=top', null, null, 1.6);
  766. }
  767. this.addFloorplanPalette();
  768. this.addBootstrapPalette();
  769. for (var i = 0; i < gmdl.length; i++)
  770. {
  771. if (gmdl[i] == 'Bottom Navigation')
  772. {
  773. this.addGMDLBottomNavigationPalette();
  774. }
  775. else if (gmdl[i] == 'Bottom Sheets')
  776. {
  777. this.addGMDLBottomSheetsPalette();
  778. }
  779. else if (gmdl[i] == 'Buttons')
  780. {
  781. this.addGMDLButtonsPalette();
  782. }
  783. else if (gmdl[i] == 'Cards')
  784. {
  785. this.addGMDLCardsPalette();
  786. }
  787. else if (gmdl[i] == 'Chips')
  788. {
  789. this.addGMDLChipsPalette();
  790. }
  791. else if (gmdl[i] == 'Dialogs')
  792. {
  793. this.addGMDLDialogsPalette();
  794. }
  795. else if (gmdl[i] == 'Dividers')
  796. {
  797. this.addGMDLDividersPalette();
  798. }
  799. else if (gmdl[i] == 'Grid Lists')
  800. {
  801. this.addGMDLGridListsPalette();
  802. }
  803. else if (gmdl[i] == 'Icons')
  804. {
  805. this.addGMDLIconsPalette();
  806. }
  807. else if (gmdl[i] == 'Lists')
  808. {
  809. this.addGMDLListsPalette();
  810. }
  811. else if (gmdl[i] == 'Menus')
  812. {
  813. this.addGMDLMenusPalette();
  814. }
  815. else if (gmdl[i] == 'Misc')
  816. {
  817. this.addGMDLMiscPalette();
  818. }
  819. else if (gmdl[i] == 'Pickers')
  820. {
  821. this.addGMDLPickersPalette();
  822. }
  823. else if (gmdl[i] == 'Selection Controls')
  824. {
  825. this.addGMDLSelectionControlsPalette();
  826. }
  827. else if (gmdl[i] == 'Sliders')
  828. {
  829. this.addGMDLSlidersPalette();
  830. }
  831. else if (gmdl[i] == 'Steppers')
  832. {
  833. this.addGMDLSteppersPalette();
  834. }
  835. else if (gmdl[i] == 'Tabs')
  836. {
  837. this.addGMDLTabsPalette();
  838. }
  839. else if (gmdl[i] == 'Text Fields')
  840. {
  841. this.addGMDLTextFieldsPalette();
  842. }
  843. }
  844. this.addCabinetsPalette();
  845. this.addArchimate3Palette();
  846. this.addArchiMatePalette();
  847. // LATER: Check if conflicts with restore libs after loading file
  848. this.showEntries();
  849. };
  850. /**
  851. * Overridden to manually create search index for stencil files which are not pre-loaded
  852. * and no entries are created programmatically.
  853. */
  854. if (urlParams['createindex'] == '1')
  855. {
  856. var sidebarAddStencilPalette = Sidebar.prototype.addStencilPalette;
  857. Sidebar.prototype.addStencilPalette = function(id, title, stencilFile, style, ignore, onInit, scale, tags)
  858. {
  859. sidebarAddStencilPalette.apply(this, arguments);
  860. scale = (scale != null) ? scale : 1;
  861. // Used for creating index
  862. mxStencilRegistry.loadStencilSet(stencilFile, mxUtils.bind(this, function(packageName, stencilName, displayName, w, h)
  863. {
  864. if (ignore == null || mxUtils.indexOf(ignore, stencilName) < 0)
  865. {
  866. var tmpTags = (tags != null) ? tags[stencilName] : null;
  867. mxLog.debug('<shape style="shape=' + packageName + stencilName + style + '" ' +
  868. 'w="' + Math.round(w * scale) + '" h="' + Math.round(h * scale) + '"' +
  869. ((tmpTags != null) ? ' tags="' + tmpTags + '"' : '') + '/>');
  870. }
  871. }), true);
  872. };
  873. }
  874. /**
  875. * Adds server icon results to local search results
  876. */
  877. var sidebarSearchEntries = Sidebar.prototype.searchEntries;
  878. Sidebar.prototype.searchEntries = function(searchTerms, count, page, success, error)
  879. {
  880. var succ = success;
  881. // Logs search terms for improving search results
  882. if (this.editorUi.enableLogging && !this.editorUi.isOffline() && page == 0)
  883. {
  884. var img = new Image();
  885. var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
  886. img.src = logDomain + '/log?severity=CONFIG&msg=shapesearch:' + encodeURIComponent(searchTerms) + '&v=' + encodeURIComponent(EditorUi.VERSION);
  887. }
  888. success = mxUtils.bind(this, function(results, len, more, terms)
  889. {
  890. if (!this.editorUi.isOffline() && results.length <= count / 4)
  891. {
  892. var pg = page - Math.ceil((len - count / 4) / count);
  893. mxUtils.get(ICONSEARCH_PATH + '?v=2&q=' + encodeURIComponent(searchTerms) +
  894. '&p=' + pg + '&c=' + count, mxUtils.bind(this, function(req)
  895. {
  896. try
  897. {
  898. if (req.getStatus() >= 200 && req.getStatus() <= 299)
  899. {
  900. var res = JSON.parse(req.getText());
  901. for (var i = 0; i < res.icons.length; i++)
  902. {
  903. var sizes = res.icons[i].raster_sizes;
  904. var index = sizes.length - 1;
  905. while (index > 0 && sizes[index].size > 128)
  906. {
  907. index--;
  908. }
  909. var size = sizes[index].size;
  910. var url = sizes[index].formats[0].preview_url;
  911. if (size != null && url != null)
  912. {
  913. (mxUtils.bind(this, function(s, u)
  914. {
  915. results.push(mxUtils.bind(this, function()
  916. {
  917. return this.createVertexTemplate('shape=image;html=1;verticalAlign=top;' +
  918. 'verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;' +
  919. 'aspect=fixed;image=' + u, s, s, '');
  920. }));
  921. }))(size, url);
  922. }
  923. }
  924. succ(results, (page - 1) * count + results.length, res.icons.length == count, terms);
  925. }
  926. else
  927. {
  928. succ(results, len, false, terms);
  929. this.editorUi.handleError({message: mxResources.get('unknownError')});
  930. }
  931. }
  932. catch (e)
  933. {
  934. succ(results, len, false, terms);
  935. this.editorUi.handleError(e);
  936. }
  937. },
  938. function()
  939. {
  940. succ(results, len, false, terms);
  941. }));
  942. }
  943. else
  944. {
  945. succ(results, len, more || !this.editorUi.isOffline(), terms);
  946. }
  947. });
  948. sidebarSearchEntries.apply(this, arguments);
  949. };
  950. /**
  951. * Adds a click handler for inserting the cell as target for dangling edge.
  952. */
  953. var sidebarItemClicked = Sidebar.prototype.itemClicked;
  954. Sidebar.prototype.itemClicked = function(cells, ds, evt)
  955. {
  956. var graph = this.editorUi.editor.graph;
  957. var handled = false;
  958. if (cells != null && graph.getSelectionCount() == 1 && graph.getModel().isVertex(cells[0]))
  959. {
  960. var target = graph.cloneCells(cells)[0];
  961. // Inserts cell as target of selected edge if not connected
  962. if (graph.getModel().isEdge(graph.getSelectionCell()) && graph.getModel().getTerminal(graph.getSelectionCell(), false) == null &&
  963. graph.getModel().isVertex(target))
  964. {
  965. graph.getModel().beginUpdate();
  966. try
  967. {
  968. var edgeState = graph.view.getState(graph.getSelectionCell());
  969. if (edgeState != null)
  970. {
  971. var tr = graph.view.translate;
  972. var s = graph.view.scale;
  973. var pt = edgeState.absolutePoints[edgeState.absolutePoints.length - 1];
  974. target.geometry.x = pt.x / s - tr.x - target.geometry.width / 2;
  975. target.geometry.y = pt.y / s - tr.y - target.geometry.height / 2;
  976. }
  977. graph.addCell(target);
  978. graph.getModel().setTerminal(graph.getSelectionCell(), target, false);
  979. }
  980. finally
  981. {
  982. graph.getModel().endUpdate();
  983. }
  984. graph.scrollCellToVisible(target);
  985. graph.setSelectionCell(target);
  986. handled = true;
  987. }
  988. }
  989. if (!handled)
  990. {
  991. sidebarItemClicked.apply(this, arguments);
  992. }
  993. };
  994. })();