Commit Graph

975 Commits (53dc6eed155f3fc75d88f5b59a5983d3b83cd9eb)

Author SHA1 Message Date
Philip Rogers 7e3f9e037d Add pathseg.js, a polyfill for the SVGPathSeg API
The SVGPathSeg API is being removed from the spec [1] and is being
removed in Chromium 47 [2]. I implemented a drop-in polyfill[3] so
svg-edit users are not broken as browsers migrate away from the
path seg api.

This patch simply imports the upstream pathseg.js and updates all
dependencies. With this change all tests pass in Chrome 46 (with
the path seg api), Chrome 47 (without the path seg api), and
there are no changes to tests in Safari 9.01 or Firefox 43. I
also manually tested svg-edit while developing the polyfill and
could not find any broken features.

[1] https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/EDC3cBg9mCU/OvElJgOWCgAJ
[3] https://github.com/progers/pathseg
2015-11-04 19:25:30 -08:00
Brett Zamir 6f7651299c Some additional JSLint; update jsPDF and SVG plugin; handle canvg for image export within svgcanvas and provide new "datauri" to "exported" event.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2875 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-06-01 21:29:54 +00:00
Brett Zamir 6afa75adda Rename labels to fix issue 1206 of confusing labels ("Open Image"->"Open SVG" and "Import SVG"->"Import Image")
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2867 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-22 23:55:05 +00:00
Brett Zamir d792d60808 Update JSLint global declarations
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2862 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-22 11:01:11 +00:00
Brett Zamir abc9cd6ffb Move embedapi.html code which is not part of the API into embedapi-dom.js; demo export PDF in embedded editor; add new exportPDF method to canvas (and exposed to embedded editor) which can support JSON-able data URI string response, removing PDF exporting from rasterExport; JSLint; move dependency checking code for canvg and jsPDF to utilities; simplify Utils calls; allow for custom PDF export handler (but not yet implemented in server-based extensions); import PDF todo
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2860 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-22 10:21:29 +00:00
Brett Zamir ad6dad8d65 Spacing
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2845 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-22 01:28:32 +00:00
Brett Zamir b574628d36 Apply patch by stuart.moore@spektrix.com to fix issue #1205
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2840 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-08 04:06:54 +00:00
Brett Zamir 35e171a15f Return when no selected element to ungroup
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2837 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-08 03:14:59 +00:00
Brett Zamir 936d7d3aa4 Support external (embedded) export invocation; utilize export in embedded demo
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2822 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-04-09 06:53:08 +00:00
Brett Zamir 2726f5f048 Change deprecated Attr.nodeValue to Attr.value
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2820 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-04-09 05:40:22 +00:00
Brett Zamir d84a4465d2 Minor clean-up
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2813 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-04-09 03:44:19 +00:00
Brett Zamir f8b10e95e9 Consistently use single quotes (except within XML or for localized strings) for streamlined searching
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2791 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-04-08 03:21:22 +00:00
Brett Zamir e463b43220 1. Reference config.js in the editor (and remove encouragement for adding extensions to HTML) but ignore config.js in SVN (let user configure) but supply config-sample.js to indicate config/pref/extension possibilities;
2. Move ext-overview_window.js to default but overridable list of extensions (as with other extensions);
3. Allow extensions to avoid problems if failing to return an object (in svgcanvas.js);
4. Support new langReady callback to ensure extension always called when locale info is ready (and always load locale, even English);
5. Move localStorage storing to a new (i18n-ized and available-by-default) storage extension which adds a dialog asking user for whether to store prefs and/or SVG content; $.pref() now falls back to checking defaultPrefs (which may have been expanded at runtime to include URL or storage settings); use new config "forceStorage" to get old (bad) behavior
6. Remove initial cap from "Editor" to reflect singleton nature of object (as compared to JSLint conventions for initial cap constructors);
7. Begin a little JSDoc, clearer grouping of properties/methods; JSLint/clean-up
8. Omit values for lang and iconsize to be successfully auto-detected; 9. Document "save_notice_done" and "export_notice_done" within list of prefs; document "showlayers" and "no_save_warning" as config
10. Add "preventAllURLConfig" and "preventURLContentLoading" config for URL security; 
11. Add "lockExtensions" and "noDefaultExtensions" config for URL behavior re: extension loading
12. Document "showGrid", and new "noStorageOnLoad" and "emptyStorageOnDecline" extension-related config
13. Change setConfig to allow a second object with "overwrite" and "allowInitialUserOverride" properties and to behave accordingly (with URL config acting with overwrite=false to act under lower priority given security concern), along with checking "preventAllURLConfig" and "lockExtensions" config.
14. Remove any dupe extensions
15. Strip all path config from URL setting in addition to extPath (imgPath, langPath, jGraduatePath)
16. Support select+checkbox type dialog (used for storage ext.)
17. Ensure clickSelect is public so can be properly used by ext-connector.js
18. Reinstate 'in' checks just to be safe
19. Fix broken linkControlPoints() and addSubPath() functions
20. Fix problem when position returned by extension object was too high (e.g., if too few other extensions were included).

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2705 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-18 15:06:27 +00:00
Brett Zamir 14397f4b19 JSLint
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2701 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-17 06:48:40 +00:00
Brett Zamir 1ac6ec3f41 JSLint svgcanvas (50% scanned)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2691 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-11 14:02:48 +00:00
Brett Zamir 08211557c2 JSLint svgcanvas.js (45% scanned)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2690 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-11 13:46:39 +00:00
Brett Zamir 6c8e4e30ab JSLint (fix one accidental global)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2689 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-11 13:32:40 +00:00
Brett Zamir 00092d4a03 JSLint svgcanvas.js (30% scanned)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2679 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-10 13:27:34 +00:00
Brett Zamir 525e8322a9 JSLint
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2652 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-01-31 10:40:52 +00:00
Brett Zamir 0df050aeb4 JSLint
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2641 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-01-31 00:39:35 +00:00
Brett Zamir f8aeacd7a8 Support PNG, JPEG, BMP, WEBP export formats by change of "Export to PNG" menu item into "Export" with its own pull-down dialog (and a HTML5 range type input element for "quality" selection for JPEG or WEBP files), including changes for the server_opensave extension; change locale key from "export_png" to "export_img" and change the corresponding localized strings (currently CS, DE, ES, FR, IT, NL, PT-BR, RO, SK, all reset to English to avoid translation errors); within the setCustomHandlers() API, deprecate "pngsave" in favor of "exportImage" (chosen to avoid just using the simpler but reserved JS keyword "export") including use within the server_opensave extension; a few JSLint-friendly changes
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2602 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-28 03:53:30 +00:00
Brett Zamir 0c88f41818 Very minor commenting issues (sp./clarify comment)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2601 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-18 12:31:35 +00:00
Brett Zamir c75661c758 Indent consistency per file
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2591 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-14 01:50:42 +00:00
James Sacksteder 3887d822b2 Added a thumbnail overview as described in Issue 208 part 6.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2533 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-09-23 18:55:52 +00:00
Daniel Shapiro 02adda7a98 Fix bug with applying text attribute changes. Change to select mode AFTER setting new attribute on text element. https://code.google.com/p/svg-edit/issues/detail?id=1143
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2525 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-09-21 22:19:24 +00:00
Ben McDonald c3bea689b2 Fixed zoom calculations for Firefox. See https://groups.google.com/forum/#!topic/svg-edit/cvrwclZVeGI and Issue 1046
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2524 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-08-21 06:20:22 +00:00
薄成文 089f061641 fix a bug in svgToString function:
some elements have no attribute, so when convert it to stinrg some namespace can't be set correctly.

