sketchily 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/app/assets/javascripts/sketchily.js +10 -10
  4. data/app/assets/javascripts/sketchily.js~ +10 -2
  5. data/app/assets/javascripts/{base64.js → sketchily/base64.js} +0 -0
  6. data/app/assets/javascripts/sketchily_embed.js +2 -2
  7. data/app/assets/javascripts/sketchily_embed.js~ +1 -4
  8. data/app/assets/stylesheets/sketchily.css +4 -4
  9. data/app/assets/stylesheets/sketchily.css~ +3 -2
  10. data/app/helpers/sketchily_helper.rb +1 -3
  11. data/app/helpers/sketchily_helper.rb~ +1 -1
  12. data/app/views/sketchily/_embed.html.erb +1 -1
  13. data/app/views/sketchily/_embed.html.erb~ +0 -1
  14. data/lib/sketchily.rb +1 -1
  15. data/lib/sketchily.rb~ +2 -2
  16. data/lib/sketchily/version.rb +1 -1
  17. data/lib/sketchily/version.rb~ +1 -1
  18. data/spec/dummy/log/test.log +120 -0
  19. data/spec/dummy/tmp/cache/assets/test/sprockets/1bf464000fcdb546c383cf7f69d46662 +0 -0
  20. data/spec/dummy/tmp/cache/assets/test/sprockets/23e9024449d6fb482717441645b0cd8c +0 -0
  21. data/spec/dummy/tmp/cache/assets/test/sprockets/2dda36ccc70570f77ad22a659af00a7e +0 -0
  22. data/spec/dummy/tmp/cache/assets/test/sprockets/413a1ea244e0c08b931057c16bfe0bc2 +0 -0
  23. data/spec/dummy/tmp/cache/assets/test/sprockets/56a18313459a66878cdaf82c4915f8f5 +0 -0
  24. data/spec/dummy/tmp/cache/assets/test/sprockets/e839e441b04ffc4a0f153b037b0c69b2 +0 -0
  25. data/vendor/assets/{svg-edit-2.6/browser-not-supported.html~ → javascripts/svg-edit-2.6/browser-not-supported.html} +3 -3
  26. data/vendor/assets/{svg-edit-2.6/browser-not-supported.html → javascripts/svg-edit-2.6/browser-not-supported.html~} +1 -1
  27. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/browser.js +0 -0
  28. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/canvg/canvg.js +0 -0
  29. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/canvg/rgbcolor.js +0 -0
  30. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/contextmenu.js +0 -0
  31. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/contextmenu/jquery.contextMenu.js +0 -0
  32. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/draw.js +0 -0
  33. data/vendor/assets/{svg-edit-2.6/embedapi.html~ → javascripts/svg-edit-2.6/embedapi.html} +1 -1
  34. data/vendor/assets/{svg-edit-2.6/embedapi.html → javascripts/svg-edit-2.6/embedapi.html~} +0 -0
  35. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/embedapi.js +0 -0
  36. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/closepath_icons.svg +0 -0
  37. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-arrows.js +0 -0
  38. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-closepath.js +92 -0
  39. data/vendor/assets/{svg-edit-2.6/extensions/ext-closepath.js → javascripts/svg-edit-2.6/extensions/ext-closepath.js~} +0 -0
  40. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-connector.js +587 -0
  41. data/vendor/assets/{svg-edit-2.6/extensions/ext-connector.js → javascripts/svg-edit-2.6/extensions/ext-connector.js~} +1 -1
  42. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-eyedropper.js +109 -0
  43. data/vendor/assets/{svg-edit-2.6/extensions/ext-eyedropper.js → javascripts/svg-edit-2.6/extensions/ext-eyedropper.js~} +0 -0
  44. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-foreignobject.js +277 -0
  45. data/vendor/assets/{svg-edit-2.6/extensions/ext-foreignobject.js → javascripts/svg-edit-2.6/extensions/ext-foreignobject.js~} +0 -0
  46. data/vendor/assets/{svg-edit-2.6/extensions/ext-grid.js~ → javascripts/svg-edit-2.6/extensions/ext-grid.js} +2 -2
  47. data/vendor/assets/{svg-edit-2.6/extensions/ext-grid.js → javascripts/svg-edit-2.6/extensions/ext-grid.js~} +0 -0
  48. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-helloworld.js +78 -0
  49. data/vendor/assets/{svg-edit-2.6/extensions/ext-helloworld.js → javascripts/svg-edit-2.6/extensions/ext-helloworld.js~} +0 -0
  50. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-imagelib.js +2 -2
  51. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-imagelib.js~ +1 -1
  52. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-imagelib.xml +0 -0
  53. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-markers.js +572 -0
  54. data/vendor/assets/{svg-edit-2.6/extensions/ext-markers.js → javascripts/svg-edit-2.6/extensions/ext-markers.js~} +0 -0
  55. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-server_moinsave.js +0 -0
  56. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-server_opensave.js +180 -0
  57. data/vendor/assets/{svg-edit-2.6/extensions/ext-server_opensave.js → javascripts/svg-edit-2.6/extensions/ext-server_opensave.js~} +0 -0
  58. data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-shapes.js +387 -0
  59. data/vendor/assets/{svg-edit-2.6/extensions/ext-shapes.js → javascripts/svg-edit-2.6/extensions/ext-shapes.js~} +0 -0
  60. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-shapes.xml +0 -0
  61. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/eyedropper-icon.xml +0 -0
  62. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/eyedropper.png +0 -0
  63. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/fileopen.php +0 -0
  64. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/filesave.php +0 -0
  65. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/foreignobject-icons.xml +0 -0
  66. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/grid-icon.xml +0 -0
  67. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/helloworld-icon.xml +0 -0
  68. data/vendor/assets/javascripts/svg-edit-2.6/extensions/imagelib/index.html +64 -0
  69. data/vendor/assets/{svg-edit-2.6/extensions/imagelib/index.html → javascripts/svg-edit-2.6/extensions/imagelib/index.html~} +0 -0
  70. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/imagelib/smiley.svg +0 -0
  71. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/markers-icons.xml +0 -0
  72. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/animal.json +0 -0
  73. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/arrow.json +0 -0
  74. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/dialog_balloon.json +0 -0
  75. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/electronics.json +0 -0
  76. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/flowchart.json +0 -0
  77. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/game.json +0 -0
  78. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/math.json +0 -0
  79. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/misc.json +0 -0
  80. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/music.json +0 -0
  81. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/object.json +0 -0
  82. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/raphael.txt +0 -0
  83. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/raphael_1.json +0 -0
  84. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/raphael_2.json +0 -0
  85. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/symbol.json +0 -0
  86. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/history.js +0 -0
  87. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/README.txt +0 -0
  88. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-bottom.png +0 -0
  89. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-bottom.svg +0 -0
  90. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-center.png +0 -0
  91. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-center.svg +0 -0
  92. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-left.png +0 -0
  93. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-left.svg +0 -0
  94. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-middle.png +0 -0
  95. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-middle.svg +0 -0
  96. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-right.png +0 -0
  97. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-right.svg +0 -0
  98. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-top.png +0 -0
  99. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-top.svg +0 -0
  100. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/bold.png +0 -0
  101. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/cancel.png +0 -0
  102. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/circle.png +0 -0
  103. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/clear.png +0 -0
  104. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/clone.png +0 -0
  105. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/conn.svg +0 -0
  106. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/copy.png +0 -0
  107. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/cut.png +0 -0
  108. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/delete.png +0 -0
  109. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/document-properties.png +0 -0
  110. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/dropdown.gif +0 -0
  111. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/ellipse.png +0 -0
  112. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/eye.png +0 -0
  113. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/fhpath.png +0 -0
  114. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/flyouth.png +0 -0
  115. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/flyup.gif +0 -0
  116. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/freehand-circle.png +0 -0
  117. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/freehand-square.png +0 -0
  118. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/go-down.png +0 -0
  119. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/go-up.png +0 -0
  120. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/image.png +0 -0
  121. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/italic.png +0 -0
  122. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/line.png +0 -0
  123. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/link_controls.png +0 -0
  124. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/logo.png +0 -0
  125. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/logo.svg +0 -0
  126. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/move_bottom.png +0 -0
  127. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/move_top.png +0 -0
  128. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/node_clone.png +0 -0
  129. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/node_delete.png +0 -0
  130. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/none.png +0 -0
  131. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/open.png +0 -0
  132. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/paste.png +0 -0
  133. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/path.png +0 -0
  134. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/polygon.png +0 -0
  135. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/polygon.svg +0 -0
  136. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/rect.png +0 -0
  137. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/redo.png +0 -0
  138. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/reorient.png +0 -0
  139. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/rotate.png +0 -0
  140. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/save.png +0 -0
  141. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/select.png +0 -0
  142. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/select_node.png +0 -0
  143. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/sep.png +0 -0
  144. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/shape_group.png +0 -0
  145. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/shape_ungroup.png +0 -0
  146. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/source.png +0 -0
  147. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/spinbtn_updn_big.png +0 -0
  148. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/square.png +0 -0
  149. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/svg_edit_icons.svg +0 -0
  150. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/svg_edit_icons.svgz +0 -0
  151. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/text.png +0 -0
  152. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/text.svg +0 -0
  153. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/to_path.png +0 -0
  154. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/undo.png +0 -0
  155. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/view-refresh.png +0 -0
  156. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/wave.png +0 -0
  157. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/wireframe.png +0 -0
  158. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/zoom.png +0 -0
  159. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/LICENSE +0 -0
  160. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/README +0 -0
  161. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/css/jPicker.css +0 -0
  162. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/css/jgraduate.css +3 -3
  163. data/vendor/assets/javascripts/svg-edit-2.6/jgraduate/css/jgraduate.css~ +351 -0
  164. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/AlphaBar.png +0 -0
  165. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/Bars.png +0 -0
  166. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/Maps.png +0 -0
  167. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/NoColor.png +0 -0
  168. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/bar-opacity.png +0 -0
  169. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/map-opacity.png +0 -0
  170. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/mappoint.gif +0 -0
  171. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/mappoint_c.png +0 -0
  172. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/mappoint_f.png +0 -0
  173. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/picker.gif +0 -0
  174. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/preview-opacity.png +0 -0
  175. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/rangearrows.gif +0 -0
  176. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/rangearrows2.gif +0 -0
  177. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jpicker.js +0 -0
  178. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jpicker.min.js +0 -0
  179. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jquery.jgraduate.js +0 -0
  180. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jquery.jgraduate.min.js +0 -0
  181. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquery-ui/jquery-ui-1.8.17.custom.min.js +0 -0
  182. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquery-ui/jquery-ui-1.8.custom.min.js +0 -0
  183. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquery.js +0 -0
  184. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquerybbq/jquery.bbq.min.js +0 -0
  185. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/js-hotkeys/README.md +0 -0
  186. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/js-hotkeys/jquery.hotkeys.min.js +0 -0
  187. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/README.txt +0 -0
  188. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.af.js +0 -0
  189. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ar.js +0 -0
  190. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.az.js +0 -0
  191. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.be.js +0 -0
  192. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.bg.js +0 -0
  193. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ca.js +0 -0
  194. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.cs.js +0 -0
  195. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.cy.js +0 -0
  196. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.da.js +0 -0
  197. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.de.js +0 -0
  198. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.el.js +0 -0
  199. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.en.js +0 -0
  200. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.es.js +0 -0
  201. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.et.js +0 -0
  202. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fa.js +0 -0
  203. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fi.js +0 -0
  204. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fr.js +0 -0
  205. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fy.js +0 -0
  206. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ga.js +0 -0
  207. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.gl.js +0 -0
  208. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.he.js +0 -0
  209. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hi.js +0 -0
  210. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hr.js +0 -0
  211. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hu.js +0 -0
  212. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hy.js +0 -0
  213. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.id.js +0 -0
  214. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.is.js +0 -0
  215. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.it.js +0 -0
  216. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ja.js +0 -0
  217. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ko.js +0 -0
  218. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.lt.js +0 -0
  219. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.lv.js +0 -0
  220. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.mk.js +0 -0
  221. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ms.js +0 -0
  222. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.mt.js +0 -0
  223. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.nl.js +0 -0
  224. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.no.js +0 -0
  225. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.pl.js +0 -0
  226. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.pt-BR.js +0 -0
  227. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.pt-PT.js +0 -0
  228. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ro.js +0 -0
  229. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ro.js~ +0 -0
  230. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ru.js +0 -0
  231. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sk.js +0 -0
  232. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sl.js +0 -0
  233. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sq.js +0 -0
  234. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sr.js +0 -0
  235. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sv.js +0 -0
  236. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sw.js +0 -0
  237. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.test.js +0 -0
  238. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.th.js +0 -0
  239. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.tl.js +0 -0
  240. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.tr.js +0 -0
  241. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.uk.js +0 -0
  242. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.vi.js +0 -0
  243. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.yi.js +0 -0
  244. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.zh-CN.js +0 -0
  245. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.zh-HK.js +0 -0
  246. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.zh-TW.js +0 -0
  247. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/locale.js +0 -0
  248. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/math.js +0 -0
  249. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/path.js +0 -0
  250. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/sanitize.js +0 -0
  251. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/select.js +0 -0
  252. data/vendor/assets/{svg-edit-2.6/spinbtn/JQuerySpinBtn.css~ → javascripts/svg-edit-2.6/spinbtn/JQuerySpinBtn.css} +1 -1
  253. data/vendor/assets/{svg-edit-2.6/spinbtn/JQuerySpinBtn.css → javascripts/svg-edit-2.6/spinbtn/JQuerySpinBtn.css~} +1 -1
  254. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/spinbtn/JQuerySpinBtn.js +0 -0
  255. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/spinbtn/JQuerySpinBtn.min.js +0 -0
  256. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/spinbtn/spinbtn_updn.png +0 -0
  257. data/vendor/assets/javascripts/svg-edit-2.6/svg-editor.css +1494 -0
  258. data/vendor/assets/{svg-edit-2.6/svg-editor.css → javascripts/svg-edit-2.6/svg-editor.css~} +0 -0
  259. data/vendor/assets/{svg-edit-2.6/svg-editor.html~ → javascripts/svg-edit-2.6/svg-editor.html} +1 -2
  260. data/vendor/assets/{svg-edit-2.6/svg-editor.html → javascripts/svg-edit-2.6/svg-editor.html~} +0 -0
  261. data/vendor/assets/{svg-edit-2.6/svg-editor.js~ → javascripts/svg-edit-2.6/svg-editor.js} +9 -9
  262. data/vendor/assets/{svg-edit-2.6/svg-editor.js → javascripts/svg-edit-2.6/svg-editor.js~} +4 -4
  263. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svg-editor.manifest +0 -0
  264. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgcanvas.js +0 -0
  265. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgcanvas.js~ +0 -0
  266. data/vendor/assets/{svg-edit-2.6/svgedit.compiled.js~ → javascripts/svg-edit-2.6/svgedit.compiled.js} +4 -4
  267. data/vendor/assets/{svg-edit-2.6/svgedit.compiled.js → javascripts/svg-edit-2.6/svgedit.compiled.js~} +2 -2
  268. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgicons/jquery.svgicons.js +0 -0
  269. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgtransformlist.js +0 -0
  270. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgutils.js +0 -0
  271. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/touch.js +0 -0
  272. data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/units.js +0 -0
  273. metadata +259 -254
