Commit Graph

112 Commits (7cf976cfb8a518812e0a7692af65ac2103b1d487)

Author SHA1 Message Date
Brett Zamir 52353c6321 - Further convert tabs -> 2 spaces in JS code comments (except in test performance
file where used for alignment though use tab escape within JS), CSS
    (including comments), PHP, SVG, JSON, XUL
- Remove extra spaces in svgcanvas.js, ext-connector.js
2018-05-18 14:41:43 +08:00
codedread 8b7b2d89da Convert all tabs to spaces in tests for issue #37 2018-05-17 21:12:27 -07:00
Brett Zamir 89cbab7217 - Refactoring (minor): Simplify (empty string is falsey)
- Refactoring (minor): Consistent HTML indenting/no-namespacing and title/icon use
- Testing: Add browser bug test with reference to issue
2018-05-18 11:35:24 +08:00
Brett Zamir 6f791b12dd Current test results:
svgedit.recalculate failing different tests in Chrome and Firefox:
    1. Chrome: Test 1:  recalculateDimensions() on rect with identity matrix
    2. Firefox: Test 3: recalculateDimensions() on text w/tspan with simple translate
- Testing: Fix draw_test
2018-05-17 13:46:16 +08:00
Brett Zamir fff77db4f1 Test summary: two tests failing: draw.js (releaseId), svgedit.recalculate (text w/tspan with simple translate)
- Testing: Add node-static to get tests working
- Testing: Fix timing for ensuring expanding iframe size to fit content
- Testing: Add favicon to test files
- Refactoring: Move scripts to own files and lint
2018-05-17 12:57:51 +08:00
Brett Zamir 5bcbb948eb - Linting (ESLint): Finish test folder; unfinished: editor/extensions/, editor/ (root) 2018-05-16 06:25:04 +08:00
Brett Zamir f7bdf6be18 - Testing (math_test): Fix undeclared variables
- Testing: Move JavaScript out of HTML to own files
- Linting: ESLint; unfinished: editor/extensions/, editor/ (root); some of test
2018-05-15 23:43:28 +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
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 14d372c084 Added qunit mocking plugin, Sinon.js 2016-05-03 15:44:12 -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 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
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
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
Philip Rogers e826d3ff19 Remove fix that cloned path segments and add tests to show it works 2016-02-21 17:13:40 -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
Brett Zamir 160c7303ca Fix QUnit.log and references to it to reflect the currently included QUnit implementation; add missing files (test1.html is still failing even after the fixes, though it was not one of the tests included with all_tests.html)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2762 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-04-07 05:33:44 +00:00
Brett Zamir 0c9308dd98 Add missing scripts to history and path tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2761 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-04-07 04:51:46 +00:00
Brett Zamir f18cdbbeae Fix issue 1174 reported by psh.tnt re: XML entity escaping (within attributes); updated test as well
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2696 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-12 10:10:56 +00:00
Brett Zamir a682236528 Add HTML charset to tests, opera widget
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2610 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-29 03:32:01 +00:00
Brett Zamir 1a73a58433 Minor: WS
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2595 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-14 03:18:03 +00:00
Brett Zamir 8afeaf6295 Remove unneeded text/javascript from tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2592 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-14 02:02:33 +00:00
Jeff Schiller 230479e038 Fix issue 1053: tspans now get remapped when their text parent are translated
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2460 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-22 15:46:11 +00:00
Jeff Schiller 0d2a3ffea4 Add another unit test and update minor formatting in recalculate.js
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2458 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-22 14:46:50 +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 bbe79434d6 Add empty test file and update Makefile
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2437 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-20 06:42:00 +00:00
Jeff Schiller 480fb64004 Unit test for text elements in coords
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2420 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-17 21:07:42 +00:00
Jeff Schiller 405e20563d Fix units unit test
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2419 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-17 18:46:39 +00:00
Waldir Pimenta 3d71cdf27b - convert svgutils_test.html from utf8 to iso-8859-1 (Western) encoding,
so that tools such as grep don't consider it a binary file.
- add <title> to test pages, to make html valid
- harmonize indentation: 2 spaces
- harmonize all empty html elements' closing tags
  to be on the same line as the opening tag



git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2418 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-17 17:28:19 +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 4c4fff6a0d cleaned svgedit.math.transformBox(), wrote the according test
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2398 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-15 19:42:04 +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
Bruno Heridet 3bd244a88f removed bad paste
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2383 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-14 12:20:28 +00:00
Bruno Heridet 5e68aefef8 fixed unit[s] typo in svgedit.units.convertUnit, added the corresponding test
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2382 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-14 12:18:13 +00:00
Jeff Schiller 936d9cc362 Fix issue 1052: Properly parse the style attribute during sanitization
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2376 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-13 15:04:58 +00:00
Ahmad Syazwan 36e0fbd2d5 Fix issue 934. Patch by adambender.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2083 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-05-25 04:04:22 +00:00
Ahmad Syazwan 3a0cfe1ce0 Add some tests for ChangeElementCommand by adambender from issue 936
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2079 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-04-03 02:59:51 +00:00
Jeff Schiller 597176e2c1 Fix Firefox unit test for realz
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2077 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-03-31 18:04:10 +00:00
Jeff Schiller 7e6a6e68a1 Rollback bad revision 2075
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2076 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-03-31 18:02:08 +00:00
Jeff Schiller b0aa96bdec Fix a test failing in Firefox by decreasing the precision expected
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2075 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-03-31 17:55:01 +00:00
Jeff Schiller 5c1227997b Reformat unit test page. Add in dependencies for test1 (but they still do not run)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2074 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-03-30 16:27:32 +00:00
Ahmad Syazwan 2d74a7ace5 Fix regression due to earlier fix of issue 937
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2072 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-03-30 03:50:54 +00:00
Jeff Schiller c7635282f4 Fix Issue 907: Allow custom menu options (Apply patch from adambender)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2055 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-02-25 02:13:18 +00:00