now, the tag like this can be correctly converted:
<se:mytag>hello</se:mytag>

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2517 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-06-08 05:29:14 +00:00
Ben McDonald e1fa525e5d Sort elements before cloning.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2515 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-06-01 08:00:10 +00:00
Jonny Bradley d9e5b797f4 Correction for r2497 - namespace had changed from 2.6 branch, sorry, didn't spot it
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2498 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-03-16 14:11:43 +00:00
Jonny Bradley 50c248dcb0 Fix in setSvgString() for images with no href (images in pattern#gridpattern don't seem to have them)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2497 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-03-16 14:07:55 +00:00
Bruno Heridet c3cc08655c added setStrokePaint() and setFillPaint() aliases for embedapi retro-compatibility
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2470 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-25 13:05:25 +00:00
Bruno Heridet 5cad5c9981 camelCased default_img_url -> defaultImageURL
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2445 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-20 21:40:21 +00:00
Jeff Schiller fb0879e74c Fix bad cut
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2443 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-20 15:37:25 +00:00
Jeff Schiller 59130ed555 Create jquery-svg module and empty test, update build. Add a couple tiny unit tests for recalculate.js
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2442 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-20 15:34:42 +00:00
Jeff Schiller ba387c22d3 Move recalculateDimensions() into its own module: recalculate.js
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2436 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-20 06:29:25 +00:00
Bruno Heridet 480c41ee69 fixed #873 function getFontSize() should be called getFontColor()
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2434 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-19 20:27:53 +00:00
Bruno Heridet 12f5fd9bce added getPaintOpacity() on svgCanvas, used it to simplify mouseDown callback on palette in svgEditor
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2430 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-19 13:17:27 +00:00
Jeff Schiller 164b22d0c1 Some more unit tests for coords
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2417 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-17 08:21:07 +00:00
Jeff Schiller 29534a7d4b Move remapElement() to coords and add a first unit test
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2416 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-17 04:58:04 +00:00
Bruno Heridet f9b8aa624c created svgedit main object, moved all namespaces handling in the same place
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2411 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-16 15:02:26 +00:00
Bruno Heridet 7a36f90eb6 fixed getRefElem and smoothControlPoints leaking variables
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2402 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-15 23:05:23 +00:00
Bruno Heridet 3d61d46f6b cleaned inconsistencies with comma spacing
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2396 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-15 16:51:48 +00:00
Bruno Heridet c446a7185f added missing semicolons, radix and cleaned some style inconsistencies
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2395 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-15 15:51:58 +00:00
Jeff Schiller 746499f637 Fixed bad paste
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2391 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-14 15:24:14 +00:00
Jeff Schiller a779a74aa9 Add fully qualified function calls, shuffle a couple tiny functions into svgutils.js, add an empty coords.js module for later
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2390 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-14 15:19:46 +00:00
Iseki Masaya (井関正也) 4ddcc94f2f Support smooth curve in real-time
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2377 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-13 16:10:15 +00:00
Luis Aguirre 522b0d6f35 Fix for issue 1046: Firefox drag-and-drop bug with elements in scaled canvas
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2330 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-06 15:49:12 +00:00
Rafael Couto 795eed4525 removed console.log
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2310 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-01-17 10:58:40 +00:00
Rafael Couto a4c4539117 fix mouse wheel scroll
(in the right place this time!)
//TODO(rafaelcastrocouto): User preference for shift key and zoom factor

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2284 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-01-16 11:42:18 +00:00
Mark MacKay b8c8b65024 correct 'use' behavior when dragging elements in webkit
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2199 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-11-28 05:39:48 +00:00