Commit Graph

2012 Commits (96e089f93040cd94834541ccd3cefb62eee4ef7b)

Author SHA1 Message Date
Brett Zamir 340915be4e - Linting (ESLint): Finish extensions and most files in editor/; unfinished: `editor/svg-editor.js`, `editor/svgcanvas.js`
- Linting (ESLint): Fix ignore file paths
- History `elem` fix
2018-05-16 12:08:41 +08:00
Brett Zamir 15331535f8 - jgraduate->jpicker: Fix Throw Error object of Invalid Mode instead of string
- jgraduate->jpicker: Fix missing `var` for some i loops
- jgraduate->jpicker: Fix Color val check when `name.length` is empty (equal to "all")
- jquery.jgraduate.js: Fix `numstops` is present for check
- Linting: ESLint; unfinished: editor/extensions/, editor/ (root), test/ (root) HTML
2018-05-15 23:10:20 +08:00
Brett Zamir 5894398c36 - Linting: ESLint (or ignore) JavaScript files; unfinished: editor/jgraduate and editor/extensions folders, editor/ (root), test/ (root) HTML
- Fix: An apparent bug in jquery.svgicons.js whereby a variable `holder` was declared in too nested of a scope
- Fix: `addBezierCurve` in canvg.js had undeclared `i`
- Fix: Undeclared variable in opera widget
- Fix: Screencast `showNotes`
2018-05-13 18:47:00 +08:00
Brett Zamir 820964334c - Fix: Broken lv locale, inconsistent tabs/spaces pt-PR
- Linting: Add ESLint script and devDeps and begin ESLint conversion (completed locales and jspdf directories only)
2018-05-13 11:03:45 +08:00
Brett Zamir 38d6274723 - Linting (HTML): Use double-quotes for attributes, remove redundant `type=text/css`,
indent/lbs, consistent non-use of HTML namespace, consistent indents, consistent charset
    casing
- Linting (Markdown): Add `.remarkrc`, use proper hierarchical headings, use consistent
    heading format, trailing spaces
- `composer.json`: consistent property spacing
- License: Add `.txt` extension, update copyright date, and reflect type (MIT) in file name
- Credits: Add self
- npm: Add `package.json` (version 3.0.0-alpha.1 for npm release only; just reserving name)
2018-05-13 09:58:13 +08:00
Neil Fraser 6aced017ea Add missing dependency
HistoryRecordingService is required at line 400.
2018-05-10 12:07:44 -07:00
Igin edb8a75402 fix #222 Browsers block data URI (#224)
* fix #222 Browsers block data URI

* add spaces and blank lines
2018-04-12 11:00:52 -07:00
Jeff Schiller 396cce40eb
Merge pull request #208 from iuyiuy/setSvgString_without_undo
Add ability to set the svg drawing without adding to the undo stack.
2018-02-27 07:04:09 -08:00
KB Jørgensen 64759a8cab Added documentation for the preventUndo parameter in the svgcanvas.setSvgString() function. 2018-02-27 11:21:07 +01:00
Jeff Schiller aadb85a9b7
Merge pull request #158 from iuyiuy/improved_transform_list_detection
Improved transform list detection.
2018-02-26 20:39:27 -08:00
Philip Rogers f5f9e627d7
Update pathseg.js to fix Firefox 59+ path editing
Firefox 59 removed some SVG path seg APIs which breaks path editing.

This change updates pathseg.js to the latest version which contains a fix for Firefox 59. I checked that Firefox 58 (pre-api-change), Firefox 59 (post-api-change), Chrome 65, and Safari Tech Preview can all edit paths correctly with this change. This change has a lot of diffs due to minor changes in pathseg.js since the first time it was imported into svgedit.

