├── AUTHORS ├── CHANGES ├── LICENSE ├── Makefile ├── README ├── build └── tools │ ├── COPYING │ ├── README │ ├── closure-compiler.jar │ ├── ship.py │ └── yuicompressor.jar ├── chrome-app ├── icon_128.png └── manifest.json ├── clipart ├── moon.svg ├── star.svg └── sun.svg ├── docs ├── files │ └── svgcanvas-js.html ├── index.html ├── index │ ├── Files.html │ ├── Functions.html │ └── General.html ├── javascript │ ├── main.js │ └── searchdata.js ├── search │ ├── FilesS.html │ ├── FunctionsA.html │ ├── FunctionsC.html │ ├── FunctionsD.html │ ├── FunctionsG.html │ ├── FunctionsM.html │ ├── FunctionsO.html │ ├── FunctionsR.html │ ├── FunctionsS.html │ ├── GeneralA.html │ ├── GeneralC.html │ ├── GeneralD.html │ ├── GeneralF.html │ ├── GeneralG.html │ ├── GeneralL.html │ ├── GeneralM.html │ ├── GeneralO.html │ ├── GeneralR.html │ ├── GeneralS.html │ └── NoResults.html └── styles │ └── main.css ├── editor ├── browser-not-supported.html ├── browser.js ├── canvg │ ├── canvg.js │ └── rgbcolor.js ├── config-sample.js ├── contextmenu.js ├── contextmenu │ └── jquery.contextMenu.js ├── coords.js ├── draw.js ├── embedapi-dom.js ├── embedapi.html ├── embedapi.js ├── extensions │ ├── allowedMimeTypes.php │ ├── closepath_icons.svg │ ├── ext-arrows.js │ ├── ext-closepath.js │ ├── ext-connector.js │ ├── ext-eyedropper.js │ ├── ext-foreignobject.js │ ├── ext-grid.js │ ├── ext-helloworld.js │ ├── ext-imagelib.js │ ├── ext-imagelib.xml │ ├── ext-markers.js │ ├── ext-mathjax.js │ ├── ext-overview_window.js │ ├── ext-panning.js │ ├── ext-panning.xml │ ├── ext-php_savefile.js │ ├── ext-polygon.js │ ├── ext-server_moinsave.js │ ├── ext-server_opensave.js │ ├── ext-shapes.js │ ├── ext-shapes.xml │ ├── ext-star.js │ ├── ext-storage.js │ ├── ext-webappfind.js │ ├── ext-xdomain-messaging.js │ ├── eyedropper-icon.xml │ ├── eyedropper.png │ ├── fileopen.php │ ├── filesave.php │ ├── foreignobject-icons.xml │ ├── grid-icon.xml │ ├── helloworld-icon.xml │ ├── imagelib │ │ ├── index.html │ │ └── smiley.svg │ ├── markers-icons.xml │ ├── mathjax-icons.xml │ ├── polygon-icons.svg │ ├── savefile.php │ ├── shapelib │ │ ├── animal.json │ │ ├── arrow.json │ │ ├── dialog_balloon.json │ │ ├── electronics.json │ │ ├── flowchart.json │ │ ├── game.json │ │ ├── math.json │ │ ├── misc.json │ │ ├── music.json │ │ ├── object.json │ │ ├── raphael.txt │ │ ├── raphael_1.json │ │ ├── raphael_2.json │ │ └── symbol.json │ ├── star-icons.svg │ └── webappfind-icon.svg ├── history.js ├── images │ ├── README.txt │ ├── align-bottom.png │ ├── align-bottom.svg │ ├── align-center.png │ ├── align-center.svg │ ├── align-left.png │ ├── align-left.svg │ ├── align-middle.png │ ├── align-middle.svg │ ├── align-right.png │ ├── align-right.svg │ ├── align-top.png │ ├── align-top.svg │ ├── bold.png │ ├── cancel.png │ ├── circle.png │ ├── clear.png │ ├── clone.png │ ├── conn.svg │ ├── copy.png │ ├── cut.png │ ├── delete.png │ ├── document-properties.png │ ├── dropdown.gif │ ├── ellipse.png │ ├── eye.png │ ├── fhpath.png │ ├── flyouth.png │ ├── flyup.gif │ ├── freehand-circle.png │ ├── freehand-square.png │ ├── go-down.png │ ├── go-up.png │ ├── image.png │ ├── italic.png │ ├── line.png │ ├── link_controls.png │ ├── logo.png │ ├── logo.svg │ ├── move_bottom.png │ ├── move_top.png │ ├── node_clone.png │ ├── node_delete.png │ ├── none.png │ ├── open.png │ ├── paste.png │ ├── path.png │ ├── polygon.png │ ├── polygon.svg │ ├── rect.png │ ├── redo.png │ ├── reorient.png │ ├── rotate.png │ ├── save.png │ ├── select.png │ ├── select_node.png │ ├── sep.png │ ├── shape_group_elements.png │ ├── shape_ungroup.png │ ├── source.png │ ├── spinbtn_updn_big.png │ ├── square.png │ ├── svg_edit_icons.svg │ ├── svg_edit_icons.svgz │ ├── text.png │ ├── text.svg │ ├── to_path.png │ ├── undo.png │ ├── view-refresh.png │ ├── wave.png │ ├── wireframe.png │ └── zoom.png ├── jgraduate │ ├── LICENSE │ ├── README │ ├── css │ │ ├── jPicker.css │ │ └── jgraduate.css │ ├── images │ │ ├── AlphaBar.png │ │ ├── Bars.png │ │ ├── Maps.png │ │ ├── NoColor.png │ │ ├── bar-opacity.png │ │ ├── map-opacity.png │ │ ├── mappoint.gif │ │ ├── mappoint_c.png │ │ ├── mappoint_f.png │ │ ├── picker.gif │ │ ├── preview-opacity.png │ │ ├── rangearrows.gif │ │ └── rangearrows2.gif │ ├── jpicker.js │ ├── jpicker.min.js │ ├── jquery.jgraduate.js │ └── jquery.jgraduate.min.js ├── jquery-svg.js ├── jquery-ui │ ├── jquery-ui-1.8.17.custom.min.js │ └── jquery-ui-1.8.custom.min.js ├── jquery.js ├── jquerybbq │ └── jquery.bbq.min.js ├── js-hotkeys │ ├── README.md │ └── jquery.hotkeys.min.js ├── jspdf │ ├── jspdf.min.js │ ├── jspdf.plugin.svgToPdf.js │ └── underscore-min.js ├── locale │ ├── README.txt │ ├── lang.af.js │ ├── lang.ar.js │ ├── lang.az.js │ ├── lang.be.js │ ├── lang.bg.js │ ├── lang.ca.js │ ├── lang.cs.js │ ├── lang.cy.js │ ├── lang.da.js │ ├── lang.de.js │ ├── lang.el.js │ ├── lang.en.js │ ├── lang.es.js │ ├── lang.et.js │ ├── lang.fa.js │ ├── lang.fi.js │ ├── lang.fr.js │ ├── lang.fy.js │ ├── lang.ga.js │ ├── lang.gl.js │ ├── lang.he.js │ ├── lang.hi.js │ ├── lang.hr.js │ ├── lang.hu.js │ ├── lang.hy.js │ ├── lang.id.js │ ├── lang.is.js │ ├── lang.it.js │ ├── lang.ja.js │ ├── lang.ko.js │ ├── lang.lt.js │ ├── lang.lv.js │ ├── lang.mk.js │ ├── lang.ms.js │ ├── lang.mt.js │ ├── lang.nl.js │ ├── lang.no.js │ ├── lang.pl.js │ ├── lang.pt-BR.js │ ├── lang.pt-PT.js │ ├── lang.ro.js │ ├── lang.ru.js │ ├── lang.sk.js │ ├── lang.sl.js │ ├── lang.sq.js │ ├── lang.sr.js │ ├── lang.sv.js │ ├── lang.sw.js │ ├── lang.test.js │ ├── lang.th.js │ ├── lang.tl.js │ ├── lang.tr.js │ ├── lang.uk.js │ ├── lang.vi.js │ ├── lang.yi.js │ ├── lang.zh-CN.js │ ├── lang.zh-HK.js │ ├── lang.zh-TW.js │ └── locale.js ├── math.js ├── path.js ├── recalculate.js ├── sanitize.js ├── select.js ├── spinbtn │ ├── JQuerySpinBtn.css │ ├── JQuerySpinBtn.js │ ├── JQuerySpinBtn.min.js │ └── spinbtn_updn.png ├── svg-editor.css ├── svg-editor.html ├── svg-editor.js ├── svg-editor.manifest ├── svgcanvas.js ├── svgedit.js ├── svgicons │ └── jquery.svgicons.js ├── svgtransformlist.js ├── svgutils.js ├── touch.js └── units.js ├── examples ├── arbelos.svg └── mickey.svg ├── extras ├── tojson.py ├── topo.py └── update-langs.py ├── firefox-extension ├── chrome.manifest ├── content │ ├── svg-edit-overlay.css │ ├── svg-edit-overlay.js │ └── svg-edit-overlay.xul ├── handlers.js └── install.rdf ├── opera-widget ├── config.xml ├── handlers.js ├── index.html └── style.css ├── screencasts ├── svgedit-screencast-1.txt ├── svgedit-screencast-2.txt ├── svgedit-screencast-3.txt └── svgopen2010 │ ├── index.html │ ├── logo.svg │ ├── script.js │ └── style.css ├── test ├── all_tests.html ├── contextmenu_test.html ├── coords_test.html ├── draw_test.html ├── history_test.html ├── jquery-svg_test.html ├── math_test.html ├── path_test.html ├── qunit │ ├── qunit.css │ └── qunit.js ├── recalculate_test.html ├── sanitize_test.html ├── select_test.html ├── svgtransformlist_test.html ├── svgutils_test.html ├── test1.html └── units_test.html └── wave ├── json2.js ├── manifest.xml ├── svg-edit.xml └── wave.js /AUTHORS: -------------------------------------------------------------------------------- 1 | Narendra Sisodiya 2 | Pavol Rusnak 3 | Jeff Schiller 4 | Vidar Hokstad 5 | Alexis Deveria 6 | 7 | Translation credits: 8 | 9 | ar: Tarik Belaam (العربية) 10 | cs: Jan Ptacek (Čeština) 11 | de: Reimar Bauer (Deutsch) 12 | es: Alicia Puerto (Español) 13 | fa: Payman Delshad (فارسی) 14 | fr: wormsxulla (Français) 15 | fy: Wander Nauta (Frysk) 16 | hi: Tavish Naruka (हिन्दी) 17 | ja: Dong (日本語) 18 | nl: Jaap Blom (Nederlands) 19 | ro: Christian Tzurcanu (Româneşte) 20 | ru: Laurent Dufloux (Русский) 21 | sk: Pavol Rusnak (Slovenčina) 22 | zh-TW: 黃瀚生 (Han Sheng Huang) (台灣正體) 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2012 by SVG-edit authors (see AUTHORS file) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | NAME=svg-edit 2 | VERSION=2.7.1 3 | PACKAGE=$(NAME)-$(VERSION) 4 | MAKEDOCS=naturaldocs/NaturalDocs 5 | CLOSURE=build/tools/closure-compiler.jar 6 | ZIP=zip 7 | 8 | # All files that will be compiled by the Closure compiler. 9 | 10 | JS_FILES=\ 11 | svgedit.js \ 12 | jquery-svg.js \ 13 | contextmenu/jquery.contextmenu.js \ 14 | browser.js \ 15 | svgtransformlist.js \ 16 | math.js \ 17 | units.js \ 18 | svgutils.js \ 19 | sanitize.js \ 20 | history.js \ 21 | coords.js \ 22 | recalculate.js \ 23 | select.js \ 24 | draw.js \ 25 | path.js \ 26 | svgcanvas.js \ 27 | svg-editor.js \ 28 | locale/locale.js \ 29 | contextmenu.js 30 | 31 | JS_INPUT_FILES=$(addprefix editor/, $(JS_FILES)) 32 | JS_BUILD_FILES=$(addprefix build/$(PACKAGE)/, $(JS_FILES)) 33 | CLOSURE_JS_ARGS=$(addprefix --js , $(JS_INPUT_FILES)) 34 | COMPILED_JS=editor/svgedit.compiled.js 35 | 36 | all: release firefox opera 37 | 38 | # The build directory relies on the JS being compiled. 39 | build/$(PACKAGE): $(COMPILED_JS) 40 | rm -rf config 41 | mkdir config 42 | if [ -x $(MAKEDOCS) ] ; then $(MAKEDOCS) -i editor/ -o html docs/ -p config/ -oft -r ; fi 43 | 44 | # Make build directory and copy all editor contents into it 45 | mkdir -p build/$(PACKAGE) 46 | cp -r editor/* build/$(PACKAGE) 47 | 48 | # Remove all hidden .svn directories 49 | -find build/$(PACKAGE) -name .svn -type d | xargs rm -rf {} \; 50 | 51 | # Create the release version of the main HTML file. 52 | build/tools/ship.py --i=editor/svg-editor.html --on=svg_edit_release > build/$(PACKAGE)/svg-editor.html 53 | 54 | # NOTE: Some files are not ready for the Closure compiler: (jquery) 55 | # NOTE: Our code safely compiles under SIMPLE_OPTIMIZATIONS 56 | # NOTE: Our code is *not* ready for ADVANCED_OPTIMIZATIONS 57 | # NOTE: WHITESPACE_ONLY and --formatting PRETTY_PRINT is helpful for debugging. 58 | $(COMPILED_JS): 59 | java -jar $(CLOSURE) \ 60 | --compilation_level SIMPLE_OPTIMIZATIONS \ 61 | $(CLOSURE_JS_ARGS) \ 62 | --js_output_file $(COMPILED_JS) 63 | 64 | compile: $(COMPILED_JS) 65 | 66 | release: build/$(PACKAGE) 67 | cd build ; $(ZIP) $(PACKAGE).zip -r $(PACKAGE) ; cd .. 68 | tar -z -c -f build/$(PACKAGE)-src.tar.gz \ 69 | --exclude='\.svn' \ 70 | --exclude='build/*' \ 71 | . 72 | 73 | firefox: build/$(PACKAGE) 74 | mkdir -p build/firefox/content/editor 75 | cp -r firefox-extension/* build/firefox 76 | rm -rf build/firefox/content/.svn 77 | cp -r build/$(PACKAGE)/* build/firefox/content/editor 78 | rm -f build/firefox/content/editor/embedapi.js 79 | cd build/firefox ; $(ZIP) ../$(PACKAGE).xpi -r * ; cd ../.. 80 | 81 | opera: build/$(PACKAGE) 82 | mkdir -p build/opera/editor 83 | cp opera-widget/* build/opera 84 | cp -r build/$(PACKAGE)/* build/opera/editor 85 | cd build/opera ; $(ZIP) ../$(PACKAGE).wgt -r * ; cd ../.. 86 | 87 | chrome: 88 | mkdir -p build/svgedit_app 89 | cp -a chrome-app/* build/svgedit_app 90 | cd build ; $(ZIP) -r $(PACKAGE)-crx.zip svgedit_app ; rm -rf svgedit_app; cd .. 91 | 92 | jgraduate: 93 | java -jar $(CLOSURE) --js editor/jgraduate/jquery.jgraduate.js --js_output_file editor/jgraduate/jquery.jgraduate.min.js 94 | clean: 95 | rm -rf config 96 | rm -rf build/$(PACKAGE) 97 | rm -rf build/firefox 98 | rm -rf build/opera 99 | rm -rf build/$(PACKAGE).zip 100 | rm -rf build/$(PACKAGE)-src.tar.gz 101 | rm -rf build/$(PACKAGE).xpi 102 | rm -rf build/$(PACKAGE).wgt 103 | rm -rf $(COMPILED_JS) 104 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | SVG-edit, a web based SVG editor 2 | 3 | http://code.google.com/p/svg-edit/ 4 | 5 | see AUTHORS file for authors 6 | 7 | ----- 8 | 9 | SVG-edit contains code from these projects: 10 | 11 | jQuery JavaScript Library v1.3.2 12 | http://jquery.com/ 13 | Copyright (c) 2009 John Resig 14 | 15 | jQuery js-Hotkeys 16 | http://code.google.com/p/js-hotkeys/ 17 | Copyright (c) 2008 Tzury Bar Yochay 18 | 19 | jPicker 20 | http://www.digitalmagicpro.com/jPicker/ 21 | Copyright (c) 2009 Christopher T. Tillman 22 | -------------------------------------------------------------------------------- /build/tools/closure-compiler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svn2github/svg-edit/19969ecf86eb6e6d02bab2f0c4f99c3b4c39f5a5/build/tools/closure-compiler.jar -------------------------------------------------------------------------------- /build/tools/yuicompressor.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svn2github/svg-edit/19969ecf86eb6e6d02bab2f0c4f99c3b4c39f5a5/build/tools/yuicompressor.jar -------------------------------------------------------------------------------- /chrome-app/icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svn2github/svg-edit/19969ecf86eb6e6d02bab2f0c4f99c3b4c39f5a5/chrome-app/icon_128.png -------------------------------------------------------------------------------- /chrome-app/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SVG-edit", 3 | "description": "A fast, web-based, Javascript-driven SVG editor that works in any modern browser", 4 | "version": "2.6", 5 | "app": { 6 | "urls": [ 7 | "*://svg-edit.googlecode.com/svn/tags/stable/" 8 | ], 9 | "launch": { 10 | "web_url": "http://svg-edit.googlecode.com/svn/tags/stable/editor/svg-editor.html" 11 | } 12 | }, 13 | "icons": { 14 | "128": "icon_128.png" 15 | }, 16 | "permissions": [ 17 | "unlimitedStorage", 18 | "notifications" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /clipart/moon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Layer 1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /clipart/star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/javascript/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = { 2 | "General": { 3 | "Symbols": false, 4 | "Numbers": false, 5 | "A": true, 6 | "B": false, 7 | "C": true, 8 | "D": true, 9 | "E": false, 10 | "F": true, 11 | "G": true, 12 | "H": true, 13 | "I": true, 14 | "J": false, 15 | "K": false, 16 | "L": true, 17 | "M": true, 18 | "N": false, 19 | "O": true, 20 | "P": false, 21 | "Q": false, 22 | "R": true, 23 | "S": true, 24 | "T": false, 25 | "U": false, 26 | "V": false, 27 | "W": false, 28 | "X": false, 29 | "Y": false, 30 | "Z": false 31 | }, 32 | "Functions": { 33 | "Symbols": false, 34 | "Numbers": false, 35 | "A": true, 36 | "B": true, 37 | "C": true, 38 | "D": true, 39 | "E": true, 40 | "F": true, 41 | "G": true, 42 | "H": true, 43 | "I": true, 44 | "J": false, 45 | "K": false, 46 | "L": true, 47 | "M": true, 48 | "N": false, 49 | "O": false, 50 | "P": true, 51 | "Q": false, 52 | "R": true, 53 | "S": true, 54 | "T": true, 55 | "U": true, 56 | "V": false, 57 | "W": true, 58 | "X": false, 59 | "Y": false, 60 | "Z": false 61 | }, 62 | "Interfaces": { 63 | "Symbols": false, 64 | "Numbers": false, 65 | "A": false, 66 | "B": false, 67 | "C": false, 68 | "D": false, 69 | "E": false, 70 | "F": false, 71 | "G": false, 72 | "H": false, 73 | "I": false, 74 | "J": false, 75 | "K": false, 76 | "L": false, 77 | "M": false, 78 | "N": false, 79 | "O": false, 80 | "P": false, 81 | "Q": false, 82 | "R": false, 83 | "S": true, 84 | "T": false, 85 | "U": false, 86 | "V": false, 87 | "W": false, 88 | "X": false, 89 | "Y": false, 90 | "Z": false 91 | }, 92 | "Classes": { 93 | "Symbols": false, 94 | "Numbers": false, 95 | "A": false, 96 | "B": false, 97 | "C": false, 98 | "D": false, 99 | "E": false, 100 | "F": false, 101 | "G": false, 102 | "H": false, 103 | "I": false, 104 | "J": false, 105 | "K": false, 106 | "L": false, 107 | "M": false, 108 | "N": false, 109 | "O": false, 110 | "P": false, 111 | "Q": false, 112 | "R": false, 113 | "S": true, 114 | "T": false, 115 | "U": false, 116 | "V": false, 117 | "W": false, 118 | "X": false, 119 | "Y": false, 120 | "Z": false 121 | } 122 | } -------------------------------------------------------------------------------- /docs/search/FilesS.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/search/FunctionsA.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
addExtension, SelectorManager
addSubCommand, SvgCanvas.BatchCommand
addSvgElementFromJson, SelectorManager
addToSelection, SelectorManager
alignSelectedElements, SelectorManager
assignAttributes, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/FunctionsC.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
changeSelectedAttribute, SelectorManager
cleanupElement, SelectorManager
clear, SelectorManager
clearSelection, SelectorManager
cloneSelectedElements, SelectorManager
convertToNum, SvgCanvas
convertToPath, SelectorManager
convertToXMLReferences, SvgCanvas.Utils
copyElem, SelectorManager
createLayer, SelectorManager
cycleElement, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/FunctionsD.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
decode64, SvgCanvas.Utils
deleteCurrentLayer, SelectorManager
deleteSelectedElements, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/FunctionsM.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
matrixMultiply, SelectorManager
moveSelectedElements, SelectorManager
moveSelectedToLayer, SelectorManager
moveToTopSelectedElement, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/FunctionsO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/FunctionsR.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
rasterExport, SelectorManager
recalculateDimensions, SelectorManager
rectsIntersect, SvgCanvas
redo, SvgCanvas.undoMgr
releaseSelector, SelectorManager.SelectorManager
remapElement, SelectorManager
removeFromSelection, SelectorManager
removeUnusedDefElems, SelectorManager
renameCurrentLayer, SelectorManager
requestSelector, SelectorManager.SelectorManager
reset, Selector.Selector
resetUndoStack, SvgCanvas
resize, Selector.Selector
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralA.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
addExtension, SelectorManager
Additional editor tools, SelectorManager
addSubCommand, SvgCanvas.BatchCommand
addSvgElementFromJson, SelectorManager
addToSelection, SelectorManager
alignSelectedElements, SelectorManager
assignAttributes, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralC.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
changeSelectedAttribute, SelectorManager
cleanupElement, SelectorManager
clear, SelectorManager
clearSelection, SelectorManager
cloneSelectedElements, SelectorManager
convertToNum, SvgCanvas
convertToPath, SelectorManager
convertToXMLReferences, SvgCanvas.Utils
copyElem, SelectorManager
createLayer, SelectorManager
cycleElement, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralD.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
decode64, SvgCanvas.Utils
deleteCurrentLayer, SelectorManager
deleteSelectedElements, SelectorManager
Document functions, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralF.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
ffClone, SelectorManager
findDefs, SelectorManager
findDuplicateGradient, SelectorManager
fromXml, SvgCanvas.Utils
Functions, Selector
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralL.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
Layers, SelectorManager
linkControlPoints, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralM.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
matrixMultiply, SelectorManager
moveSelectedElements, SelectorManager
moveSelectedToLayer, SelectorManager
moveToTopSelectedElement, SelectorManager
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/GeneralR.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Loading...
rasterExport, SelectorManager
recalculateDimensions, SelectorManager
rectsIntersect, SvgCanvas
redo, SvgCanvas.undoMgr
releaseSelector, SelectorManager.SelectorManager
remapElement, SelectorManager
removeFromSelection, SelectorManager
removeUnusedDefElems, SelectorManager
renameCurrentLayer, SelectorManager
requestSelector, SelectorManager.SelectorManager
reset, Selector.Selector
resetUndoStack, SvgCanvas
resize, Selector.Selector
Searching...
No Matches
-------------------------------------------------------------------------------- /docs/search/NoResults.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
No Matches
-------------------------------------------------------------------------------- /editor/browser-not-supported.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Browser does not support SVG | SVG-edit 10 | 11 | 12 | 13 |
14 | SVG-edit logo
15 |

