- 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-22 10:03:16 +00:00
( function ( ) {
'use strict' ;
var classCallCheck = function ( instance , Constructor ) {
if ( ! ( instance instanceof Constructor ) ) {
throw new TypeError ( "Cannot call a class as a function" ) ;
}
} ;
var createClass = function ( ) {
function defineProperties ( target , props ) {
for ( var i = 0 ; i < props . length ; i ++ ) {
var descriptor = props [ i ] ;
descriptor . enumerable = descriptor . enumerable || false ;
descriptor . configurable = true ;
if ( "value" in descriptor ) descriptor . writable = true ;
Object . defineProperty ( target , descriptor . key , descriptor ) ;
}
}
return function ( Constructor , protoProps , staticProps ) {
if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ;
if ( staticProps ) defineProperties ( Constructor , staticProps ) ;
return Constructor ;
} ;
} ( ) ;
var inherits = function ( subClass , superClass ) {
if ( typeof superClass !== "function" && superClass !== null ) {
throw new TypeError ( "Super expression must either be null or a function, not " + typeof superClass ) ;
}
subClass . prototype = Object . create ( superClass && superClass . prototype , {
constructor : {
value : subClass ,
enumerable : false ,
writable : true ,
configurable : true
}
} ) ;
if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . _ _proto _ _ = superClass ;
} ;
var possibleConstructorReturn = function ( self , call ) {
if ( ! self ) {
throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ;
}
return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ;
} ;
- 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-06-06 07:26:20 +00:00
/ * *
* SVGPathSeg API polyfill
* https : //github.com/progers/pathseg
*
* This is a drop - in replacement for the ` SVGPathSeg ` and ` SVGPathSegList ` APIs
* that were removed from SVG2 ( { @ link https : //lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html}),
* including the latest spec changes which were implemented in Firefox 43 and
* Chrome 46.
* /
- 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-22 10:03:16 +00:00
( function ( ) {
if ( ! ( 'SVGPathSeg' in window ) ) {
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg
var _SVGPathSeg = function ( ) {
function _SVGPathSeg ( type , typeAsLetter , owningPathSegList ) {
classCallCheck ( this , _SVGPathSeg ) ;
this . pathSegType = type ;
this . pathSegTypeAsLetter = typeAsLetter ;
this . _owningPathSegList = owningPathSegList ;
}
// Notify owning PathSegList on any changes so they can be synchronized back to the path element.
createClass ( _SVGPathSeg , [ {
key : '_segmentChanged' ,
value : function _segmentChanged ( ) {
if ( this . _owningPathSegList ) {
this . _owningPathSegList . segmentChanged ( this ) ;
}
}
} ] ) ;
return _SVGPathSeg ;
} ( ) ;
_SVGPathSeg . prototype . classname = 'SVGPathSeg' ;
_SVGPathSeg . PATHSEG _UNKNOWN = 0 ;
_SVGPathSeg . PATHSEG _CLOSEPATH = 1 ;
_SVGPathSeg . PATHSEG _MOVETO _ABS = 2 ;
_SVGPathSeg . PATHSEG _MOVETO _REL = 3 ;
_SVGPathSeg . PATHSEG _LINETO _ABS = 4 ;
_SVGPathSeg . PATHSEG _LINETO _REL = 5 ;
_SVGPathSeg . PATHSEG _CURVETO _CUBIC _ABS = 6 ;
_SVGPathSeg . PATHSEG _CURVETO _CUBIC _REL = 7 ;
_SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _ABS = 8 ;
_SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _REL = 9 ;
_SVGPathSeg . PATHSEG _ARC _ABS = 10 ;
_SVGPathSeg . PATHSEG _ARC _REL = 11 ;
_SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _ABS = 12 ;
_SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _REL = 13 ;
_SVGPathSeg . PATHSEG _LINETO _VERTICAL _ABS = 14 ;
_SVGPathSeg . PATHSEG _LINETO _VERTICAL _REL = 15 ;
_SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _ABS = 16 ;
_SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _REL = 17 ;
_SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _ABS = 18 ;
_SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _REL = 19 ;
var _SVGPathSegClosePath = function ( _SVGPathSeg2 ) {
inherits ( _SVGPathSegClosePath , _SVGPathSeg2 ) ;
function _SVGPathSegClosePath ( owningPathSegList ) {
classCallCheck ( this , _SVGPathSegClosePath ) ;
return possibleConstructorReturn ( this , ( _SVGPathSegClosePath . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegClosePath ) ) . call ( this , _SVGPathSeg . PATHSEG _CLOSEPATH , 'z' , owningPathSegList ) ) ;
}
createClass ( _SVGPathSegClosePath , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegClosePath]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegClosePath ( undefined ) ;
}
} ] ) ;
return _SVGPathSegClosePath ;
} ( _SVGPathSeg ) ;
var _SVGPathSegMovetoAbs = function ( _SVGPathSeg3 ) {
inherits ( _SVGPathSegMovetoAbs , _SVGPathSeg3 ) ;
function _SVGPathSegMovetoAbs ( owningPathSegList , x , y ) {
classCallCheck ( this , _SVGPathSegMovetoAbs ) ;
var _this2 = possibleConstructorReturn ( this , ( _SVGPathSegMovetoAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegMovetoAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _MOVETO _ABS , 'M' , owningPathSegList ) ) ;
_this2 . _x = x ;
_this2 . _y = y ;
return _this2 ;
}
createClass ( _SVGPathSegMovetoAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegMovetoAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegMovetoAbs ( undefined , this . _x , this . _y ) ;
}
} ] ) ;
return _SVGPathSegMovetoAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegMovetoAbs . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true
} ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true
}
} ) ;
var _SVGPathSegMovetoRel = function ( _SVGPathSeg4 ) {
inherits ( _SVGPathSegMovetoRel , _SVGPathSeg4 ) ;
function _SVGPathSegMovetoRel ( owningPathSegList , x , y ) {
classCallCheck ( this , _SVGPathSegMovetoRel ) ;
var _this3 = possibleConstructorReturn ( this , ( _SVGPathSegMovetoRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegMovetoRel ) ) . call ( this , _SVGPathSeg . PATHSEG _MOVETO _REL , 'm' , owningPathSegList ) ) ;
_this3 . _x = x ;
_this3 . _y = y ;
return _this3 ;
}
createClass ( _SVGPathSegMovetoRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegMovetoRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegMovetoRel ( undefined , this . _x , this . _y ) ;
}
} ] ) ;
return _SVGPathSegMovetoRel ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegMovetoRel . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegLinetoAbs = function ( _SVGPathSeg5 ) {
inherits ( _SVGPathSegLinetoAbs , _SVGPathSeg5 ) ;
function _SVGPathSegLinetoAbs ( owningPathSegList , x , y ) {
classCallCheck ( this , _SVGPathSegLinetoAbs ) ;
var _this4 = possibleConstructorReturn ( this , ( _SVGPathSegLinetoAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegLinetoAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _LINETO _ABS , 'L' , owningPathSegList ) ) ;
_this4 . _x = x ;
_this4 . _y = y ;
return _this4 ;
}
createClass ( _SVGPathSegLinetoAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegLinetoAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegLinetoAbs ( undefined , this . _x , this . _y ) ;
}
} ] ) ;
return _SVGPathSegLinetoAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegLinetoAbs . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegLinetoRel = function ( _SVGPathSeg6 ) {
inherits ( _SVGPathSegLinetoRel , _SVGPathSeg6 ) ;
function _SVGPathSegLinetoRel ( owningPathSegList , x , y ) {
classCallCheck ( this , _SVGPathSegLinetoRel ) ;
var _this5 = possibleConstructorReturn ( this , ( _SVGPathSegLinetoRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegLinetoRel ) ) . call ( this , _SVGPathSeg . PATHSEG _LINETO _REL , 'l' , owningPathSegList ) ) ;
_this5 . _x = x ;
_this5 . _y = y ;
return _this5 ;
}
createClass ( _SVGPathSegLinetoRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegLinetoRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegLinetoRel ( undefined , this . _x , this . _y ) ;
}
} ] ) ;
return _SVGPathSegLinetoRel ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegLinetoRel . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegCurvetoCubicAbs = function ( _SVGPathSeg7 ) {
inherits ( _SVGPathSegCurvetoCubicAbs , _SVGPathSeg7 ) ;
function _SVGPathSegCurvetoCubicAbs ( owningPathSegList , x , y , x1 , y1 , x2 , y2 ) {
classCallCheck ( this , _SVGPathSegCurvetoCubicAbs ) ;
var _this6 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoCubicAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoCubicAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _CUBIC _ABS , 'C' , owningPathSegList ) ) ;
_this6 . _x = x ;
_this6 . _y = y ;
_this6 . _x1 = x1 ;
_this6 . _y1 = y1 ;
_this6 . _x2 = x2 ;
_this6 . _y2 = y2 ;
return _this6 ;
}
createClass ( _SVGPathSegCurvetoCubicAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoCubicAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x1 + ' ' + this . _y1 + ' ' + this . _x2 + ' ' + this . _y2 + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoCubicAbs ( undefined , this . _x , this . _y , this . _x1 , this . _y1 , this . _x2 , this . _y2 ) ;
}
} ] ) ;
return _SVGPathSegCurvetoCubicAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoCubicAbs . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x1 : {
get : function get$$1 ( ) {
return this . _x1 ;
} ,
set : function set$$1 ( x1 ) {
this . _x1 = x1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y1 : {
get : function get$$1 ( ) {
return this . _y1 ;
} ,
set : function set$$1 ( y1 ) {
this . _y1 = y1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x2 : {
get : function get$$1 ( ) {
return this . _x2 ;
} ,
set : function set$$1 ( x2 ) {
this . _x2 = x2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y2 : {
get : function get$$1 ( ) {
return this . _y2 ;
} ,
set : function set$$1 ( y2 ) {
this . _y2 = y2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegCurvetoCubicRel = function ( _SVGPathSeg8 ) {
inherits ( _SVGPathSegCurvetoCubicRel , _SVGPathSeg8 ) ;
function _SVGPathSegCurvetoCubicRel ( owningPathSegList , x , y , x1 , y1 , x2 , y2 ) {
classCallCheck ( this , _SVGPathSegCurvetoCubicRel ) ;
var _this7 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoCubicRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoCubicRel ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _CUBIC _REL , 'c' , owningPathSegList ) ) ;
_this7 . _x = x ;
_this7 . _y = y ;
_this7 . _x1 = x1 ;
_this7 . _y1 = y1 ;
_this7 . _x2 = x2 ;
_this7 . _y2 = y2 ;
return _this7 ;
}
createClass ( _SVGPathSegCurvetoCubicRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoCubicRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x1 + ' ' + this . _y1 + ' ' + this . _x2 + ' ' + this . _y2 + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoCubicRel ( undefined , this . _x , this . _y , this . _x1 , this . _y1 , this . _x2 , this . _y2 ) ;
}
} ] ) ;
return _SVGPathSegCurvetoCubicRel ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoCubicRel . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x1 : {
get : function get$$1 ( ) {
return this . _x1 ;
} ,
set : function set$$1 ( x1 ) {
this . _x1 = x1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y1 : {
get : function get$$1 ( ) {
return this . _y1 ;
} ,
set : function set$$1 ( y1 ) {
this . _y1 = y1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x2 : {
get : function get$$1 ( ) {
return this . _x2 ;
} ,
set : function set$$1 ( x2 ) {
this . _x2 = x2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y2 : {
get : function get$$1 ( ) {
return this . _y2 ;
} ,
set : function set$$1 ( y2 ) {
this . _y2 = y2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegCurvetoQuadraticAbs = function ( _SVGPathSeg9 ) {
inherits ( _SVGPathSegCurvetoQuadraticAbs , _SVGPathSeg9 ) ;
function _SVGPathSegCurvetoQuadraticAbs ( owningPathSegList , x , y , x1 , y1 ) {
classCallCheck ( this , _SVGPathSegCurvetoQuadraticAbs ) ;
var _this8 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoQuadraticAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoQuadraticAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _ABS , 'Q' , owningPathSegList ) ) ;
_this8 . _x = x ;
_this8 . _y = y ;
_this8 . _x1 = x1 ;
_this8 . _y1 = y1 ;
return _this8 ;
}
createClass ( _SVGPathSegCurvetoQuadraticAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoQuadraticAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x1 + ' ' + this . _y1 + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoQuadraticAbs ( undefined , this . _x , this . _y , this . _x1 , this . _y1 ) ;
}
} ] ) ;
return _SVGPathSegCurvetoQuadraticAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoQuadraticAbs . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x1 : {
get : function get$$1 ( ) {
return this . _x1 ;
} ,
set : function set$$1 ( x1 ) {
this . _x1 = x1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y1 : {
get : function get$$1 ( ) {
return this . _y1 ;
} ,
set : function set$$1 ( y1 ) {
this . _y1 = y1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegCurvetoQuadraticRel = function ( _SVGPathSeg10 ) {
inherits ( _SVGPathSegCurvetoQuadraticRel , _SVGPathSeg10 ) ;
function _SVGPathSegCurvetoQuadraticRel ( owningPathSegList , x , y , x1 , y1 ) {
classCallCheck ( this , _SVGPathSegCurvetoQuadraticRel ) ;
var _this9 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoQuadraticRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoQuadraticRel ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _REL , 'q' , owningPathSegList ) ) ;
_this9 . _x = x ;
_this9 . _y = y ;
_this9 . _x1 = x1 ;
_this9 . _y1 = y1 ;
return _this9 ;
}
createClass ( _SVGPathSegCurvetoQuadraticRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoQuadraticRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x1 + ' ' + this . _y1 + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoQuadraticRel ( undefined , this . _x , this . _y , this . _x1 , this . _y1 ) ;
}
} ] ) ;
return _SVGPathSegCurvetoQuadraticRel ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoQuadraticRel . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x1 : {
get : function get$$1 ( ) {
return this . _x1 ;
} ,
set : function set$$1 ( x1 ) {
this . _x1 = x1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y1 : {
get : function get$$1 ( ) {
return this . _y1 ;
} ,
set : function set$$1 ( y1 ) {
this . _y1 = y1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegArcAbs = function ( _SVGPathSeg11 ) {
inherits ( _SVGPathSegArcAbs , _SVGPathSeg11 ) ;
function _SVGPathSegArcAbs ( owningPathSegList , x , y , r1 , r2 , angle , largeArcFlag , sweepFlag ) {
classCallCheck ( this , _SVGPathSegArcAbs ) ;
var _this10 = possibleConstructorReturn ( this , ( _SVGPathSegArcAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegArcAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _ARC _ABS , 'A' , owningPathSegList ) ) ;
_this10 . _x = x ;
_this10 . _y = y ;
_this10 . _r1 = r1 ;
_this10 . _r2 = r2 ;
_this10 . _angle = angle ;
_this10 . _largeArcFlag = largeArcFlag ;
_this10 . _sweepFlag = sweepFlag ;
return _this10 ;
}
createClass ( _SVGPathSegArcAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegArcAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _r1 + ' ' + this . _r2 + ' ' + this . _angle + ' ' + ( this . _largeArcFlag ? '1' : '0' ) + ' ' + ( this . _sweepFlag ? '1' : '0' ) + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegArcAbs ( undefined , this . _x , this . _y , this . _r1 , this . _r2 , this . _angle , this . _largeArcFlag , this . _sweepFlag ) ;
}
} ] ) ;
return _SVGPathSegArcAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegArcAbs . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
r1 : {
get : function get$$1 ( ) {
return this . _r1 ;
} ,
set : function set$$1 ( r1 ) {
this . _r1 = r1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
r2 : {
get : function get$$1 ( ) {
return this . _r2 ;
} ,
set : function set$$1 ( r2 ) {
this . _r2 = r2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
angle : {
get : function get$$1 ( ) {
return this . _angle ;
} ,
set : function set$$1 ( angle ) {
this . _angle = angle ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
largeArcFlag : {
get : function get$$1 ( ) {
return this . _largeArcFlag ;
} ,
set : function set$$1 ( largeArcFlag ) {
this . _largeArcFlag = largeArcFlag ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
sweepFlag : {
get : function get$$1 ( ) {
return this . _sweepFlag ;
} ,
set : function set$$1 ( sweepFlag ) {
this . _sweepFlag = sweepFlag ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegArcRel = function ( _SVGPathSeg12 ) {
inherits ( _SVGPathSegArcRel , _SVGPathSeg12 ) ;
function _SVGPathSegArcRel ( owningPathSegList , x , y , r1 , r2 , angle , largeArcFlag , sweepFlag ) {
classCallCheck ( this , _SVGPathSegArcRel ) ;
var _this11 = possibleConstructorReturn ( this , ( _SVGPathSegArcRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegArcRel ) ) . call ( this , _SVGPathSeg . PATHSEG _ARC _REL , 'a' , owningPathSegList ) ) ;
_this11 . _x = x ;
_this11 . _y = y ;
_this11 . _r1 = r1 ;
_this11 . _r2 = r2 ;
_this11 . _angle = angle ;
_this11 . _largeArcFlag = largeArcFlag ;
_this11 . _sweepFlag = sweepFlag ;
return _this11 ;
}
createClass ( _SVGPathSegArcRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegArcRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _r1 + ' ' + this . _r2 + ' ' + this . _angle + ' ' + ( this . _largeArcFlag ? '1' : '0' ) + ' ' + ( this . _sweepFlag ? '1' : '0' ) + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegArcRel ( undefined , this . _x , this . _y , this . _r1 , this . _r2 , this . _angle , this . _largeArcFlag , this . _sweepFlag ) ;
}
} ] ) ;
return _SVGPathSegArcRel ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegArcRel . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
r1 : {
get : function get$$1 ( ) {
return this . _r1 ;
} ,
set : function set$$1 ( r1 ) {
this . _r1 = r1 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
r2 : {
get : function get$$1 ( ) {
return this . _r2 ;
} ,
set : function set$$1 ( r2 ) {
this . _r2 = r2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
angle : {
get : function get$$1 ( ) {
return this . _angle ;
} ,
set : function set$$1 ( angle ) {
this . _angle = angle ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
largeArcFlag : {
get : function get$$1 ( ) {
return this . _largeArcFlag ;
} ,
set : function set$$1 ( largeArcFlag ) {
this . _largeArcFlag = largeArcFlag ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
sweepFlag : {
get : function get$$1 ( ) {
return this . _sweepFlag ;
} ,
set : function set$$1 ( sweepFlag ) {
this . _sweepFlag = sweepFlag ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegLinetoHorizontalAbs = function ( _SVGPathSeg13 ) {
inherits ( _SVGPathSegLinetoHorizontalAbs , _SVGPathSeg13 ) ;
function _SVGPathSegLinetoHorizontalAbs ( owningPathSegList , x ) {
classCallCheck ( this , _SVGPathSegLinetoHorizontalAbs ) ;
var _this12 = possibleConstructorReturn ( this , ( _SVGPathSegLinetoHorizontalAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegLinetoHorizontalAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _ABS , 'H' , owningPathSegList ) ) ;
_this12 . _x = x ;
return _this12 ;
}
createClass ( _SVGPathSegLinetoHorizontalAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegLinetoHorizontalAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegLinetoHorizontalAbs ( undefined , this . _x ) ;
}
} ] ) ;
return _SVGPathSegLinetoHorizontalAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperty ( _SVGPathSegLinetoHorizontalAbs . prototype , 'x' , {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ) ;
var _SVGPathSegLinetoHorizontalRel = function ( _SVGPathSeg14 ) {
inherits ( _SVGPathSegLinetoHorizontalRel , _SVGPathSeg14 ) ;
function _SVGPathSegLinetoHorizontalRel ( owningPathSegList , x ) {
classCallCheck ( this , _SVGPathSegLinetoHorizontalRel ) ;
var _this13 = possibleConstructorReturn ( this , ( _SVGPathSegLinetoHorizontalRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegLinetoHorizontalRel ) ) . call ( this , _SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _REL , 'h' , owningPathSegList ) ) ;
_this13 . _x = x ;
return _this13 ;
}
createClass ( _SVGPathSegLinetoHorizontalRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegLinetoHorizontalRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegLinetoHorizontalRel ( undefined , this . _x ) ;
}
} ] ) ;
return _SVGPathSegLinetoHorizontalRel ;
} ( _SVGPathSeg ) ;
Object . defineProperty ( _SVGPathSegLinetoHorizontalRel . prototype , 'x' , {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ) ;
var _SVGPathSegLinetoVerticalAbs = function ( _SVGPathSeg15 ) {
inherits ( _SVGPathSegLinetoVerticalAbs , _SVGPathSeg15 ) ;
function _SVGPathSegLinetoVerticalAbs ( owningPathSegList , y ) {
classCallCheck ( this , _SVGPathSegLinetoVerticalAbs ) ;
var _this14 = possibleConstructorReturn ( this , ( _SVGPathSegLinetoVerticalAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegLinetoVerticalAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _LINETO _VERTICAL _ABS , 'V' , owningPathSegList ) ) ;
_this14 . _y = y ;
return _this14 ;
}
createClass ( _SVGPathSegLinetoVerticalAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegLinetoVerticalAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegLinetoVerticalAbs ( undefined , this . _y ) ;
}
} ] ) ;
return _SVGPathSegLinetoVerticalAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperty ( _SVGPathSegLinetoVerticalAbs . prototype , 'y' , {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ) ;
var _SVGPathSegLinetoVerticalRel = function ( _SVGPathSeg16 ) {
inherits ( _SVGPathSegLinetoVerticalRel , _SVGPathSeg16 ) ;
function _SVGPathSegLinetoVerticalRel ( owningPathSegList , y ) {
classCallCheck ( this , _SVGPathSegLinetoVerticalRel ) ;
var _this15 = possibleConstructorReturn ( this , ( _SVGPathSegLinetoVerticalRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegLinetoVerticalRel ) ) . call ( this , _SVGPathSeg . PATHSEG _LINETO _VERTICAL _REL , 'v' , owningPathSegList ) ) ;
_this15 . _y = y ;
return _this15 ;
}
createClass ( _SVGPathSegLinetoVerticalRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegLinetoVerticalRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegLinetoVerticalRel ( undefined , this . _y ) ;
}
} ] ) ;
return _SVGPathSegLinetoVerticalRel ;
} ( _SVGPathSeg ) ;
Object . defineProperty ( _SVGPathSegLinetoVerticalRel . prototype , 'y' , {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ) ;
var _SVGPathSegCurvetoCubicSmoothAbs = function ( _SVGPathSeg17 ) {
inherits ( _SVGPathSegCurvetoCubicSmoothAbs , _SVGPathSeg17 ) ;
function _SVGPathSegCurvetoCubicSmoothAbs ( owningPathSegList , x , y , x2 , y2 ) {
classCallCheck ( this , _SVGPathSegCurvetoCubicSmoothAbs ) ;
var _this16 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoCubicSmoothAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoCubicSmoothAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _ABS , 'S' , owningPathSegList ) ) ;
_this16 . _x = x ;
_this16 . _y = y ;
_this16 . _x2 = x2 ;
_this16 . _y2 = y2 ;
return _this16 ;
}
createClass ( _SVGPathSegCurvetoCubicSmoothAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoCubicSmoothAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x2 + ' ' + this . _y2 + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoCubicSmoothAbs ( undefined , this . _x , this . _y , this . _x2 , this . _y2 ) ;
}
} ] ) ;
return _SVGPathSegCurvetoCubicSmoothAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoCubicSmoothAbs . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x2 : {
get : function get$$1 ( ) {
return this . _x2 ;
} ,
set : function set$$1 ( x2 ) {
this . _x2 = x2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y2 : {
get : function get$$1 ( ) {
return this . _y2 ;
} ,
set : function set$$1 ( y2 ) {
this . _y2 = y2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegCurvetoCubicSmoothRel = function ( _SVGPathSeg18 ) {
inherits ( _SVGPathSegCurvetoCubicSmoothRel , _SVGPathSeg18 ) ;
function _SVGPathSegCurvetoCubicSmoothRel ( owningPathSegList , x , y , x2 , y2 ) {
classCallCheck ( this , _SVGPathSegCurvetoCubicSmoothRel ) ;
var _this17 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoCubicSmoothRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoCubicSmoothRel ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _REL , 's' , owningPathSegList ) ) ;
_this17 . _x = x ;
_this17 . _y = y ;
_this17 . _x2 = x2 ;
_this17 . _y2 = y2 ;
return _this17 ;
}
createClass ( _SVGPathSegCurvetoCubicSmoothRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoCubicSmoothRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x2 + ' ' + this . _y2 + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoCubicSmoothRel ( undefined , this . _x , this . _y , this . _x2 , this . _y2 ) ;
}
} ] ) ;
return _SVGPathSegCurvetoCubicSmoothRel ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoCubicSmoothRel . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
x2 : {
get : function get$$1 ( ) {
return this . _x2 ;
} ,
set : function set$$1 ( x2 ) {
this . _x2 = x2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y2 : {
get : function get$$1 ( ) {
return this . _y2 ;
} ,
set : function set$$1 ( y2 ) {
this . _y2 = y2 ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegCurvetoQuadraticSmoothAbs = function ( _SVGPathSeg19 ) {
inherits ( _SVGPathSegCurvetoQuadraticSmoothAbs , _SVGPathSeg19 ) ;
function _SVGPathSegCurvetoQuadraticSmoothAbs ( owningPathSegList , x , y ) {
classCallCheck ( this , _SVGPathSegCurvetoQuadraticSmoothAbs ) ;
var _this18 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoQuadraticSmoothAbs . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoQuadraticSmoothAbs ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _ABS , 'T' , owningPathSegList ) ) ;
_this18 . _x = x ;
_this18 . _y = y ;
return _this18 ;
}
createClass ( _SVGPathSegCurvetoQuadraticSmoothAbs , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoQuadraticSmoothAbs]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoQuadraticSmoothAbs ( undefined , this . _x , this . _y ) ;
}
} ] ) ;
return _SVGPathSegCurvetoQuadraticSmoothAbs ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoQuadraticSmoothAbs . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
var _SVGPathSegCurvetoQuadraticSmoothRel = function ( _SVGPathSeg20 ) {
inherits ( _SVGPathSegCurvetoQuadraticSmoothRel , _SVGPathSeg20 ) ;
function _SVGPathSegCurvetoQuadraticSmoothRel ( owningPathSegList , x , y ) {
classCallCheck ( this , _SVGPathSegCurvetoQuadraticSmoothRel ) ;
var _this19 = possibleConstructorReturn ( this , ( _SVGPathSegCurvetoQuadraticSmoothRel . _ _proto _ _ || Object . getPrototypeOf ( _SVGPathSegCurvetoQuadraticSmoothRel ) ) . call ( this , _SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _REL , 't' , owningPathSegList ) ) ;
_this19 . _x = x ;
_this19 . _y = y ;
return _this19 ;
}
createClass ( _SVGPathSegCurvetoQuadraticSmoothRel , [ {
key : 'toString' ,
value : function toString ( ) {
return '[object SVGPathSegCurvetoQuadraticSmoothRel]' ;
}
} , {
key : '_asPathString' ,
value : function _asPathString ( ) {
return this . pathSegTypeAsLetter + ' ' + this . _x + ' ' + this . _y ;
}
} , {
key : 'clone' ,
value : function clone ( ) {
return new _SVGPathSegCurvetoQuadraticSmoothRel ( undefined , this . _x , this . _y ) ;
}
} ] ) ;
return _SVGPathSegCurvetoQuadraticSmoothRel ;
} ( _SVGPathSeg ) ;
Object . defineProperties ( _SVGPathSegCurvetoQuadraticSmoothRel . prototype , {
x : {
get : function get$$1 ( ) {
return this . _x ;
} ,
set : function set$$1 ( x ) {
this . _x = x ; this . _segmentChanged ( ) ;
} ,
enumerable : true } ,
y : {
get : function get$$1 ( ) {
return this . _y ;
} ,
set : function set$$1 ( y ) {
this . _y = y ; this . _segmentChanged ( ) ;
} ,
enumerable : true }
} ) ;
// Add createSVGPathSeg* functions to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathElement.
SVGPathElement . prototype . createSVGPathSegClosePath = function ( ) {
return new _SVGPathSegClosePath ( undefined ) ;
} ;
SVGPathElement . prototype . createSVGPathSegMovetoAbs = function ( x , y ) {
return new _SVGPathSegMovetoAbs ( undefined , x , y ) ;
} ;
SVGPathElement . prototype . createSVGPathSegMovetoRel = function ( x , y ) {
return new _SVGPathSegMovetoRel ( undefined , x , y ) ;
} ;
SVGPathElement . prototype . createSVGPathSegLinetoAbs = function ( x , y ) {
return new _SVGPathSegLinetoAbs ( undefined , x , y ) ;
} ;
SVGPathElement . prototype . createSVGPathSegLinetoRel = function ( x , y ) {
return new _SVGPathSegLinetoRel ( undefined , x , y ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoCubicAbs = function ( x , y , x1 , y1 , x2 , y2 ) {
return new _SVGPathSegCurvetoCubicAbs ( undefined , x , y , x1 , y1 , x2 , y2 ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoCubicRel = function ( x , y , x1 , y1 , x2 , y2 ) {
return new _SVGPathSegCurvetoCubicRel ( undefined , x , y , x1 , y1 , x2 , y2 ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoQuadraticAbs = function ( x , y , x1 , y1 ) {
return new _SVGPathSegCurvetoQuadraticAbs ( undefined , x , y , x1 , y1 ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoQuadraticRel = function ( x , y , x1 , y1 ) {
return new _SVGPathSegCurvetoQuadraticRel ( undefined , x , y , x1 , y1 ) ;
} ;
SVGPathElement . prototype . createSVGPathSegArcAbs = function ( x , y , r1 , r2 , angle , largeArcFlag , sweepFlag ) {
return new _SVGPathSegArcAbs ( undefined , x , y , r1 , r2 , angle , largeArcFlag , sweepFlag ) ;
} ;
SVGPathElement . prototype . createSVGPathSegArcRel = function ( x , y , r1 , r2 , angle , largeArcFlag , sweepFlag ) {
return new _SVGPathSegArcRel ( undefined , x , y , r1 , r2 , angle , largeArcFlag , sweepFlag ) ;
} ;
SVGPathElement . prototype . createSVGPathSegLinetoHorizontalAbs = function ( x ) {
return new _SVGPathSegLinetoHorizontalAbs ( undefined , x ) ;
} ;
SVGPathElement . prototype . createSVGPathSegLinetoHorizontalRel = function ( x ) {
return new _SVGPathSegLinetoHorizontalRel ( undefined , x ) ;
} ;
SVGPathElement . prototype . createSVGPathSegLinetoVerticalAbs = function ( y ) {
return new _SVGPathSegLinetoVerticalAbs ( undefined , y ) ;
} ;
SVGPathElement . prototype . createSVGPathSegLinetoVerticalRel = function ( y ) {
return new _SVGPathSegLinetoVerticalRel ( undefined , y ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoCubicSmoothAbs = function ( x , y , x2 , y2 ) {
return new _SVGPathSegCurvetoCubicSmoothAbs ( undefined , x , y , x2 , y2 ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoCubicSmoothRel = function ( x , y , x2 , y2 ) {
return new _SVGPathSegCurvetoCubicSmoothRel ( undefined , x , y , x2 , y2 ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoQuadraticSmoothAbs = function ( x , y ) {
return new _SVGPathSegCurvetoQuadraticSmoothAbs ( undefined , x , y ) ;
} ;
SVGPathElement . prototype . createSVGPathSegCurvetoQuadraticSmoothRel = function ( x , y ) {
return new _SVGPathSegCurvetoQuadraticSmoothRel ( undefined , x , y ) ;
} ;
if ( ! ( 'getPathSegAtLength' in SVGPathElement . prototype ) ) {
// Add getPathSegAtLength to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-__svg__SVGPathElement__getPathSegAtLength
// This polyfill requires SVGPathElement.getTotalLength to implement the distance-along-a-path algorithm.
SVGPathElement . prototype . getPathSegAtLength = function ( distance ) {
if ( distance === undefined || ! isFinite ( distance ) ) {
throw new Error ( 'Invalid arguments.' ) ;
}
var measurementElement = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'path' ) ;
measurementElement . setAttribute ( 'd' , this . getAttribute ( 'd' ) ) ;
var lastPathSegment = measurementElement . pathSegList . numberOfItems - 1 ;
// If the path is empty, return 0.
if ( lastPathSegment <= 0 ) {
return 0 ;
}
do {
measurementElement . pathSegList . removeItem ( lastPathSegment ) ;
if ( distance > measurementElement . getTotalLength ( ) ) {
break ;
}
lastPathSegment -- ;
} while ( lastPathSegment > 0 ) ;
return lastPathSegment ;
} ;
}
window . SVGPathSeg = _SVGPathSeg ;
window . SVGPathSegClosePath = _SVGPathSegClosePath ;
window . SVGPathSegMovetoAbs = _SVGPathSegMovetoAbs ;
window . SVGPathSegMovetoRel = _SVGPathSegMovetoRel ;
window . SVGPathSegLinetoAbs = _SVGPathSegLinetoAbs ;
window . SVGPathSegLinetoRel = _SVGPathSegLinetoRel ;
window . SVGPathSegCurvetoCubicAbs = _SVGPathSegCurvetoCubicAbs ;
window . SVGPathSegCurvetoCubicRel = _SVGPathSegCurvetoCubicRel ;
window . SVGPathSegCurvetoQuadraticAbs = _SVGPathSegCurvetoQuadraticAbs ;
window . SVGPathSegCurvetoQuadraticRel = _SVGPathSegCurvetoQuadraticRel ;
window . SVGPathSegArcAbs = _SVGPathSegArcAbs ;
window . SVGPathSegArcRel = _SVGPathSegArcRel ;
window . SVGPathSegLinetoHorizontalAbs = _SVGPathSegLinetoHorizontalAbs ;
window . SVGPathSegLinetoHorizontalRel = _SVGPathSegLinetoHorizontalRel ;
window . SVGPathSegLinetoVerticalAbs = _SVGPathSegLinetoVerticalAbs ;
window . SVGPathSegLinetoVerticalRel = _SVGPathSegLinetoVerticalRel ;
window . SVGPathSegCurvetoCubicSmoothAbs = _SVGPathSegCurvetoCubicSmoothAbs ;
window . SVGPathSegCurvetoCubicSmoothRel = _SVGPathSegCurvetoCubicSmoothRel ;
window . SVGPathSegCurvetoQuadraticSmoothAbs = _SVGPathSegCurvetoQuadraticSmoothAbs ;
window . SVGPathSegCurvetoQuadraticSmoothRel = _SVGPathSegCurvetoQuadraticSmoothRel ;
}
// Checking for SVGPathSegList in window checks for the case of an implementation without the
// SVGPathSegList API.
// The second check for appendItem is specific to Firefox 59+ which removed only parts of the
// SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API
// so the polyfill data (i.e., _list) is used throughout.
if ( ! ( 'SVGPathSegList' in window ) || ! ( 'appendItem' in SVGPathSegList . prototype ) ) {
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
var _SVGPathSegList = function ( ) {
function _SVGPathSegList ( pathElement ) {
classCallCheck ( this , _SVGPathSegList ) ;
this . _pathElement = pathElement ;
this . _list = this . _parsePath ( this . _pathElement . getAttribute ( 'd' ) ) ;
// Use a MutationObserver to catch changes to the path's "d" attribute.
this . _mutationObserverConfig = { attributes : true , attributeFilter : [ 'd' ] } ;
this . _pathElementMutationObserver = new MutationObserver ( this . _updateListFromPathMutations . bind ( this ) ) ;
this . _pathElementMutationObserver . observe ( this . _pathElement , this . _mutationObserverConfig ) ;
}
// Process any pending mutations to the path element and update the list as needed.
// This should be the first call of all public functions and is needed because
// MutationObservers are not synchronous so we can have pending asynchronous mutations.
createClass ( _SVGPathSegList , [ {
key : '_checkPathSynchronizedToList' ,
value : function _checkPathSynchronizedToList ( ) {
this . _updateListFromPathMutations ( this . _pathElementMutationObserver . takeRecords ( ) ) ;
}
} , {
key : '_updateListFromPathMutations' ,
value : function _updateListFromPathMutations ( mutationRecords ) {
if ( ! this . _pathElement ) {
return ;
}
var hasPathMutations = false ;
mutationRecords . forEach ( function ( record ) {
if ( record . attributeName === 'd' ) {
hasPathMutations = true ;
}
} ) ;
if ( hasPathMutations ) {
this . _list = this . _parsePath ( this . _pathElement . getAttribute ( 'd' ) ) ;
}
}
// Serialize the list and update the path's 'd' attribute.
} , {
key : '_writeListToPath' ,
value : function _writeListToPath ( ) {
this . _pathElementMutationObserver . disconnect ( ) ;
this . _pathElement . setAttribute ( 'd' , _SVGPathSegList . _pathSegArrayAsString ( this . _list ) ) ;
this . _pathElementMutationObserver . observe ( this . _pathElement , this . _mutationObserverConfig ) ;
}
// When a path segment changes the list needs to be synchronized back to the path element.
} , {
key : 'segmentChanged' ,
value : function segmentChanged ( pathSeg ) {
this . _writeListToPath ( ) ;
}
} , {
key : 'clear' ,
value : function clear ( ) {
this . _checkPathSynchronizedToList ( ) ;
this . _list . forEach ( function ( pathSeg ) {
pathSeg . _owningPathSegList = null ;
} ) ;
this . _list = [ ] ;
this . _writeListToPath ( ) ;
}
} , {
key : 'initialize' ,
value : function initialize ( newItem ) {
this . _checkPathSynchronizedToList ( ) ;
this . _list = [ newItem ] ;
newItem . _owningPathSegList = this ;
this . _writeListToPath ( ) ;
return newItem ;
}
} , {
key : '_checkValidIndex' ,
value : function _checkValidIndex ( index ) {
if ( isNaN ( index ) || index < 0 || index >= this . numberOfItems ) {
throw new Error ( 'INDEX_SIZE_ERR' ) ;
}
}
} , {
key : 'getItem' ,
value : function getItem ( index ) {
this . _checkPathSynchronizedToList ( ) ;
this . _checkValidIndex ( index ) ;
return this . _list [ index ] ;
}
} , {
key : 'insertItemBefore' ,
value : function insertItemBefore ( newItem , index ) {
this . _checkPathSynchronizedToList ( ) ;
// Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
if ( index > this . numberOfItems ) {
index = this . numberOfItems ;
}
if ( newItem . _owningPathSegList ) {
// SVG2 spec says to make a copy.
newItem = newItem . clone ( ) ;
}
this . _list . splice ( index , 0 , newItem ) ;
newItem . _owningPathSegList = this ;
this . _writeListToPath ( ) ;
return newItem ;
}
} , {
key : 'replaceItem' ,
value : function replaceItem ( newItem , index ) {
this . _checkPathSynchronizedToList ( ) ;
if ( newItem . _owningPathSegList ) {
// SVG2 spec says to make a copy.
newItem = newItem . clone ( ) ;
}
this . _checkValidIndex ( index ) ;
this . _list [ index ] = newItem ;
newItem . _owningPathSegList = this ;
this . _writeListToPath ( ) ;
return newItem ;
}
} , {
key : 'removeItem' ,
value : function removeItem ( index ) {
this . _checkPathSynchronizedToList ( ) ;
this . _checkValidIndex ( index ) ;
var item = this . _list [ index ] ;
this . _list . splice ( index , 1 ) ;
this . _writeListToPath ( ) ;
return item ;
}
} , {
key : 'appendItem' ,
value : function appendItem ( newItem ) {
this . _checkPathSynchronizedToList ( ) ;
if ( newItem . _owningPathSegList ) {
// SVG2 spec says to make a copy.
newItem = newItem . clone ( ) ;
}
this . _list . push ( newItem ) ;
newItem . _owningPathSegList = this ;
// TODO: Optimize this to just append to the existing attribute.
this . _writeListToPath ( ) ;
return newItem ;
}
// This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp.
} , {
key : '_parsePath' ,
value : function _parsePath ( string ) {
if ( ! string || ! string . length ) {
return [ ] ;
}
var owningPathSegList = this ;
var Builder = function ( ) {
function Builder ( ) {
classCallCheck ( this , Builder ) ;
this . pathSegList = [ ] ;
}
createClass ( Builder , [ {
key : 'appendSegment' ,
value : function appendSegment ( pathSeg ) {
this . pathSegList . push ( pathSeg ) ;
}
} ] ) ;
return Builder ;
} ( ) ;
var Source = function ( ) {
function Source ( string ) {
classCallCheck ( this , Source ) ;
this . _string = string ;
this . _currentIndex = 0 ;
this . _endIndex = this . _string . length ;
this . _previousCommand = SVGPathSeg . PATHSEG _UNKNOWN ;
this . _skipOptionalSpaces ( ) ;
}
createClass ( Source , [ {
key : '_isCurrentSpace' ,
value : function _isCurrentSpace ( ) {
var character = this . _string [ this . _currentIndex ] ;
return character <= ' ' && ( character === ' ' || character === '\n' || character === '\t' || character === '\r' || character === '\f' ) ;
}
} , {
key : '_skipOptionalSpaces' ,
value : function _skipOptionalSpaces ( ) {
while ( this . _currentIndex < this . _endIndex && this . _isCurrentSpace ( ) ) {
this . _currentIndex ++ ;
}
return this . _currentIndex < this . _endIndex ;
}
} , {
key : '_skipOptionalSpacesOrDelimiter' ,
value : function _skipOptionalSpacesOrDelimiter ( ) {
if ( this . _currentIndex < this . _endIndex && ! this . _isCurrentSpace ( ) && this . _string . charAt ( this . _currentIndex ) !== ',' ) {
return false ;
}
if ( this . _skipOptionalSpaces ( ) ) {
if ( this . _currentIndex < this . _endIndex && this . _string . charAt ( this . _currentIndex ) === ',' ) {
this . _currentIndex ++ ;
this . _skipOptionalSpaces ( ) ;
}
}
return this . _currentIndex < this . _endIndex ;
}
} , {
key : 'hasMoreData' ,
value : function hasMoreData ( ) {
return this . _currentIndex < this . _endIndex ;
}
} , {
key : 'peekSegmentType' ,
value : function peekSegmentType ( ) {
var lookahead = this . _string [ this . _currentIndex ] ;
return this . _pathSegTypeFromChar ( lookahead ) ;
}
} , {
key : '_pathSegTypeFromChar' ,
value : function _pathSegTypeFromChar ( lookahead ) {
switch ( lookahead ) {
case 'Z' :
case 'z' :
return SVGPathSeg . PATHSEG _CLOSEPATH ;
case 'M' :
return SVGPathSeg . PATHSEG _MOVETO _ABS ;
case 'm' :
return SVGPathSeg . PATHSEG _MOVETO _REL ;
case 'L' :
return SVGPathSeg . PATHSEG _LINETO _ABS ;
case 'l' :
return SVGPathSeg . PATHSEG _LINETO _REL ;
case 'C' :
return SVGPathSeg . PATHSEG _CURVETO _CUBIC _ABS ;
case 'c' :
return SVGPathSeg . PATHSEG _CURVETO _CUBIC _REL ;
case 'Q' :
return SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _ABS ;
case 'q' :
return SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _REL ;
case 'A' :
return SVGPathSeg . PATHSEG _ARC _ABS ;
case 'a' :
return SVGPathSeg . PATHSEG _ARC _REL ;
case 'H' :
return SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _ABS ;
case 'h' :
return SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _REL ;
case 'V' :
return SVGPathSeg . PATHSEG _LINETO _VERTICAL _ABS ;
case 'v' :
return SVGPathSeg . PATHSEG _LINETO _VERTICAL _REL ;
case 'S' :
return SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _ABS ;
case 's' :
return SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _REL ;
case 'T' :
return SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _ABS ;
case 't' :
return SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _REL ;
default :
return SVGPathSeg . PATHSEG _UNKNOWN ;
}
}
} , {
key : '_nextCommandHelper' ,
value : function _nextCommandHelper ( lookahead , previousCommand ) {
// Check for remaining coordinates in the current command.
if ( ( lookahead === '+' || lookahead === '-' || lookahead === '.' || lookahead >= '0' && lookahead <= '9' ) && previousCommand !== SVGPathSeg . PATHSEG _CLOSEPATH ) {
if ( previousCommand === SVGPathSeg . PATHSEG _MOVETO _ABS ) {
return SVGPathSeg . PATHSEG _LINETO _ABS ;
}
if ( previousCommand === SVGPathSeg . PATHSEG _MOVETO _REL ) {
return SVGPathSeg . PATHSEG _LINETO _REL ;
}
return previousCommand ;
}
return SVGPathSeg . PATHSEG _UNKNOWN ;
}
} , {
key : 'initialCommandIsMoveTo' ,
value : function initialCommandIsMoveTo ( ) {
// If the path is empty it is still valid, so return true.
if ( ! this . hasMoreData ( ) ) {
return true ;
}
var command = this . peekSegmentType ( ) ;
// Path must start with moveTo.
return command === SVGPathSeg . PATHSEG _MOVETO _ABS || command === SVGPathSeg . PATHSEG _MOVETO _REL ;
}
// Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
} , {
key : '_parseNumber' ,
value : function _parseNumber ( ) {
var exponent = 0 ;
var integer = 0 ;
var frac = 1 ;
var decimal = 0 ;
var sign = 1 ;
var expsign = 1 ;
var startIndex = this . _currentIndex ;
this . _skipOptionalSpaces ( ) ;
// Read the sign.
if ( this . _currentIndex < this . _endIndex && this . _string . charAt ( this . _currentIndex ) === '+' ) {
this . _currentIndex ++ ;
} else if ( this . _currentIndex < this . _endIndex && this . _string . charAt ( this . _currentIndex ) === '-' ) {
this . _currentIndex ++ ;
sign = - 1 ;
}
if ( this . _currentIndex === this . _endIndex || ( this . _string . charAt ( this . _currentIndex ) < '0' || this . _string . charAt ( this . _currentIndex ) > '9' ) && this . _string . charAt ( this . _currentIndex ) !== '.' ) {
// The first character of a number must be one of [0-9+-.].
return undefined ;
}
// Read the integer part, build right-to-left.
var startIntPartIndex = this . _currentIndex ;
while ( this . _currentIndex < this . _endIndex && this . _string . charAt ( this . _currentIndex ) >= '0' && this . _string . charAt ( this . _currentIndex ) <= '9' ) {
this . _currentIndex ++ ; // Advance to first non-digit.
}
if ( this . _currentIndex !== startIntPartIndex ) {
var scanIntPartIndex = this . _currentIndex - 1 ;
var multiplier = 1 ;
while ( scanIntPartIndex >= startIntPartIndex ) {
integer += multiplier * ( this . _string . charAt ( scanIntPartIndex -- ) - '0' ) ;
multiplier *= 10 ;
}
}
// Read the decimals.
if ( this . _currentIndex < this . _endIndex && this . _string . charAt ( this . _currentIndex ) === '.' ) {
this . _currentIndex ++ ;
// There must be a least one digit following the .
if ( this . _currentIndex >= this . _endIndex || this . _string . charAt ( this . _currentIndex ) < '0' || this . _string . charAt ( this . _currentIndex ) > '9' ) {
return undefined ;
}
while ( this . _currentIndex < this . _endIndex && this . _string . charAt ( this . _currentIndex ) >= '0' && this . _string . charAt ( this . _currentIndex ) <= '9' ) {
frac *= 10 ;
decimal += ( this . _string . charAt ( this . _currentIndex ) - '0' ) / frac ;
this . _currentIndex += 1 ;
}
}
// Read the exponent part.
if ( this . _currentIndex !== startIndex && this . _currentIndex + 1 < this . _endIndex && ( this . _string . charAt ( this . _currentIndex ) === 'e' || this . _string . charAt ( this . _currentIndex ) === 'E' ) && this . _string . charAt ( this . _currentIndex + 1 ) !== 'x' && this . _string . charAt ( this . _currentIndex + 1 ) !== 'm' ) {
this . _currentIndex ++ ;
// Read the sign of the exponent.
if ( this . _string . charAt ( this . _currentIndex ) === '+' ) {
this . _currentIndex ++ ;
} else if ( this . _string . charAt ( this . _currentIndex ) === '-' ) {
this . _currentIndex ++ ;
expsign = - 1 ;
}
// There must be an exponent.
if ( this . _currentIndex >= this . _endIndex || this . _string . charAt ( this . _currentIndex ) < '0' || this . _string . charAt ( this . _currentIndex ) > '9' ) {
return undefined ;
}
while ( this . _currentIndex < this . _endIndex && this . _string . charAt ( this . _currentIndex ) >= '0' && this . _string . charAt ( this . _currentIndex ) <= '9' ) {
exponent *= 10 ;
exponent += this . _string . charAt ( this . _currentIndex ) - '0' ;
this . _currentIndex ++ ;
}
}
var number = integer + decimal ;
number *= sign ;
if ( exponent ) {
number *= Math . pow ( 10 , expsign * exponent ) ;
}
if ( startIndex === this . _currentIndex ) {
return undefined ;
}
this . _skipOptionalSpacesOrDelimiter ( ) ;
return number ;
}
} , {
key : '_parseArcFlag' ,
value : function _parseArcFlag ( ) {
if ( this . _currentIndex >= this . _endIndex ) {
return undefined ;
}
var flag = false ;
var flagChar = this . _string . charAt ( this . _currentIndex ++ ) ;
if ( flagChar === '0' ) {
flag = false ;
} else if ( flagChar === '1' ) {
flag = true ;
} else {
return undefined ;
}
this . _skipOptionalSpacesOrDelimiter ( ) ;
return flag ;
}
} , {
key : 'parseSegment' ,
value : function parseSegment ( ) {
var lookahead = this . _string [ this . _currentIndex ] ;
var command = this . _pathSegTypeFromChar ( lookahead ) ;
if ( command === SVGPathSeg . PATHSEG _UNKNOWN ) {
// Possibly an implicit command. Not allowed if this is the first command.
if ( this . _previousCommand === SVGPathSeg . PATHSEG _UNKNOWN ) {
return null ;
}
command = this . _nextCommandHelper ( lookahead , this . _previousCommand ) ;
if ( command === SVGPathSeg . PATHSEG _UNKNOWN ) {
return null ;
}
} else {
this . _currentIndex ++ ;
}
this . _previousCommand = command ;
switch ( command ) {
case SVGPathSeg . PATHSEG _MOVETO _REL :
return new SVGPathSegMovetoRel ( owningPathSegList , this . _parseNumber ( ) , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _MOVETO _ABS :
return new SVGPathSegMovetoAbs ( owningPathSegList , this . _parseNumber ( ) , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _LINETO _REL :
return new SVGPathSegLinetoRel ( owningPathSegList , this . _parseNumber ( ) , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _LINETO _ABS :
return new SVGPathSegLinetoAbs ( owningPathSegList , this . _parseNumber ( ) , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _REL :
return new SVGPathSegLinetoHorizontalRel ( owningPathSegList , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _LINETO _HORIZONTAL _ABS :
return new SVGPathSegLinetoHorizontalAbs ( owningPathSegList , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _LINETO _VERTICAL _REL :
return new SVGPathSegLinetoVerticalRel ( owningPathSegList , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _LINETO _VERTICAL _ABS :
return new SVGPathSegLinetoVerticalAbs ( owningPathSegList , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _CLOSEPATH :
this . _skipOptionalSpaces ( ) ;
return new SVGPathSegClosePath ( owningPathSegList ) ;
case SVGPathSeg . PATHSEG _CURVETO _CUBIC _REL :
{
var _points = { x1 : this . _parseNumber ( ) , y1 : this . _parseNumber ( ) , x2 : this . _parseNumber ( ) , y2 : this . _parseNumber ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegCurvetoCubicRel ( owningPathSegList , _points . x , _points . y , _points . x1 , _points . y1 , _points . x2 , _points . y2 ) ;
} case SVGPathSeg . PATHSEG _CURVETO _CUBIC _ABS :
{
var _points2 = { x1 : this . _parseNumber ( ) , y1 : this . _parseNumber ( ) , x2 : this . _parseNumber ( ) , y2 : this . _parseNumber ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegCurvetoCubicAbs ( owningPathSegList , _points2 . x , _points2 . y , _points2 . x1 , _points2 . y1 , _points2 . x2 , _points2 . y2 ) ;
} case SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _REL :
{
var _points3 = { x2 : this . _parseNumber ( ) , y2 : this . _parseNumber ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegCurvetoCubicSmoothRel ( owningPathSegList , _points3 . x , _points3 . y , _points3 . x2 , _points3 . y2 ) ;
} case SVGPathSeg . PATHSEG _CURVETO _CUBIC _SMOOTH _ABS :
{
var _points4 = { x2 : this . _parseNumber ( ) , y2 : this . _parseNumber ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegCurvetoCubicSmoothAbs ( owningPathSegList , _points4 . x , _points4 . y , _points4 . x2 , _points4 . y2 ) ;
} case SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _REL :
{
var _points5 = { x1 : this . _parseNumber ( ) , y1 : this . _parseNumber ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegCurvetoQuadraticRel ( owningPathSegList , _points5 . x , _points5 . y , _points5 . x1 , _points5 . y1 ) ;
} case SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _ABS :
var points = { x1 : this . _parseNumber ( ) , y1 : this . _parseNumber ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegCurvetoQuadraticAbs ( owningPathSegList , points . x , points . y , points . x1 , points . y1 ) ;
case SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _REL :
return new SVGPathSegCurvetoQuadraticSmoothRel ( owningPathSegList , this . _parseNumber ( ) , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _CURVETO _QUADRATIC _SMOOTH _ABS :
return new SVGPathSegCurvetoQuadraticSmoothAbs ( owningPathSegList , this . _parseNumber ( ) , this . _parseNumber ( ) ) ;
case SVGPathSeg . PATHSEG _ARC _REL :
{
var _points6 = { x1 : this . _parseNumber ( ) , y1 : this . _parseNumber ( ) , arcAngle : this . _parseNumber ( ) , arcLarge : this . _parseArcFlag ( ) , arcSweep : this . _parseArcFlag ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegArcRel ( owningPathSegList , _points6 . x , _points6 . y , _points6 . x1 , _points6 . y1 , _points6 . arcAngle , _points6 . arcLarge , _points6 . arcSweep ) ;
} case SVGPathSeg . PATHSEG _ARC _ABS :
{
var _points7 = { x1 : this . _parseNumber ( ) , y1 : this . _parseNumber ( ) , arcAngle : this . _parseNumber ( ) , arcLarge : this . _parseArcFlag ( ) , arcSweep : this . _parseArcFlag ( ) , x : this . _parseNumber ( ) , y : this . _parseNumber ( ) } ;
return new SVGPathSegArcAbs ( owningPathSegList , _points7 . x , _points7 . y , _points7 . x1 , _points7 . y1 , _points7 . arcAngle , _points7 . arcLarge , _points7 . arcSweep ) ;
} default :
throw new Error ( 'Unknown path seg type.' ) ;
}
}
} ] ) ;
return Source ;
} ( ) ;
var builder = new Builder ( ) ;
var source = new Source ( string ) ;
if ( ! source . initialCommandIsMoveTo ( ) ) {
return [ ] ;
}
while ( source . hasMoreData ( ) ) {
var pathSeg = source . parseSegment ( ) ;
if ( ! pathSeg ) {
return [ ] ;
}
builder . appendSegment ( pathSeg ) ;
}
return builder . pathSegList ;
}
} ] ) ;
return _SVGPathSegList ;
} ( ) ;
_SVGPathSegList . prototype . classname = 'SVGPathSegList' ;
Object . defineProperty ( _SVGPathSegList . prototype , 'numberOfItems' , {
get : function get$$1 ( ) {
this . _checkPathSynchronizedToList ( ) ;
return this . _list . length ;
} ,
enumerable : true
} ) ;
_SVGPathSegList . _pathSegArrayAsString = function ( pathSegArray ) {
var string = '' ;
var first = true ;
pathSegArray . forEach ( function ( pathSeg ) {
if ( first ) {
first = false ;
string += pathSeg . _asPathString ( ) ;
} else {
string += ' ' + pathSeg . _asPathString ( ) ;
}
} ) ;
return string ;
} ;
// Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object . defineProperties ( SVGPathElement . prototype , {
pathSegList : {
get : function get$$1 ( ) {
if ( ! this . _pathSegList ) {
this . _pathSegList = new _SVGPathSegList ( this ) ;
}
return this . _pathSegList ;
} ,
enumerable : true
} ,
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList.
normalizedPathSegList : {
get : function get$$1 ( ) {
return this . pathSegList ;
} ,
enumerable : true } ,
animatedPathSegList : {
get : function get$$1 ( ) {
return this . pathSegList ;
} ,
enumerable : true } ,
animatedNormalizedPathSegList : {
get : function get$$1 ( ) {
return this . pathSegList ;
} ,
enumerable : true }
} ) ;
window . SVGPathSegList = _SVGPathSegList ;
}
} ) ( ) ;
/ * *
- 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-06-06 07:26:20 +00:00
* Namespaces or tools therefor
* @ module namespaces
* @ license MIT
* /
- 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-22 10:03:16 +00:00
/ * *
* Common namepaces constants in alpha order
- 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-06-06 07:26:20 +00:00
* @ enum { string }
* @ type { PlainObject }
* @ memberof module : namespaces
- 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-22 10:03:16 +00:00
* /
var NS = {
HTML : 'http://www.w3.org/1999/xhtml' ,
MATH : 'http://www.w3.org/1998/Math/MathML' ,
SE : 'http://svg-edit.googlecode.com' ,
SVG : 'http://www.w3.org/2000/svg' ,
XLINK : 'http://www.w3.org/1999/xlink' ,
XML : 'http://www.w3.org/XML/1998/namespace' ,
XMLNS : 'http://www.w3.org/2000/xmlns/' // see http://www.w3.org/TR/REC-xml-names/#xmlReserved
} ;
/* globals jQuery */
var $ = jQuery ;
- 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-06-06 07:26:20 +00:00
var supportsSVG _ = function ( ) {
- 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-22 10:03:16 +00:00
return ! ! document . createElementNS && ! ! document . createElementNS ( NS . SVG , 'svg' ) . createSVGRect ;
} ( ) ;
- 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-06-06 07:26:20 +00:00
/ * *
* @ function module : browser . supportsSvg
* @ returns { boolean }
* /
- 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-22 10:03:16 +00:00
var supportsSvg = function supportsSvg ( ) {
- 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-06-06 07:26:20 +00:00
return supportsSVG _ ;
- 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-22 10:03:16 +00:00
} ;
var _navigator = navigator ,
userAgent = _navigator . userAgent ;
var svg = document . createElementNS ( NS . SVG , 'svg' ) ;
// Note: Browser sniffing should only be used if no other detection method is possible
var isOpera _ = ! ! window . opera ;
var isWebkit _ = userAgent . includes ( 'AppleWebKit' ) ;
var isGecko _ = userAgent . includes ( 'Gecko/' ) ;
var isIE _ = userAgent . includes ( 'MSIE' ) ;
var isChrome _ = userAgent . includes ( 'Chrome/' ) ;
var isWindows _ = userAgent . includes ( 'Windows' ) ;
var isMac _ = userAgent . includes ( 'Macintosh' ) ;
var supportsSelectors _ = function ( ) {
return ! ! svg . querySelector ;
} ( ) ;
var supportsXpath _ = function ( ) {
return ! ! document . evaluate ;
} ( ) ;
// segList functions (for FF1.5 and 2.0)
var supportsPathReplaceItem _ = function ( ) {
var path = document . createElementNS ( NS . SVG , 'path' ) ;
path . setAttribute ( 'd' , 'M0,0 10,10' ) ;
var seglist = path . pathSegList ;
var seg = path . createSVGPathSegLinetoAbs ( 5 , 5 ) ;
try {
seglist . replaceItem ( seg , 1 ) ;
return true ;
} catch ( err ) { }
return false ;
} ( ) ;
var supportsPathInsertItemBefore _ = function ( ) {
var path = document . createElementNS ( NS . SVG , 'path' ) ;
path . setAttribute ( 'd' , 'M0,0 10,10' ) ;
var seglist = path . pathSegList ;
var seg = path . createSVGPathSegLinetoAbs ( 5 , 5 ) ;
try {
seglist . insertItemBefore ( seg , 1 ) ;
return true ;
} catch ( err ) { }
return false ;
} ( ) ;
// text character positioning (for IE9)
var supportsGoodTextCharPos _ = function ( ) {
var svgroot = document . createElementNS ( NS . SVG , 'svg' ) ;
var svgcontent = document . createElementNS ( NS . SVG , 'svg' ) ;
- 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-02 01:14:38 +00:00
document . documentElement . append ( svgroot ) ;
- 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-22 10:03:16 +00:00
svgcontent . setAttribute ( 'x' , 5 ) ;
- 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-02 01:14:38 +00:00
svgroot . append ( svgcontent ) ;
- 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-22 10:03:16 +00:00
var text = document . createElementNS ( NS . SVG , 'text' ) ;
text . textContent = 'a' ;
- 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-02 01:14:38 +00:00
svgcontent . append ( text ) ;
- 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-22 10:03:16 +00:00
var pos = text . getStartPositionOfChar ( 0 ) . x ;
- 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-02 01:14:38 +00:00
svgroot . remove ( ) ;
- 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-22 10:03:16 +00:00
return pos === 0 ;
} ( ) ;
var supportsPathBBox _ = function ( ) {
var svgcontent = document . createElementNS ( NS . SVG , 'svg' ) ;
- 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-02 01:14:38 +00:00
document . documentElement . append ( svgcontent ) ;
- 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-22 10:03:16 +00:00
var path = document . createElementNS ( NS . SVG , 'path' ) ;
path . setAttribute ( 'd' , 'M0,0 C0,0 10,10 10,0' ) ;
- 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-02 01:14:38 +00:00
svgcontent . append ( path ) ;
- 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-22 10:03:16 +00:00
var bbox = path . getBBox ( ) ;
- 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-02 01:14:38 +00:00
svgcontent . remove ( ) ;
- 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-22 10:03:16 +00:00
return bbox . height > 4 && bbox . height < 5 ;
} ( ) ;
// Support for correct bbox sizing on groups with horizontal/vertical lines
var supportsHVLineContainerBBox _ = function ( ) {
var svgcontent = document . createElementNS ( NS . SVG , 'svg' ) ;
- 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-02 01:14:38 +00:00
document . documentElement . append ( svgcontent ) ;
- 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-22 10:03:16 +00:00
var path = document . createElementNS ( NS . SVG , 'path' ) ;
path . setAttribute ( 'd' , 'M0,0 10,0' ) ;
var path2 = document . createElementNS ( NS . SVG , 'path' ) ;
path2 . setAttribute ( 'd' , 'M5,0 15,0' ) ;
var g = document . createElementNS ( NS . SVG , 'g' ) ;
- 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-02 01:14:38 +00:00
g . append ( path , path2 ) ;
svgcontent . append ( g ) ;
- 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-22 10:03:16 +00:00
var bbox = g . getBBox ( ) ;
- 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-02 01:14:38 +00:00
svgcontent . remove ( ) ;
- 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-22 10:03:16 +00:00
// Webkit gives 0, FF gives 10, Opera (correctly) gives 15
return bbox . width === 15 ;
} ( ) ;
var supportsGoodDecimals _ = function ( ) {
// Correct decimals on clone attributes (Opera < 10.5/win/non-en)
var rect = document . createElementNS ( NS . SVG , 'rect' ) ;
rect . setAttribute ( 'x' , 0.1 ) ;
var crect = rect . cloneNode ( false ) ;
var retValue = ! crect . getAttribute ( 'x' ) . includes ( ',' ) ;
if ( ! retValue ) {
// Todo: i18nize or remove
$ . alert ( 'NOTE: This version of Opera is known to contain bugs in SVG-edit.\n' + 'Please upgrade to the <a href="http://opera.com">latest version</a> in which the problems have been fixed.' ) ;
}
return retValue ;
} ( ) ;
var supportsNonScalingStroke _ = function ( ) {
var rect = document . createElementNS ( NS . SVG , 'rect' ) ;
rect . setAttribute ( 'style' , 'vector-effect:non-scaling-stroke' ) ;
return rect . style . vectorEffect === 'non-scaling-stroke' ;
} ( ) ;
var supportsNativeSVGTransformLists _ = function ( ) {
var rect = document . createElementNS ( NS . SVG , 'rect' ) ;
var rxform = rect . transform . baseVal ;
var t1 = svg . createSVGTransform ( ) ;
rxform . appendItem ( t1 ) ;
var r1 = rxform . getItem ( 0 ) ;
// Todo: Do frame-independent instance checking
return r1 instanceof SVGTransform && t1 instanceof SVGTransform && r1 . type === t1 . type && r1 . angle === t1 . angle && r1 . matrix . a === t1 . matrix . a && r1 . matrix . b === t1 . matrix . b && r1 . matrix . c === t1 . matrix . c && r1 . matrix . d === t1 . matrix . d && r1 . matrix . e === t1 . matrix . e && r1 . matrix . f === t1 . matrix . f ;
} ( ) ;
if ( ! supportsSvg ( ) ) {
window . location = 'browser-not-supported.html' ;
}
} ( ) ) ;