This fixes issue #216
2018-02-26 18:10:26 -08:00
KB Jørgensen d3ed6cbb8c Changed code style as requested in svgedit pull request #208. 2018-01-26 15:11:41 +01:00
KB Jørgensen 07803fd1db Add ability to set the svg drawing without adding to the undo stack. 2018-01-22 11:40:00 +01:00
KB Jørgensen 42bcd5bcf8 Fixed typo in comment. 2018-01-22 10:15:59 +01:00
KB Jørgensen e055468f77 Added comment to explain meaning of a regex. 2018-01-22 10:15:59 +01:00
KB Jørgensen 055198e28d Use a variable for the key, as requested by codedread. 2018-01-22 10:15:59 +01:00
KB Jørgensen 19170116ba Fixed handling of connectors after the new clipboard changes. 2018-01-22 10:15:59 +01:00
KB Jørgensen 524f47cab9 Let the 'this' keyword propagate in to the for each loop. 2018-01-22 10:15:59 +01:00
KB Jørgensen 02c8721c2d Implemented a clipboard that works across tabs and windows. 2018-01-18 14:02:03 +01:00
codedread 6f7aa650f8 Allow data- attributes in the sanitize whitelist. Fixes issue #203. 2017-11-29 07:52:02 -08:00
Jeff Schiller cba2d0aa1e
Merge pull request #195 from TijoloAzul/master
Bug importing complex paths to svg edit
2017-11-28 00:00:50 -08:00
Teemu Koivisto 6ee97e0d3f Fix broken saving of svg in Chrome >=60 2017-11-27 19:49:34 +02:00
Tiago Fonseca c761cb68b7 correct import of paths with several "M/m" and "Z/z" 2017-10-04 12:15:43 +01:00
KB Jørgensen 92719c1bce Improved transform list detection. 2017-01-04 12:28:09 +01:00
KB Jørgensen aafcbb694e Log errors from extensions to the browser console. 2016-11-21 15:45:43 +01:00
Jeff Schiller 97f5127e81 Merge pull request #130 from iuyiuy/addSvgElementFromJson_expansion
Add svg element from json expansion
2016-11-15 05:57:26 -08:00
KB Jørgensen b92024eca2 Adjusted requested code styling changes. 2016-11-15 09:27:31 +01:00
Jeff Schiller f7a1d2eb81 Merge pull request #148 from iuyiuy/optimized_loading
Optimized loading by removing unnecessary code
2016-11-14 08:17:10 -08:00
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
Jeff Schiller 627d038e33 Merge pull request #142 from iuyiuy/null_stroke_fix
Fixed an issue where resizing an element would set stroke="null" on it.
2016-11-11 10:09:06 -08:00
Jeff Schiller 8f73ae16bb Update svgcanvas.js 2016-11-11 10:08:38 -08:00
Jeff Schiller 0108115b41 Merge pull request #138 from sbrown345/master
Fixed call to createSVGRect in getIntersectionList
2016-11-11 10:06:55 -08:00
Jeff Schiller 9b80e65828 Merge pull request #127 from iuyiuy/upstream_issue_93
Fix for issue #93 - svgEditorReady event is not triggered in an iframe.
2016-11-11 08:50:30 -08:00
Jeff Schiller 90b8837aa2 Merge pull request #111 from q2apro/patch-1
Improved DE translation
2016-11-11 08:49:01 -08:00
KB Jørgensen 6f2822fac8 Removed code which went through all nodes and recalculated dimensions,
which was a lot of work for large svg drawings. There's no need to do
that when loading. It will happen gradually when you use it and on
manageable parts. This changed the loading time for a page with svg-edit
and a large drawing from ~50 secs to ~5 secs.
2016-11-11 15:46:51 +01:00
KB Jørgensen b2469d27d5 Fixed an issue where resizing an element would set stroke="null" on it. 2016-10-12 10:37:50 +02:00
Simon Brown b9549e1d43 fixed call to createSVGRect in getIntersectionList
createSVGRect() does not have parameters, they must be set on the object after

