sketchily 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/app/assets/javascripts/sketchily.js +10 -10
- data/app/assets/javascripts/sketchily.js~ +10 -2
- data/app/assets/javascripts/{base64.js → sketchily/base64.js} +0 -0
- data/app/assets/javascripts/sketchily_embed.js +2 -2
- data/app/assets/javascripts/sketchily_embed.js~ +1 -4
- data/app/assets/stylesheets/sketchily.css +4 -4
- data/app/assets/stylesheets/sketchily.css~ +3 -2
- data/app/helpers/sketchily_helper.rb +1 -3
- data/app/helpers/sketchily_helper.rb~ +1 -1
- data/app/views/sketchily/_embed.html.erb +1 -1
- data/app/views/sketchily/_embed.html.erb~ +0 -1
- data/lib/sketchily.rb +1 -1
- data/lib/sketchily.rb~ +2 -2
- data/lib/sketchily/version.rb +1 -1
- data/lib/sketchily/version.rb~ +1 -1
- data/spec/dummy/log/test.log +120 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1bf464000fcdb546c383cf7f69d46662 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/23e9024449d6fb482717441645b0cd8c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2dda36ccc70570f77ad22a659af00a7e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/413a1ea244e0c08b931057c16bfe0bc2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/56a18313459a66878cdaf82c4915f8f5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e839e441b04ffc4a0f153b037b0c69b2 +0 -0
- data/vendor/assets/{svg-edit-2.6/browser-not-supported.html~ → javascripts/svg-edit-2.6/browser-not-supported.html} +3 -3
- data/vendor/assets/{svg-edit-2.6/browser-not-supported.html → javascripts/svg-edit-2.6/browser-not-supported.html~} +1 -1
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/browser.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/canvg/canvg.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/canvg/rgbcolor.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/contextmenu.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/contextmenu/jquery.contextMenu.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/draw.js +0 -0
- data/vendor/assets/{svg-edit-2.6/embedapi.html~ → javascripts/svg-edit-2.6/embedapi.html} +1 -1
- data/vendor/assets/{svg-edit-2.6/embedapi.html → javascripts/svg-edit-2.6/embedapi.html~} +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/embedapi.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/closepath_icons.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-arrows.js +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-closepath.js +92 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-closepath.js → javascripts/svg-edit-2.6/extensions/ext-closepath.js~} +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-connector.js +587 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-connector.js → javascripts/svg-edit-2.6/extensions/ext-connector.js~} +1 -1
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-eyedropper.js +109 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-eyedropper.js → javascripts/svg-edit-2.6/extensions/ext-eyedropper.js~} +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-foreignobject.js +277 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-foreignobject.js → javascripts/svg-edit-2.6/extensions/ext-foreignobject.js~} +0 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-grid.js~ → javascripts/svg-edit-2.6/extensions/ext-grid.js} +2 -2
- data/vendor/assets/{svg-edit-2.6/extensions/ext-grid.js → javascripts/svg-edit-2.6/extensions/ext-grid.js~} +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-helloworld.js +78 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-helloworld.js → javascripts/svg-edit-2.6/extensions/ext-helloworld.js~} +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-imagelib.js +2 -2
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-imagelib.js~ +1 -1
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-imagelib.xml +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-markers.js +572 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-markers.js → javascripts/svg-edit-2.6/extensions/ext-markers.js~} +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-server_moinsave.js +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-server_opensave.js +180 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-server_opensave.js → javascripts/svg-edit-2.6/extensions/ext-server_opensave.js~} +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/ext-shapes.js +387 -0
- data/vendor/assets/{svg-edit-2.6/extensions/ext-shapes.js → javascripts/svg-edit-2.6/extensions/ext-shapes.js~} +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/ext-shapes.xml +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/eyedropper-icon.xml +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/eyedropper.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/fileopen.php +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/filesave.php +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/foreignobject-icons.xml +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/grid-icon.xml +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/helloworld-icon.xml +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/extensions/imagelib/index.html +64 -0
- data/vendor/assets/{svg-edit-2.6/extensions/imagelib/index.html → javascripts/svg-edit-2.6/extensions/imagelib/index.html~} +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/imagelib/smiley.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/markers-icons.xml +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/animal.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/arrow.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/dialog_balloon.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/electronics.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/flowchart.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/game.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/math.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/misc.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/music.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/object.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/raphael.txt +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/raphael_1.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/raphael_2.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/extensions/shapelib/symbol.json +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/history.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/README.txt +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-bottom.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-bottom.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-center.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-center.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-left.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-left.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-middle.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-middle.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-right.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-right.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-top.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/align-top.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/bold.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/cancel.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/circle.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/clear.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/clone.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/conn.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/copy.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/cut.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/delete.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/document-properties.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/dropdown.gif +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/ellipse.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/eye.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/fhpath.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/flyouth.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/flyup.gif +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/freehand-circle.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/freehand-square.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/go-down.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/go-up.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/image.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/italic.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/line.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/link_controls.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/logo.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/logo.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/move_bottom.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/move_top.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/node_clone.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/node_delete.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/none.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/open.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/paste.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/path.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/polygon.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/polygon.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/rect.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/redo.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/reorient.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/rotate.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/save.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/select.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/select_node.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/sep.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/shape_group.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/shape_ungroup.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/source.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/spinbtn_updn_big.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/square.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/svg_edit_icons.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/svg_edit_icons.svgz +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/text.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/text.svg +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/to_path.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/undo.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/view-refresh.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/wave.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/wireframe.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/images/zoom.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/LICENSE +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/README +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/css/jPicker.css +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/css/jgraduate.css +3 -3
- data/vendor/assets/javascripts/svg-edit-2.6/jgraduate/css/jgraduate.css~ +351 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/AlphaBar.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/Bars.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/Maps.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/NoColor.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/bar-opacity.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/map-opacity.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/mappoint.gif +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/mappoint_c.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/mappoint_f.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/picker.gif +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/preview-opacity.png +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/rangearrows.gif +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/images/rangearrows2.gif +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jpicker.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jpicker.min.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jquery.jgraduate.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jgraduate/jquery.jgraduate.min.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquery-ui/jquery-ui-1.8.17.custom.min.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquery-ui/jquery-ui-1.8.custom.min.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquery.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/jquerybbq/jquery.bbq.min.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/js-hotkeys/README.md +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/js-hotkeys/jquery.hotkeys.min.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/README.txt +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.af.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ar.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.az.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.be.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.bg.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ca.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.cs.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.cy.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.da.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.de.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.el.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.en.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.es.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.et.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fa.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fi.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fr.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.fy.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ga.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.gl.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.he.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hi.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hr.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hu.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.hy.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.id.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.is.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.it.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ja.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ko.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.lt.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.lv.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.mk.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ms.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.mt.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.nl.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.no.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.pl.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.pt-BR.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.pt-PT.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ro.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ro.js~ +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.ru.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sk.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sl.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sq.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sr.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sv.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.sw.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.test.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.th.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.tl.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.tr.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.uk.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.vi.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.yi.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.zh-CN.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.zh-HK.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/lang.zh-TW.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/locale/locale.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/math.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/path.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/sanitize.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/select.js +0 -0
- data/vendor/assets/{svg-edit-2.6/spinbtn/JQuerySpinBtn.css~ → javascripts/svg-edit-2.6/spinbtn/JQuerySpinBtn.css} +1 -1
- data/vendor/assets/{svg-edit-2.6/spinbtn/JQuerySpinBtn.css → javascripts/svg-edit-2.6/spinbtn/JQuerySpinBtn.css~} +1 -1
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/spinbtn/JQuerySpinBtn.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/spinbtn/JQuerySpinBtn.min.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/spinbtn/spinbtn_updn.png +0 -0
- data/vendor/assets/javascripts/svg-edit-2.6/svg-editor.css +1494 -0
- data/vendor/assets/{svg-edit-2.6/svg-editor.css → javascripts/svg-edit-2.6/svg-editor.css~} +0 -0
- data/vendor/assets/{svg-edit-2.6/svg-editor.html~ → javascripts/svg-edit-2.6/svg-editor.html} +1 -2
- data/vendor/assets/{svg-edit-2.6/svg-editor.html → javascripts/svg-edit-2.6/svg-editor.html~} +0 -0
- data/vendor/assets/{svg-edit-2.6/svg-editor.js~ → javascripts/svg-edit-2.6/svg-editor.js} +9 -9
- data/vendor/assets/{svg-edit-2.6/svg-editor.js → javascripts/svg-edit-2.6/svg-editor.js~} +4 -4
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svg-editor.manifest +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgcanvas.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgcanvas.js~ +0 -0
- data/vendor/assets/{svg-edit-2.6/svgedit.compiled.js~ → javascripts/svg-edit-2.6/svgedit.compiled.js} +4 -4
- data/vendor/assets/{svg-edit-2.6/svgedit.compiled.js → javascripts/svg-edit-2.6/svgedit.compiled.js~} +2 -2
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgicons/jquery.svgicons.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgtransformlist.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/svgutils.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/touch.js +0 -0
- data/vendor/assets/{svg-edit-2.6 → javascripts/svg-edit-2.6}/units.js +0 -0
- metadata +259 -254
@@ -0,0 +1,109 @@
|
|
1
|
+
/*
|
2
|
+
* ext-eyedropper.js
|
3
|
+
*
|
4
|
+
* Licensed under the MIT License
|
5
|
+
*
|
6
|
+
* Copyright(c) 2010 Jeff Schiller
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
// Dependencies:
|
11
|
+
// 1) jQuery
|
12
|
+
// 2) history.js
|
13
|
+
// 3) svg_editor.js
|
14
|
+
// 4) svgcanvas.js
|
15
|
+
|
16
|
+
svgEditor.addExtension("eyedropper", function(S) {
|
17
|
+
var svgcontent = S.svgcontent,
|
18
|
+
svgns = "http://www.w3.org/2000/svg",
|
19
|
+
svgdoc = S.svgroot.parentNode.ownerDocument,
|
20
|
+
svgCanvas = svgEditor.canvas,
|
21
|
+
ChangeElementCommand = svgedit.history.ChangeElementCommand,
|
22
|
+
addToHistory = function(cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); },
|
23
|
+
currentStyle = {fillPaint: "red", fillOpacity: 1.0,
|
24
|
+
strokePaint: "black", strokeOpacity: 1.0,
|
25
|
+
strokeWidth: 5, strokeDashArray: null,
|
26
|
+
opacity: 1.0,
|
27
|
+
strokeLinecap: 'butt',
|
28
|
+
strokeLinejoin: 'miter',
|
29
|
+
};
|
30
|
+
|
31
|
+
function getStyle(opts) {
|
32
|
+
// if we are in eyedropper mode, we don't want to disable the eye-dropper tool
|
33
|
+
var mode = svgCanvas.getMode();
|
34
|
+
if (mode == "eyedropper") return;
|
35
|
+
|
36
|
+
var elem = null;
|
37
|
+
var tool = $('#tool_eyedropper');
|
38
|
+
// enable-eye-dropper if one element is selected
|
39
|
+
if (!opts.multiselected && opts.elems[0] &&
|
40
|
+
$.inArray(opts.elems[0].nodeName, ['svg', 'g', 'use']) == -1)
|
41
|
+
{
|
42
|
+
elem = opts.elems[0];
|
43
|
+
tool.removeClass('disabled');
|
44
|
+
// grab the current style
|
45
|
+
currentStyle.fillPaint = elem.getAttribute("fill") || "black";
|
46
|
+
currentStyle.fillOpacity = elem.getAttribute("fill-opacity") || 1.0;
|
47
|
+
currentStyle.strokePaint = elem.getAttribute("stroke");
|
48
|
+
currentStyle.strokeOpacity = elem.getAttribute("stroke-opacity") || 1.0;
|
49
|
+
currentStyle.strokeWidth = elem.getAttribute("stroke-width");
|
50
|
+
currentStyle.strokeDashArray = elem.getAttribute("stroke-dasharray");
|
51
|
+
currentStyle.strokeLinecap = elem.getAttribute("stroke-linecap");
|
52
|
+
currentStyle.strokeLinejoin = elem.getAttribute("stroke-linejoin");
|
53
|
+
currentStyle.opacity = elem.getAttribute("opacity") || 1.0;
|
54
|
+
}
|
55
|
+
// disable eye-dropper tool
|
56
|
+
else {
|
57
|
+
tool.addClass('disabled');
|
58
|
+
}
|
59
|
+
|
60
|
+
}
|
61
|
+
|
62
|
+
return {
|
63
|
+
name: "eyedropper",
|
64
|
+
svgicons: "/assets/svg-edit-2.6/extensions/eyedropper-icon.xml",
|
65
|
+
buttons: [{
|
66
|
+
id: "tool_eyedropper",
|
67
|
+
type: "mode",
|
68
|
+
title: "Eye Dropper Tool",
|
69
|
+
key: "I",
|
70
|
+
events: {
|
71
|
+
"click": function() {
|
72
|
+
svgCanvas.setMode("eyedropper");
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}],
|
76
|
+
|
77
|
+
// if we have selected an element, grab its paint and enable the eye dropper button
|
78
|
+
selectedChanged: getStyle,
|
79
|
+
elementChanged: getStyle,
|
80
|
+
|
81
|
+
mouseDown: function(opts) {
|
82
|
+
var mode = svgCanvas.getMode();
|
83
|
+
if (mode == "eyedropper") {
|
84
|
+
var e = opts.event;
|
85
|
+
var target = e.target;
|
86
|
+
if ($.inArray(target.nodeName, ['svg', 'g', 'use']) == -1) {
|
87
|
+
var changes = {};
|
88
|
+
|
89
|
+
var change = function(elem, attrname, newvalue) {
|
90
|
+
changes[attrname] = elem.getAttribute(attrname);
|
91
|
+
elem.setAttribute(attrname, newvalue);
|
92
|
+
};
|
93
|
+
|
94
|
+
if (currentStyle.fillPaint) change(target, "fill", currentStyle.fillPaint);
|
95
|
+
if (currentStyle.fillOpacity) change(target, "fill-opacity", currentStyle.fillOpacity);
|
96
|
+
if (currentStyle.strokePaint) change(target, "stroke", currentStyle.strokePaint);
|
97
|
+
if (currentStyle.strokeOpacity) change(target, "stroke-opacity", currentStyle.strokeOpacity);
|
98
|
+
if (currentStyle.strokeWidth) change(target, "stroke-width", currentStyle.strokeWidth);
|
99
|
+
if (currentStyle.strokeDashArray) change(target, "stroke-dasharray", currentStyle.strokeDashArray);
|
100
|
+
if (currentStyle.opacity) change(target, "opacity", currentStyle.opacity);
|
101
|
+
if (currentStyle.strokeLinecap) change(target, "stroke-linecap", currentStyle.strokeLinecap);
|
102
|
+
if (currentStyle.strokeLinejoin) change(target, "stroke-linejoin", currentStyle.strokeLinejoin);
|
103
|
+
|
104
|
+
addToHistory(new ChangeElementCommand(target, changes));
|
105
|
+
}
|
106
|
+
}
|
107
|
+
},
|
108
|
+
};
|
109
|
+
});
|
File without changes
|
@@ -0,0 +1,277 @@
|
|
1
|
+
/*
|
2
|
+
* ext-foreignobject.js
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2
|
5
|
+
*
|
6
|
+
* Copyright(c) 2010 Jacques Distler
|
7
|
+
* Copyright(c) 2010 Alexis Deveria
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
|
11
|
+
svgEditor.addExtension("foreignObject", function(S) {
|
12
|
+
var svgcontent = S.svgcontent,
|
13
|
+
addElem = S.addSvgElementFromJson,
|
14
|
+
selElems,
|
15
|
+
svgns = "http://www.w3.org/2000/svg",
|
16
|
+
xlinkns = "http://www.w3.org/1999/xlink",
|
17
|
+
xmlns = "http://www.w3.org/XML/1998/namespace",
|
18
|
+
xmlnsns = "http://www.w3.org/2000/xmlns/",
|
19
|
+
se_ns = "http://svg-edit.googlecode.com",
|
20
|
+
htmlns = "http://www.w3.org/1999/xhtml",
|
21
|
+
mathns = "http://www.w3.org/1998/Math/MathML",
|
22
|
+
editingforeign = false,
|
23
|
+
svgdoc = S.svgroot.parentNode.ownerDocument,
|
24
|
+
started,
|
25
|
+
newFO;
|
26
|
+
|
27
|
+
|
28
|
+
var properlySourceSizeTextArea = function(){
|
29
|
+
// TODO: remove magic numbers here and get values from CSS
|
30
|
+
var height = $('#svg_source_container').height() - 80;
|
31
|
+
$('#svg_source_textarea').css('height', height);
|
32
|
+
};
|
33
|
+
|
34
|
+
function showPanel(on) {
|
35
|
+
var fc_rules = $('#fc_rules');
|
36
|
+
if(!fc_rules.length) {
|
37
|
+
fc_rules = $('<style id="fc_rules"><\/style>').appendTo('head');
|
38
|
+
}
|
39
|
+
fc_rules.text(!on?"":" #tool_topath { display: none !important; }");
|
40
|
+
$('#foreignObject_panel').toggle(on);
|
41
|
+
}
|
42
|
+
|
43
|
+
function toggleSourceButtons(on) {
|
44
|
+
$('#tool_source_save, #tool_source_cancel').toggle(!on);
|
45
|
+
$('#foreign_save, #foreign_cancel').toggle(on);
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
// Function: setForeignString(xmlString, elt)
|
50
|
+
// This function sets the content of element elt to the input XML.
|
51
|
+
//
|
52
|
+
// Parameters:
|
53
|
+
// xmlString - The XML text.
|
54
|
+
// elt - the parent element to append to
|
55
|
+
//
|
56
|
+
// Returns:
|
57
|
+
// This function returns false if the set was unsuccessful, true otherwise.
|
58
|
+
function setForeignString(xmlString) {
|
59
|
+
var elt = selElems[0];
|
60
|
+
try {
|
61
|
+
// convert string into XML document
|
62
|
+
var newDoc = Utils.text2xml('<svg xmlns="'+svgns+'" xmlns:xlink="'+xlinkns+'">'+xmlString+'</svg>');
|
63
|
+
// run it through our sanitizer to remove anything we do not support
|
64
|
+
S.sanitizeSvg(newDoc.documentElement);
|
65
|
+
elt.parentNode.replaceChild(svgdoc.importNode(newDoc.documentElement.firstChild, true), elt);
|
66
|
+
S.call("changed", [elt]);
|
67
|
+
svgCanvas.clearSelection();
|
68
|
+
} catch(e) {
|
69
|
+
console.log(e);
|
70
|
+
return false;
|
71
|
+
}
|
72
|
+
|
73
|
+
return true;
|
74
|
+
};
|
75
|
+
|
76
|
+
function showForeignEditor() {
|
77
|
+
var elt = selElems[0];
|
78
|
+
if (!elt || editingforeign) return;
|
79
|
+
editingforeign = true;
|
80
|
+
toggleSourceButtons(true);
|
81
|
+
elt.removeAttribute('fill');
|
82
|
+
|
83
|
+
var str = S.svgToString(elt, 0);
|
84
|
+
$('#svg_source_textarea').val(str);
|
85
|
+
$('#svg_source_editor').fadeIn();
|
86
|
+
properlySourceSizeTextArea();
|
87
|
+
$('#svg_source_textarea').focus();
|
88
|
+
}
|
89
|
+
|
90
|
+
function setAttr(attr, val) {
|
91
|
+
svgCanvas.changeSelectedAttribute(attr, val);
|
92
|
+
S.call("changed", selElems);
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
return {
|
97
|
+
name: "foreignObject",
|
98
|
+
svgicons: "/assets/svg-edit-2.6/extensions/foreignobject-icons.xml",
|
99
|
+
buttons: [{
|
100
|
+
id: "tool_foreign",
|
101
|
+
type: "mode",
|
102
|
+
title: "Foreign Object Tool",
|
103
|
+
events: {
|
104
|
+
'click': function() {
|
105
|
+
svgCanvas.setMode('foreign')
|
106
|
+
}
|
107
|
+
}
|
108
|
+
},{
|
109
|
+
id: "edit_foreign",
|
110
|
+
type: "context",
|
111
|
+
panel: "foreignObject_panel",
|
112
|
+
title: "Edit ForeignObject Content",
|
113
|
+
events: {
|
114
|
+
'click': function() {
|
115
|
+
showForeignEditor();
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}],
|
119
|
+
|
120
|
+
context_tools: [{
|
121
|
+
type: "input",
|
122
|
+
panel: "foreignObject_panel",
|
123
|
+
title: "Change foreignObject's width",
|
124
|
+
id: "foreign_width",
|
125
|
+
label: "w",
|
126
|
+
size: 3,
|
127
|
+
events: {
|
128
|
+
change: function() {
|
129
|
+
setAttr('width', this.value);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
},{
|
133
|
+
type: "input",
|
134
|
+
panel: "foreignObject_panel",
|
135
|
+
title: "Change foreignObject's height",
|
136
|
+
id: "foreign_height",
|
137
|
+
label: "h",
|
138
|
+
events: {
|
139
|
+
change: function() {
|
140
|
+
setAttr('height', this.value);
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}, {
|
144
|
+
type: "input",
|
145
|
+
panel: "foreignObject_panel",
|
146
|
+
title: "Change foreignObject's font size",
|
147
|
+
id: "foreign_font_size",
|
148
|
+
label: "font-size",
|
149
|
+
size: 2,
|
150
|
+
defval: 16,
|
151
|
+
events: {
|
152
|
+
change: function() {
|
153
|
+
setAttr('font-size', this.value);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
|
159
|
+
],
|
160
|
+
callback: function() {
|
161
|
+
$('#foreignObject_panel').hide();
|
162
|
+
|
163
|
+
var endChanges = function() {
|
164
|
+
$('#svg_source_editor').hide();
|
165
|
+
editingforeign = false;
|
166
|
+
$('#svg_source_textarea').blur();
|
167
|
+
toggleSourceButtons(false);
|
168
|
+
}
|
169
|
+
|
170
|
+
// TODO: Needs to be done after orig icon loads
|
171
|
+
setTimeout(function() {
|
172
|
+
// Create source save/cancel buttons
|
173
|
+
var save = $('#tool_source_save').clone()
|
174
|
+
.hide().attr('id', 'foreign_save').unbind()
|
175
|
+
.appendTo("#tool_source_back").click(function() {
|
176
|
+
|
177
|
+
if (!editingforeign) return;
|
178
|
+
|
179
|
+
if (!setForeignString($('#svg_source_textarea').val())) {
|
180
|
+
$.confirm("Errors found. Revert to original?", function(ok) {
|
181
|
+
if(!ok) return false;
|
182
|
+
endChanges();
|
183
|
+
});
|
184
|
+
} else {
|
185
|
+
endChanges();
|
186
|
+
}
|
187
|
+
// setSelectMode();
|
188
|
+
});
|
189
|
+
|
190
|
+
var cancel = $('#tool_source_cancel').clone()
|
191
|
+
.hide().attr('id', 'foreign_cancel').unbind()
|
192
|
+
.appendTo("#tool_source_back").click(function() {
|
193
|
+
endChanges();
|
194
|
+
});
|
195
|
+
|
196
|
+
}, 3000);
|
197
|
+
},
|
198
|
+
mouseDown: function(opts) {
|
199
|
+
var e = opts.event;
|
200
|
+
|
201
|
+
if(svgCanvas.getMode() == "foreign") {
|
202
|
+
|
203
|
+
started = true;
|
204
|
+
newFO = S.addSvgElementFromJson({
|
205
|
+
"element": "foreignObject",
|
206
|
+
"attr": {
|
207
|
+
"x": opts.start_x,
|
208
|
+
"y": opts.start_y,
|
209
|
+
"id": S.getNextId(),
|
210
|
+
"font-size": 16, //cur_text.font_size,
|
211
|
+
"width": "48",
|
212
|
+
"height": "20",
|
213
|
+
"style": "pointer-events:inherit"
|
214
|
+
}
|
215
|
+
});
|
216
|
+
var m = svgdoc.createElementNS(mathns, 'math');
|
217
|
+
m.setAttributeNS(xmlnsns, 'xmlns', mathns);
|
218
|
+
m.setAttribute('display', 'inline');
|
219
|
+
var mi = svgdoc.createElementNS(mathns, 'mi');
|
220
|
+
mi.setAttribute('mathvariant', 'normal');
|
221
|
+
mi.textContent = "\u03A6";
|
222
|
+
var mo = svgdoc.createElementNS(mathns, 'mo');
|
223
|
+
mo.textContent = "\u222A";
|
224
|
+
var mi2 = svgdoc.createElementNS(mathns, 'mi');
|
225
|
+
mi2.textContent = "\u2133";
|
226
|
+
m.appendChild(mi);
|
227
|
+
m.appendChild(mo);
|
228
|
+
m.appendChild(mi2);
|
229
|
+
newFO.appendChild(m);
|
230
|
+
return {
|
231
|
+
started: true
|
232
|
+
}
|
233
|
+
}
|
234
|
+
},
|
235
|
+
mouseUp: function(opts) {
|
236
|
+
var e = opts.event;
|
237
|
+
if(svgCanvas.getMode() == "foreign" && started) {
|
238
|
+
var attrs = $(newFO).attr(["width", "height"]);
|
239
|
+
keep = (attrs.width != 0 || attrs.height != 0);
|
240
|
+
svgCanvas.addToSelection([newFO], true);
|
241
|
+
|
242
|
+
return {
|
243
|
+
keep: keep,
|
244
|
+
element: newFO
|
245
|
+
}
|
246
|
+
|
247
|
+
}
|
248
|
+
|
249
|
+
},
|
250
|
+
selectedChanged: function(opts) {
|
251
|
+
// Use this to update the current selected elements
|
252
|
+
selElems = opts.elems;
|
253
|
+
|
254
|
+
var i = selElems.length;
|
255
|
+
|
256
|
+
while(i--) {
|
257
|
+
var elem = selElems[i];
|
258
|
+
if(elem && elem.tagName == "foreignObject") {
|
259
|
+
if(opts.selectedElement && !opts.multiselected) {
|
260
|
+
$('#foreign_font_size').val(elem.getAttribute("font-size"));
|
261
|
+
$('#foreign_width').val(elem.getAttribute("width"));
|
262
|
+
$('#foreign_height').val(elem.getAttribute("height"));
|
263
|
+
|
264
|
+
showPanel(true);
|
265
|
+
} else {
|
266
|
+
showPanel(false);
|
267
|
+
}
|
268
|
+
} else {
|
269
|
+
showPanel(false);
|
270
|
+
}
|
271
|
+
}
|
272
|
+
},
|
273
|
+
elementChanged: function(opts) {
|
274
|
+
var elem = opts.elems[0];
|
275
|
+
}
|
276
|
+
};
|
277
|
+
});
|
File without changes
|
@@ -59,7 +59,7 @@ svgEditor.addExtension("view_grid", function(s) {
|
|
59
59
|
});
|
60
60
|
|
61
61
|
gridPattern.appendChild(gridimg);
|
62
|
-
$('#
|
62
|
+
$('#canvasGrid').append(gridPattern);
|
63
63
|
|
64
64
|
// grid-box
|
65
65
|
var gridBox = svgdoc.createElementNS(svgns, "rect");
|
@@ -151,7 +151,7 @@ svgEditor.addExtension("view_grid", function(s) {
|
|
151
151
|
|
152
152
|
return {
|
153
153
|
name: "view_grid",
|
154
|
-
svgicons: "/assets/extensions/grid-icon.xml",
|
154
|
+
svgicons: "/assets/svg-edit-2.6/extensions/grid-icon.xml",
|
155
155
|
|
156
156
|
zoomChanged: function(zoom) {
|
157
157
|
// update size
|
File without changes
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/*
|
2
|
+
* ext-helloworld.js
|
3
|
+
*
|
4
|
+
* Licensed under the MIT License
|
5
|
+
*
|
6
|
+
* Copyright(c) 2010 Alexis Deveria
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
/*
|
11
|
+
This is a very basic SVG-Edit extension. It adds a "Hello World" button in
|
12
|
+
the left panel. Clicking on the button, and then the canvas will show the
|
13
|
+
user the point on the canvas that was clicked on.
|
14
|
+
*/
|
15
|
+
|
16
|
+
svgEditor.addExtension("Hello World", function() {
|
17
|
+
|
18
|
+
return {
|
19
|
+
name: "Hello World",
|
20
|
+
// For more notes on how to make an icon file, see the source of
|
21
|
+
// the hellorworld-icon.xml
|
22
|
+
svgicons: "/assets/svg-edit-2.6/extensions/helloworld-icon.xml",
|
23
|
+
|
24
|
+
// Multiple buttons can be added in this array
|
25
|
+
buttons: [{
|
26
|
+
// Must match the icon ID in helloworld-icon.xml
|
27
|
+
id: "hello_world",
|
28
|
+
|
29
|
+
// This indicates that the button will be added to the "mode"
|
30
|
+
// button panel on the left side
|
31
|
+
type: "mode",
|
32
|
+
|
33
|
+
// Tooltip text
|
34
|
+
title: "Say 'Hello World'",
|
35
|
+
|
36
|
+
// Events
|
37
|
+
events: {
|
38
|
+
'click': function() {
|
39
|
+
// The action taken when the button is clicked on.
|
40
|
+
// For "mode" buttons, any other button will
|
41
|
+
// automatically be de-pressed.
|
42
|
+
svgCanvas.setMode("hello_world");
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}],
|
46
|
+
// This is triggered when the main mouse button is pressed down
|
47
|
+
// on the editor canvas (not the tool panels)
|
48
|
+
mouseDown: function() {
|
49
|
+
// Check the mode on mousedown
|
50
|
+
if(svgCanvas.getMode() == "hello_world") {
|
51
|
+
|
52
|
+
// The returned object must include "started" with
|
53
|
+
// a value of true in order for mouseUp to be triggered
|
54
|
+
return {started: true};
|
55
|
+
}
|
56
|
+
},
|
57
|
+
|
58
|
+
// This is triggered from anywhere, but "started" must have been set
|
59
|
+
// to true (see above). Note that "opts" is an object with event info
|
60
|
+
mouseUp: function(opts) {
|
61
|
+
// Check the mode on mouseup
|
62
|
+
if(svgCanvas.getMode() == "hello_world") {
|
63
|
+
var zoom = svgCanvas.getZoom();
|
64
|
+
|
65
|
+
// Get the actual coordinate by dividing by the zoom value
|
66
|
+
var x = opts.mouse_x / zoom;
|
67
|
+
var y = opts.mouse_y / zoom;
|
68
|
+
|
69
|
+
var text = "Hello World!\n\nYou clicked here: "
|
70
|
+
+ x + ", " + y;
|
71
|
+
|
72
|
+
// Show the text using the custom alert function
|
73
|
+
$.alert(text);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
};
|
77
|
+
});
|
78
|
+
|