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
@@ -23,7 +23,7 @@ svgEditor.addExtension("imagelib", function() {
23
23
 
24
24
  var img_libs = [/*{
25
25
  name: 'Demo library (local)',
26
- url: '/assets/extensions/imagelib/index.html',
26
+ url: '/assets/svg-edit-2.6/extensions/imagelib/index.html',
27
27
  description: 'Demonstration library for SVG-edit on this server'
28
28
  },*/
29
29
  {
@@ -359,7 +359,7 @@ svgEditor.addExtension("imagelib", function() {
359
359
  }
360
360
 
361
361
  return {
362
- svgicons: "/assets/extensions/ext-imagelib.xml",
362
+ svgicons: "/assets/svg-edit-2.6/extensions/ext-imagelib.xml",
363
363
  buttons: [{
364
364
  id: "tool_imagelib",
365
365
  type: "app_menu", // _flyout
@@ -359,7 +359,7 @@ svgEditor.addExtension("imagelib", function() {
359
359
  }
360
360
 
361
361
  return {
362
- svgicons: "/assets/extensions/ext-imagelib.xml",
362
+ svgicons: "/assets/svg-edit-2.6/extensions/ext-imagelib.xml",
363
363
  buttons: [{
364
364
  id: "tool_imagelib",
365
365
  type: "app_menu", // _flyout
@@ -0,0 +1,572 @@
1
+ /*
2
+ * ext-markers.js
3
+ *
4
+ * Licensed under the Apache License, Version 2
5
+ *
6
+ * Copyright(c) 2010 Will Schleter
7
+ * based on ext-arrows.js by Copyright(c) 2010 Alexis Deveria
8
+ *
9
+ * This extension provides for the addition of markers to the either end
10
+ * or the middle of a line, polyline, path, polygon.
11
+ *
12
+ * Markers may be either a graphic or arbitary text
13
+ *
14
+ * to simplify the coding and make the implementation as robust as possible,
15
+ * markers are not shared - every object has its own set of markers.
16
+ * this relationship is maintained by a naming convention between the
17
+ * ids of the markers and the ids of the object
18
+ *
19
+ * The following restrictions exist for simplicty of use and programming
20
+ * objects and their markers to have the same color
21
+ * marker size is fixed
22
+ * text marker font, size, and attributes are fixed
23
+ * an application specific attribute - se_type - is added to each marker element
24
+ * to store the type of marker
25
+ *
26
+ * TODO:
27
+ * remove some of the restrictions above
28
+ * add option for keeping text aligned to horizontal
29
+ * add support for dimension extension lines
30
+ *
31
+ */
32
+
33
+ svgEditor.addExtension("Markers", function(S) {
34
+ var svgcontent = S.svgcontent,
35
+ addElem = S.addSvgElementFromJson,
36
+ selElems;
37
+
38
+ var mtypes = ['start','mid','end'];
39
+
40
+ var marker_prefix = 'se_marker_';
41
+ var id_prefix = 'mkr_';
42
+
43
+ // note - to add additional marker types add them below with a unique id
44
+ // and add the associated icon(s) to marker-icons.svg
45
+ // the geometry is normallized to a 100x100 box with the origin at lower left
46
+ // Safari did not like negative values for low left of viewBox
47
+ // remember that the coordinate system has +y downward
48
+ var marker_types = {
49
+ nomarker: {},
50
+ leftarrow:
51
+ {element:'path', attr:{d:'M0,50 L100,90 L70,50 L100,10 Z'}},
52
+ rightarrow:
53
+ {element:'path', attr:{d:'M100,50 L0,90 L30,50 L0,10 Z'}},
54
+ textmarker:
55
+ {element:'text', attr: {x:0, y:0,'stroke-width':0,'stroke':'none','font-size':75,'font-family':'serif','text-anchor':'left',
56
+ 'xml:space': 'preserve'}},
57
+ forwardslash:
58
+ {element:'path', attr:{d:'M30,100 L70,0'}},
59
+ reverseslash:
60
+ {element:'path', attr:{d:'M30,0 L70,100'}},
61
+ verticalslash:
62
+ {element:'path', attr:{d:'M50,0 L50,100'}},
63
+ box:
64
+ {element:'path', attr:{d:'M20,20 L20,80 L80,80 L80,20 Z'}},
65
+ star:
66
+ {element:'path', attr:{d:'M10,30 L90,30 L20,90 L50,10 L80,90 Z'}},
67
+ xmark:
68
+ {element:'path', attr:{d:'M20,80 L80,20 M80,80 L20,20'}},
69
+ triangle:
70
+ {element:'path', attr:{d:'M10,80 L50,20 L80,80 Z'}},
71
+ mcircle:
72
+ {element:'circle', attr:{r:30, cx:50, cy:50}},
73
+ }
74
+
75
+
76
+ var lang_list = {
77
+ "en":[
78
+ {id: "start_marker_list", title: "Select start marker type" },
79
+ {id: "mid_marker_list", title: "Select mid marker type" },
80
+ {id: "end_marker_list", title: "Select end marker type" },
81
+ {id: "nomarker", title: "No Marker" },
82
+ {id: "leftarrow", title: "Left Arrow" },
83
+ {id: "rightarrow", title: "Right Arrow" },
84
+ {id: "textmarker", title: "Text Marker" },
85
+ {id: "forwardslash", title: "Forward Slash" },
86
+ {id: "reverseslash", title: "Reverse Slash" },
87
+ {id: "verticalslash", title: "Vertical Slash" },
88
+ {id: "box", title: "Box" },
89
+ {id: "star", title: "Star" },
90
+ {id: "xmark", title: "X" },
91
+ {id: "triangle", title: "Triangle" },
92
+ {id: "mcircle", title: "Circle" },
93
+ {id: "leftarrow_o", title: "Open Left Arrow" },
94
+ {id: "rightarrow_o", title: "Open Right Arrow" },
95
+ {id: "box_o", title: "Open Box" },
96
+ {id: "star_o", title: "Open Star" },
97
+ {id: "triangle_o", title: "Open Triangle" },
98
+ {id: "mcircle_o", title: "Open Circle" },
99
+ ]
100
+ };
101
+
102
+
103
+ // duplicate shapes to support unfilled (open) marker types with an _o suffix
104
+ $.each(['leftarrow','rightarrow','box','star','mcircle','triangle'],function(i,v) {
105
+ marker_types[v+'_o'] = marker_types[v];
106
+ });
107
+
108
+ // elem = a graphic element will have an attribute like marker-start
109
+ // attr - marker-start, marker-mid, or marker-end
110
+ // returns the marker element that is linked to the graphic element
111
+ function getLinked(elem, attr) {
112
+ var str = elem.getAttribute(attr);
113
+ if(!str) return null;
114
+ var m = str.match(/\(\#(.*)\)/);
115
+ if(!m || m.length !== 2) {
116
+ return null;
117
+ }
118
+ return S.getElem(m[1]);
119
+ }
120
+
121
+ //toggles context tool panel off/on
122
+ //sets the controls with the selected element's settings
123
+ function showPanel(on) {
124
+ $('#marker_panel').toggle(on);
125
+
126
+ if(on) {
127
+ var el = selElems[0];
128
+ var val;
129
+ var ci;
130
+
131
+ $.each(mtypes, function(i, pos) {
132
+ var m=getLinked(el,"marker-"+pos);
133
+ var txtbox = $('#'+pos+'_marker');
134
+ if (!m) {
135
+ val='\\nomarker';
136
+ ci=val;
137
+ txtbox.hide() // hide text box
138
+ } else {
139
+ if (!m.attributes.se_type) return; // not created by this extension
140
+ val='\\'+m.attributes.se_type.textContent;
141
+ ci=val;
142
+ if (val=='\\textmarker') {
143
+ val=m.lastChild.textContent;
144
+ //txtbox.show(); // show text box
145
+ } else {
146
+ txtbox.hide() // hide text box
147
+ }
148
+ }
149
+ txtbox.val(val);
150
+ setIcon(pos,ci);
151
+ })
152
+ }
153
+ }
154
+
155
+ function addMarker(id, val) {
156
+ var txt_box_bg = '#ffffff';
157
+ var txt_box_border = 'none';
158
+ var txt_box_stroke_width = 0;
159
+
160
+ var marker = S.getElem(id);
161
+
162
+ if (marker) return;
163
+
164
+ if (val=='' || val=='\\nomarker') return;
165
+
166
+ var el = selElems[0];
167
+ var color = el.getAttribute('stroke');
168
+ //NOTE: Safari didn't like a negative value in viewBox
169
+ //so we use a standardized 0 0 100 100
170
+ //with 50 50 being mapped to the marker position
171
+ var refX = 50;
172
+ var refY = 50;
173
+ var viewBox = "0 0 100 100";
174
+ var markerWidth = 5;
175
+ var markerHeight = 5;
176
+ var strokeWidth = 10;
177
+ if (val.substr(0,1)=='\\') se_type=val.substr(1);
178
+ else se_type='textmarker';
179
+
180
+ if (!marker_types[se_type]) return; // an unknown type!
181
+
182
+ // create a generic marker
183
+ marker = addElem({
184
+ "element": "marker",
185
+ "attr": {
186
+ "id": id,
187
+ "markerUnits": "strokeWidth",
188
+ "orient": "auto",
189
+ "style": "pointer-events:none",
190
+ "se_type": se_type
191
+ }
192
+ });
193
+
194
+ if (se_type!='textmarker') {
195
+ var mel = addElem(marker_types[se_type]);
196
+ var fillcolor = color;
197
+ if (se_type.substr(-2)=='_o') fillcolor='none';
198
+ mel.setAttribute('fill',fillcolor);
199
+ mel.setAttribute('stroke',color);
200
+ mel.setAttribute('stroke-width',strokeWidth);
201
+ marker.appendChild(mel);
202
+ } else {
203
+ var text = addElem(marker_types[se_type]);
204
+ // have to add text to get bounding box
205
+ text.textContent = val;
206
+ var tb=text.getBBox();
207
+ //alert( tb.x + " " + tb.y + " " + tb.width + " " + tb.height);
208
+ var pad=1;
209
+ var bb = tb;
210
+ bb.x = 0;
211
+ bb.y = 0;
212
+ bb.width += pad*2;
213
+ bb.height += pad*2;
214
+ // shift text according to its size
215
+ text.setAttribute('x', pad);
216
+ text.setAttribute('y', bb.height - pad - tb.height/4); // kludge?
217
+ text.setAttribute('fill',color);
218
+ refX = bb.width/2+pad;
219
+ refY = bb.height/2+pad;
220
+ viewBox = bb.x + " " + bb.y + " " + bb.width + " " + bb.height;
221
+ markerWidth =bb.width/10;
222
+ markerHeight = bb.height/10;
223
+
224
+ var box = addElem({
225
+ "element": "rect",
226
+ "attr": {
227
+ "x": bb.x,
228
+ "y": bb.y,
229
+ "width": bb.width,
230
+ "height": bb.height,
231
+ "fill": txt_box_bg,
232
+ "stroke": txt_box_border,
233
+ "stroke-width": txt_box_stroke_width
234
+ }
235
+ });
236
+ marker.setAttribute("orient",0);
237
+ marker.appendChild(box);
238
+ marker.appendChild(text);
239
+ }
240
+
241
+ marker.setAttribute("viewBox",viewBox);
242
+ marker.setAttribute("markerWidth", markerWidth);
243
+ marker.setAttribute("markerHeight", markerHeight);
244
+ marker.setAttribute("refX", refX);
245
+ marker.setAttribute("refY", refY);
246
+ S.findDefs().appendChild(marker);
247
+
248
+ return marker;
249
+ }
250
+
251
+
252
+ function setMarker() {
253
+ var poslist={'start_marker':'start','mid_marker':'mid','end_marker':'end'};
254
+ var pos = poslist[this.id];
255
+ var marker_name = 'marker-'+pos;
256
+ var val = this.value;
257
+ var el = selElems[0];
258
+ var marker = getLinked(el, marker_name);
259
+ if (marker) $(marker).remove();
260
+ el.removeAttribute(marker_name);
261
+ if (val=='') val='\\nomarker';
262
+ if (val=='\\nomarker') {
263
+ setIcon(pos,val);
264
+ S.call("changed", selElems);
265
+ return;
266
+ }
267
+ // Set marker on element
268
+ var id = marker_prefix + pos + '_' + el.id;
269
+ addMarker(id, val);
270
+ svgCanvas.changeSelectedAttribute(marker_name, "url(#" + id + ")");
271
+ if (el.tagName == "line" && pos=='mid') el=convertline(el);
272
+ S.call("changed", selElems);
273
+ setIcon(pos,val);
274
+ }
275
+
276
+ function convertline(elem) {
277
+ // this routine came from the connectors extension
278
+ // it is needed because midpoint markers don't work with line elements
279
+ if (!(elem.tagName == "line")) return elem;
280
+
281
+ // Convert to polyline to accept mid-arrow
282
+
283
+ var x1 = elem.getAttribute('x1')-0;
284
+ var x2 = elem.getAttribute('x2')-0;
285
+ var y1 = elem.getAttribute('y1')-0;
286
+ var y2 = elem.getAttribute('y2')-0;
287
+ var id = elem.id;
288
+
289
+ var mid_pt = (' '+((x1+x2)/2)+','+((y1+y2)/2) + ' ');
290
+ var pline = addElem({
291
+ "element": "polyline",
292
+ "attr": {
293
+ "points": (x1+','+y1+ mid_pt +x2+','+y2),
294
+ "stroke": elem.getAttribute('stroke'),
295
+ "stroke-width": elem.getAttribute('stroke-width'),
296
+ "fill": "none",
297
+ "opacity": elem.getAttribute('opacity') || 1
298
+ }
299
+ });
300
+ $.each(mtypes, function(i, pos) { // get any existing marker definitions
301
+ var nam = 'marker-'+pos;
302
+ var m = elem.getAttribute(nam);
303
+ if (m) pline.setAttribute(nam,elem.getAttribute(nam));
304
+ });
305
+
306
+ var batchCmd = new S.BatchCommand();
307
+ batchCmd.addSubCommand(new S.RemoveElementCommand(elem, elem.parentNode));
308
+ batchCmd.addSubCommand(new S.InsertElementCommand(pline));
309
+
310
+ $(elem).after(pline).remove();
311
+ svgCanvas.clearSelection();
312
+ pline.id = id;
313
+ svgCanvas.addToSelection([pline]);
314
+ S.addCommandToHistory(batchCmd);
315
+ return pline;
316
+ }
317
+
318
+ // called when the main system modifies an object
319
+ // this routine changes the associated markers to be the same color
320
+ function colorChanged(elem) {
321
+ var color = elem.getAttribute('stroke');
322
+
323
+ $.each(mtypes, function(i, pos) {
324
+ var marker = getLinked(elem, 'marker-'+pos);
325
+ if (!marker) return;
326
+ if (!marker.attributes.se_type) return; //not created by this extension
327
+ var ch = marker.lastElementChild;
328
+ if (!ch) return;
329
+ var curfill = ch.getAttribute("fill");
330
+ var curstroke = ch.getAttribute("stroke")
331
+ if (curfill && curfill!='none') ch.setAttribute("fill",color);
332
+ if (curstroke && curstroke!='none') ch.setAttribute("stroke",color);
333
+ });
334
+ }
335
+
336
+ // called when the main system creates or modifies an object
337
+ // primary purpose is create new markers for cloned objects
338
+ function updateReferences(el) {
339
+ $.each(mtypes, function (i,pos) {
340
+ var id = marker_prefix + pos + '_' + el.id;
341
+ var marker_name = 'marker-'+pos;
342
+ var marker = getLinked(el, marker_name);
343
+ if (!marker || !marker.attributes.se_type) return; //not created by this extension
344
+ var url = el.getAttribute(marker_name);
345
+ if (url) {
346
+ var len = el.id.length;
347
+ var linkid = url.substr(-len-1,len);
348
+ if (el.id != linkid) {
349
+ var val = $('#'+pos+'_marker').attr('value');
350
+ addMarker(id, val);
351
+ svgCanvas.changeSelectedAttribute(marker_name, "url(#" + id + ")");
352
+ if (el.tagName == "line" && pos=='mid') el=convertline(el);
353
+ S.call("changed", selElems);
354
+ }
355
+ }
356
+ });
357
+ }
358
+
359
+ // simulate a change event a text box that stores the current element's marker type
360
+ function triggerTextEntry(pos,val) {
361
+ $('#'+pos+'_marker').val(val);
362
+ $('#'+pos+'_marker').change();
363
+ var txtbox = $('#'+pos+'_marker');
364
+ //if (val.substr(0,1)=='\\') txtbox.hide();
365
+ //else txtbox.show();
366
+ }
367
+
368
+ function setIcon(pos,id) {
369
+ if (id.substr(0,1)!='\\') id='\\textmarker'
370
+ var ci = '#'+id_prefix+pos+'_'+id.substr(1);
371
+ svgEditor.setIcon('#cur_' + pos +'_marker_list', $(ci).children());
372
+ $(ci).addClass('current').siblings().removeClass('current');
373
+ }
374
+
375
+ function setMarkerSet(obj) {
376
+ var parts = this.id.split('_');
377
+ var set = parts[2];
378
+ switch (set) {
379
+ case 'off':
380
+ triggerTextEntry('start','\\nomarker');
381
+ triggerTextEntry('mid','\\nomarker');
382
+ triggerTextEntry('end','\\nomarker');
383
+ break;
384
+ case 'dimension':
385
+ triggerTextEntry('start','\\leftarrow');
386
+ triggerTextEntry('end','\\rightarrow');
387
+ showTextPrompt('mid');
388
+ break;
389
+ case 'label':
390
+ triggerTextEntry('mid','\\nomarker');
391
+ triggerTextEntry('end','\\rightarrow');
392
+ showTextPrompt('start');
393
+ break;
394
+ }
395
+ }
396
+
397
+ function showTextPrompt(pos) {
398
+ var def = $('#'+pos+'_marker').val();
399
+ if (def.substr(0,1)=='\\') def='';
400
+ $.prompt('Enter text for ' + pos + ' marker', def , function(txt) { if (txt) triggerTextEntry(pos,txt); });
401
+ }
402
+
403
+ // callback function for a toolbar button click
404
+ function setArrowFromButton(obj) {
405
+
406
+ var parts = this.id.split('_');
407
+ var pos = parts[1];
408
+ var val = parts[2];
409
+ if (parts[3]) val+='_'+parts[3];
410
+
411
+ if (val!='textmarker') {
412
+ triggerTextEntry(pos,'\\'+val);
413
+ } else {
414
+ showTextPrompt(pos);
415
+ }
416
+ }
417
+
418
+ function getTitle(lang,id) {
419
+ var list = lang_list[lang];
420
+ for (var i in list) {
421
+ if (list[i].id==id) return list[i].title;
422
+ }
423
+ return id;
424
+ }
425
+
426
+
427
+ // build the toolbar button array from the marker definitions
428
+ // TODO: need to incorporate language specific titles
429
+ function buildButtonList() {
430
+ var buttons=[];
431
+ var i=0;
432
+ /*
433
+ buttons.push({
434
+ id:id_prefix + 'markers_off',
435
+ title:'Turn off all markers',
436
+ type:'context',
437
+ events: { 'click': setMarkerSet },
438
+ panel: 'marker_panel'
439
+ });
440
+ buttons.push({
441
+ id:id_prefix + 'markers_dimension',
442
+ title:'Dimension',
443
+ type:'context',
444
+ events: { 'click': setMarkerSet },
445
+ panel: 'marker_panel'
446
+ });
447
+ buttons.push({
448
+ id:id_prefix + 'markers_label',
449
+ title:'Label',
450
+ type:'context',
451
+ events: { 'click': setMarkerSet },
452
+ panel: 'marker_panel'
453
+ });
454
+ */
455
+ $.each(mtypes,function(k,pos) {
456
+ var listname = pos + "_marker_list";
457
+ var def = true;
458
+ $.each(marker_types,function(id,v) {
459
+ var title = getTitle('en',id);
460
+ buttons.push({
461
+ id:id_prefix + pos + "_" + id,
462
+ svgicon:id,
463
+ title:title,
464
+ type:'context',
465
+ events: { 'click': setArrowFromButton },
466
+ panel:'marker_panel',
467
+ list: listname,
468
+ isDefault: def
469
+ });
470
+ def = false;
471
+ });
472
+ });
473
+ return buttons;
474
+ }
475
+
476
+ return {
477
+ name: "Markers",
478
+ svgicons: "/assets/svg-edit-2.6/extensions/markers-icons.xml",
479
+ buttons: buildButtonList(),
480
+ context_tools: [
481
+ {
482
+ type: "input",
483
+ panel: "marker_panel",
484
+ title: "Start marker",
485
+ id: "start_marker",
486
+ label: "s",
487
+ size: 3,
488
+ events: { change: setMarker }
489
+ },{
490
+ type: "button-select",
491
+ panel: "marker_panel",
492
+ title: getTitle('en','start_marker_list'),
493
+ id: "start_marker_list",
494
+ colnum: 3,
495
+ events: { change: setArrowFromButton }
496
+ },{
497
+ type: "input",
498
+ panel: "marker_panel",
499
+ title: "Middle marker",
500
+ id: "mid_marker",
501
+ label: "m",
502
+ defval: "",
503
+ size: 3,
504
+ events: { change: setMarker }
505
+ },{
506
+ type: "button-select",
507
+ panel: "marker_panel",
508
+ title: getTitle('en','mid_marker_list'),
509
+ id: "mid_marker_list",
510
+ colnum: 3,
511
+ events: { change: setArrowFromButton }
512
+ },{
513
+ type: "input",
514
+ panel: "marker_panel",
515
+ title: "End marker",
516
+ id: "end_marker",
517
+ label: "e",
518
+ size: 3,
519
+ events: { change: setMarker }
520
+ },{
521
+ type: "button-select",
522
+ panel: "marker_panel",
523
+ title: getTitle('en','end_marker_list'),
524
+ id: "end_marker_list",
525
+ colnum: 3,
526
+ events: { change: setArrowFromButton }
527
+ } ],
528
+ callback: function() {
529
+ $('#marker_panel').addClass('toolset').hide();
530
+
531
+ },
532
+ addLangData: function(lang) {
533
+ return { data: lang_list[lang] };
534
+ },
535
+
536
+ selectedChanged: function(opts) {
537
+ // Use this to update the current selected elements
538
+ //console.log('selectChanged',opts);
539
+ selElems = opts.elems;
540
+
541
+ var i = selElems.length;
542
+ var marker_elems = ['line','path','polyline','polygon'];
543
+
544
+ while(i--) {
545
+ var elem = selElems[i];
546
+ if(elem && $.inArray(elem.tagName, marker_elems) != -1) {
547
+ if(opts.selectedElement && !opts.multiselected) {
548
+ showPanel(true);
549
+ } else {
550
+ showPanel(false);
551
+ }
552
+ } else {
553
+ showPanel(false);
554
+ }
555
+ }
556
+ },
557
+
558
+ elementChanged: function(opts) {
559
+ //console.log('elementChanged',opts);
560
+ var elem = opts.elems[0];
561
+ if(elem && (
562
+ elem.getAttribute("marker-start") ||
563
+ elem.getAttribute("marker-mid") ||
564
+ elem.getAttribute("marker-end")
565
+ )) {
566
+ colorChanged(elem);
567
+ updateReferences(elem);
568
+ }
569
+ changing_flag = false;
570
+ }
571
+ };
572
+ });