Commit Graph

26 Commits (30b2f3cfe1e59af3aacb2367991d9cdf02f7b409)

Author SHA1 Message Date
Brett Zamir 9f65b1adb9 - Breaking change: Extension now formatted as export (and `this` is set to editor, including for `callback`)
- Breaking change: Locale now formatted as export
- Breaking change: Moved out remaining modular i18n (imagelib) to own folder
- Breaking change: Drop `executeAfterLoads` (and getJSPDF/getCanvg)
- Breaking change: `RGBColor` must accept `new`
- Breaking change: canvg - `stackBlurCanvasRGBA` must be set now by function (`setStackBlurCanvasRGBA`) rather than global; `canvg` now a named export
- Breaking change: Avoid passing `canvg`/`buildCanvgCallback` to extensions (have them import)
- Fix: i18nize imaglib more deeply
- Fix: Positioning of Document Properties dialog (Fixes #246)
- Fix (regression): PDF Export (Fixes #249)
- Fix (regression): Add polyfill for `ChildNode`/`ParentNode` (and use further)
- Fix (regression): Apply Babel universally to dependencies
- Fix (regression): Ordering of `uaPrefix` function in `svgEditor.js`
- Fix (regression): Embedded API
- Fix (embedded editor): Fix backspace key in Firefox so it doesn't navigate out of frame
- Fix: Alert if no exportWindow for PDF (e.g., if blocked)
- Refactoring( RGBColor) `RGBColor` as class, without rebuilding constants, optimize string replacement, move methods to prototype, use templates and object literals, use `Object.keys`
- Refactoring (canvg) Use classes more internally, use shorthand objects; array extras, return to lazy-loading
- Refactoring: Use Promises in place of `$.getScript`; always return Promises in case deciding to await resolving
- Refactoring: Avoid importing `RGBColor` into `svgutils.js` (jsPDF imports it itself)
- Refactoring: Arrow functions, destructuring, shorter property references
- Refactoring: Fix `lang` and `dir` for locales (though not in use currently anyways)
- Refactoring: Provide path config for canvg, jspdf
2018-06-12 06:50:28 +08:00
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
codedread 646a927ef6 Convert all tabs to spaces in extensions for issue #37 2018-05-17 21:54:31 -07: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
Brett Zamir 6bffe68d65 PDF export in server_opensave extension
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2886 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-06-13 14:58:46 +00:00
Brett Zamir bddf4c2324 todo
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2864 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-22 11:24:18 +00:00
Brett Zamir 09dd5e7975 Add todo
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2863 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-22 11:03:53 +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 73a4804324 Ensure all dependencies available for canvg-using extensions (server_moinsave, server_opensave)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2849 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-05-22 02:56:00 +00:00
Brett Zamir 51dcf01415 Minor: Avoid internal use of svgEditor, fix comment
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2706 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-18 23:57:49 +00:00
Brett Zamir d6cc464ba5 JSLint extensions
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2695 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-12 09:38:38 +00:00
Brett Zamir 51b18d2664 Apply changes of mmariani in Github extpath branch (https://github.com/mmariani/svg-edit/compare/extpath ) as reported by birbag in issue 1184
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2693 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-12 03:48:48 +00:00
Brett Zamir 1181de6847 Minor clean-up; UTF-8 for SVG
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2667 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-02 01:06:25 +00:00
Brett Zamir adbec3e33e Safer XHTML escape
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2665 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-01 17:00:36 +00:00
Brett Zamir 21c946fd99 server_opensave-related changes: 1) Be more lenient in filename possibilities for server_opensave (supporting Unicode except characters disallowed in Windows file names); 2) XHTML escape filename and SVG content when put into HTML hidden input element as opposed to unnecessary URL-encoding; 3) fix base64 encoding (with update to dependent utf8-encoding function)--old base64 code caused SVG to break with surrogate pairs (e.g., in title); 4) provide default UTF-8 encoding in XML declaration and add this XML declaration to the download attribute as well
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2662 eee81c28-f429-11dd-99c0-75d572ba1ddd
2014-02-01 16:13:51 +00:00
Brett Zamir 5ff2311348 Making tabbing consistent
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2615 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-29 06:54:31 +00:00
Brett Zamir c3c98033b6 Fix data:image/svg link loading for imagelib extension; fix server_opensave-extension-opened SVG files for older browsers; leverage utilities base 64 encoding in place of btoa also in server_opensave extension
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2614 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-29 06:33:37 +00:00
Brett Zamir e5f3e81a07 Change ext-server_opensave.js to work wholly client-side if download attribute supported (and JSLint in process)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2606 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-10-29 01:26:23 +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
Adrian Jones f4057ce908 Trim title of leading/trailing spaces before making filename. Avoids excess hyphens in filename.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2514 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-05-30 17:35: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 450cc3df8c Fixed some imagelib bugs, added nicer icon, nicer buttons
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1695 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-08-31 20:31:58 +00:00
Alexis Deveria 31dd2a429c Added canvg callback to opensave extension
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1693 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-08-31 13:52:54 +00:00
Alexis Deveria 3130f85ac6 Added timeout to PNG export for server_opensave extension
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1669 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-08-18 16:45:02 +00:00
Alexis Deveria 8ce73cd5ca Added file saving/export ability to server_opensave extension, fixing issue 582
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1625 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-07-06 13:57:05 +00:00