Commit Graph

2049 Commits (cba5909472e8d9a0f634768449e3d2152e1c15bb)

Author SHA1 Message Date
Brett Zamir cba5909472 - Fix (regression): i18n of markers extension 2018-09-14 07:36:06 +08:00
Brett Zamir b51db3a3c1 - Fix (Context menus): Avoid showing double shortcuts (#285); add some
missing ones
2018-09-14 07:18:26 +08:00
Brett Zamir ed6aa3fcb8 - Build: Update `dist` files 2018-09-13 22:57:01 +08:00
Brett Zamir c0ea00d36b - Fix (image export) Export in Chrome; fixes #282 2018-09-13 18:23:53 +08:00
Brett Zamir 0688b9af60 - Fix (image import): Put src after onload to avoid missing event;
check other width/height properties in case offset is 0; fixes #278
2018-09-13 17:54:40 +08:00
Brett Zamir b0bad24645 - Linting (ESLint): Apply coding standards
- Breaking change (minor): Change export filename to check `exportWindowName` and change default from `download.pdf` to `svg.pdf` to distinguish from other downloads
- Enhancement: Restore old dataURI functionality for non-Chrome browsers
2018-09-13 09:13:05 +08:00
eric fc1f36714e fix pdf export issue. #124 and #254 2018-09-13 07:47:19 +08:00
Brett Zamir 4b22c248e4 - npm: Update devDeps
- Build: Switch to `terser` plugin with `uglify` plugin not
    supporting ES6+-capable minifier
- Linting (ESLint): Consistent curly spacing; follow new "standard"
2018-09-07 08:19:45 +08:00
Brett Zamir cad412fe6e - Optimization: Image compression 2018-09-07 05:41:46 +08:00
Brett Zamir 97d093d6ef - Linting (ESLint): Add xdomain file to ignore file
- Fix (i18n): Regression in last commit with locales and apostrophe values
- npm: Avoid adding config files to ignore file
- npm: Bump to 3.0.0-rc.2
- Build: Update build
2018-07-31 15:15:25 -07:00
Brett Zamir 63fab9ff43 - i18n: Move `imagelib` reference from common to ext. locale;
remove `toggle_grid` from `az` locale
2018-07-31 14:59:27 -07:00
Brett Zamir f1666d11d1 - i18n: Remove eyedropper reference from main locale (in extension locale now)
- i18n: Add placeholders for `pick_stroke_paint_opacity`, `pick_fill_paint_opacity`, `popupWindowBlocked`
- i18n: Update `saveFromBrowser`
- i18n: Reapply locale strings
2018-07-31 13:22:00 -07:00
Brett Zamir acb57c1609 - Fix: Add images (and references) for fallback (#135)
- Fix (canvg): blur export fix
- i18n (Chinese): A few fixes (#135)
- Optimize: Further image optimizing
- Refactoring: Avoid custom JS substitution syntax
- Refactoring: Reorder default extension list
2018-07-31 00:18:39 -07:00
Brett Zamir 5ad6e6ba48 - Enhancement: Create xdomain file build which works without ES6 Modules
- Enhancement: Build xdomain files dynamically
- Fix: Race condition in svgIcons plugin
- Build: Update `dist` files
2018-07-30 12:51:57 -07:00
Brett Zamir 0a2da503f1 - Fix: Avoid extension `includeWith` button conflicts/redundancies;
Incorporates #147
- Fix: Ensure shift-key cycling through flyouts works with extension-added
    `includeWith` as well as toolbarbuttons
- Fix: Apply flyout arrows after extensions callback
- Fix: Ensure SVG icon of flyout right-arrow is cloned to can be applied to
    more than one extension
- Fix: Ensure line tool shows as selected when "L" key command is used
- Refactoring: Avoid passing on `undefined` var. (#147)
- Refactoring: lbs; avoid indent in connector, destructuring, use map over push
- Docs: Clarify nature of fixes
- Docs: JSDoc for `setupFlyouts`, `Actions`, `toggleSidePanel`; missing for
  ToolbarButton
2018-07-28 19:16:55 -07:00
Brett Zamir e2d378cfe6 - Optimize: Avoid rewriting `points` attribute for free-hand path; incorporates #176 (fixes #175)
- Docs: Update CHANGES
2018-07-26 00:01:58 -07:00
Brett Zamir 3008696314 - Allow template to have text node for readability 2018-07-25 17:44:37 -07:00
Brett Zamir aa2c3f142e - Fix (regression in last commit): Avoid empty text node in SVG template 2018-07-25 17:42:06 -07:00
Brett Zamir a68696ee34 - Refactoring (minor): Array destructuring
- Refactoring (minor): ES6 templates
- i18n: picking stroke/fill paint and opacity
2018-07-25 16:43:29 -07:00
Brett Zamir 5d0dd85507 - Fix: Regression for `text` and `tspan` elements as far as
`captureTextNodes` with canvg (inheriting class had set
  `captureTextNodes` too late)
- Fix: Avoid errors for tspan passed to `getGradient`
2018-07-22 23:39:22 -07:00
Brett Zamir d71ca48654 - Docs: A couple JSDoc fixes 2018-07-20 20:45:46 -07:00
Brett Zamir 0a25236477 - Breaking change: Avoid adding `assignAttributes`, `addSVGElementFromJson`,
`call`, `copyElem`, `findDefs`, `getElem`, `getId`, `getIntersectionList`,
  `getMouseTarget`, `getNextId`, `getUrlFromAttr`, `hasMatrixTransform`,
  `matrixMultiply`, `recalculateAllSelectedDimensions`,
  `recalculateDimensions`, `remapElement`, `removeUnusedDefElems`, `round`,
  `runExtensions`, `sanitizeSvg`, `setGradient` `transformListToTransform`
  (and mistaken `toString` export) to `getPrivateMethods` (passed to
  extensions) as available as public ones
- Build: Update ext-xdomain-messaging
- Fix (extension): ForeignObject editor
- Docs: Avoid reporting deliberate "Any" type
- Docs: Further docs (`logMatrix`, `getPrivateMethods`)
- Docs: Suggest `npm pack`
2018-07-19 14:58:30 -07:00
Brett Zamir 6122d6d2f1 - Fix (Embedded editor): Workaround Chrome blocking issue 2018-07-18 22:37:47 -07:00
Brett Zamir 7e9235504a - Fix (Embedded editor): Ensure origins can match by extracting origin out of base path 2018-07-18 22:32:04 -07:00
Brett Zamir b023a0076b - npm: Add script for testing embedded API
- Fix (Embedded editor): Ensure adding allowedOrigins for embedded response
- Enhancement (Embedded editor): Log if an origin is not whitelisted as sender/receiver
- Demo: Point to raw.githack for proper content-type setting and apparent CORS support; also add `xdomain-svg-editor-es.html` to set origin config and work on Git-based server
2018-07-18 22:25:09 -07:00
Brett Zamir 082d8d0246 - Fix: Truly fix jGraduate CSS casing 2018-07-18 21:21:15 -07:00
Brett Zamir 3289131f7c - Fix (npm): Update `load-stylesheets` to avoid recursion upon CSS loading errors 2018-07-18 21:10:05 -07:00
Brett Zamir a3f0b8e501 - Security fix: 'extPath', 'imgPath', 'extIconsPath', 'canvgPath', 'langPath', 'jGraduatePath', and 'jspdfPath' were not being prevented
- Breaking change: Rename "svgutils.js" to "utilities.js" (make in conformity with JSDoc module naming convention)
- Breaking change: Rename "svgedit.js" to "namespaces.js" (to make clear purpose and avoid confusing with editor)
- Breaking change: Rename "jquery-svg.js" to "jQuery.attr.js"
- Breaking change: Rename "jquery.contextMenu.js" to "jQuery.contextMenu.js"
- Breaking change: Rename "jquery.jpicker.js" to "jQuery.jPicker.js"
- Breaking change: Rename "JQuerySpinBtn.css" to "jQuery.SpinButton.css"
- Breaking change: Rename "JQuerySpinBtn.js" to "jQuery.SpinButton.js" (to have file name more closely reflect name)
- Breaking change: Rename "jquery.svgicons.js" to "jQuery.svgIcons.js"
- Breaking change: Rename "jquery.jgraduate.js" to "jQuery.jGraduate.js"
- Breaking change: Rename "pathseg.js" to "svgpathseg.js" (as it is a poyfill of SVGPathSeg)
- Breaking change: Rename `addSvgElementFromJson()` to `addSVGElementFromJson` for consistency
- Breaking change: Rename `changeSvgContent()` to `changeSVGContent()` for consistency
- Breaking change: Have `exportPDF` resolve with `output` and `outputType` rather than `dataurlstring` (as type may vary)
- Breaking change: Rename `extensions/mathjax/MathJax.js` to `extensions/mathjax/MathJax.min.js`
- Breaking change: Avoid recent change to have editor ready callbacks return Promises (we're not using and advantageous to keep sequential)
- Breaking change: Avoid recent addition of locale-side function in ext-imagelib for l10n
- Breaking change: Change name of ext-arrows.js from `Arrows` to `arrows` for sake of file path (not localized anyways).
- Breaking change: Change `addlangData` extension event to `addLangData` for consistency with method name
- Breaking change: Have `readLang`  return lang and data but do not call `setLang`
- Fix: Have general locales load first so extensions may use
- Fix: Provide `importLocale` to extensions `init` so it may delay adding of the extension until locale data loaded
- Fix: Ensure call to `rasterExport` without `imgType` properly sets MIME type to PNG
- Fix: Wrong name for moinsave
- Update: Update WebAppFind per new API changes
- Enhancement: Make `setStrings` public on editor for late setting (used
  by `ext-shapes.js`)
- Enhancement: Add `extensions_added` event
- Enhancement: Add `message` event (Relay messages including those which
  have been been received prior to extension load)
- Enhancement: Allow SVGEdit to work out of the box--avoid need for copying sample config file. Should also help with Github-based file servers
- Enhancement: Allow avoiding "name" in extension export (just extract out of file name)
- Enhancement: Add stack blur to canvg by default (and refactoring it)
- Enhancement: Return `Promise` for `embedImage` (as with some other loading methods)
- Enhancement: Supply `importLocale` to `langReady` to facilitate extension locale loading
- Enhancement: Recover if an extension fails to load (just log and otherwise ignore)
- Enhancement: More i18n of extensions (also fixed issue with some console warnings about missing locale strings); i18nize Hello World too
- Enhancement: Allowing importing of locales within `addLangData`
- npm: Update devDeps
- Docs: Migrate copies of all old wiki pages to docs/from-old-wiki folder; intended for a possible move to Markdown, so raw HTML (with formatting) was not preserved, though named links had their absolute URL links preserved
- Docs: Begin deleting `SvgCanvas.md` as ensuring jsdoc has replacements
- Docs: Add Edtior doc file for help to general users
- Docs: Clarify/simplify install instructions
- npm/Docs (JSDoc): Add script to check for overly generic types
- Docs (JSDoc): For config/prefs and extension creating, link to tutorials (moved tutorials to own directory to avoid recursion problems by jsdoc)
- Docs (JSDoc): Add modules (upper case for usual main entrance files or regular names)
- Docs (JSDoc): Fill out missing areas; indicate return of `undefined`; consistency with `@returns`
- Docs (JSDoc): Add our own layout template to support overflow
- Docs (JSDoc): Use cleverLinks and disallow unknown tags
- Docs (JSDoc): Insist on "pedantic" flag; put output directory in config
- Docs (JSDoc): Use more precise Integer/Float over number, the specific type of array/function/object
- Docs (JSDoc): Use `@throws`, `@enum`, `@event`/`@fires`/`@listens`
- Docs: Generally update/improve docs (fixes #92)
- Docs: Update links to `latest` path (Avoid needing to update such references upon each release)
- Docs: 80 chars max
- Refactoring: Drop code for extension as function (already requiring export to be an object)
- Refactoring: Object destructuring, `Object.entries`, Object shorthand, array extras, more camelCase variable names
- Refactoring: Add a `Command` base class
- Refactoring: Simplify svgicons `callback` ready detection
- Refactoring: Put `let` or `const` closer to scope
- Refactoring: Remove unneeded `delimiter` from regex escaping utility
- Refactoring: Clearer variable names
- Refactoring: Use (non-deprecated) Event constructors
- Testing: Use new Sinon
2018-07-08 22:39:46 -07:00
Brett Zamir efc3f5aaba - Avoid erring during resize on encountering MathML (which have no `style`) 2018-06-25 13:26:13 +08:00
Brett Zamir 30b2f3cfe1 - Fix rectangle/image/square/foreignObject (fixes #262) 2018-06-25 13:12:27 +08:00
Brett Zamir ccb793e78c - Fix: Detection of whether to keep ellipse (rx and ry when just created are now returning 0 instead of null); fixes #262
- Refactoring: Simplify `isValidUnit`
2018-06-25 12:39:10 +08:00
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
Neil Fraser a2df54881f Remove redundant (and incorrect) length set. (#256)
* Remove redundant (and incorrect) length set.

Fixes issue #255

* Simplify code by using push instead of a variable
2018-06-11 08:44:45 -07:00
Brett Zamir e7f3fbc841 - npm: Update devDep Rollup
- Linting (ESLint): Prefer `const` over `let`
- Build: Update `dist` files
2018-06-06 16:44:19 +08:00
Neil Fraser 2deaf4710a Sort SVG attributes alphabetically. (#252)
* Sort SVG attributes alphabetically.

This makes the exported SVG deterministic and diffable.

* Simplify attr variable
2018-06-03 02:44:57 -07:00
Brett Zamir 5469084919 - Refactoring (minor): `getIssues` to return codes and strings, lbs
- JSDoc: Fix param
2018-06-01 15:59:17 +08:00
Brett Zamir a27a5d5637 - Docs: Exclude from jsdoc firefox-extension, opera-widget, screencasts, test folders and build.html.js/rollup files
- Docs: Further JSDoc of methods
- Docs: Transfer some changes from ExtensionDocs on wiki (need to fully reconcile)
- Refactoring (minor): variadic args through ellipsis
2018-05-31 16:07:44 +08:00
Brett Zamir 96e089f930 - Breaking change: In interests of modularity/removing globals, remove `window.svgCanvas`
and `svgCanvas.ready` as used by older extensions; use `svgEditor.canvas` and
    `svgEditor.ready` instead
- npm: Add `prepare` script to ensure building/testing before publish
2018-05-31 09:53:47 +08:00
Brett Zamir 77999a31ce - Docs: Fix outdated comment 2018-05-31 09:43:35 +08:00
Brett Zamir 6ccaf2491c - Enhancement: Add `pointsAdded` canvas event (Fixes #141) 2018-05-31 09:43:18 +08:00
Brett Zamir 7f5c315812 - Linting (ESLint): Missed a few comments 2018-05-31 09:16:29 +08:00
Brett Zamir a5c25a2113 - Code comments: Coding standards within
- Refactoring (minor): Use single quotes in PHP
2018-05-31 07:52:13 +08:00
Brett Zamir 8f53e34c0c - Docs (JSDoc)
- Fix regression (Imagelib): Fix path for non-module version
2018-05-30 21:49:32 +08:00
Brett Zamir d173df34d2 - Fix (Embedded API): Cross-domain may fail to even access `origin` or `contentDocument`
- Fix (Embedded API): Avoid adding URL to iframe src if there are no arguments
- Fix (Cross-domain usage): Recover from exceptions with `localStorage`
- Docs (JSDoc): Missing function
2018-05-30 19:39:00 +08:00
Brett Zamir f2b1a1ff0c - Enhancement: Allow callback argument and return promise
for canvas methods: `rasterExport` and `exportPDF`
2018-05-30 16:47:43 +08:00
Brett Zamir a5ad91a370 - Refactoring: Sort Embedded functions alphabetically and add lbs for better visibiilty in code
- i18n: Clarify locale messages (where still available as English) to reflect fact that Chrome only has "Save as" via context menu/right-click, not via file menu (toward #192)
- Linting (ESLint): Avoid linting jsdoc folder
2018-05-30 16:00:06 +08:00
Brett Zamir 2ddc78d525 - Fix (regression): Favicon setting 2018-05-30 08:54:56 +08:00
Brett Zamir 9f4eedc419 - Fix (regression): Star tool (radialshift) 2018-05-30 08:48:56 +08:00
Brett Zamir 81dc19cc17 - Fix (regression): Bad name on function passed to `path.js`
- Linting (ESLint): Fix semi-colon error
2018-05-30 08:25:56 +08:00
tetedacier d098dc0914 Bugfix/separate declaration from exposition (#245)
* Separate definition from exposition

* Suppress previous documentation before generating new one

* Restore deleted line

* Set up verbosity to provide details on what's going on
2018-05-29 09:43:02 -07:00