Commit Graph

35 Commits (2fa2bfac1e2e37f65e49731777a3164aa5c8128f)

Author SHA1 Message Date
Brett Zamir d9d4d94976 - Linting (ESLint): Apply per latest ash-nazg (jsdoc: complete sentence descriptions)
- npm: Update devDeps
2019-12-31 15:27:16 +08:00
Brett Zamir 22dda2c50b - Docs: Missing returns, param names 2019-12-31 13:45:42 +08:00
Brett Zamir 19f7962c4a - Revert `prefer-named-capture-group` due to apparently problematic Babel plugin 2019-11-16 10:08:38 +08:00
Brett Zamir e4231aeb10 - Linting (ESLint): Lint per latest ash-nazg (e.g., named capture)
- Linting (ESLint): Add HTML files to linting and add devDeps for new ash-nazg
- npm: Update devDeps
2019-07-03 17:50:46 +08:00
Brett Zamir fa4ea90c72 INCOMPLETE: Remove check types file
- Linting: `match-description`, bad returns
- Linting: Use eslint-plugin-jdsoc `preferredTypes` in place of custom file
- Linting: Remove `report-unused-disable-directives` command as have as rule
- Lintin: Avoid overly generic `Array`
- npm: Update devDep
2019-05-24 14:44:57 +08:00
Brett Zamir 597644999d - Refactoring: Use `static` keyword for classes 2019-05-08 09:58:18 +08:00
Brett Zamir d84f39cb3f - Docs (JSDoc): Further on preferring `void` 2019-04-16 08:59:53 +08:00
Brett Zamir 7c470e9909 - Linting (ESLint): Stricter rules (or switch to warning)
- Breaking internal API change: `updateGripCursor` moved to be class method of Selector rather than instance method
- Breaking internal API change: `subpathIsClosed` moved to be class method of `Path` rather than instance method
- Refactoring: Reuse utilities base64 encoder for SVG icons plugin
- Docs (JSDoc): Fix return of the `mouseUp` (can also be an object) and `mouseDown` (may also be a boolean) of `pathActions`; other JSDoc additions/improvements
2018-11-08 14:42:48 +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 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 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 dc79fe7fde - npm: Alphabetize scripts
- JSDoc: Exclude svgedit config files
- JSDoc: Convert remaining items in old format to JSDoc (as could easily be found)
2018-05-29 20:31:24 +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
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
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 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 e906a0f6fd cleaned quote inconsistencies
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2397 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-15 17:02:24 +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
Bruno Heridet a9ab2f2c7e removed unused var and uneeded else
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2384 eee81c28-f429-11dd-99c0-75d572ba1ddd
2013-02-14 12:34:11 +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
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 28b9c0cfd7 Rename browsersupport module to browser
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1910 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-13 07:47:21 +00:00
Jeff Schiller 282f81f27a Rewrite browsersupport JS module to only expose functions. Added detection for Selectors and XPath support. Updated svgcanvas.js to create its getElem() function based on browsersupport.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1909 eee81c28-f429-11dd-99c0-75d572ba1ddd
2011-01-13 07:38:27 +00:00
Jeff Schiller f03a503d9a Add more tests for svgtransformlist.js. Move from browser-sniffing to feature detection for SVGTransformList.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1858 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-11-08 18:03:33 +00:00
Jeff Schiller 1039b68c0a More tests for SVGTransformList
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1857 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-11-08 16:26:58 +00:00
Jeff Schiller 3aabcb428b Add unit tests for svgtransformlist.js and all_tests page
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1853 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-11-08 07:23:26 +00:00
Jeff Schiller a681fc2579 Add a sanitize.js module and put sanitizeSvg into it. Fix some browsersupport sniffing calls.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1852 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-11-07 20:14:05 +00:00
Jeff Schiller 071a562c41 Start on a units JS package. Rename BrowserSupport and Utilities packages to lower-case
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1844 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-11-05 17:00:32 +00:00
Jeff Schiller 5e140062b8 Hide svgTransformLists from svgcanvas. Fix test HTML file.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1838 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-11-05 14:59:59 +00:00
Jeff Schiller 16ea2a36a5 Move getTransformList() into svgtransformlist.js, move getHref adn setHref into svgutils.js
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1837 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-11-05 14:43:12 +00:00
Jeff Schiller f97395ced4 Move SVGTransformList out into its own separate JS file
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1831 eee81c28-f429-11dd-99c0-75d572ba1ddd
2010-10-28 06:08:45 +00:00