Sidebar.js 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  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//hFI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QGS1WMXcas9lK4R090+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.show();
  500. mxLog.textarea.value = '';
  501. }
  502. this.addSearchPalette(true);
  503. this.addGeneralPalette(true);
  504. this.addMiscPalette(false);
  505. this.addAdvancedPalette(false);
  506. this.addUmlPalette(false);
  507. this.addErPalette();
  508. this.addBasicPalette();
  509. this.addFlowchartPalette();
  510. this.addNetworkPalette();
  511. this.addAzurePalette();
  512. this.addCitrixPalette();
  513. this.addMSCAEPalette();
  514. this.addBpmnPalette(dir, false);
  515. this.addAWSPalette();
  516. this.addAWS3DPalette();
  517. this.addLeanMappingPalette();
  518. this.addIos7Palette();
  519. this.addIosPalette();
  520. this.addAndroidPalette();
  521. this.addMockupPalette();
  522. this.addElectricalPalette();
  523. this.addOfficePalette();
  524. this.addVeeamPalette();
  525. this.addStencilPalette('arrows', mxResources.get('arrows'), dir + '/arrows.xml',
  526. ';html=1;' + mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;' + mxConstants.STYLE_STROKEWIDTH + '=2;strokeColor=#000000;');
  527. this.addArrows2Palette();
  528. this.addImagePalette('computer', 'Clipart / Computer', imgDir
  529. + '/lib/clip_art/computers/', '_128x128.png', ['Antivirus',
  530. 'Data_Filtering', 'Database', 'Database_Add', 'Database_Minus',
  531. 'Database_Move_Stack', 'Database_Remove', 'Fujitsu_Tablet',
  532. 'Harddrive', 'IBM_Tablet', 'iMac', 'iPad', 'Laptop', 'MacBook',
  533. 'Mainframe', 'Monitor', 'Monitor_Tower',
  534. 'Monitor_Tower_Behind', 'Netbook', 'Network', 'Network_2',
  535. 'Printer', 'Printer_Commercial', 'Secure_System', 'Server',
  536. 'Server_Rack', 'Server_Rack_Empty', 'Server_Rack_Partial',
  537. 'Server_Tower', 'Software', 'Stylus', 'Touch', 'USB_Hub',
  538. 'Virtual_Application', 'Virtual_Machine', 'Virus',
  539. 'Workstation' ], [ 'Antivirus', 'Data Filtering', 'Database',
  540. 'Database Add', 'Database Minus', 'Database Move Stack',
  541. 'Database Remove', 'Fujitsu Tablet', 'Harddrive', 'IBMTablet',
  542. 'iMac', 'iPad', 'Laptop', 'MacBook', 'Mainframe', 'Monitor',
  543. 'Monitor Tower', 'Monitor Tower Behind', 'Netbook', 'Network',
  544. 'Network 2', 'Printer', 'Printer Commercial', 'Secure System',
  545. 'Server', 'Server Rack', 'Server Rack Empty', 'Server Rack Partial',
  546. 'Server Tower', 'Software', 'Stylus', 'Touch', 'USB Hub',
  547. 'Virtual Application', 'Virtual Machine', 'Virus', 'Workstation']);
  548. this.addImagePalette('finance', 'Clipart / Finance', imgDir
  549. + '/lib/clip_art/finance/', '_128x128.png', [ 'Arrow_Down',
  550. 'Arrow_Up', 'Coins', 'Credit_Card', 'Dollar', 'Graph',
  551. 'Pie_Chart', 'Piggy_Bank', 'Safe', 'Shopping_Cart',
  552. 'Stock_Down', 'Stock_Up'], ['Arrow_Down', 'Arrow Up',
  553. 'Coins', 'Credit Card', 'Dollar', 'Graph', 'Pie Chart',
  554. 'Piggy Bank', 'Safe', 'Shopping Basket', 'Stock Down', 'Stock Up']);
  555. this.addImagePalette('clipart', 'Clipart / Various', imgDir
  556. + '/lib/clip_art/general/', '_128x128.png', [ 'Battery_0',
  557. 'Battery_100', 'Battery_50', 'Battery_75', 'Battery_allstates',
  558. 'Bluetooth', 'Earth_globe', 'Empty_Folder', 'Full_Folder',
  559. 'Gear', 'Keys', 'Lock', 'Mouse_Pointer', 'Plug', 'Ships_Wheel',
  560. 'Star', 'Tire' ], [ 'Battery 0%', 'Battery 100%', 'Battery 50%',
  561. 'Battery 75%', 'Battery', 'Bluetooth', 'Globe',
  562. 'Empty Folder', 'Full Folder', 'Gear', 'Keys', 'Lock', 'Mousepointer',
  563. 'Plug', 'Ships Wheel', 'Star', 'Tire']);
  564. this.addImagePalette('networking', 'Clipart / Networking', imgDir
  565. + '/lib/clip_art/networking/', '_128x128.png', ['Bridge',
  566. 'Certificate', 'Certificate_Off', 'Cloud', 'Cloud_Computer',
  567. 'Cloud_Computer_Private', 'Cloud_Rack', 'Cloud_Rack_Private',
  568. 'Cloud_Server', 'Cloud_Server_Private', 'Cloud_Storage',
  569. 'Concentrator', 'Email', 'Firewall_02', 'Firewall',
  570. 'Firewall-page1', 'Ip_Camera', 'Modem',
  571. 'power_distribution_unit', 'Print_Server',
  572. 'Print_Server_Wireless', 'Repeater', 'Router', 'Router_Icon',
  573. 'Switch', 'UPS', 'Wireless_Router', 'Wireless_Router_N'],
  574. ['Bridge', 'Certificate', 'Certificate Off', 'Cloud', 'Cloud Computer',
  575. 'Cloud Computer Private', 'Cloud Rack', 'Cloud Rack Private',
  576. 'Cloud Server', 'Cloud Server Private', 'Cloud Storage',
  577. 'Concentrator', 'Email', 'Firewall 1', 'Firewall 2',
  578. 'Firewall', 'Camera', 'Modem',
  579. 'Power Distribution Unit', 'Print Server',
  580. 'Print Server Wireless', 'Repeater', 'Router', 'Router Icon',
  581. 'Switch', 'UPS', 'Wireless Router', 'Wireless Router N'],
  582. {'Wireless_Router': 'wireless router switch wap wifi access point wlan',
  583. 'Wireless_Router_N': 'wireless router switch wap wifi access point wlan',
  584. 'Router': 'router switch',
  585. 'Router_Icon': 'router switch'});
  586. this.addImagePalette('people', 'Clipart / People', imgDir
  587. + '/lib/clip_art/people/', '_128x128.png', ['Suit_Man',
  588. 'Suit_Man_Black', 'Suit_Man_Blue', 'Suit_Man_Green',
  589. 'Suit_Man_Green_Black', 'Suit_Woman', 'Suit_Woman_Black',
  590. 'Suit_Woman_Blue', 'Suit_Woman_Green',
  591. 'Suit_Woman_Green_Black', 'Construction_Worker_Man',
  592. 'Construction_Worker_Man_Black', 'Construction_Worker_Woman',
  593. 'Construction_Worker_Woman_Black', 'Doctor_Man',
  594. 'Doctor_Man_Black', 'Doctor_Woman', 'Doctor_Woman_Black',
  595. 'Farmer_Man', 'Farmer_Man_Black', 'Farmer_Woman',
  596. 'Farmer_Woman_Black', 'Nurse_Man', 'Nurse_Man_Black',
  597. 'Nurse_Man_Green', 'Nurse_Man_Red', 'Nurse_Woman',
  598. 'Nurse_Woman_Black', 'Nurse_Woman_Green', 'Nurse_Woman_Red',
  599. 'Military_Officer', 'Military_Officer_Black',
  600. 'Military_Officer_Woman', 'Military_Officer_Woman_Black',
  601. 'Pilot_Man', 'Pilot_Man_Black', 'Pilot_Woman',
  602. 'Pilot_Woman_Black', 'Scientist_Man', 'Scientist_Man_Black',
  603. 'Scientist_Woman', 'Scientist_Woman_Black', 'Security_Man',
  604. 'Security_Man_Black', 'Security_Woman', 'Security_Woman_Black',
  605. 'Soldier', 'Soldier_Black', 'Tech_Man', 'Tech_Man_Black',
  606. 'Telesales_Man', 'Telesales_Man_Black', 'Telesales_Woman',
  607. 'Telesales_Woman_Black', 'Waiter', 'Waiter_Black',
  608. 'Waiter_Woman', 'Waiter_Woman_Black', 'Worker_Black',
  609. 'Worker_Man', 'Worker_Woman', 'Worker_Woman_Black']);
  610. this.addImagePalette('telco', 'Clipart / Telecommunication', imgDir
  611. + '/lib/clip_art/telecommunication/', '_128x128.png', [
  612. 'BlackBerry', 'Cellphone', 'HTC_smartphone', 'iPhone',
  613. 'Palm_Treo', 'Signal_tower_off', 'Signal_tower_on' ],
  614. ['BlackBerry', 'Cellphone', 'HTC smartphone', 'iPhone',
  615. 'Palm Treo', 'Signaltower off', 'Signaltower on']);
  616. for (var i = 0; i < signs.length; i++)
  617. {
  618. this.addStencilPalette('signs' + signs[i], 'Signs / ' + signs[i],
  619. dir + '/signs/' + signs[i].toLowerCase() + '.xml',
  620. ';html=1;fillColor=#000000;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top;align=center;');
  621. }
  622. for (var i = 0; i < rack.length; i++)
  623. {
  624. if (rack[i].toLowerCase() === 'general')
  625. {
  626. this.addRackGeneralPalette();
  627. }
  628. else if (rack[i].toLowerCase() === 'f5')
  629. {
  630. this.addRackF5Palette();
  631. }
  632. else
  633. {
  634. this.addStencilPalette('rack' + rack[i], 'Rack / ' + rack[i],
  635. dir + '/rack/' + rack[i].toLowerCase() + '.xml',
  636. ';html=1;labelPosition=right;align=left;spacingLeft=15;dashed=0;shadow=0;fillColor=#ffffff;');
  637. }
  638. }
  639. for (var i = 0; i < pids.length; i++)
  640. {
  641. if (pids[i] == 'Instruments')
  642. {
  643. this.addPidInstrumentsPalette();
  644. }
  645. else if (pids[i] == 'Misc')
  646. {
  647. this.addPidMiscPalette();
  648. }
  649. else if (pids[i] == 'Valves')
  650. {
  651. this.addPidValvesPalette();
  652. }
  653. else if (pids[i] == 'Compressors')
  654. {
  655. this.addPidCompressorsPalette();
  656. }
  657. else if (pids[i] == 'Engines')
  658. {
  659. this.addPidEnginesPalette();
  660. }
  661. else if (pids[i] == 'Filters')
  662. {
  663. this.addPidFiltersPalette();
  664. }
  665. else if (pids[i] == 'Flow Sensors')
  666. {
  667. this.addPidFlowSensorsPalette();
  668. }
  669. else if (pids[i] == 'Piping')
  670. {
  671. this.addPidPipingPalette();
  672. }
  673. else
  674. {
  675. this.addStencilPalette('pid' + pids[i], 'Proc. Eng. / ' + pids[i],
  676. dir + '/pid/' + pids[i].toLowerCase().replace(' ', '_') + '.xml',
  677. ';html=1;align=center;' + mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;dashed=0;');
  678. }
  679. }
  680. for (var i = 0; i < sysml.length; i++)
  681. {
  682. if (sysml[i] == 'Model Elements')
  683. {
  684. this.addSysMLModelElementsPalette();
  685. }
  686. else if (sysml[i] == 'Blocks')
  687. {
  688. this.addSysMLBlocksPalette();
  689. }
  690. else if (sysml[i] == 'Ports and Flows')
  691. {
  692. this.addSysMLPortsAndFlowsPalette();
  693. }
  694. else if (sysml[i] == 'Constraint Blocks')
  695. {
  696. this.addSysMLConstraintBlocksPalette();
  697. }
  698. else if (sysml[i] == 'Activities')
  699. {
  700. this.addSysMLActivitiesPalette();
  701. }
  702. else if (sysml[i] == 'Interactions')
  703. {
  704. this.addSysMLInteractionsPalette();
  705. }
  706. else if (sysml[i] == 'State Machines')
  707. {
  708. this.addSysMLStateMachinesPalette();
  709. }
  710. else if (sysml[i] == 'Use Cases')
  711. {
  712. this.addSysMLUseCasesPalette();
  713. }
  714. else if (sysml[i] == 'Allocations')
  715. {
  716. this.addSysMLAllocationsPalette();
  717. }
  718. else if (sysml[i] == 'Requirements')
  719. {
  720. this.addSysMLRequirementsPalette();
  721. }
  722. else if (sysml[i] == 'Profiles')
  723. {
  724. this.addSysMLProfilesPalette();
  725. }
  726. else if (sysml[i] == 'Stereotypes')
  727. {
  728. this.addSysMLStereotypesPalette();
  729. }
  730. }
  731. for (var i = 0; i < eip.length; i++)
  732. {
  733. if (eip[i] == 'Message Construction')
  734. {
  735. this.addEipMessageConstructionPalette();
  736. }
  737. else if (eip[i] == 'Message Routing')
  738. {
  739. this.addEipMessageRoutingPalette();
  740. }
  741. else if (eip[i] == 'Message Transformation')
  742. {
  743. this.addEipMessageTransformationPalette();
  744. }
  745. else if (eip[i] == 'Messaging Channels')
  746. {
  747. this.addEipMessagingChannelsPalette();
  748. }
  749. else if (eip[i] == 'Messaging Endpoints')
  750. {
  751. this.addEipMessagingEndpointsPalette();
  752. }
  753. else if (eip[i] == 'Messaging Systems')
  754. {
  755. this.addEipMessagingSystemsPalette();
  756. }
  757. else if (eip[i] == 'System Management')
  758. {
  759. this.addEipSystemManagementPalette();
  760. }
  761. }
  762. for (var i = 0; i < cisco.length; i++)
  763. {
  764. this.addStencilPalette('cisco' + cisco[i], 'Cisco / ' + cisco[i],
  765. dir + '/cisco/' + cisco[i].toLowerCase().replace(/ /g, '_') + '.xml',
  766. ';html=1;dashed=0;fillColor=#036897;strokeColor=#ffffff;strokeWidth=2;verticalLabelPosition=bottom;verticalAlign=top', null, null, 1.6);
  767. }
  768. this.addFloorplanPalette();
  769. this.addBootstrapPalette();
  770. for (var i = 0; i < gmdl.length; i++)
  771. {
  772. if (gmdl[i] == 'Bottom Navigation')
  773. {
  774. this.addGMDLBottomNavigationPalette();
  775. }
  776. else if (gmdl[i] == 'Bottom Sheets')
  777. {
  778. this.addGMDLBottomSheetsPalette();
  779. }
  780. else if (gmdl[i] == 'Buttons')
  781. {
  782. this.addGMDLButtonsPalette();
  783. }
  784. else if (gmdl[i] == 'Cards')
  785. {
  786. this.addGMDLCardsPalette();
  787. }
  788. else if (gmdl[i] == 'Chips')
  789. {
  790. this.addGMDLChipsPalette();
  791. }
  792. else if (gmdl[i] == 'Dialogs')
  793. {
  794. this.addGMDLDialogsPalette();
  795. }
  796. else if (gmdl[i] == 'Dividers')
  797. {
  798. this.addGMDLDividersPalette();
  799. }
  800. else if (gmdl[i] == 'Grid Lists')
  801. {
  802. this.addGMDLGridListsPalette();
  803. }
  804. else if (gmdl[i] == 'Icons')
  805. {
  806. this.addGMDLIconsPalette();
  807. }
  808. else if (gmdl[i] == 'Lists')
  809. {
  810. this.addGMDLListsPalette();
  811. }
  812. else if (gmdl[i] == 'Menus')
  813. {
  814. this.addGMDLMenusPalette();
  815. }
  816. else if (gmdl[i] == 'Misc')
  817. {
  818. this.addGMDLMiscPalette();
  819. }
  820. else if (gmdl[i] == 'Pickers')
  821. {
  822. this.addGMDLPickersPalette();
  823. }
  824. else if (gmdl[i] == 'Selection Controls')
  825. {
  826. this.addGMDLSelectionControlsPalette();
  827. }
  828. else if (gmdl[i] == 'Sliders')
  829. {
  830. this.addGMDLSlidersPalette();
  831. }
  832. else if (gmdl[i] == 'Steppers')
  833. {
  834. this.addGMDLSteppersPalette();
  835. }
  836. else if (gmdl[i] == 'Tabs')
  837. {
  838. this.addGMDLTabsPalette();
  839. }
  840. else if (gmdl[i] == 'Text Fields')
  841. {
  842. this.addGMDLTextFieldsPalette();
  843. }
  844. }
  845. this.addCabinetsPalette();
  846. this.addArchimate3Palette();
  847. this.addArchiMatePalette();
  848. // LATER: Check if conflicts with restore libs after loading file
  849. this.showEntries();
  850. };
  851. /**
  852. * Overridden to manually create search index for stencil files which are not pre-loaded
  853. * and no entries are created programmatically.
  854. */
  855. if (urlParams['createindex'] == '1')
  856. {
  857. var sidebarAddStencilPalette = Sidebar.prototype.addStencilPalette;
  858. Sidebar.prototype.addStencilPalette = function(id, title, stencilFile, style, ignore, onInit, scale, tags)
  859. {
  860. sidebarAddStencilPalette.apply(this, arguments);
  861. scale = (scale != null) ? scale : 1;
  862. // Used for creating index
  863. mxStencilRegistry.loadStencilSet(stencilFile, mxUtils.bind(this, function(packageName, stencilName, displayName, w, h)
  864. {
  865. if (ignore == null || mxUtils.indexOf(ignore, stencilName) < 0)
  866. {
  867. var tmpTags = (tags != null) ? tags[stencilName] : null;
  868. mxLog.debug('<shape style="shape=' + packageName + stencilName + style + '" ' +
  869. 'w="' + Math.round(w * scale) + '" h="' + Math.round(h * scale) + '"' +
  870. ((tmpTags != null) ? ' tags="' + tmpTags + '"' : '') + '/>');
  871. }
  872. }), true);
  873. };
  874. }
  875. /**
  876. * Adds server icon results to local search results
  877. */
  878. var sidebarSearchEntries = Sidebar.prototype.searchEntries;
  879. Sidebar.prototype.searchEntries = function(searchTerms, count, page, success, error)
  880. {
  881. var succ = success;
  882. // Logs search terms for improving search results
  883. if (this.editorUi.enableLogging && !this.editorUi.isOffline() && page == 0)
  884. {
  885. var img = new Image();
  886. var logDomain = window.DRAWIO_LOG_URL != null ? window.DRAWIO_LOG_URL : '';
  887. img.src = logDomain + '/log?severity=CONFIG&msg=shapesearch:' + encodeURIComponent(searchTerms) + '&v=' + encodeURIComponent(EditorUi.VERSION);
  888. }
  889. success = mxUtils.bind(this, function(results, len, more, terms)
  890. {
  891. if (!this.editorUi.isOffline() && results.length <= count / 4)
  892. {
  893. var pg = page - Math.ceil((len - count / 4) / count);
  894. mxUtils.get(ICONSEARCH_PATH + '?v=2&q=' + encodeURIComponent(searchTerms) +
  895. '&p=' + pg + '&c=' + count, mxUtils.bind(this, function(req)
  896. {
  897. try
  898. {
  899. if (req.getStatus() >= 200 && req.getStatus() <= 299)
  900. {
  901. var res = JSON.parse(req.getText());
  902. for (var i = 0; i < res.icons.length; i++)
  903. {
  904. var sizes = res.icons[i].raster_sizes;
  905. var index = sizes.length - 1;
  906. while (index > 0 && sizes[index].size > 128)
  907. {
  908. index--;
  909. }
  910. var size = sizes[index].size;
  911. var url = sizes[index].formats[0].preview_url;
  912. if (size != null && url != null)
  913. {
  914. (mxUtils.bind(this, function(s, u)
  915. {
  916. results.push(mxUtils.bind(this, function()
  917. {
  918. return this.createVertexTemplate('shape=image;html=1;verticalAlign=top;' +
  919. 'verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;' +
  920. 'aspect=fixed;image=' + u, s, s, '');
  921. }));
  922. }))(size, url);
  923. }
  924. }
  925. succ(results, (page - 1) * count + results.length, res.icons.length == count, terms);
  926. }
  927. else
  928. {
  929. succ(results, len, false, terms);
  930. this.editorUi.handleError({message: mxResources.get('unknownError')});
  931. }
  932. }
  933. catch (e)
  934. {
  935. succ(results, len, false, terms);
  936. this.editorUi.handleError(e);
  937. }
  938. },
  939. function()
  940. {
  941. succ(results, len, false, terms);
  942. }));
  943. }
  944. else
  945. {
  946. succ(results, len, more || !this.editorUi.isOffline(), terms);
  947. }
  948. });
  949. sidebarSearchEntries.apply(this, arguments);
  950. };
  951. /**
  952. * Adds a click handler for inserting the cell as target for dangling edge.
  953. */
  954. var sidebarItemClicked = Sidebar.prototype.itemClicked;
  955. Sidebar.prototype.itemClicked = function(cells, ds, evt)
  956. {
  957. var graph = this.editorUi.editor.graph;
  958. var handled = false;
  959. if (cells != null && graph.getSelectionCount() == 1 && graph.getModel().isVertex(cells[0]))
  960. {
  961. var target = graph.cloneCells(cells)[0];
  962. // Inserts cell as target of selected edge if not connected
  963. if (graph.getModel().isEdge(graph.getSelectionCell()) && graph.getModel().getTerminal(graph.getSelectionCell(), false) == null &&
  964. graph.getModel().isVertex(target))
  965. {
  966. graph.getModel().beginUpdate();
  967. try
  968. {
  969. var edgeState = graph.view.getState(graph.getSelectionCell());
  970. if (edgeState != null)
  971. {
  972. var tr = graph.view.translate;
  973. var s = graph.view.scale;
  974. var pt = edgeState.absolutePoints[edgeState.absolutePoints.length - 1];
  975. target.geometry.x = pt.x / s - tr.x - target.geometry.width / 2;
  976. target.geometry.y = pt.y / s - tr.y - target.geometry.height / 2;
  977. }
  978. graph.addCell(target);
  979. graph.getModel().setTerminal(graph.getSelectionCell(), target, false);
  980. }
  981. finally
  982. {
  983. graph.getModel().endUpdate();
  984. }
  985. graph.scrollCellToVisible(target);
  986. graph.setSelectionCell(target);
  987. handled = true;
  988. }
  989. }
  990. if (!handled)
  991. {
  992. sidebarItemClicked.apply(this, arguments);
  993. }
  994. };
  995. })();