Commit Graph

78 Commits (01083faf73279e21bc0ac7e12f2394efae2a9d96)

Author SHA1 Message Date
Brett Zamir 01083faf73 - Docs: Update CHANGES
- npm: Update devDeps
- npm: Bump to 4.2.0
2018-12-13 09:48:06 +08:00
Brett Zamir cf476ed8ea - l10n: Add zh-CN dist files
- Linting (ESLint): Add back `no-console`; while useful for debugging, could flag incomplete code (and was breaking at reporting of unused directives)
- Docs (CHANGES): Add changes and apply more formal style
- Build: Rebuild with updated Babel/Rollup
- npm: Update devDeps
2018-12-04 14:36:02 +08:00
Brett Zamir 17bc78fa3f - l10n: Add Chinese (simplified) extension locales (Thanks, @enlove!)
- Linting (ESLint): Avoid reporting `no-console`
- Refactoring: Avoid Firefox console errors with hidden iframe
- Docs (CHANGES): Fix Markdown heading level
2018-11-30 18:27:22 +08:00
Brett Zamir c6d07fbb7c - Fix: Extension locales with hyphens
- npm: Bump to 4.1.0
2018-11-29 20:41:50 +08:00
Brett Zamir 99ec41a3c3 - Fix: Avoid cross-frame unsafe `instanceof`
- npm: Update eslint-config-ash-nazg
2018-11-28 08:56:41 +08:00
Brett Zamir 9f844f6496 - Docs (CHANGES) 2018-11-25 22:23:42 +08:00
Brett Zamir 4716a1985f - Enhancement: Add svgcanvas distributions (fixes #301) 2018-11-22 08:46:04 +08:00
Brett Zamir 1c284c948d - Fix (regression): RGBColor
- npm: Bump to 4.0.1
2018-11-16 15:44:20 +08:00
Brett Zamir ba1f0d7f14 - Fix: Adjust side panel width checking based on device zoom (fixes #298) 2018-11-16 14:17:26 +08:00
Brett Zamir 2e5c7557a9 - Breaking change: `loadSvgString` now returns a `Promise` rather than accepting a callback
- Breaking change: Treat callbacks to `editor.ready` as Promises, only resolving after all resolve
- Breaking change: Make `editor.runCallbacks` return a `Promise` which resolves upon all callbacks resolving
- Breaking change: Require `npx` (used with `babel-node`) to allow Node files
  for HTML building and JSDoc type checking to be expressed as ESM.
- Breaking change: `addExtension` now throws upon a repeated attempt to add an already-added extension
- Breaking change (storage preference cookies): Namespace the cookie as "svgeditstore" instead of just "store"
- Breaking change (API): Remove `svgCanvas.rasterExport` fourth (callback) argument, collapsing fifth (options) to fourth
- Breaking change (API): Remove `svgCanvas.exportPDF` third (callback) argument
- Breaking change (API): `editor/contextmenu.js` `add` now throws instead of giving a console error only upon detecting a bad menuitem or preexisting context menu
- Breaking change (API): Remove `svgCanvas.embedImage` second (callback) argument
- Breaking change (API): Make `getHelpXML` a class instead of instance method of `RGBColor`
- Breaking change (internal API): Refactor `dbox` (and `alert`/`confirm`/`process`/`prompt`/`select`) to avoid a callback argument in favor of return a Promise
- Fix: Avoid running in extension `langReady` multiple times or serially
- Enhancement (API): Add svgCanvas.runExtension to run just one extension and add `nameFilter` callback to `runExtensions`
- Enhancement (API): Supply `$` (our wrapped jQuery) to extensions so can use its plugins, e.g., dbox with its `alert`
- Enhancement: Use alert dialog in place of `alert` in webappfind
- Enhancement: `editor.ready` now returns a Promise resolving when all callbacks have resolved
- Enhancement: Allow `noAlert` option as part of second argument to `loadSvgString` (and `loadFromURL` and `loadFromDataURI`) to avoid UI alert (and trigger promise rejection)
- Enhancement: Make `dbox` as a separate module for alert, prompt, etc. dialogs
- Refactoring: Internal `PaintBox` as class; other misc. tweaks; no bitwise in canvg
- Linting (ESLint): Further linting changes (for editor); rename `.eslintrc` -> `.eslintrc.json` per recommendation
- Optimization: Recompress images (imageoptim-cli updated)
- npm: Update devDeps
- npm: Bump to 4.0.0
2018-11-16 12:48:23 +08:00
Brett Zamir 901c9547fe TODO: Besides splitting this out from previous commit, should really avoid markdown field in favor of modifying jsdoc to report wherever it lays out "prettyprint"; still probably missing some one-liners; see https://github.com/google/code-prettify; update builds to confirm new stackblur is working; add below to CHANGES; add back for eslint-plugin-jsdoc once merged (though need new version `^3.9.1`); move any linting changes to other linting branch
- Refactoring (minor): Add favicon to canvas demo
- Linting (ESLint Markdown JavaScript): Add `eslint-plugin-markdown` with
  slightly loosened config (`no-undef` and `padded-blocks` off and
  `no-unused-vars` as a warning)
- Linting (ESLint JSDoc code comments): Add `eslint-plugin-jsdoc` and apply to
    JSDoc code comments
- Linting (ESLint): Completely avoid unescaped tabs in files
- Docs (Linting): Add linting info file
- npm: Rename `copy-deps` script to `copy`
- Refactoring: Add stackblur-canvas as a dependency and copy it in (until such time as we can do so for canvg)
2018-11-07 14:51:09 +08:00
Brett Zamir 8899680e60 - npm: Actually commit minor version update to avoid vulnerable qunit dependency; also update sinon
- npm: Avoid using Github version of JSDoc (used in a branch for layout override testing); do a fresh
    install of all packages and update `package-lock.json` accordingly; update qunit dist and openclipart
- npm: Bump to 3.2.0
2018-11-04 15:38:28 +08:00
Brett Zamir 8775528c94 - Docs (CHANGES): Add main heading
- npm: Update devDeps (including Jamilih copied into dist files as well as an updated qunit which resolves some security vulnerabilities
2018-11-04 15:14:53 +08:00
Brett Zamir aef7b095ef - Refactoring: Avoid unnecessary addEventListener `false`; change internal
jPicker function to class (used with `new`)
- Linting (ESLint): Add `valid-jsdoc` rule and make fixes; but turn off for
  now due to <https://github.com/eslint/eslint/issues/11036> and
  <https://github.com/eslint/eslint/issues/11037>
- Docs (JSDoc): Add some Markdown for variables, line breaks; tighten checks
  for overly generic types (though allow for `.Function` as in
  `jQuery.Function`) and avoid one previously missed instance
2018-10-31 00:31:12 +08:00
Brett Zamir 9b9c900ede - Linting (ESLint compat): Add eslint-plugin-compat to get browser support
warnings
- Docs (README): Indicate minimal polyfills needed for older browsers
    (IE <= 11, IE Mobile, Opera Mini, Blackberry Browser <= 10,
    Android Browser 4.4.3-4.4.4)
- npm: Update devDeps
2018-10-29 08:46:34 +08:00
Brett Zamir 126b2cb840 - Docs (3.0.0): Clarify 2018-10-26 08:08:26 +08:00
Brett Zamir 5c96501507 - Docs (ReleaseInstructions): Clarify need for npm permissions to publish 2018-10-25 11:05:48 +08:00
Brett Zamir b573a85fba - Fix: Save broken on Firefox (since FF version?)
- Docs: Mention potentially more frequent release schedule
- Docs (ReleaseInstructions): Update per new testing; update
  `grep-doc` -> `types-doc` and indicate current failing status; indicate
  when `build-doc` will be used; clarify `npm pack`
- npm: Add newly renamed `jsdoc-check-overly-generic-types.js` to ignore
- npm: Bump to 3.1.1
2018-10-25 10:45:57 +08:00
Brett Zamir e18d992216 - Docs (CHANGES): Update 2018-10-25 10:14:25 +08:00
Brett Zamir 9a9f5b6a18 - npm: Per convention, switch Node-based (headless browser) testing script to
`npm test` and change the browser tests to "browser-test"
2018-10-24 15:24:08 +08:00
Brett Zamir 283ef0b521 - Fix: Have export handler, if triggered, always open a window even if no
window name was given (needed in Chrome to avoid opening an extra window)
- Fix (Embedded editor regression): Ensure event handlers are added even if
    document cannot be directly modified
- Enhancement: Add `opts` object to `rasterExport` with `avoidEvent` property
  to avoid calling the `exported` event
- Docs (CHANGES): Update
- Docs (README): Deemphasize unstable embedded editor fixes
2018-10-24 14:56:09 +08:00
Brett Zamir 07f59ba01a - Refactoring: Reorder path config to group (non-modular-dependent) image
paths together (and correct code comment)
- Docs: CHANGES clarifications/fixes
- Docs: Migrations documents section
- Docs: Add code comment re: use of `extIconsPath` in Mathjax
- Docs: Add JSDoc indicate @this for `ExtensionInitResponse#callback`
- Build: Update build files
- npm: Bump to 3.1.0
2018-10-24 13:52:08 +08:00
Brett Zamir 4a0889c7e5 - Enhancement: For anyone visiting the ES6 modules entrance file without ESM
support, redirect to non-modular vesion
- Build: Add comment not to edit xdomain editor directly
2018-10-24 10:56:07 +08:00
Brett Zamir 25f02d99f2 - Refactoring: Display inline styles within a template for readability
(until we may refactor as class swapping)
- Refactoring: Line breaks
2018-10-24 09:44:43 +08:00
Brett Zamir a714c122d3 - Fix (Embedded editor): (Though embedding cross-origin iframes apparently
only working now in Chrome if same origin or if https?--at least not
  localhost of different ports), PDF export has been fixed (we download the
  PDF to workaround data URI limitations in Chrome)
- Fix (Embedded editor): Avoid using same origin shortcut if there is no
  global available to use (e.g., if using the modular editor)
- Fix (Embedded editor): Add events only after load is complete and
  svgCanvas is available; also log blocked error objects
- Enhancement: For PDF export, switch Chrome by default to "save" `outputType`
- Docs (JSdoc): Denote optional arguments
2018-10-23 22:24:09 +08:00
Brett Zamir 5b4dae0d30 - Docs: CHANGES clarifications
- Docs: More info on `importLocale` for extensions
- Refactoring: Better type-checking on `canvasRGBA_` (but set correctly by default anyways)
- Build: Remove unused Makefile
2018-10-23 18:35:49 +08:00
Brett Zamir 2835ec11b6 - Refactoring: Avoid redundant use of *AttributeNS methods with
`null` value; just use *Attribute methods without namespace
2018-10-23 18:14:27 +08:00
Brett Zamir f4bbd34d34 - Fix: Revert fix to have extension `mouseup` events run on "zoom" and
"select" modes (#159); breaks polygon selection
- npm: Bump to 3.0.1
2018-10-22 23:43:59 +08:00
Brett Zamir 2cecbac24a - Fix (jgraduate->jpicker): Actually fix issue with color val check when no other proper results (equal to "all");
prior fix had not covered original intention
- Docs: Clean-up and fixes in CHANGES
2018-10-22 23:13:04 +08:00
Brett Zamir 052a2c4571 - Docs: Add CHANGES info for npm 3.0.0-alpha.1 (i.e., changes between 2.8.1 and alpha.2)
- Docs: Add "optimization" and "localization" as commit prefixes
2018-10-22 10:58:39 +08:00
Brett Zamir d13f99bb5e - Breaking change: Remove `storagePromptClosed` state boolean in favor of
`storagePromptState`; used by `ext-storage.js`
- Fix (regression): Ensure storage dialog will not be blocked because of
    canvas updating done for sake of centering background
- Fix (extensions): Ensure `langReady` changes are available by time prefs
  dialog is closed and that its changes have occurred by time extensions
  have first loaded (`setLang` now returns a Promise rather than `undefined`
  as it waits for extension's `langReady` to resolve); this is also useful
  with `ext-storage.js` so we know that `extensions_loaded` (which
  conditionally updates the canvas based on `storagePromptState`) has seen
  `langReady` and the storage extension hasn't set a `storagePromptState`
  of "waiting"
2018-10-21 18:38:53 +08:00
Brett Zamir c37e60fd87 - Fix: Centering of canvas wasn't being set at proper time; fixes #272
- Refactoring: Avoid unneeded internal IIFEs; simplify w/h formula
2018-10-21 01:17:44 +08:00
Brett Zamir 5d9da2d56e - Breaking change: For checkbox for persisting choice of initial use storage
approval in storage extension dialog, turn on by default for convenience of
  most users (must still hit "ok" and users can still turn off the checkbox)
2018-10-20 23:38:47 +08:00
Brett Zamir fb9eb80798 - Fix (regression): Extension locale loading for non-English locales
- Fix: Allow language to be properly set back to a different locale and
  retaining preference (and ensure language changes are available before
  dialog closed)
- Refactoring: array extra/spread operator
- npm: Update devDep (sinon-test)
2018-10-20 22:21:58 +08:00
Brett Zamir 0dc0324104 - npm: Update devDeps 2018-10-19 20:59:24 +08:00
Brett Zamir 8024304a96 - Fix: Map extension click events to "mousedown" so they can be received
on touch devices (since `touch.js` changes `touchstart` to
    `mousedown`) (@ClemArt); closes #168
- Fix: Ensure extension `mouseup` events run on "zoom" and "select"
  modes (@iuyiuy); closes #159
2018-10-19 20:42:10 +08:00
Brett Zamir 2a943cd1fa - Enhancement: Allow 'a' also with meta key (command in Mac, ctrl otherwise)
to select all (part of #291)
- Enhancement: Add a global escape key listener to clear the selection
- Refactoring: Change 'a' to lower case in key command to avoid impression
  that shift is needed
2018-10-02 13:21:04 +08:00
Brett Zamir 3c036c70cd - Enhancement: Allow "Escape" to work with hotkeys within text boxes;
allows escaping out of source textarea (part of #291)
2018-10-01 16:30:10 +08:00
Brett Zamir 71b2b33e41 - Fix: Avoid errors occurring in Chrome now for `supportsGoodTextCharPos`
- Linting: Avoid Jamilih file in doc linting
- Testing: Add testcafe (ESLint plugin/rules, accessibility test
  (failing), ui test beginnings (passing))
- Docs: Add "Testing" prefix to contributing file
- npm: Bump to 3.0.0-rc.3
2018-09-30 12:13:34 +08:00
Brett Zamir 90ff5b9479 - Update (Imagelib): Remove extra (and more outdated) jQuery copy
- Refactoring (minor): Reuse local variable
- Docs: Contributing re: updates
2018-09-25 14:21:40 +08:00
Brett Zamir fa37778ec0 - Fix: Ensure repeated selection of same file overwrites with that
file's contents (fix #289)
2018-09-25 11:19:13 +08:00
Brett Zamir 0034447d44 - Imagelib backward compatibility enhancement: Allow string based API
again so as not to break old SVG-Edit which fail at *presence* of
  `namespace` (fixes #274)
- Known regression: Remove Openclipart as its site's now setting of
  `X-Frame-Options` to `"sameorigin"` makes it unusable on our end
  for our cross-origin uses
- Forward compatibility enhancement: For IAN image library, add
  `svgedit=3` param to URL so that it can keep using old API for
  SVG-Edit versions before 3, while conditionally using new object-based
  API now (and if we switch exclusively to the object-based API in the
  future, this site will continue to work)
- Docs: Add "Forward compatibility enhancement" to list
2018-09-25 10:13:29 +08:00
Brett Zamir 704336c0f2 - Imagelib backward compatibility enhancement: Allow `namespace-key` as
alternative to `namespace` so as not to break old SVG-Edit which fail
  at *presence* of `namespace` (fixes #274)
- Forward compatibility enhancement: Once IE9 support may be dropped,
  we may post messages as objects, so don't break if objects received
  (embedded API, xdomain, Imagelib)
2018-09-25 03:06:22 +08:00
Brett Zamir 7ff2721ba9 - Enhancement: Auto-detect `allowedImageLibOrigins` based on locale rather than requiring user to supply 2018-09-25 02:35:15 +08:00
Brett Zamir a22895c53a - Security fix (Imagelib): Avoid XSS (fixes #288)
- Fix (Imagelib): `dropXMLInternalSubset` misspelled
2018-09-25 02:06:51 +08:00
Brett Zamir 11baad0402 - Security fix/Breaking change (Imagelib): Require `allowedImageLibOrigins`
config array be set with safe origins or otherwise reject `postMessage`
  messages in case from untrusted sources
- Security fix/Breaking change (xdomain): Namespace xdomain file to avoid
  it being used to modify non-xdomain storage
- Security fix (Imagelib): Expose `dropXMLInternalSubset` to extensions
  for preventing billion laughs attack (and use in Imagelib)
2018-09-24 20:59:47 +08:00
Brett Zamir 23e982e403 - Docs: CHANGES 2018-09-22 12:05:05 +08:00
Brett Zamir 72b0cee994 - Docs (CHANGES)
- Docs: Add "known regression" as possible commit prefix
2018-09-22 10:12:11 +08:00
Brett Zamir be17cd249c LGTM.com-inspired changes:
- Fix: Ensure all apostrophes are escaped for `toXml` utility
- Fix: Avoid error if `URL` is not defined
- Fix (jPicker): Precision argument had not been passed in previously
- Fix (Star extension): Minor: Avoid erring if `inradius` is `NaN`
- Refactoring: Avoid passing unused arguments, setting unused variables,
  and making unnecessary checks; avoid useless call to `createSVGMatrix`
- Linting (LGTM): Add `lgtm.yml` file (still some remaining items flagged
  but hoping for in-code flagging)
- Docs: Contributing file
2018-09-21 10:56:07 +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