Commit Graph

1004 Commits (c65f98b0bad74df7b96611be6541c68e8d5ee3e0)

Author SHA1 Message Date
KB Jørgensen c65f98b0ba Split code for added clarity. 2016-11-14 10:08:06 +01:00
KB Jørgensen 4994deb6ec Removed redundant function name. 2016-11-14 10:06:05 +01:00
KB Jørgensen 0bf50b0b42 Added description of the new children option to the addSvgElementFromJson() function. 2016-11-14 09:54:53 +01:00
KB Jørgensen e79db0f2a6 Added ability to create a text node with just a string in addSvgElementFromJson(). 2016-08-08 16:32:59 +02:00
KB Jørgensen b301acf716 Added ability to include children in the json to addSvgElementFromJson(). 2016-08-05 14:29:58 +02:00
Flint O'Brien 6023bd6f5a Formatting changes. 2016-05-04 09:54:20 -04:00
Flint O'Brien 87e25e9d2c Fix merge/cloneLayer. Migrate more Canvas functions to Draw. Tests.
Fixed recently introduced bugs in mergeLayer, cloneLayer.
More Draw unit tests.
Migrating Canvas methods to Draw, Layer, and utilities: copyElem,
pathActions.convertPath, cloneLayer, mergeLayer, and mergeAllLayers.
Canvas API is unchanged for backwards compatibility (i.e. previous
functions forward to new functions).
2016-05-04 09:38:29 -04:00
Flint O'Brien 2799b4cba2 Test and fix current layer rename. 2016-05-02 18:33:45 -04:00
Flint O'Brien 899853c963 Fixed Layers in svgcanvas. Moved Layer class. New HistoryRecordingservice.
Canvas was referencing drawing.all_layers and drawing.current_layer.
Both variables now represent Layer instead of group element and should
be considered private.
Moved Layer class to layer.js
New HistoryRecordingService added to help with moving Layer code out of
Canvas. Started using it in Canvas.mergLayer
2016-05-01 22:58:41 -04:00
Flint O'Brien 7db3b22c58 Updates from pull request code review. Refactored getExtraAttributesForConvertToPath.
Updated all formatting requests.
Refactored and renamed addAttributesForConvertToPath to
getExtraAttributesForConvertToPath. Now called from
getBBoxOfElementAsPath and convertToPath.
2016-04-26 16:01:39 -04:00
Flint O'Brien 17c3e0fa28 Performance improvement for select.js and canvas.addToSelection
canvas.addToSelection was calling getBBox, throwing it away, then
calling selectorManager.requestSelector() which called getBBox again.
Now passing-in an optional bbox to selector functions.
2016-04-24 16:56:32 -04:00
Flint O'Brien 12a393505d Refactoring and performance improvements for getStrokedBBox.
canvas.getStrokedBBox internals refactored to svgutils.
getStrokedBBox/getCheckedBBox renamed to
svgedit.utilities.getBBoxWithTransform
Removed duplicate calls to native getBBox.
Refactored slow transformed BBox from temporary DOM append/remove to
matrix calculations.
Lots of tests. Added qunit/qunit-assert-close.js.
2016-04-24 16:43:20 -04:00
Flint O'Brien 01ad9d7fdd Refactor canvas.convertToPath() internals to svgutils in preparation for getBBox performance improvements.
Two new functions in svgutils: convertToPath() and getBBoxOfElementAsPath().
Updated test/svgutils_test.html.
2016-04-22 12:24:52 -04:00
Jeff Schiller a3dbb7c5af Merge pull request #91 from magnebra/add_text_config_options
Add config options for text
2016-03-19 22:35:11 -07:00
Magne Bratseth 1f57536546 Add config options for text 2016-03-15 08:43:24 +01:00
Philip Rogers 9d7e60933b Merge pull request #90 from magnebra/missing_defs_after_paste
Check for deleted defs after paste, fixes #82
2016-03-14 23:55:54 -07:00
Magne Bratseth a41191158f Check for deleted defs after paste, fixes #82 2016-03-14 13:16:30 +01:00
Ian Newborn d8dae76d3a Exposed grid snapping setting on svgCanvas 2016-03-14 09:13:56 +00:00
Jeff Schiller e625a2b434 Merge pull request #67 from magnebra/getintersectionlist_fails_ie_chrome
some browsers require objects passed to getInsectionList to be of correct the type
2016-02-20 19:38:32 -08:00
Jeff Schiller e26c7cd759 Merge pull request #57 from StalderT/patch-3
Update svgcanvas.js
2016-02-14 21:32:38 -08:00
Magne Bratseth 88ef7b02cc It seems some browsers require objects passed to getInsectionList to
actually be of the correct type
2016-02-10 09:38:43 +01:00
Jeff Schiller 6715e62146 Merge pull request #7 from ibrierley/master
Fix for import svg image leading to unattached dragtool
2016-01-31 23:27:01 -08:00
StalderT ae533338a1 Update svgcanvas.js
correct https://github.com/SVG-Edit/svgedit/issues/54
2016-01-16 19:42:15 +01:00
StalderT 5a5347045c Update svgcanvas.js
correct https://github.com/SVG-Edit/svgedit/issues/55
2016-01-16 19:40:29 +01:00
Jeff Schiller c6255aaceb Update home page links to github 2015-12-03 00:24:28 -08:00
Jeff Schiller 3f0db99c6c Use SVGElement.getIntersectionList() for multiselect. Remove some try-catch statements 2015-11-30 19:08:13 -08:00
Jeff Schiller 59303eb6cc Remove all suspendRedraws 2015-11-30 18:59:53 -08:00
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
Ian f1b67e4159 Update svgcanvas.js
Changed docs and return value to match if unsuccessful
2015-09-30 11:24:16 +01:00
ibrierley 4d745dc05b Fix for importing svg files where grabber just selects nothing as it doesnt know the svg to select 2015-07-16 15:45:48 +02: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