Commit Graph

36 Commits (a353d6fc89c5cff2fd4554bbc02c84361d1ce557)

Author SHA1 Message Date
Brett Zamir 8c9e40d349 - Breaking change: Rename config file to `svgedit-config-iife.js` (or for the module version, `svgedit-config-es.js`);
also expect one directory higher; incorporates #207 (@iuyiuy)
- Breaking change: Separate `extIconsPath` from `extPath` (not copying over icons)
- Breaking change: Don't reference `custom.css` in HTML; can instead be referenced in JavaScript through
    the config file (provided in `svgedit-config-sample-iife.js`/`svgedit-config-sample-es.js` as `svgedit-custom.css` for
    better namespacing); incorporates #207 (@iuyiuy)
- Breaking change: Remove minified jgraduate/spinbtn files (minified within Rollup routine)
- Fix: Zoom when scrolled; incorporates #169 (@AndrolGenhald), adapting for conventions; also allow avoidance when shift key pressed
- Fix: Update Atom feed reference in HTML
- Fixes related to recent commits: Some path and method name fixes needed, function order, missing methods, variable scope declaration, no need for DOMContentLoaded listeners in modules, switch back to non-default export, avoid trimming nullish, deal with mock tests, fix `math.matrixMultiply`, use jquery-svg where needed for array/SVG attributes; add babel-polyfill and defer script to imagelib; other misc. fixes
- Enhancement: Move config-sample.js out of `editor` directory
- Enhancement: For `callback`-style extensions, also provide config object; add following
   to that object: buildCanvgCallback, canvg, decode64, encode64, executeAfterLoads, getTypeMap, isChrome, ieIE, NS, text2xml
- Enhancement: Complete ES6 modules work (extensions, locales, tests), along with Babel;
    make Node build routine for converting modular source to non-modular,
    use `loadStylesheets` for modular stylehsheet defining (but parallel loading);
- Enhancement: Add `stylesheets` config for modular but parallel stylesheet loading with `@default` option for simple inclusion/exclusion of defaults (if not going with default).
- Refactoring: Clean up `svg-editor.html`: consistent indents; avoid extra lbs, avoid long lines
- Refactoring: Avoid embedded API adding inline JavaScript listener
- Refactoring: Move layers and context code to `draw.js`
- Refactoring: Move `pathActions` from `svgcanvas.js` (though preserve aliases to these methods on `canvas`) and `convertPath` from `svgutils.js` to `path.js`
- Refactoring: Move `getStrokedBBox` from `svgcanvas.js` (while keeping an alias) to `svgutils.js` (as `getStrokedBBoxDefaultVisible` to avoid conflict with existing)
- Docs: Remove "dependencies" comments in code except where summarizing role of jQuery or a non-obvious dependency
- Refactoring/Linting: Enfore `no-extra-semi` and `quote-props` rules
- Refactoring: Further avoidance of quotes on properties (as possible)
- Refactoring: Use `class` in place of functions where intended as classes
- Refactoring: Consistency and granularity in extensions imports
- Testing: Update QUnit to 2.6.1 (node_modules) and Sinon to 5.0.8 (and add sinon-test at 2.1.3) and enforce eslint-plugin-qunit linting rules; update custom extensions
- Testing: Add node-static for automating (and accessing out-of-directory contents)
- Testing: Avoid HTML attributes for styling
- Testing: Add npm `test` script
- Testing: Comment out unused jQuery SVG test
- Testing: Add test1 and svgutils_performance_test to all tests page
- Testing: Due apparently to Path having not been a formal class, the test was calling it without `new`; refactored now with sufficient mock data to take into account it is a class
- npm: Update devDeps
- npm: Add html modules and config build to test script
2018-05-25 20:03:14 +08:00
Brett Zamir ae2394f086 (INCOMPLETE: ES6 Module conversion and linting)
- Breaking change: Require `new` with `EmbeddedSVGEdit` (allows us to use `class` internally)
- Breaking change: If `svgcanvas.setUiStrings` must now be called if not using editor in order
    to get strings (for sake of i18n) (and if using path.js alone, must also have its `setUiStrings` called)
- Breaking change (ext-overview-window): Avoid global `overviewWindowGlobals`
- Breaking change (ext-imagelib): Change to object-based encoding for namespacing of
    messages (though keep stringifying/parsing ourselves until we remove IE9 support)
- Breaking change: Rename `jquery.js` to `jquery.min.js`
- Breaking change: Remove `scoped` attribute from `style`; it is now deprecated and
    obsolete; also move to head (after other stylesheets)
- Enhancement: Make SpinButton plugin independent of SVGEdit via
    generic state object for tool_scale