@@ -0,0 +1,180 @@
1
+ /*
2
+ * ext-server_opensave.js
3
+ *
4
+ * Licensed under the MIT License
5
+ *
6
+ * Copyright(c) 2010 Alexis Deveria
7
+ *
8
+ */
9
+
10
+ svgEditor.addExtension("server_opensave", {
11
+ callback: function() {
12
+
13
+ var save_svg_action = '/assets/svg-edit-2.6/extensions/filesave.php';
14
+ var save_png_action = '/assets/svg-edit-2.6/extensions/filesave.php';
15
+
16
+ // Create upload target (hidden iframe)
17
+ var target = $('<iframe name="output_frame" src="#"/>').hide().appendTo('body');
18
+
19
+ svgEditor.setCustomHandlers({
20
+ save: function(win, data) {
21
+ var svg = "<?xml version=\"1.0\"?>\n" + data;
22
+
23
+ var title = svgCanvas.getDocumentTitle();
24
+ var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_');
25
+
26
+ var form = $('<form>').attr({
27
+ method: 'post',
28
+ action: save_svg_action,
29
+ target: 'output_frame'
30
+ }) .append('<input type="hidden" name="output_svg" value="' + encodeURI(svg) + '">')
31
+ .append('<input type="hidden" name="filename" value="' + filename + '">')
32
+ .appendTo('body')
33
+ .submit().remove();
34
+ },
35
+ pngsave: function(win, data) {
36
+ var issues = data.issues;
37
+
38
+ if(!$('#export_canvas').length) {
39
+ $('<canvas>', {id: 'export_canvas'}).hide().appendTo('body');
40
+ }
41
+ var c = $('#export_canvas')[0];
42
+
43
+ c.width = svgCanvas.contentW;
44
+ c.height = svgCanvas.contentH;
45
+ canvg(c, data.svg, {renderCallback: function() {
46
+ var datauri = c.toDataURL('image/png');
47
+
48
+ var uiStrings = svgEditor.uiStrings;
49
+ var note = '';
50
+
51
+ // Check if there's issues
52
+ if(issues.length) {
53
+ var pre = "\n \u2022 ";
54
+ note += ("\n\n" + pre + issues.join(pre));
55
+ }
56
+
57
+ if(note.length) {
58
+ alert(note);
59
+ }
60
+
61
+ var title = svgCanvas.getDocumentTitle();
62
+ var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_');
63
+
64
+ var form = $('<form>').attr({
65
+ method: 'post',
66
+ action: save_png_action,
67
+ target: 'output_frame'
68
+ }) .append('<input type="hidden" name="output_png" value="' + datauri + '">')
69
+ .append('<input type="hidden" name="filename" value="' + filename + '">')
70
+ .appendTo('body')
71
+ .submit().remove();
72
+ }});
73
+
74
+
75
+ }
76
+ });
77
+
78
+ // Do nothing if client support is found
79
+ if(window.FileReader) return;
80
+
81
+ var cancelled = false;
82
+
83
+ // Change these to appropriate script file
84
+ var open_svg_action = 'extensions/fileopen.php?type=load_svg';
85
+ var import_svg_action = 'extensions/fileopen.php?type=import_svg';
86
+ var import_img_action = 'extensions/fileopen.php?type=import_img';
87
+
88
+ // Set up function for PHP uploader to use
89
+ svgEditor.processFile = function(str64, type) {
90
+ if(cancelled) {
91
+ cancelled = false;
92
+ return;
93
+ }
94
+
95
+ $('#dialog_box').hide();
96
+
97
+ if(type != 'import_img') {
98
+ var xmlstr = svgCanvas.Utils.decode64(str64);
99
+ }
100
+
101
+ switch ( type ) {
102
+ case 'load_svg':
103
+ svgCanvas.clear();
104
+ svgCanvas.setSvgString(xmlstr);
105
+ svgEditor.updateCanvas();
106
+ break;
107
+ case 'import_svg':
108
+ svgCanvas.importSvgString(xmlstr);
109
+ svgEditor.updateCanvas();
110
+ break;
111
+ case 'import_img':
112
+ svgCanvas.setGoodImage(str64);
113
+ break;
114
+ }
115
+ }
116
+
117
+ // Create upload form
118
+ var open_svg_form = $('<form>');
119
+ open_svg_form.attr({
120
+ enctype: 'multipart/form-data',
121
+ method: 'post',
122
+ action: open_svg_action,
123
+ target: 'output_frame'
124
+ });
125
+
126
+ // Create import form
127
+ var import_svg_form = open_svg_form.clone().attr('action', import_svg_action);
128
+
129
+ // Create image form
130
+ var import_img_form = open_svg_form.clone().attr('action', import_img_action);
131
+
132
+ // It appears necessory to rebuild this input every time a file is
133
+ // selected so the same file can be picked and the change event can fire.
134
+ function rebuildInput(form) {
135
+ form.empty();
136
+ var inp = $('<input type="file" name="svg_file">').appendTo(form);
137
+
138
+
139
+ function submit() {
140
+ // This submits the form, which returns the file data using svgEditor.uploadSVG
141
+ form.submit();
142
+
143
+ rebuildInput(form);
144
+ $.process_cancel("Uploading...", function() {
145
+ cancelled = true;
146
+ $('#dialog_box').hide();
147
+ });
148
+ }
149
+
150
+ if(form[0] == open_svg_form[0]) {
151
+ inp.change(function() {
152
+ // This takes care of the "are you sure" dialog box
153
+ svgEditor.openPrep(function(ok) {
154
+ if(!ok) {
155
+ rebuildInput(form);
156
+ return;
157
+ }
158
+ submit();
159
+ });
160
+ });
161
+ } else {
162
+ inp.change(function() {
163
+ // This submits the form, which returns the file data using svgEditor.uploadSVG
164
+ submit();
165
+ });
166
+ }
167
+ }
168
+
169
+ // Create the input elements
170
+ rebuildInput(open_svg_form);
171
+ rebuildInput(import_svg_form);
172
+ rebuildInput(import_img_form);
173
+
174
+ // Add forms to buttons
175
+ $("#tool_open").show().prepend(open_svg_form);
176
+ $("#tool_import").show().prepend(import_svg_form);
177
+ $("#tool_image").prepend(import_img_form);
178
+ }
179
+ });
180
+
@@ -0,0 +1,387 @@
1
+ /*
2
+ * ext-shapes.js
3
+ *
4
+ * Licensed under the MIT License
5
+ *
6
+ * Copyright(c) 2010 Christian Tzurcanu
7
+ * Copyright(c) 2010 Alexis Deveria
8
+ *
9
+ */
10
+
11
+ svgEditor.addExtension("shapes", function() {
12
+
13
+
14
+ var current_d, cur_shape_id;
15
+ var canv = svgEditor.canvas;
16
+ var cur_shape;
17
+ var start_x, start_y;
18
+ var svgroot = canv.getRootElem();
19
+ var lastBBox = {};
20
+
21
+ // This populates the category list
22
+ var categories = {
23
+ basic: 'Basic',
24
+ object: 'Objects',
25
+ symbol: 'Symbols',
26
+ arrow: 'Arrows',
27
+ flowchart: 'Flowchart',
28
+ animal: 'Animals',
29
+ game: 'Cards & Chess',
30
+ dialog_balloon: 'Dialog balloons',
31
+ electronics: 'Electronics',
32
+ math: 'Mathematical',
33
+ music: 'Music',
34
+ misc: 'Miscellaneous',
35
+ raphael_1: 'raphaeljs.com set 1',
36
+ raphael_2: 'raphaeljs.com set 2'
37
+ };
38
+
39
+ var library = {
40
+ 'basic': {
41
+ data: {
42
+ 'heart': 'm150,73c61,-175 300,0 0,225c-300,-225 -61,-400 0,-225z',
43
+ 'frame': 'm0,0l300,0l0,300l-300,0zm35,-265l0,230l230,0l0,-230z',
44
+ 'donut': 'm1,150l0,0c0,-82.29042 66.70958,-149 149,-149l0,0c39.51724,0 77.41599,15.69816 105.35889,43.64108c27.94293,27.94293 43.64111,65.84165 43.64111,105.35892l0,0c0,82.29041 -66.70958,149 -149,149l0,0c-82.29041,0 -149,-66.70959 -149,-149zm74.5,0l0,0c0,41.1452 33.35481,74.5 74.5,74.5c41.14522,0 74.5,-33.3548 74.5,-74.5c0,-41.1452 -33.3548,-74.5 -74.5,-74.5l0,0c-41.14519,0 -74.5,33.35481 -74.5,74.5z',
45
+ "triangle": "m1,280.375l149,-260.75l149,260.75z",
46
+ "right_triangle": "m1,299l0,-298l298,298z",
47
+ "diamond": "m1,150l149,-149l149,149l-149,149l-149,-149z",
48
+ "pentagon": "m1.00035,116.97758l148.99963,-108.4053l148.99998,108.4053l-56.91267,175.4042l-184.1741,0l-56.91284,-175.4042z",
49
+ "hexagon": "m1,149.99944l63.85715,-127.71428l170.28572,0l63.85713,127.71428l-63.85713,127.71428l-170.28572,0l-63.85715,-127.71428z",
50
+ "septagon1": "m0.99917,191.06511l29.51249,-127.7108l119.48833,-56.83673l119.48836,56.83673l29.51303,127.7108l-82.69087,102.41679l-132.62103,0l-82.69031,-102.41679z",
51
+ "heptagon": "m1,88.28171l87.28172,-87.28171l123.43653,0l87.28172,87.28171l0,123.43654l-87.28172,87.28172l-123.43653,0l-87.28172,-87.28172l0,-123.43654z",
52
+ "decagon": "m1,150.00093l28.45646,-88.40318l74.49956,-54.63682l92.08794,0l74.50002,54.63682l28.45599,88.40318l-28.45599,88.40318l-74.50002,54.63681l-92.08794,0l-74.49956,-54.63681l-28.45646,-88.40318z",
53
+ "dodecagon": "m1,110.07421l39.92579,-69.14842l69.14842,-39.92579l79.85159,0l69.14842,39.92579l39.92578,69.14842l0,79.85159l-39.92578,69.14842l-69.14842,39.92578l-79.85159,0l-69.14842,-39.92578l-39.92579,-69.14842l0,-79.85159z",
54
+ "star_points_5": "m1,116.58409l113.82668,0l35.17332,-108.13487l35.17334,108.13487l113.82666,0l-92.08755,66.83026l35.17514,108.13487l-92.08759,-66.83208l-92.08757,66.83208l35.17515,-108.13487l-92.08758,-66.83026z",
55
+ "trapezoid": "m1,299l55.875,-298l186.25001,0l55.87498,298z",
56
+ "arrow_up": "m1.49805,149.64304l148.50121,-148.00241l148.50121,148.00241l-74.25061,0l0,148.71457l-148.5012,0l0,-148.71457z",
57
+ "vertical_scrool": "m37.375,261.625l0,-242.9375l0,0c0,-10.32083 8.36669,-18.6875 18.6875,-18.6875l224.25,0c10.32083,0 18.6875,8.36667 18.6875,18.6875c0,10.32081 -8.36667,18.6875 -18.6875,18.6875l-18.6875,0l0,242.9375c0,10.32083 -8.36668,18.6875 -18.6875,18.6875l-224.25,0l0,0c-10.32083,0 -18.6875,-8.36667 -18.6875,-18.6875c0,-10.32083 8.36667,-18.6875 18.6875,-18.6875zm37.375,-261.625l0,0c10.32081,0 18.6875,8.36667 18.6875,18.6875c0,10.32081 -8.36669,18.6875 -18.6875,18.6875c-5.1604,0 -9.34375,-4.18335 -9.34375,-9.34375c0,-5.16041 4.18335,-9.34375 9.34375,-9.34375l18.6875,0m186.875,18.6875l-205.5625,0m-37.375,224.25l0,0c5.1604,0 9.34375,4.18335 9.34375,9.34375c0,5.1604 -4.18335,9.34375 -9.34375,9.34375l18.6875,0m-18.6875,18.6875l0,0c10.32081,0 18.6875,-8.36667 18.6875,-18.6875l0,-18.6875",
58
+ "smiley": "m68.49886,214.78838q81.06408,55.67332 161.93891,0m-144.36983,-109.9558c0,-8.60432 6.97517,-15.57949 15.57948,-15.57949c8.60431,0 15.57948,6.97517 15.57948,15.57949c0,8.60431 -6.97517,15.57947 -15.57948,15.57947c-8.60431,0 -15.57948,-6.97516 -15.57948,-15.57947m95.83109,0c0,-8.60432 6.97517,-15.57949 15.57948,-15.57949c8.60431,0 15.57947,6.97517 15.57947,15.57949c0,8.60431 -6.97516,15.57947 -15.57947,15.57947c-8.60429,0 -15.57948,-6.97516 -15.57948,-15.57947m-181.89903,44.73038l0,0c0,-82.60133 66.96162,-149.56296 149.56296,-149.56296c82.60135,0 149.56296,66.96162 149.56296,149.56296c0,82.60135 -66.96161,149.56296 -149.56296,149.56296c-82.60133,0 -149.56296,-66.96161 -149.56296,-149.56296zm0,0l0,0c0,-82.60133 66.96162,-149.56296 149.56296,-149.56296c82.60135,0 149.56296,66.96162 149.56296,149.56296c0,82.60135 -66.96161,149.56296 -149.56296,149.56296c-82.60133,0 -149.56296,-66.96161 -149.56296,-149.56296z",
59
+ "left_braket": "m174.24565,298.5c-13.39009,0 -24.24489,-1.80908 -24.24489,-4.04065l0,-140.4187c0,-2.23158 -10.85481,-4.04065 -24.2449,-4.04065l0,0c13.39009,0 24.2449,-1.80907 24.2449,-4.04065l0,-140.4187l0,0c0,-2.23159 10.8548,-4.04066 24.24489,-4.04066",
60
+ "uml_actor": "m40.5,100l219,0m-108.99991,94.00006l107,105m-107.00009,-106.00006l-100,106m99.5,-231l0,125m33.24219,-158.75781c0,18.35916 -14.88303,33.24219 -33.24219,33.24219c-18.35916,0 -33.2422,-14.88303 -33.2422,-33.24219c0.00002,-18.35915 14.88304,-33.24219 33.2422,-33.24219c18.35916,0 33.24219,14.88304 33.24219,33.24219z",
61
+ "dialog_balloon_1": "m0.99786,35.96579l0,0c0,-19.31077 15.28761,-34.96524 34.14583,-34.96524l15.52084,0l0,0l74.50001,0l139.68748,0c9.05606,0 17.74118,3.68382 24.14478,10.24108c6.40356,6.55726 10.00107,15.45081 10.00107,24.72416l0,87.41311l0,0l0,52.44785l0,0c0,19.31078 -15.2876,34.96524 -34.14584,34.96524l-139.68748,0l-97.32507,88.90848l22.82506,-88.90848l-15.52084,0c-18.85822,0 -34.14583,-15.65446 -34.14583,-34.96524l0,0l0,-52.44785l0,0z",
62
+ "cloud": "m182.05086,34.31005c-0.64743,0.02048 -1.27309,0.07504 -1.92319,0.13979c-10.40161,1.03605 -19.58215,7.63722 -24.24597,17.4734l-2.47269,7.44367c0.53346,-2.57959 1.35258,-5.08134 2.47269,-7.44367c-8.31731,-8.61741 -19.99149,-12.59487 -31.52664,-10.72866c-11.53516,1.8662 -21.55294,9.3505 -27.02773,20.19925c-15.45544,-9.51897 -34.72095,-8.94245 -49.62526,1.50272c-14.90431,10.44516 -22.84828,28.93916 -20.43393,47.59753l1.57977,7.58346c-0.71388,-2.48442 -1.24701,-5.01186 -1.57977,-7.58346l-0.2404,0.69894c-12.95573,1.4119 -23.58103,11.46413 -26.34088,24.91708c-2.75985,13.45294 2.9789,27.25658 14.21789,34.21291l17.54914,4.26352c-6.1277,0.50439 -12.24542,-0.9808 -17.54914,-4.26352c-8.66903,9.71078 -10.6639,24.08736 -4.94535,35.96027c5.71854,11.87289 17.93128,18.70935 30.53069,17.15887l7.65843,-2.02692c-2.46413,1.0314 -5.02329,1.70264 -7.65843,2.02692c7.15259,13.16728 19.01251,22.77237 32.93468,26.5945c13.92217,3.82214 28.70987,1.56322 41.03957,-6.25546c10.05858,15.86252 27.91113,24.19412 45.81322,21.38742c17.90208,-2.8067 32.66954,-16.26563 37.91438,-34.52742l1.82016,-10.20447c-0.27254,3.46677 -0.86394,6.87508 -1.82016,10.20447c12.31329,8.07489 27.80199,8.52994 40.52443,1.18819c12.72244,-7.34175 20.6609,-21.34155 20.77736,-36.58929l-4.56108,-22.7823l-17.96776,-15.41455c13.89359,8.70317 22.6528,21.96329 22.52884,38.19685c16.5202,0.17313 30.55292,-13.98268 36.84976,-30.22897c6.29684,-16.24631 3.91486,-34.76801 -6.2504,-48.68089c4.21637,-10.35873 3.96622,-22.14172 -0.68683,-32.29084c-4.65308,-10.14912 -13.23602,-17.69244 -23.55914,-20.65356c-2.31018,-13.45141 -11.83276,-24.27162 -24.41768,-27.81765c-12.58492,-3.54603 -25.98557,0.82654 -34.41142,11.25287l-5.11707,8.63186c1.30753,-3.12148 3.01521,-6.03101 5.11707,-8.63186c-5.93959,-8.19432 -15.2556,-12.8181 -24.96718,-12.51096z",
63
+ "cylinder": "m299.0007,83.77844c0,18.28676 -66.70958,33.11111 -149.00002,33.11111m149.00002,-33.11111l0,0c0,18.28676 -66.70958,33.11111 -149.00002,33.11111c-82.29041,0 -148.99997,-14.82432 -148.99997,-33.11111m0,0l0,0c0,-18.28674 66.70956,-33.1111 148.99997,-33.1111c82.29044,0 149.00002,14.82436 149.00002,33.1111l0,132.44449c0,18.28674 -66.70958,33.11105 -149.00002,33.11105c-82.29041,0 -148.99997,-14.82431 -148.99997,-33.11105z",
64
+ "arrow_u_turn": "m1.00059,299.00055l0,-167.62497l0,0c0,-72.00411 58.37087,-130.37499 130.375,-130.37499l0,0l0,0c34.57759,0 67.73898,13.7359 92.18906,38.18595c24.45006,24.45005 38.18593,57.61144 38.18593,92.18904l0,18.625l37.24997,0l-74.49995,74.50002l-74.50002,-74.50002l37.25,0l0,-18.625c0,-30.8589 -25.0161,-55.87498 -55.87498,-55.87498l0,0l0,0c-30.85892,0 -55.875,25.01608 -55.875,55.87498l0,167.62497z",
65
+ "arrow_left_up": "m0.99865,224.5l74.50004,-74.5l0,37.25l111.74991,0l0,-111.75l-37.25,0l74.5,-74.5l74.5,74.5l-37.25,0l0,186.25l-186.24989,0l0,37.25l-74.50005,-74.5z",
66
+ "maximize": "m1.00037,150.34581l55.30305,-55.30267l0,27.65093l22.17356,0l0,-44.21833l44.21825,0l0,-22.17357l-27.65095,0l55.30267,-55.30292l55.3035,55.30292l-27.65175,0l0,22.17357l44.21835,0l0,44.21833l22.17357,0l0,-27.65093l55.30345,55.30267l-55.30345,55.3035l0,-27.65175l-22.17357,0l0,44.21834l-44.21835,0l0,22.17355l27.65175,0l-55.3035,55.30348l-55.30267,-55.30348l27.65095,0l0,-22.17355l-44.21825,0l0,-44.21834l-22.17356,0l0,27.65175l-55.30305,-55.3035z",
67
+ "cross": "m0.99844,99.71339l98.71494,0l0,-98.71495l101.26279,0l0,98.71495l98.71495,0l0,101.2628l-98.71495,0l0,98.71494l-101.26279,0l0,-98.71494l-98.71494,0z",
68
+ "plaque": "m-0.00197,49.94376l0,0c27.5829,0 49.94327,-22.36036 49.94327,-49.94327l199.76709,0l0,0c0,27.5829 22.36037,49.94327 49.94325,49.94327l0,199.7671l0,0c-27.58289,0 -49.94325,22.36034 -49.94325,49.94325l-199.76709,0c0,-27.58292 -22.36037,-49.94325 -49.94327,-49.94325z",
69
+ "page": "m249.3298,298.99744l9.9335,-39.73413l39.73413,-9.93355l-49.66763,49.66768l-248.33237,0l0,-298.00001l298.00001,0l0,248.33234"
70
+
71
+ },
72
+ buttons: []
73
+ }
74
+ };
75
+
76
+ var cur_lib = library.basic;
77
+
78
+ var mode_id = 'shapelib';
79
+
80
+ function loadIcons() {
81
+ $('#shape_buttons').empty();
82
+
83
+ // Show lib ones
84
+ $('#shape_buttons').append(cur_lib.buttons);
85
+ }
86
+
87
+ function loadLibrary(cat_id) {
88
+
89
+ var lib = library[cat_id];
90
+
91
+ if(!lib) {
92
+ $('#shape_buttons').html('Loading...');
93
+ $.getJSON('extensions/shapelib/' + cat_id + '.json', function(result, textStatus) {
94
+ cur_lib = library[cat_id] = {
95
+ data: result.data,
96
+ size: result.size,
97
+ fill: result.fill
98
+ }
99
+ makeButtons(cat_id, result);
100
+ loadIcons();
101
+ });
102
+ return;
103
+ }
104
+
105
+ cur_lib = lib;
106
+ if(!lib.buttons.length) makeButtons(cat_id, lib);
107
+ loadIcons();
108
+ }
109
+
110
+ function makeButtons(cat, shapes) {
111
+ var size = cur_lib.size || 300;
112
+ var fill = cur_lib.fill || false;
113
+ var off = size * .05;
114
+ var vb = [-off, -off, size + off*2, size + off*2].join(' ');
115
+ var stroke = fill ? 0: (size/30);
116
+
117
+ var shape_icon = new DOMParser().parseFromString(
118
+ '<svg xmlns="http://www.w3.org/2000/svg"><svg viewBox="' + vb + '"><path fill="'+(fill?'#333':'none')+'" stroke="#000000" stroke-width="' + stroke + '" /><\/svg><\/svg>',
119
+ 'text/xml');
120
+
121
+ var width = 24;
122
+ var height = 24;
123
+ shape_icon.documentElement.setAttribute('width', width);
124
+ shape_icon.documentElement.setAttribute('height', height);
125
+ var svg_elem = $(document.importNode(shape_icon.documentElement,true));
126
+
127
+ var data = shapes.data;
128
+
129
+ cur_lib.buttons = [];
130
+
131
+ for(var id in data) {
132
+ var path_d = data[id];
133
+ var icon = svg_elem.clone();
134
+ icon.find('path').attr('d', path_d);
135
+
136
+ var icon_btn = icon.wrap('<div class="tool_button">').parent().attr({
137
+ id: mode_id + '_' + id,
138
+ title: id
139
+ });
140
+
141
+
142
+ // Store for later use
143
+ cur_lib.buttons.push(icon_btn[0]);
144
+ }
145
+
146
+ }
147
+
148
+
149
+ return {
150
+ svgicons: "/assets/svg-edit-2.6/extensions/ext-shapes.xml",
151
+ buttons: [{
152
+ id: "tool_shapelib",
153
+ type: "mode_flyout", // _flyout
154
+ position: 6,
155
+ title: "Shape library",
156
+ events: {
157
+ "click": function() {
158
+ canv.setMode(mode_id);
159
+ }
160
+ }
161
+ }],
162
+ callback: function() {
163
+
164
+ $('<style>').text('\
165
+ #shape_buttons {\
166
+ overflow: auto;\
167
+ width: 180px;\
168
+ max-height: 300px;\
169
+ display: table-cell;\
170
+ vertical-align: middle;\
171
+ }\
172
+ \
173
+ #shape_cats {\
174
+ min-width: 110px;\
175
+ display: table-cell;\
176
+ vertical-align: middle;\
177
+ height: 300px;\
178
+ }\
179
+ #shape_cats > div {\
180
+ line-height: 1em;\
181
+ padding: .5em;\
182
+ border:1px solid #B0B0B0;\
183
+ background: #E8E8E8;\
184
+ margin-bottom: -1px;\
185
+ }\
186
+ #shape_cats div:hover {\
187
+ background: #FFFFCC;\
188
+ }\
189
+ #shape_cats div.current {\
190
+ font-weight: bold;\
191
+ }').appendTo('head');
192
+
193
+
194
+ var btn_div = $('<div id="shape_buttons">');
195
+ $('#tools_shapelib > *').wrapAll(btn_div);
196
+
197
+ var shower = $('#tools_shapelib_show');
198
+
199
+
200
+ loadLibrary('basic');
201
+
202
+ // Do mouseup on parent element rather than each button
203
+ $('#shape_buttons').mouseup(function(evt) {
204
+ var btn = $(evt.target).closest('div.tool_button');
205
+
206
+ if(!btn.length) return;
207
+
208
+ var copy = btn.children().clone();
209
+ shower.children(':not(.flyout_arrow_horiz)').remove();
210
+ shower
211
+ .append(copy)
212
+ .attr('data-curopt', '#' + btn[0].id) // This sets the current mode
213
+ .mouseup();
214
+ canv.setMode(mode_id);
215
+
216
+ cur_shape_id = btn[0].id.substr((mode_id+'_').length);
217
+ current_d = cur_lib.data[cur_shape_id];
218
+
219
+ $('.tools_flyout').fadeOut();
220
+
221
+ });
222
+
223
+ //
224
+ var shape_cats = $('<div id="shape_cats">');
225
+
226
+ var cat_str = '';
227
+
228
+ $.each(categories, function(id, label) {
229
+ cat_str += '<div data-cat=' + id + '>' + label + '</div>';
230
+ });
231
+
232
+ shape_cats.html(cat_str).children().bind('mouseup', function() {
233
+ var catlink = $(this);
234
+ catlink.siblings().removeClass('current');
235
+ catlink.addClass('current');
236
+
237
+ loadLibrary(catlink.attr('data-cat'));
238
+ // Get stuff
239
+
240
+ return false;
241
+ });
242
+
243
+ shape_cats.children().eq(0).addClass('current');
244
+
245
+ $('#tools_shapelib').append(shape_cats);
246
+
247
+ shower.mouseup(function() {
248
+ canv.setMode(current_d ? mode_id : 'select');
249
+ });
250
+
251
+
252
+ $('#tool_shapelib').remove();
253
+
254
+ var h = $('#tools_shapelib').height();
255
+ $('#tools_shapelib').css({
256
+ 'margin-top': -(h/2 - 15),
257
+ 'margin-left': 3
258
+ });
259
+
260
+
261
+ },
262
+ mouseDown: function(opts) {
263
+ var mode = canv.getMode();
264
+ if(mode !== mode_id) return;
265
+
266
+ var e = opts.event;
267
+ var x = start_x = opts.start_x;
268
+ var y = start_y = opts.start_y;
269
+ var cur_style = canv.getStyle();
270
+
271
+ cur_shape = canv.addSvgElementFromJson({
272
+ "element": "path",
273
+ "curStyles": true,
274
+ "attr": {
275
+ "d": current_d,
276
+ "id": canv.getNextId(),
277
+ "opacity": cur_style.opacity / 2,
278
+ "style": "pointer-events:none"
279
+ }
280
+ });
281
+
282
+ // Make sure shape uses absolute values
283
+ if(/[a-z]/.test(current_d)) {
284
+ current_d = cur_lib.data[cur_shape_id] = canv.pathActions.convertPath(cur_shape);
285
+ cur_shape.setAttribute('d', current_d);
286
+ canv.pathActions.fixEnd(cur_shape);
287
+ }
288
+
289
+ cur_shape.setAttribute('transform', "translate(" + x + "," + y + ") scale(0.005) translate(" + -x + "," + -y + ")");
290
+
291
+ // console.time('b');
292
+ canv.recalculateDimensions(cur_shape);
293
+
294
+ var tlist = canv.getTransformList(cur_shape);
295
+
296
+ lastBBox = cur_shape.getBBox();
297
+
298
+ return {
299
+ started: true
300
+ }
301
+ // current_d
302
+ },
303
+ mouseMove: function(opts) {
304
+ var mode = canv.getMode();
305
+ if(mode !== mode_id) return;
306
+
307
+ var zoom = canv.getZoom();
308
+ var evt = opts.event
309
+
310
+ var x = opts.mouse_x/zoom;
311
+ var y = opts.mouse_y/zoom;
312
+
313
+ var tlist = canv.getTransformList(cur_shape),
314
+ box = cur_shape.getBBox(),
315
+ left = box.x, top = box.y, width = box.width,
316
+ height = box.height;
317
+ var dx = (x-start_x), dy = (y-start_y);
318
+
319
+ var newbox = {
320
+ 'x': Math.min(start_x,x),
321
+ 'y': Math.min(start_y,y),
322
+ 'width': Math.abs(x-start_x),
323
+ 'height': Math.abs(y-start_y)
324
+ };
325
+
326
+ var ts = null,
327
+ tx = 0, ty = 0,
328
+ sy = height ? (height+dy)/height : 1,
329
+ sx = width ? (width+dx)/width : 1;
330
+
331
+ var sx = newbox.width / lastBBox.width;
332
+ var sy = newbox.height / lastBBox.height;
333
+
334
+ sx = sx || 1;
335
+ sy = sy || 1;
336
+
337
+ // Not perfect, but mostly works...
338
+ if(x < start_x) {
339
+ tx = lastBBox.width;
340
+ }
341
+ if(y < start_y) ty = lastBBox.height;
342
+
343
+ // update the transform list with translate,scale,translate
344
+ var translateOrigin = svgroot.createSVGTransform(),
345
+ scale = svgroot.createSVGTransform(),
346
+ translateBack = svgroot.createSVGTransform();
347
+
348
+ translateOrigin.setTranslate(-(left+tx), -(top+ty));
349
+ if(!evt.shiftKey) {
350
+ var max = Math.min(Math.abs(sx), Math.abs(sy));
351
+
352
+ sx = max * (sx < 0 ? -1 : 1);
353
+ sy = max * (sy < 0 ? -1 : 1);
354
+ }
355
+ scale.setScale(sx,sy);
356
+
357
+ translateBack.setTranslate(left+tx, top+ty);
358
+ var N = tlist.numberOfItems;
359
+ tlist.appendItem(translateBack);
360
+ tlist.appendItem(scale);
361
+ tlist.appendItem(translateOrigin);
362
+
363
+ canv.recalculateDimensions(cur_shape);
364
+
365
+ lastBBox = cur_shape.getBBox();
366
+ },
367
+ mouseUp: function(opts) {
368
+ var mode = canv.getMode();
369
+ if(mode !== mode_id) return;
370
+
371
+ if(opts.mouse_x == start_x && opts.mouse_y == start_y) {
372
+ return {
373
+ keep: false,
374
+ element: cur_shape,
375
+ started: false
376
+ }
377
+ }
378
+
379
+ return {
380
+ keep: true,
381
+ element: cur_shape,
382
+ started: false
383
+ }
384
+ }
385
+ }
386
+ });
387
+