https://developer.mozilla.org/en/docs/Web/API/SVGSVGElement
2016-09-14 18:44:09 +01:00
Sylvain Chiron 644f5c2448 Updated/reviewed French translation
Signed-off-by: Sylvain Chiron <chironsylvain@orange.fr>
2016-08-12 23:34:05 +02: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
KB Jørgensen f9b7ae97e5 Also trigger the svgEditorReady event when opened through an iframe. 2016-08-01 09:48:00 +02:00
jingsam 051e0ca73a add zh-CN language option 2016-07-02 20:17:31 +08:00
q2apro.com b3b44cd964 Improved DE translation 2016-05-08 18:26:47 +03: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 853891aeaf Added new files to Makefile. Added underscores to private members in HistoryRecordingService. 2016-05-02 12:27:53 -04:00
Flint O'Brien 53cfe68afa Merge pull request #107 from gec/createLayerFix
Fixed Layers in svgcanvas. Moved Layer class. HistoryRecordingservice
2016-05-02 12:02:42 -04:00
Jeff Schiller fb5e2c78ec Merge pull request #85 from magnebra/text_input_update
Change the text input bindings to catch more input events
2016-05-02 07:53:41 -07:00
Jeff Schiller 1120d61544 Merge pull request #96 from iuyiuy/patch-1
Trigger the svgEditorReady after the canvas is ready.
2016-05-02 07:49:42 -07: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 ed16b0a8d1 Updated comment. 2016-04-30 21:46:45 -04:00
Flint O'Brien 7b4f7d0ae9 Code formatting updated. 2016-04-30 21:30:13 -04:00
Flint O'Brien 26b7ac05a1 Fixed bug with getCurrentLayer when no current layer. 2016-04-30 21:11:02 -04:00
Flint O'Brien 575a056bd9 Refactored draw.js to use new Layer class. 2016-04-30 20:58:19 -04:00
Flint O'Brien ebcf3d9c47 Update layers panel on programatic call to createLayer.
Add class=“layer” to each layer element. This happens when calling
createLayer() or any call to identifyLayers(). This happens with new
drawings and when opening legacy drawings, so it’s fully backwards
compatible.
svg-editor.js elementChanged() looks for g.layer as an addition test
for calling populateLayers() which updates the layers panel.
Addition tests for class=“layer” added to draw_test.html.
Fixed Firefox exception in draw_test.html.
2016-04-29 16:13:35 -04:00
Jeff Schiller 3ef423e30a Merge pull request #103 from gec/getBBox-performance
GetBBox performance improvements
2016-04-28 16:21:12 -07:00
Flint O'Brien 3230520d67 Optimized getBBoxWithTransform when rotation multiple of 90
This feature was in previous release, but broken. This update uses
standard, faster bounding box calculation for simple shapes when angle
is multiple of 90.
Updated tests. Fixed two tests that were broken in Safari.
2016-04-28 12:11:54 -04:00
Waldir Pimenta 0833678eba link to appropriate section of TR 2016-04-27 10:24:59 +01: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 0c9ff4d1ac Updated comment svgutils convertToPath... again. 2016-04-22 13:39:20 -04:00
Flint O'Brien 86c3818886 Updated comment svgutils convertToPath. 2016-04-22 13:36:10 -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
iuyiuy 2fe15e4d3f Trigger the svgEditorReady after the canvas is ready. 2016-03-23 11:40:42 +01: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
Jeff Schiller c01930d4ec Merge pull request #87 from Saurbaum/snaptogrid
Expose current zoom level through canvas for extensions
2016-03-14 09:20:23 -07:00
Jeff Schiller 2a062f6b01 Merge pull request #86 from Saurbaum/return
Images drawn using an extension always spawn the URL dialog
2016-03-14 09:19:31 -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
Ian Newborn 0c035f8aa2 Removed debugger; 2016-03-14 09:12:47 +00:00
Ian Newborn 8f904c05dd Prevented Editor opening image browser if not in image mode 2016-03-14 09:12:23 +00:00
Magne Bratseth d03d50dc3b Remove binding of change - 'input' is sufficient 2016-03-14 08:01:42 +01:00
Magne Bratseth 9fdb305fb5 Change the text input bindings to catch more input events 2016-03-11 12:06:10 +01:00
Magne Bratseth fc269cf045 Make sure font size is set to display when text is selected 2016-03-11 11:04:11 +01:00
Magne Bratseth 1c77772740 Sizing the font-size elements leave them disabled and not shown later on 2016-03-11 10:34:05 +01:00
Magne Bratseth 48e54b6f85 Simplify the code a bit more 2016-02-26 09:46:32 +01:00
Magne Bratseth 78f214de8b Cosmetics 2016-02-25 09:05:50 +01:00
Magne Bratseth 0cf2fc57a1 Slight changes to make the code more readable 2016-02-25 09:03:20 +01:00
Magne Bratseth d19cc062c5 Merge branch 'master' into ellipse_preserve_0_rx_ry 2016-02-25 08:50:37 +01:00
Philip Rogers e826d3ff19 Remove fix that cloned path segments and add tests to show it works 2016-02-21 17:13:40 -08: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
Jeff Schiller 948ba30214 Fix browser.js error messages when testing whether replaceItem and insertItemBefore work, since paths must start with M commands 2016-02-14 13:42:28 -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
Magne Bratseth b23502fba4 Do not strip rx=0 and ry=0 from ellipse elements as these values are not
default and holds a special meaning for ellipses (a value of 0 disables
rendering of the element)
2016-02-09 15:16:44 +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
Jeff Schiller 7e5a012aa9 Merge pull request #60 from GoTeamScotch/master
#59 Remove double-bind of keypresses Z and Y
2016-01-20 18:01:54 -08:00
Jordan cac6202e58 #59 Remove double-bind of keypresses Z and Y
Patch for Issue #59. https://github.com/SVG-Edit/svgedit/issues/59
2016-01-19 17:00:59 -08:00
Jeff Schiller 8e4875bf5d Merge pull request #49 from harikk/patch-2
Fix for issue #48 - improper placement of rubber-band box for 'use' elements.
2016-01-16 12:35:54 -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
Harikrishnan K 750c9c7141 Update svgutils.js
remove the commented 'if' to resolve #48
2015-12-11 12:04:03 +05:30
Jeff Schiller 96e5b2377e Only disable overview panel in Chrome 48-, not all Chrome 2015-12-07 07:53:28 -08:00
Jeff Schiller 87f92ce236 Fix tab indent 2015-12-03 17:27:28 -08:00