- Enhancement: Remove now unused Python l10n scripts (#238)
- Enhancement: ES6 Modules (including jQuery plugins but not jQuery)
- Enhancement: Further JSDoc (incomplete)
- Enhancement (Optimization): Compress images using imageoptim (and add
    npm script) (per #215)
- Fix: i18nize path.js strings and canvas notifications
- Fix: Attempt i18n for ext-markers
- Refactoring (ext-storage): Move locale info to own file imported by the extension (toward modularity; still should be split into separate files by language and *dynamically* imported, but we'll wait for better `import` support to refactor this)
- Refactoring: For imagelib, add local jQuery copy (using old 1.4.4 as had
    been using from server)
- Refactoring: For MathJax, add local copy (using old 2.3 as had been using from
    server); server had not been working
- Refactoring: Remove `use strict` (implicit in modules)
- Refactoring: Remove trailing whitespace, fix some code within comments
- Refactoring: Expect `jQuery` global rather than `$` for better modularity
    (also to adapt line later once available via `import`)
- Refactoring: Prefer `const` (and then `let`)
- Refactoring: Add block scope keywords closer to first block in which they appear
- Refactoring: Use ES6 `class`
- Refactoring `$.isArray` -> `Array.isArray` and avoid some other jQuery core methods
    with simple VanillaJS replacements
- Refactoring: Use abbreviated object property syntax
- Refactoring: Object destructuring
- Refactoring: Remove `uiStrings` contents in svg-editor.js (obtains from locale)
- Refactoring: Add favicon to embedded API file
- Refactoring: Use arrow functions for brief functions (incomplete)
- Refactoring: Use `Array.prototype.includes`/`String.prototype.includes`;
    `String.prototype.startsWith`, `String.prototype.trim`
- Refactoring: Remove now unnecessary svgutils do/while resetting of variables
- Refactoring: Use shorthand methods for object literals (avoid ": function")
- Refactoring: Avoid quoting object property keys where unnecessary
- Refactoring: Just do truthy/falsey check for lengths in place of comparison to 0
- Refactoring (Testing): Avoid jQuery usage within most test files (defer script,
    also in preparation for future switch to ES6 modules for tests)
- Refactoring: Make jpicker variable declaration indent bearable
- Refactoring (Linting): Finish svgcanvas.js
- Docs: Mention in comment no longer an entry file as before
- Docs: Migrate old config, extensions, and FAQ docs
- Licensing: Indicate MIT is license type of rgbcolor; rename/add license file name for
    jgraduate and screencast to reflect type (Apache 2.0); rename file to reflect it
    contains license information (of type MIT) for Raphael icons
2018-05-22 18:02:57 +08:00
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 4043c6e537 Change all tab indentations to 2sp indentation. Addresses issue #37 2018-05-17 21:02:30 -07:00
Brett Zamir a3b3525789 - Linting (ESLint): Finish
- Fix: Globals (x, y) in `mouseMove`
- Fix: Global (element, d_attr->dAttr) in `mouseDown`
- Fix: Avoid `drawnPath` not defined error
- Docs: sp.
2018-05-17 11:34:21 +08:00
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
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 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
Brett Zamir 6e1393f2ea JSDoc
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2733 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-03-16 11:19:37 +00:00
Brett Zamir 3e6dbcb111 Some JSDoc
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2731 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-03-15 13:27:39 +00:00
Brett Zamir 75bd787023 JSLint
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2644 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-01-31 02:13:37 +00:00
Bruno Heridet cc2d05f125 simplified visElems, and renamed current_drawing -> currentDrawing
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2461 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-23 16:46:02 +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 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
Marc Laporte cf0dde3f4a Updating license information as per http://code.google.com/p/svg-edit/issues/detail?id=959
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2088 eee81c28-f429-11dd-99c0-75d572ba1ddd
2012-09-16 18:53:27 +00:00
Alexis Deveria 01e08e2116 Fixed bugs causing tests to fail in Firefox and IE9
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1993 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-02-10 19:09:35 +00:00
Jeff Schiller 76a2ce76d5 Add third mode of id randomization and some tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1974 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-02-03 16:38:15 +00:00
Jeff Schiller 09ab8a85fe Fix randomizeIds() to also add a nonce to the current document if not present
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1972 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-02-03 06:45:01 +00:00
Jeff Schiller 9c8ba2361f Fix Issue 770: Trouncing the nonce. Restructured how random ids are produced. Updated how new documents are created.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1962 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-02-01 07:22:18 +00:00
Jeff Schiller d85a7bc8a2 Add deleteCurrentLayer() to Drawing
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1953 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-30 17:11:56 +00:00
Jeff Schiller 00d05776a2 Move setLayerVisibility() and setLayerOpacity() into Drawing and some tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1943 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-28 07:39:30 +00:00
Jeff Schiller 4190990d69 Move getLayerVisibility() and getLayerOpacity() into Drawing and some tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1942 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-28 06:45:34 +00:00
Jeff Schiller 3e9f1747ff Add createLayer() to Drawing and tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1941 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-28 04:37:41 +00:00
Jeff Schiller ec56e8b2c3 Move setCurrentLayer() into Drawing. Rename getCurrentLayer() to getCurrentLayerName() and move into Drawing. Tests.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1937 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-26 03:18:59 +00:00
Jeff Schiller 493ac8ae41 Move current_layer into Drawing
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1936 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-25 16:15:29 +00:00
Jeff Schiller 6b8958bd39 Turn on Closure compilers SIMPLE_OPTIMIZATIONS. Slightly change how svgedit namespace is set up in each module
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1931 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-18 06:46:45 +00:00
Jeff Schiller 97071abd0e Move getLayer() into Drawing with tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1928 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-17 05:02:08 +00:00
Jeff Schiller 8691a37376 Add identifyLayers() to svg.draw.Drawing with tests
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1927 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-17 04:36:54 +00:00
Jeff Schiller 6f9f943093 Move hasLayer() into svgedit.draw.Drawing
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1926 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-16 23:18:51 +00:00
Jeff Schiller 0db154bff4 Rename document module to draw. Add getNumLayers() to draw module.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1925 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-16 23:07:35 +00:00