Sorry, but your browser does not support SVG. Below is a list of alternate browsers and versions that support SVG and SVG-edit (from caniuse.com).

16 |

Try the latest version of Firefox, Google Chrome, Safari, Opera or Internet Explorer.

17 |

If you are unable to install one of these and must use an old version of Internet Explorer, you can install the Google Chrome Frame plugin.

18 | 19 |
20 | 21 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /editor/contextmenu.js: -------------------------------------------------------------------------------- 1 | /*globals $, svgEditor*/ 2 | /*jslint vars: true, eqeq: true*/ 3 | /** 4 | * Package: svgedit.contextmenu 5 | * 6 | * Licensed under the Apache License, Version 2 7 | * 8 | * Author: Adam Bender 9 | */ 10 | // Dependencies: 11 | // 1) jQuery (for dom injection of context menus) 12 | var svgedit = svgedit || {}; 13 | (function() { 14 | var self = this; 15 | if (!svgedit.contextmenu) { 16 | svgedit.contextmenu = {}; 17 | } 18 | self.contextMenuExtensions = {}; 19 | var menuItemIsValid = function(menuItem) { 20 | return menuItem && menuItem.id && menuItem.label && menuItem.action && typeof menuItem.action == 'function'; 21 | }; 22 | var addContextMenuItem = function(menuItem) { 23 | // menuItem: {id, label, shortcut, action} 24 | if (!menuItemIsValid(menuItem)) { 25 | console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function"); 26 | return; 27 | } 28 | if (menuItem.id in self.contextMenuExtensions) { 29 | console.error('Cannot add extension "' + menuItem.id + '", an extension by that name already exists"'); 30 | return; 31 | } 32 | // Register menuItem action, see below for deferred menu dom injection 33 | console.log("Registed contextmenu item: {id:"+ menuItem.id+", label:"+menuItem.label+"}"); 34 | self.contextMenuExtensions[menuItem.id] = menuItem; 35 | //TODO: Need to consider how to handle custom enable/disable behavior 36 | }; 37 | var hasCustomHandler = function(handlerKey) { 38 | return self.contextMenuExtensions[handlerKey] && true; 39 | }; 40 | var getCustomHandler = function(handlerKey) { 41 | return self.contextMenuExtensions[handlerKey].action; 42 | }; 43 | var injectExtendedContextMenuItemIntoDom = function(menuItem) { 44 | if (Object.keys(self.contextMenuExtensions).length === 0) { 45 | // all menuItems appear at the bottom of the menu in their own container. 46 | // if this is the first extension menu we need to add the separator. 47 | $("#cmenu_canvas").append("
  • "); 48 | } 49 | var shortcut = menuItem.shortcut || ""; 50 | $("#cmenu_canvas").append("
  • " 51 | + menuItem.label + "" 52 | + shortcut + "
  • "); 53 | }; 54 | // Defer injection to wait out initial menu processing. This probably goes away once all context 55 | // menu behavior is brought here. 56 | svgEditor.ready(function() { 57 | var menuItem; 58 | for (menuItem in contextMenuExtensions) { 59 | injectExtendedContextMenuItemIntoDom(contextMenuExtensions[menuItem]); 60 | } 61 | }); 62 | svgedit.contextmenu.resetCustomMenus = function(){self.contextMenuExtensions = {};}; 63 | svgedit.contextmenu.add = addContextMenuItem; 64 | svgedit.contextmenu.hasCustomHandler = hasCustomHandler; 65 | svgedit.contextmenu.getCustomHandler = getCustomHandler; 66 | }()); 67 | -------------------------------------------------------------------------------- /editor/embedapi-dom.js: -------------------------------------------------------------------------------- 1 | /*globals $, EmbeddedSVGEdit*/ 2 | /*jslint vars: true */ 3 | var initEmbed; 4 | 5 | // Todo: Get rid of frame.contentWindow dependencies so can be more easily adjusted to work cross-domain 6 | 7 | $(function () {'use strict'; 8 | 9 | var svgCanvas = null; 10 | var frame; 11 | 12 | initEmbed = function () { 13 | var doc, mainButton; 14 | svgCanvas = new EmbeddedSVGEdit(frame); 15 | // Hide main button, as we will be controlling new, load, save, etc. from the host document 16 | doc = frame.contentDocument || frame.contentWindow.document; 17 | mainButton = doc.getElementById('main_button'); 18 | mainButton.style.display = 'none'; 19 | }; 20 | 21 | function handleSvgData(data, error) { 22 | if (error) { 23 | alert('error ' + error); 24 | } else { 25 | alert('Congratulations. Your SVG string is back in the host page, do with it what you will\n\n' + data); 26 | } 27 | } 28 | 29 | function loadSvg() { 30 | var svgexample = 'Layer 1'; 31 | svgCanvas.setSvgString(svgexample); 32 | } 33 | 34 | function saveSvg() { 35 | svgCanvas.getSvgString()(handleSvgData); 36 | } 37 | 38 | function exportPNG() { 39 | var str = frame.contentWindow.svgEditor.uiStrings.notification.loadingImage; 40 | 41 | var exportWindow = window.open( 42 | 'data:text/html;charset=utf-8,' + encodeURIComponent('' + str + '

    ' + str + '

    '), 43 | 'svg-edit-exportWindow' 44 | ); 45 | svgCanvas.rasterExport('PNG', null, exportWindow.name); 46 | } 47 | 48 | function exportPDF() { 49 | var str = frame.contentWindow.svgEditor.uiStrings.notification.loadingImage; 50 | 51 | /** 52 | // If you want to handle the PDF blob yourself, do as follows 53 | svgCanvas.bind('exportedPDF', function (win, data) { 54 | alert(data.dataurlstring); 55 | }); 56 | svgCanvas.exportPDF(); // Accepts two args: optionalWindowName supplied back to bound exportPDF handler and optionalOutputType (defaults to dataurlstring) 57 | return; 58 | */ 59 | 60 | var exportWindow = window.open( 61 | 'data:text/html;charset=utf-8,' + encodeURIComponent('' + str + '

    ' + str + '

    '), 62 | 'svg-edit-exportWindow' 63 | ); 64 | svgCanvas.exportPDF(exportWindow.name); 65 | } 66 | 67 | // Add event handlers 68 | $('#load').click(loadSvg); 69 | $('#save').click(saveSvg); 70 | $('#exportPNG').click(exportPNG); 71 | $('#exportPDF').click(exportPDF); 72 | $('body').append( 73 | $('' 76 | ) 77 | ); 78 | frame = document.getElementById('svgedit'); 79 | }); 80 | -------------------------------------------------------------------------------- /editor/embedapi.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Embed API 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | 18 | -------------------------------------------------------------------------------- /editor/extensions/allowedMimeTypes.php: -------------------------------------------------------------------------------- 1 | 'image/svg+xml;charset=UTF-8', 5 | 'png' => 'image/png', 6 | 'jpeg' => 'image/jpeg', 7 | 'bmp' => 'image/bmp', 8 | 'webp' => 'image/webp', 9 | 'pdf' => 'application/pdf' 10 | ); 11 | 12 | ?> -------------------------------------------------------------------------------- /editor/extensions/closepath_icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Layer 1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Layer 1 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /editor/extensions/ext-closepath.js: -------------------------------------------------------------------------------- 1 | /*globals svgEditor, $*/ 2 | /*jslint vars: true, eqeq: true*/ 3 | /* 4 | * ext-closepath.js 5 | * 6 | * Licensed under the MIT License 7 | * 8 | * Copyright(c) 2010 Jeff Schiller 9 | * 10 | */ 11 | 12 | // This extension adds a simple button to the contextual panel for paths 13 | // The button toggles whether the path is open or closed 14 | svgEditor.addExtension('ClosePath', function() {'use strict'; 15 | var selElems, 16 | updateButton = function(path) { 17 | var seglist = path.pathSegList, 18 | closed = seglist.getItem(seglist.numberOfItems - 1).pathSegType == 1, 19 | showbutton = closed ? '#tool_openpath' : '#tool_closepath', 20 | hidebutton = closed ? '#tool_closepath' : '#tool_openpath'; 21 | $(hidebutton).hide(); 22 | $(showbutton).show(); 23 | }, 24 | showPanel = function(on) { 25 | $('#closepath_panel').toggle(on); 26 | if (on) { 27 | var path = selElems[0]; 28 | if (path) {updateButton(path);} 29 | } 30 | }, 31 | toggleClosed = function() { 32 | var path = selElems[0]; 33 | if (path) { 34 | var seglist = path.pathSegList, 35 | last = seglist.numberOfItems - 1; 36 | // is closed 37 | if (seglist.getItem(last).pathSegType == 1) { 38 | seglist.removeItem(last); 39 | } else { 40 | seglist.appendItem(path.createSVGPathSegClosePath()); 41 | } 42 | updateButton(path); 43 | } 44 | }; 45 | 46 | return { 47 | name: 'ClosePath', 48 | svgicons: svgEditor.curConfig.extPath + 'closepath_icons.svg', 49 | buttons: [{ 50 | id: 'tool_openpath', 51 | type: 'context', 52 | panel: 'closepath_panel', 53 | title: 'Open path', 54 | events: { 55 | click: function() { 56 | toggleClosed(); 57 | } 58 | } 59 | }, 60 | { 61 | id: 'tool_closepath', 62 | type: 'context', 63 | panel: 'closepath_panel', 64 | title: 'Close path', 65 | events: { 66 | click: function() { 67 | toggleClosed(); 68 | } 69 | } 70 | }], 71 | callback: function() { 72 | $('#closepath_panel').hide(); 73 | }, 74 | selectedChanged: function(opts) { 75 | selElems = opts.elems; 76 | var i = selElems.length; 77 | while (i--) { 78 | var elem = selElems[i]; 79 | if (elem && elem.tagName == 'path') { 80 | if (opts.selectedElement && !opts.multiselected) { 81 | showPanel(true); 82 | } else { 83 | showPanel(false); 84 | } 85 | } else { 86 | showPanel(false); 87 | } 88 | } 89 | } 90 | }; 91 | }); 92 | -------------------------------------------------------------------------------- /editor/extensions/ext-eyedropper.js: -------------------------------------------------------------------------------- 1 | /*globals svgEditor, svgedit, $*/ 2 | /*jslint vars: true, eqeq: true*/ 3 | /* 4 | * ext-eyedropper.js 5 | * 6 | * Licensed under the MIT License 7 | * 8 | * Copyright(c) 2010 Jeff Schiller 9 | * 10 | */ 11 | 12 | // Dependencies: 13 | // 1) jQuery 14 | // 2) history.js 15 | // 3) svg_editor.js 16 | // 4) svgcanvas.js 17 | 18 | svgEditor.addExtension("eyedropper", function(S) {'use strict'; 19 | var // NS = svgedit.NS, 20 | // svgcontent = S.svgcontent, 21 | // svgdoc = S.svgroot.parentNode.ownerDocument, 22 | svgCanvas = svgEditor.canvas, 23 | ChangeElementCommand = svgedit.history.ChangeElementCommand, 24 | addToHistory = function(cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); }, 25 | currentStyle = { 26 | fillPaint: "red", fillOpacity: 1.0, 27 | strokePaint: "black", strokeOpacity: 1.0, 28 | strokeWidth: 5, strokeDashArray: null, 29 | opacity: 1.0, 30 | strokeLinecap: 'butt', 31 | strokeLinejoin: 'miter' 32 | }; 33 | 34 | function getStyle(opts) { 35 | // if we are in eyedropper mode, we don't want to disable the eye-dropper tool 36 | var mode = svgCanvas.getMode(); 37 | if (mode == "eyedropper") {return;} 38 | 39 | var elem = null; 40 | var tool = $('#tool_eyedropper'); 41 | // enable-eye-dropper if one element is selected 42 | if (!opts.multiselected && opts.elems[0] && 43 | $.inArray(opts.elems[0].nodeName, ['svg', 'g', 'use']) === -1 44 | ) { 45 | elem = opts.elems[0]; 46 | tool.removeClass('disabled'); 47 | // grab the current style 48 | currentStyle.fillPaint = elem.getAttribute("fill") || "black"; 49 | currentStyle.fillOpacity = elem.getAttribute("fill-opacity") || 1.0; 50 | currentStyle.strokePaint = elem.getAttribute("stroke"); 51 | currentStyle.strokeOpacity = elem.getAttribute("stroke-opacity") || 1.0; 52 | currentStyle.strokeWidth = elem.getAttribute("stroke-width"); 53 | currentStyle.strokeDashArray = elem.getAttribute("stroke-dasharray"); 54 | currentStyle.strokeLinecap = elem.getAttribute("stroke-linecap"); 55 | currentStyle.strokeLinejoin = elem.getAttribute("stroke-linejoin"); 56 | currentStyle.opacity = elem.getAttribute("opacity") || 1.0; 57 | } 58 | // disable eye-dropper tool 59 | else { 60 | tool.addClass('disabled'); 61 | } 62 | 63 | } 64 | 65 | return { 66 | name: "eyedropper", 67 | svgicons: svgEditor.curConfig.extPath + "eyedropper-icon.xml", 68 | buttons: [{ 69 | id: "tool_eyedropper", 70 | type: "mode", 71 | title: "Eye Dropper Tool", 72 | key: "I", 73 | events: { 74 | "click": function() { 75 | svgCanvas.setMode("eyedropper"); 76 | } 77 | } 78 | }], 79 | 80 | // if we have selected an element, grab its paint and enable the eye dropper button 81 | selectedChanged: getStyle, 82 | elementChanged: getStyle, 83 | 84 | mouseDown: function(opts) { 85 | var mode = svgCanvas.getMode(); 86 | if (mode == "eyedropper") { 87 | var e = opts.event; 88 | var target = e.target; 89 | if ($.inArray(target.nodeName, ['svg', 'g', 'use']) === -1) { 90 | var changes = {}; 91 | 92 | var change = function(elem, attrname, newvalue) { 93 | changes[attrname] = elem.getAttribute(attrname); 94 | elem.setAttribute(attrname, newvalue); 95 | }; 96 | 97 | if (currentStyle.fillPaint) {change(target, "fill", currentStyle.fillPaint);} 98 | if (currentStyle.fillOpacity) {change(target, "fill-opacity", currentStyle.fillOpacity);} 99 | if (currentStyle.strokePaint) {change(target, "stroke", currentStyle.strokePaint);} 100 | if (currentStyle.strokeOpacity) {change(target, "stroke-opacity", currentStyle.strokeOpacity);} 101 | if (currentStyle.strokeWidth) {change(target, "stroke-width", currentStyle.strokeWidth);} 102 | if (currentStyle.strokeDashArray) {change(target, "stroke-dasharray", currentStyle.strokeDashArray);} 103 | if (currentStyle.opacity) {change(target, "opacity", currentStyle.opacity);} 104 | if (currentStyle.strokeLinecap) {change(target, "stroke-linecap", currentStyle.strokeLinecap);} 105 | if (currentStyle.strokeLinejoin) {change(target, "stroke-linejoin", currentStyle.strokeLinejoin);} 106 | 107 | addToHistory(new ChangeElementCommand(target, changes)); 108 | } 109 | } 110 | } 111 | }; 112 | }); 113 | -------------------------------------------------------------------------------- /editor/extensions/ext-grid.js: -------------------------------------------------------------------------------- 1 | /*globals svgEditor, svgedit, svgCanvas, $*/ 2 | /*jslint vars: true*/ 3 | /* 4 | * ext-grid.js 5 | * 6 | * Licensed under the Apache License, Version 2 7 | * 8 | * Copyright(c) 2010 Redou Mine 9 | * Copyright(c) 2010 Alexis Deveria 10 | * 11 | */ 12 | 13 | // Dependencies: 14 | // 1) units.js 15 | // 2) everything else 16 | 17 | svgEditor.addExtension('view_grid', function() { 'use strict'; 18 | 19 | var NS = svgedit.NS, 20 | svgdoc = document.getElementById('svgcanvas').ownerDocument, 21 | showGrid = svgEditor.curConfig.showGrid || false, 22 | assignAttributes = svgCanvas.assignAttributes, 23 | hcanvas = document.createElement('canvas'), 24 | canvBG = $('#canvasBackground'), 25 | units = svgedit.units.getTypeMap(), 26 | intervals = [0.01, 0.1, 1, 10, 100, 1000]; 27 | 28 | $(hcanvas).hide().appendTo('body'); 29 | 30 | var canvasGrid = svgdoc.createElementNS(NS.SVG, 'svg'); 31 | assignAttributes(canvasGrid, { 32 | 'id': 'canvasGrid', 33 | 'width': '100%', 34 | 'height': '100%', 35 | 'x': 0, 36 | 'y': 0, 37 | 'overflow': 'visible', 38 | 'display': 'none' 39 | }); 40 | canvBG.append(canvasGrid); 41 | 42 | // grid-pattern 43 | var gridPattern = svgdoc.createElementNS(NS.SVG, 'pattern'); 44 | assignAttributes(gridPattern, { 45 | 'id': 'gridpattern', 46 | 'patternUnits': 'userSpaceOnUse', 47 | 'x': 0, //-(value.strokeWidth / 2), // position for strokewidth 48 | 'y': 0, //-(value.strokeWidth / 2), // position for strokewidth 49 | 'width': 100, 50 | 'height': 100 51 | }); 52 | 53 | var gridimg = svgdoc.createElementNS(NS.SVG, 'image'); 54 | assignAttributes(gridimg, { 55 | 'x': 0, 56 | 'y': 0, 57 | 'width': 100, 58 | 'height': 100 59 | }); 60 | gridPattern.appendChild(gridimg); 61 | $('#svgroot defs').append(gridPattern); 62 | 63 | // grid-box 64 | var gridBox = svgdoc.createElementNS(NS.SVG, 'rect'); 65 | assignAttributes(gridBox, { 66 | 'width': '100%', 67 | 'height': '100%', 68 | 'x': 0, 69 | 'y': 0, 70 | 'stroke-width': 0, 71 | 'stroke': 'none', 72 | 'fill': 'url(#gridpattern)', 73 | 'style': 'pointer-events: none; display:visible;' 74 | }); 75 | $('#canvasGrid').append(gridBox); 76 | 77 | function updateGrid(zoom) { 78 | var i; 79 | // TODO: Try this with elements, then compare performance difference 80 | var unit = units[svgEditor.curConfig.baseUnit]; // 1 = 1px 81 | var u_multi = unit * zoom; 82 | // Calculate the main number interval 83 | var raw_m = 100 / u_multi; 84 | var multi = 1; 85 | for (i = 0; i < intervals.length; i++) { 86 | var num = intervals[i]; 87 | multi = num; 88 | if (raw_m <= num) { 89 | break; 90 | } 91 | } 92 | var big_int = multi * u_multi; 93 | 94 | // Set the canvas size to the width of the container 95 | hcanvas.width = big_int; 96 | hcanvas.height = big_int; 97 | var ctx = hcanvas.getContext('2d'); 98 | var cur_d = 0.5; 99 | var part = big_int / 10; 100 | 101 | ctx.globalAlpha = 0.2; 102 | ctx.strokeStyle = svgEditor.curConfig.gridColor; 103 | for (i = 1; i < 10; i++) { 104 | var sub_d = Math.round(part * i) + 0.5; 105 | // var line_num = (i % 2)?12:10; 106 | var line_num = 0; 107 | ctx.moveTo(sub_d, big_int); 108 | ctx.lineTo(sub_d, line_num); 109 | ctx.moveTo(big_int, sub_d); 110 | ctx.lineTo(line_num ,sub_d); 111 | } 112 | ctx.stroke(); 113 | ctx.beginPath(); 114 | ctx.globalAlpha = 0.5; 115 | ctx.moveTo(cur_d, big_int); 116 | ctx.lineTo(cur_d, 0); 117 | 118 | ctx.moveTo(big_int, cur_d); 119 | ctx.lineTo(0, cur_d); 120 | ctx.stroke(); 121 | 122 | var datauri = hcanvas.toDataURL('image/png'); 123 | gridimg.setAttribute('width', big_int); 124 | gridimg.setAttribute('height', big_int); 125 | gridimg.parentNode.setAttribute('width', big_int); 126 | gridimg.parentNode.setAttribute('height', big_int); 127 | svgCanvas.setHref(gridimg, datauri); 128 | } 129 | 130 | function gridUpdate () { 131 | if (showGrid) { 132 | updateGrid(svgCanvas.getZoom()); 133 | } 134 | $('#canvasGrid').toggle(showGrid); 135 | $('#view_grid').toggleClass('push_button_pressed tool_button'); 136 | } 137 | return { 138 | name: 'view_grid', 139 | svgicons: svgEditor.curConfig.extPath + 'grid-icon.xml', 140 | 141 | zoomChanged: function(zoom) { 142 | if (showGrid) {updateGrid(zoom);} 143 | }, 144 | callback: function () { 145 | if (showGrid) { 146 | gridUpdate(); 147 | } 148 | }, 149 | buttons: [{ 150 | id: 'view_grid', 151 | type: 'context', 152 | panel: 'editor_panel', 153 | title: 'Show/Hide Grid', 154 | events: { 155 | click: function() { 156 | svgEditor.curConfig.showGrid = showGrid = !showGrid; 157 | gridUpdate(); 158 | } 159 | } 160 | }] 161 | }; 162 | }); 163 | -------------------------------------------------------------------------------- /editor/extensions/ext-helloworld.js: -------------------------------------------------------------------------------- 1 | /*globals svgEditor, svgCanvas, $*/ 2 | /*jslint vars: true, eqeq: true*/ 3 | /* 4 | * ext-helloworld.js 5 | * 6 | * Licensed under the MIT License 7 | * 8 | * Copyright(c) 2010 Alexis Deveria 9 | * 10 | */ 11 | 12 | /* 13 | This is a very basic SVG-Edit extension. It adds a "Hello World" button in 14 | the left panel. Clicking on the button, and then the canvas will show the 15 | user the point on the canvas that was clicked on. 16 | */ 17 | 18 | svgEditor.addExtension("Hello World", function() {'use strict'; 19 | 20 | return { 21 | name: "Hello World", 22 | // For more notes on how to make an icon file, see the source of 23 | // the helloworld-icon.xml 24 | svgicons: svgEditor.curConfig.extPath + "helloworld-icon.xml", 25 | 26 | // Multiple buttons can be added in this array 27 | buttons: [{ 28 | // Must match the icon ID in helloworld-icon.xml 29 | id: "hello_world", 30 | 31 | // This indicates that the button will be added to the "mode" 32 | // button panel on the left side 33 | type: "mode", 34 | 35 | // Tooltip text 36 | title: "Say 'Hello World'", 37 | 38 | // Events 39 | events: { 40 | 'click': function() { 41 | // The action taken when the button is clicked on. 42 | // For "mode" buttons, any other button will 43 | // automatically be de-pressed. 44 | svgCanvas.setMode("hello_world"); 45 | } 46 | } 47 | }], 48 | // This is triggered when the main mouse button is pressed down 49 | // on the editor canvas (not the tool panels) 50 | mouseDown: function() { 51 | // Check the mode on mousedown 52 | if(svgCanvas.getMode() == "hello_world") { 53 | 54 | // The returned object must include "started" with 55 | // a value of true in order for mouseUp to be triggered 56 | return {started: true}; 57 | } 58 | }, 59 | 60 | // This is triggered from anywhere, but "started" must have been set 61 | // to true (see above). Note that "opts" is an object with event info 62 | mouseUp: function(opts) { 63 | // Check the mode on mouseup 64 | if(svgCanvas.getMode() == "hello_world") { 65 | var zoom = svgCanvas.getZoom(); 66 | 67 | // Get the actual coordinate by dividing by the zoom value 68 | var x = opts.mouse_x / zoom; 69 | var y = opts.mouse_y / zoom; 70 | 71 | var text = "Hello World!\n\nYou clicked here: " 72 | + x + ", " + y; 73 | 74 | // Show the text using the custom alert function 75 | $.alert(text); 76 | } 77 | } 78 | }; 79 | }); 80 | 81 | -------------------------------------------------------------------------------- /editor/extensions/ext-imagelib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /editor/extensions/ext-panning.js: -------------------------------------------------------------------------------- 1 | /*globals svgEditor, svgCanvas*/ 2 | /*jslint eqeq: true*/ 3 | /* 4 | * ext-panning.js 5 | * 6 | * Licensed under the MIT License 7 | * 8 | * Copyright(c) 2013 Luis Aguirre 9 | * 10 | */ 11 | 12 | /* 13 | This is a very basic SVG-Edit extension to let tablet/mobile devices panning without problem 14 | */ 15 | 16 | svgEditor.addExtension('ext-panning', function() {'use strict'; 17 | return { 18 | name: 'Extension Panning', 19 | svgicons: svgEditor.curConfig.extPath + 'ext-panning.xml', 20 | buttons: [{ 21 | id: 'ext-panning', 22 | type: 'mode', 23 | title: 'Panning', 24 | events: { 25 | click: function() { 26 | svgCanvas.setMode('ext-panning'); 27 | } 28 | } 29 | }], 30 | mouseDown: function() { 31 | if (svgCanvas.getMode() == 'ext-panning') { 32 | svgEditor.setPanning(true); 33 | return {started: true}; 34 | } 35 | }, 36 | mouseUp: function() { 37 | if (svgCanvas.getMode() == 'ext-panning') { 38 | svgEditor.setPanning(false); 39 | return { 40 | keep: false, 41 | element: null 42 | }; 43 | } 44 | } 45 | }; 46 | }); 47 | -------------------------------------------------------------------------------- /editor/extensions/ext-panning.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /editor/extensions/ext-php_savefile.js: -------------------------------------------------------------------------------- 1 | /*globals $, svgCanvas, svgEditor*/ 2 | /*jslint regexp:true*/ 3 | // TODO: Might add support for "exportImage" custom 4 | // handler as in "ext-server_opensave.js" (and in savefile.php) 5 | 6 | svgEditor.addExtension("php_savefile", { 7 | callback: function() { 8 | 'use strict'; 9 | function getFileNameFromTitle () { 10 | var title = svgCanvas.getDocumentTitle(); 11 | return $.trim(title); 12 | } 13 | var save_svg_action = svgEditor.curConfig.extPath + 'savefile.php'; 14 | svgEditor.setCustomHandlers({ 15 | save: function(win, data) { 16 | var svg = '\n' + data, 17 | filename = getFileNameFromTitle(); 18 | 19 | $.post(save_svg_action, {output_svg: svg, filename: filename}); 20 | } 21 | }); 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /editor/extensions/ext-server_moinsave.js: -------------------------------------------------------------------------------- 1 | /*globals svgEditor, svgedit, svgCanvas, canvg, $, top*/ 2 | /*jslint vars: true*/ 3 | /* 4 | * ext-server_moinsave.js 5 | * 6 | * Licensed under the MIT License 7 | * 8 | * Copyright(c) 2010 Alexis Deveria 9 | * 2011 MoinMoin:ReimarBauer 10 | * adopted for moinmoins item storage. it sends in one post png and svg data 11 | * (I agree to dual license my work to additional GPLv2 or later) 12 | * 13 | */ 14 | 15 | svgEditor.addExtension("server_opensave", { 16 | callback: function() {'use strict'; 17 | var Utils = svgedit.utilities; 18 | var save_svg_action = '/+modify'; 19 | 20 | // Create upload target (hidden iframe) 21 | var target = $(' 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 33 | -------------------------------------------------------------------------------- /test/contextmenu_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unit Tests for contextmenu.js 6 | 7 | 8 | 12 | 13 | 14 | 75 | 76 | 77 |

    Unit Tests for contextmenu.js

    78 |

    79 |

    80 |
      81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /test/jquery-svg_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unit Tests for jquery-svg.js 6 | 7 | 8 | 9 | 20 | 21 | 22 |

      Unit Tests for jquery-svg

      23 |

      24 |

      25 |
        26 |
        27 | 28 | 29 | -------------------------------------------------------------------------------- /test/path_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unit Tests for path.js 6 | 7 | 8 | 9 | 10 | 11 | 21 | 22 | 23 |

        Unit Tests for path.js

        24 |

        25 |

        26 |
          27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /test/qunit/qunit.css: -------------------------------------------------------------------------------- 1 | /** Font Family and Sizes */ 2 | 3 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 4 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial; 5 | } 6 | 7 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 8 | #qunit-tests { font-size: smaller; } 9 | 10 | 11 | /** Resets */ 12 | 13 | #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { 14 | margin: 0; 15 | padding: 0; 16 | } 17 | 18 | 19 | /** Header */ 20 | 21 | #qunit-header { 22 | padding: 0.5em 0 0.5em 1em; 23 | 24 | color: #8699a4; 25 | background-color: #0d3349; 26 | 27 | font-size: 1.5em; 28 | line-height: 1em; 29 | font-weight: normal; 30 | 31 | border-radius: 15px 15px 0 0; 32 | -moz-border-radius: 15px 15px 0 0; 33 | -webkit-border-top-right-radius: 15px; 34 | -webkit-border-top-left-radius: 15px; 35 | } 36 | 37 | #qunit-header a { 38 | text-decoration: none; 39 | color: #c2ccd1; 40 | } 41 | 42 | #qunit-header a:hover, 43 | #qunit-header a:focus { 44 | color: #fff; 45 | } 46 | 47 | #qunit-banner { 48 | height: 5px; 49 | } 50 | 51 | #qunit-testrunner-toolbar { 52 | padding: 0.5em 0 0.5em 2em; 53 | color: #5E740B; 54 | background-color: #eee; 55 | } 56 | 57 | #qunit-userAgent { 58 | padding: 0.5em 0 0.5em 2.5em; 59 | background-color: #2b81af; 60 | color: #fff; 61 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 62 | } 63 | 64 | 65 | /** Tests: Pass/Fail */ 66 | 67 | #qunit-tests { 68 | list-style-position: inside; 69 | } 70 | 71 | #qunit-tests li { 72 | padding: 0.4em 0.5em 0.4em 2.5em; 73 | border-bottom: 1px solid #fff; 74 | list-style-position: inside; 75 | } 76 | 77 | #qunit-tests li strong { 78 | cursor: pointer; 79 | } 80 | 81 | #qunit-tests ol { 82 | margin-top: 0.5em; 83 | padding: 0.5em; 84 | 85 | background-color: #fff; 86 | 87 | border-radius: 15px; 88 | -moz-border-radius: 15px; 89 | -webkit-border-radius: 15px; 90 | 91 | box-shadow: inset 0px 2px 13px #999; 92 | -moz-box-shadow: inset 0px 2px 13px #999; 93 | -webkit-box-shadow: inset 0px 2px 13px #999; 94 | } 95 | 96 | #qunit-tests table { 97 | border-collapse: collapse; 98 | margin-top: .2em; 99 | } 100 | 101 | #qunit-tests th { 102 | text-align: right; 103 | vertical-align: top; 104 | padding: 0 .5em 0 0; 105 | } 106 | 107 | #qunit-tests td { 108 | vertical-align: top; 109 | } 110 | 111 | #qunit-tests pre { 112 | margin: 0; 113 | white-space: pre-wrap; 114 | word-wrap: break-word; 115 | } 116 | 117 | #qunit-tests del { 118 | background-color: #e0f2be; 119 | color: #374e0c; 120 | text-decoration: none; 121 | } 122 | 123 | #qunit-tests ins { 124 | background-color: #ffcaca; 125 | color: #500; 126 | text-decoration: none; 127 | } 128 | 129 | /*** Test Counts */ 130 | 131 | #qunit-tests b.counts { color: black; } 132 | #qunit-tests b.passed { color: #5E740B; } 133 | #qunit-tests b.failed { color: #710909; } 134 | 135 | #qunit-tests li li { 136 | margin: 0.5em; 137 | padding: 0.4em 0.5em 0.4em 0.5em; 138 | background-color: #fff; 139 | border-bottom: none; 140 | list-style-position: inside; 141 | } 142 | 143 | /*** Passing Styles */ 144 | 145 | #qunit-tests li li.pass { 146 | color: #5E740B; 147 | background-color: #fff; 148 | border-left: 26px solid #C6E746; 149 | } 150 | 151 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 152 | #qunit-tests .pass .test-name { color: #366097; } 153 | 154 | #qunit-tests .pass .test-actual, 155 | #qunit-tests .pass .test-expected { color: #999999; } 156 | 157 | #qunit-banner.qunit-pass { background-color: #C6E746; } 158 | 159 | /*** Failing Styles */ 160 | 161 | #qunit-tests li li.fail { 162 | color: #710909; 163 | background-color: #fff; 164 | border-left: 26px solid #EE5757; 165 | } 166 | 167 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 168 | #qunit-tests .fail .test-name, 169 | #qunit-tests .fail .module-name { color: #000000; } 170 | 171 | #qunit-tests .fail .test-actual { color: #EE5757; } 172 | #qunit-tests .fail .test-expected { color: green; } 173 | 174 | #qunit-banner.qunit-fail { background-color: #EE5757; } 175 | 176 | 177 | /** Footer */ 178 | 179 | #qunit-testresult { 180 | padding: 0.5em 0.5em 0.5em 2.5em; 181 | 182 | color: #2b81af; 183 | background-color: #D2E0E6; 184 | 185 | border-radius: 0 0 15px 15px; 186 | -moz-border-radius: 0 0 15px 15px; 187 | -webkit-border-bottom-right-radius: 15px; 188 | -webkit-border-bottom-left-radius: 15px; 189 | } 190 | 191 | /** Fixture */ 192 | 193 | #qunit-fixture { 194 | position: absolute; 195 | top: -10000px; 196 | left: -10000px; 197 | } 198 | -------------------------------------------------------------------------------- /test/sanitize_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unit Tests for sanitize.js 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 39 | 40 | 41 |

          Unit Tests for sanitize.js

          42 |

          43 |

          44 |
            45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /test/svgutils_test.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svn2github/svg-edit/19969ecf86eb6e6d02bab2f0c4f99c3b4c39f5a5/test/svgutils_test.html -------------------------------------------------------------------------------- /test/units_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unit Tests for units.js 6 | 7 | 8 | 9 | 10 | 11 | 93 | 94 | 95 |

            Unit Tests for units.js

            96 |

            97 |

            98 |
              99 | 100 |
              101 | 102 | 103 |
              104 | 105 | 106 | -------------------------------------------------------------------------------- /wave/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | --------------------------------------------------------------------------------