- npm: Update devDeps
- Build: Switch to `terser` plugin with `uglify` plugin not supporting ES6+-capable minifier - Linting (ESLint): Consistent curly spacing; follow new "standard"master
parent
cad412fe6e
commit
4b22c248e4
|
@ -17,6 +17,7 @@
|
|||
"no-var": 2,
|
||||
"prefer-const": 2,
|
||||
"no-extra-semi": 2,
|
||||
"quote-props": [2, "as-needed"]
|
||||
"quote-props": [2, "as-needed"],
|
||||
"object-curly-spacing": ["error", "never"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
# ?
|
||||
|
||||
- npm: Update devDeps
|
||||
- npm: Point to official sinon-test package now that ES6 Modules
|
||||
support landed
|
||||
- Build: Switch to `terser` plugin with `uglify` plugin not
|
||||
supporting ES6+-capable minifier
|
||||
- Linting (ESLint): Consistent spacing; new "standard"
|
||||
|
||||
# 3.0.0-rc.2
|
||||
|
||||
|
|
|
@ -232,6 +232,15 @@ var getReverseNS = function getReverseNS() {
|
|||
return reverseNS;
|
||||
};
|
||||
|
||||
/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,
|
||||
SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,
|
||||
SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,
|
||||
SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,
|
||||
SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,
|
||||
SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,
|
||||
SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,
|
||||
SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,
|
||||
SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */
|
||||
/**
|
||||
* SVGPathSeg API polyfill
|
||||
* https://github.com/progers/pathseg
|
||||
|
@ -1542,11 +1551,11 @@ var getReverseNS = function getReverseNS() {
|
|||
// 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)) {
|
||||
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
||||
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
||||
var _SVGPathSegList = function () {
|
||||
function _SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, _SVGPathSegList);
|
||||
var SVGPathSegList = function () {
|
||||
function SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, SVGPathSegList);
|
||||
|
||||
this._pathElement = pathElement;
|
||||
this._list = this._parsePath(this._pathElement.getAttribute('d'));
|
||||
|
@ -1561,7 +1570,7 @@ var getReverseNS = function getReverseNS() {
|
|||
// MutationObservers are not synchronous so we can have pending asynchronous mutations.
|
||||
|
||||
|
||||
createClass(_SVGPathSegList, [{
|
||||
createClass(SVGPathSegList, [{
|
||||
key: '_checkPathSynchronizedToList',
|
||||
value: function _checkPathSynchronizedToList() {
|
||||
this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
|
||||
|
@ -1589,7 +1598,7 @@ var getReverseNS = function getReverseNS() {
|
|||
key: '_writeListToPath',
|
||||
value: function _writeListToPath() {
|
||||
this._pathElementMutationObserver.disconnect();
|
||||
this._pathElement.setAttribute('d', _SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
|
||||
}
|
||||
|
||||
|
@ -2066,12 +2075,12 @@ var getReverseNS = function getReverseNS() {
|
|||
return builder.pathSegList;
|
||||
}
|
||||
}]);
|
||||
return _SVGPathSegList;
|
||||
return SVGPathSegList;
|
||||
}();
|
||||
|
||||
_SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
|
||||
Object.defineProperty(_SVGPathSegList.prototype, 'numberOfItems', {
|
||||
Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {
|
||||
get: function get$$1() {
|
||||
this._checkPathSynchronizedToList();
|
||||
return this._list.length;
|
||||
|
@ -2080,7 +2089,7 @@ var getReverseNS = function getReverseNS() {
|
|||
enumerable: true
|
||||
});
|
||||
|
||||
_SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
var string = '';
|
||||
var first = true;
|
||||
pathSegArray.forEach(function (pathSeg) {
|
||||
|
@ -2100,7 +2109,7 @@ var getReverseNS = function getReverseNS() {
|
|||
pathSegList: {
|
||||
get: function get$$1() {
|
||||
if (!this._pathSegList) {
|
||||
this._pathSegList = new _SVGPathSegList(this);
|
||||
this._pathSegList = new SVGPathSegList(this);
|
||||
}
|
||||
return this._pathSegList;
|
||||
},
|
||||
|
@ -2124,7 +2133,7 @@ var getReverseNS = function getReverseNS() {
|
|||
},
|
||||
enumerable: true }
|
||||
});
|
||||
window.SVGPathSegList = _SVGPathSegList;
|
||||
window.SVGPathSegList = SVGPathSegList;
|
||||
}
|
||||
})();
|
||||
|
||||
|
@ -12289,7 +12298,7 @@ if (!window.console) {
|
|||
|
||||
if (window.opera) {
|
||||
window.console.log = function (str) {
|
||||
opera.postError(str);
|
||||
window.opera.postError(str);
|
||||
};
|
||||
window.console.dir = function (str) {};
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -238,6 +238,15 @@
|
|||
return reverseNS;
|
||||
};
|
||||
|
||||
/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,
|
||||
SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,
|
||||
SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,
|
||||
SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,
|
||||
SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,
|
||||
SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,
|
||||
SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,
|
||||
SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,
|
||||
SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */
|
||||
/**
|
||||
* SVGPathSeg API polyfill
|
||||
* https://github.com/progers/pathseg
|
||||
|
@ -1548,11 +1557,11 @@
|
|||
// 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)) {
|
||||
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
||||
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
||||
var _SVGPathSegList = function () {
|
||||
function _SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, _SVGPathSegList);
|
||||
var SVGPathSegList = function () {
|
||||
function SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, SVGPathSegList);
|
||||
|
||||
this._pathElement = pathElement;
|
||||
this._list = this._parsePath(this._pathElement.getAttribute('d'));
|
||||
|
@ -1567,7 +1576,7 @@
|
|||
// MutationObservers are not synchronous so we can have pending asynchronous mutations.
|
||||
|
||||
|
||||
createClass(_SVGPathSegList, [{
|
||||
createClass(SVGPathSegList, [{
|
||||
key: '_checkPathSynchronizedToList',
|
||||
value: function _checkPathSynchronizedToList() {
|
||||
this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
|
||||
|
@ -1595,7 +1604,7 @@
|
|||
key: '_writeListToPath',
|
||||
value: function _writeListToPath() {
|
||||
this._pathElementMutationObserver.disconnect();
|
||||
this._pathElement.setAttribute('d', _SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
|
||||
}
|
||||
|
||||
|
@ -2072,12 +2081,12 @@
|
|||
return builder.pathSegList;
|
||||
}
|
||||
}]);
|
||||
return _SVGPathSegList;
|
||||
return SVGPathSegList;
|
||||
}();
|
||||
|
||||
_SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
|
||||
Object.defineProperty(_SVGPathSegList.prototype, 'numberOfItems', {
|
||||
Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {
|
||||
get: function get$$1() {
|
||||
this._checkPathSynchronizedToList();
|
||||
return this._list.length;
|
||||
|
@ -2086,7 +2095,7 @@
|
|||
enumerable: true
|
||||
});
|
||||
|
||||
_SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
var string = '';
|
||||
var first = true;
|
||||
pathSegArray.forEach(function (pathSeg) {
|
||||
|
@ -2106,7 +2115,7 @@
|
|||
pathSegList: {
|
||||
get: function get$$1() {
|
||||
if (!this._pathSegList) {
|
||||
this._pathSegList = new _SVGPathSegList(this);
|
||||
this._pathSegList = new SVGPathSegList(this);
|
||||
}
|
||||
return this._pathSegList;
|
||||
},
|
||||
|
@ -2130,7 +2139,7 @@
|
|||
},
|
||||
enumerable: true }
|
||||
});
|
||||
window.SVGPathSegList = _SVGPathSegList;
|
||||
window.SVGPathSegList = SVGPathSegList;
|
||||
}
|
||||
})();
|
||||
|
||||
|
@ -12295,7 +12304,7 @@
|
|||
|
||||
if (window.opera) {
|
||||
window.console.log = function (str) {
|
||||
opera.postError(str);
|
||||
window.opera.postError(str);
|
||||
};
|
||||
window.console.dir = function (str) {};
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -49,6 +49,15 @@
|
|||
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
||||
};
|
||||
|
||||
/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,
|
||||
SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,
|
||||
SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,
|
||||
SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,
|
||||
SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,
|
||||
SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,
|
||||
SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,
|
||||
SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,
|
||||
SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */
|
||||
/**
|
||||
* SVGPathSeg API polyfill
|
||||
* https://github.com/progers/pathseg
|
||||
|
@ -1359,11 +1368,11 @@
|
|||
// 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)) {
|
||||
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
||||
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
||||
var _SVGPathSegList = function () {
|
||||
function _SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, _SVGPathSegList);
|
||||
var SVGPathSegList = function () {
|
||||
function SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, SVGPathSegList);
|
||||
|
||||
this._pathElement = pathElement;
|
||||
this._list = this._parsePath(this._pathElement.getAttribute('d'));
|
||||
|
@ -1378,7 +1387,7 @@
|
|||
// MutationObservers are not synchronous so we can have pending asynchronous mutations.
|
||||
|
||||
|
||||
createClass(_SVGPathSegList, [{
|
||||
createClass(SVGPathSegList, [{
|
||||
key: '_checkPathSynchronizedToList',
|
||||
value: function _checkPathSynchronizedToList() {
|
||||
this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
|
||||
|
@ -1406,7 +1415,7 @@
|
|||
key: '_writeListToPath',
|
||||
value: function _writeListToPath() {
|
||||
this._pathElementMutationObserver.disconnect();
|
||||
this._pathElement.setAttribute('d', _SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
|
||||
}
|
||||
|
||||
|
@ -1883,12 +1892,12 @@
|
|||
return builder.pathSegList;
|
||||
}
|
||||
}]);
|
||||
return _SVGPathSegList;
|
||||
return SVGPathSegList;
|
||||
}();
|
||||
|
||||
_SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
|
||||
Object.defineProperty(_SVGPathSegList.prototype, 'numberOfItems', {
|
||||
Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {
|
||||
get: function get$$1() {
|
||||
this._checkPathSynchronizedToList();
|
||||
return this._list.length;
|
||||
|
@ -1897,7 +1906,7 @@
|
|||
enumerable: true
|
||||
});
|
||||
|
||||
_SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
var string = '';
|
||||
var first = true;
|
||||
pathSegArray.forEach(function (pathSeg) {
|
||||
|
@ -1917,7 +1926,7 @@
|
|||
pathSegList: {
|
||||
get: function get$$1() {
|
||||
if (!this._pathSegList) {
|
||||
this._pathSegList = new _SVGPathSegList(this);
|
||||
this._pathSegList = new SVGPathSegList(this);
|
||||
}
|
||||
return this._pathSegList;
|
||||
},
|
||||
|
@ -1941,7 +1950,7 @@
|
|||
},
|
||||
enumerable: true }
|
||||
});
|
||||
window.SVGPathSegList = _SVGPathSegList;
|
||||
window.SVGPathSegList = SVGPathSegList;
|
||||
}
|
||||
})();
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ function build (opts) {
|
|||
svg.ViewPort = {
|
||||
viewPorts: [],
|
||||
Clear () { this.viewPorts = []; },
|
||||
SetCurrent (width, height) { this.viewPorts.push({ width, height }); },
|
||||
SetCurrent (width, height) { this.viewPorts.push({width, height}); },
|
||||
RemoveCurrent () { this.viewPorts.pop(); },
|
||||
Current () { return this.viewPorts[this.viewPorts.length - 1]; },
|
||||
width () { return this.Current().width; },
|
||||
|
@ -1912,7 +1912,7 @@ function build (opts) {
|
|||
|
||||
// fraction of duration we've covered
|
||||
progress () {
|
||||
const ret = { progress: (this.duration - this.begin) / (this.maxDuration - this.begin) };
|
||||
const ret = {progress: (this.duration - this.begin) / (this.maxDuration - this.begin)};
|
||||
if (this.values.hasValue()) {
|
||||
const p = ret.progress * (this.values.value.length - 1);
|
||||
const lb = Math.floor(p), ub = Math.ceil(p);
|
||||
|
|
|
@ -94,7 +94,7 @@ function jQueryContextMenu ($) {
|
|||
|
||||
// Show the menu
|
||||
doc.unbind('click');
|
||||
menu.css({ top: y, left: x }).fadeIn(o.inSpeed);
|
||||
menu.css({top: y, left: x}).fadeIn(o.inSpeed);
|
||||
// Hover events
|
||||
menu.find('A').mouseover(function () {
|
||||
menu.find('LI.hover').removeClass('hover');
|
||||
|
|
|
@ -457,38 +457,38 @@ export default {
|
|||
panel: 'marker_panel',
|
||||
id: 'start_marker',
|
||||
size: 3,
|
||||
events: { change: setMarker }
|
||||
events: {change: setMarker}
|
||||
}, {
|
||||
type: 'button-select',
|
||||
panel: 'marker_panel',
|
||||
id: 'start_marker_list',
|
||||
colnum: 3,
|
||||
events: { change: setArrowFromButton }
|
||||
events: {change: setArrowFromButton}
|
||||
}, {
|
||||
type: 'input',
|
||||
panel: 'marker_panel',
|
||||
id: 'mid_marker',
|
||||
defval: '',
|
||||
size: 3,
|
||||
events: { change: setMarker }
|
||||
events: {change: setMarker}
|
||||
}, {
|
||||
type: 'button-select',
|
||||
panel: 'marker_panel',
|
||||
id: 'mid_marker_list',
|
||||
colnum: 3,
|
||||
events: { change: setArrowFromButton }
|
||||
events: {change: setArrowFromButton}
|
||||
}, {
|
||||
type: 'input',
|
||||
panel: 'marker_panel',
|
||||
id: 'end_marker',
|
||||
size: 3,
|
||||
events: { change: setMarker }
|
||||
events: {change: setMarker}
|
||||
}, {
|
||||
type: 'button-select',
|
||||
panel: 'marker_panel',
|
||||
id: 'end_marker_list',
|
||||
colnum: 3,
|
||||
events: { change: setArrowFromButton }
|
||||
events: {change: setArrowFromButton}
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -499,7 +499,7 @@ export default {
|
|||
$('#marker_panel').addClass('toolset').hide();
|
||||
},
|
||||
async addLangData ({importLocale, lang}) {
|
||||
return { data: strings.langList };
|
||||
return {data: strings.langList};
|
||||
},
|
||||
selectedChanged (opts) {
|
||||
// Use this to update the current selected elements
|
||||
|
|
|
@ -112,7 +112,7 @@ export function importModule (url, atts = {}, {returnDefault = false} = {}) {
|
|||
};
|
||||
const absURL = toAbsoluteURL(url);
|
||||
const loader = `import * as m from '${absURL.replace(/'/g, "\\'")}'; window.${vector} = ${returnDefault ? 'm.default || ' : ''}m;`; // export Module
|
||||
const blob = new Blob([loader], { type: 'text/javascript' });
|
||||
const blob = new Blob([loader], {type: 'text/javascript'});
|
||||
script.src = URL.createObjectURL(blob);
|
||||
|
||||
document.head.append(script);
|
||||
|
|
|
@ -656,9 +656,9 @@ export default function ($) {
|
|||
while (thisAlpha.length < 2) { thisAlpha = '0' + thisAlpha; }
|
||||
color = stopColor.substr(1) + thisAlpha;
|
||||
$('#' + id + '_jGraduate_stopPicker').css({left: 100, bottom: 15}).jPicker({
|
||||
window: { title: 'Pick the start color and opacity for the gradient' },
|
||||
images: { clientPath: $settings.images.clientPath },
|
||||
color: { active: color, alphaSupport: true }
|
||||
window: {title: 'Pick the start color and opacity for the gradient'},
|
||||
images: {clientPath: $settings.images.clientPath},
|
||||
color: {active: color, alphaSupport: true}
|
||||
}, function (color, arg2) {
|
||||
stopColor = color.val('hex') ? ('#' + color.val('hex')) : 'none';
|
||||
stopOpacity = color.val('a') !== null ? color.val('a') / 256 : 1;
|
||||
|
@ -1188,9 +1188,9 @@ export default function ($) {
|
|||
|
||||
colPicker.jPicker(
|
||||
{
|
||||
window: { title: $settings.window.pickerTitle },
|
||||
images: { clientPath: $settings.images.clientPath },
|
||||
color: { active: color, alphaSupport: true }
|
||||
window: {title: $settings.window.pickerTitle},
|
||||
images: {clientPath: $settings.images.clientPath},
|
||||
color: {active: color, alphaSupport: true}
|
||||
},
|
||||
function (color) {
|
||||
$this.paint.type = 'solidColor';
|
||||
|
|
|
@ -112,7 +112,7 @@ const jPicker = function ($) {
|
|||
else if (locX > barW) locX = barW;
|
||||
if (locY < 0) locY = 0;
|
||||
else if (locY > barH) locY = barH;
|
||||
val.call($this, 'xy', { x: ((locX / barW) * rangeX) + minX, y: ((locY / barH) * rangeY) + minY });
|
||||
val.call($this, 'xy', {x: ((locX / barW) * rangeX) + minX, y: ((locY / barH) * rangeY) + minY});
|
||||
}
|
||||
function draw () {
|
||||
const
|
||||
|
@ -140,7 +140,7 @@ const jPicker = function ($) {
|
|||
if (arrowH >= barH) arrowOffsetY = (barH >> 1) - (arrowH >> 1);
|
||||
else arrowOffsetY -= arrowH >> 1;
|
||||
// set the arrow position based on these offsets
|
||||
arrow.css({ left: arrowOffsetX + 'px', top: arrowOffsetY + 'px' });
|
||||
arrow.css({left: arrowOffsetX + 'px', top: arrowOffsetY + 'px'});
|
||||
}, 0);
|
||||
}
|
||||
function val (name, value, context) {
|
||||
|
@ -151,7 +151,7 @@ const jPicker = function ($) {
|
|||
case 'x': return x;
|
||||
case 'y': return y;
|
||||
case 'xy':
|
||||
default: return { x, y };
|
||||
default: return {x, y};
|
||||
}
|
||||
}
|
||||
if (context != null && context === $this) return;
|
||||
|
@ -197,12 +197,12 @@ const jPicker = function ($) {
|
|||
switch (name.toLowerCase()) {
|
||||
case 'minx': return minX;
|
||||
case 'maxx': return maxX;
|
||||
case 'rangex': return { minX, maxX, rangeX };
|
||||
case 'rangex': return {minX, maxX, rangeX};
|
||||
case 'miny': return minY;
|
||||
case 'maxy': return maxY;
|
||||
case 'rangey': return { minY, maxY, rangeY };
|
||||
case 'rangey': return {minY, maxY, rangeY};
|
||||
case 'all':
|
||||
default: return { minX, maxX, rangeX, minY, maxY, rangeY };
|
||||
default: return {minX, maxX, rangeX, minY, maxY, rangeY};
|
||||
}
|
||||
}
|
||||
let // changed = false,
|
||||
|
@ -586,9 +586,9 @@ const jPicker = function ($) {
|
|||
if (name === undefined || name == null || name === '') name = 'all';
|
||||
if (r == null) return null;
|
||||
switch (name.toLowerCase()) {
|
||||
case 'ahex': return ColorMethods.rgbaToHex({ r, g, b, a });
|
||||
case 'ahex': return ColorMethods.rgbaToHex({r, g, b, a});
|
||||
case 'hex': return val('ahex').substring(0, 6);
|
||||
case 'all': return { r, g, b, a, h, s, v, hex: val.call($this, 'hex'), ahex: val.call($this, 'ahex') };
|
||||
case 'all': return {r, g, b, a, h, s, v, hex: val.call($this, 'hex'), ahex: val.call($this, 'ahex')};
|
||||
default:
|
||||
let ret = {};
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
|
@ -666,7 +666,7 @@ const jPicker = function ($) {
|
|||
case 'ahex':
|
||||
case 'hex':
|
||||
const ret = ColorMethods.hexToRgba((value && (value.ahex || value.hex)) || value || 'none');
|
||||
val.call($this, 'rgba', { r: ret.r, g: ret.g, b: ret.b, a: name === 'ahex' ? ret.a : a != null ? a : 255 }, context);
|
||||
val.call($this, 'rgba', {r: ret.r, g: ret.g, b: ret.b, a: name === 'ahex' ? ret.a : a != null ? a : 255}, context);
|
||||
break;
|
||||
default:
|
||||
if (value && (value.ahex != null || value.hex != null)) {
|
||||
|
@ -766,13 +766,13 @@ const jPicker = function ($) {
|
|||
r = r || 0;
|
||||
g = g || 0;
|
||||
b = b || 0;
|
||||
const ret = ColorMethods.rgbToHsv({ r, g, b });
|
||||
const ret = ColorMethods.rgbToHsv({r, g, b});
|
||||
({h, s, v} = ret);
|
||||
} else if (hsv) {
|
||||
h = h || 0;
|
||||
s = s != null ? s : 100;
|
||||
v = v != null ? v : 100;
|
||||
const ret = ColorMethods.hsvToRgb({ h, s, v });
|
||||
const ret = ColorMethods.hsvToRgb({h, s, v});
|
||||
({r, g, b} = ret);
|
||||
}
|
||||
a = a != null ? a : 255;
|
||||
|
@ -843,7 +843,7 @@ const jPicker = function ($) {
|
|||
* @returns {module:jPicker.RGBA}
|
||||
*/
|
||||
hexToRgba (hex) {
|
||||
if (hex === '' || hex === 'none') return { r: null, g: null, b: null, a: null };
|
||||
if (hex === '' || hex === 'none') return {r: null, g: null, b: null, a: null};
|
||||
hex = this.validateHex(hex);
|
||||
let r = '00', g = '00', b = '00', a = '255';
|
||||
if (hex.length === 6) hex += 'ff';
|
||||
|
@ -911,7 +911,7 @@ const jPicker = function ($) {
|
|||
* @returns {module:jPicker.HSV}
|
||||
*/
|
||||
rgbToHsv (rgb) {
|
||||
const r = rgb.r / 255, g = rgb.g / 255, b = rgb.b / 255, hsv = { h: 0, s: 0, v: 0 };
|
||||
const r = rgb.r / 255, g = rgb.g / 255, b = rgb.b / 255, hsv = {h: 0, s: 0, v: 0};
|
||||
let min = 0, max = 0;
|
||||
if (r >= g && r >= b) {
|
||||
max = r;
|
||||
|
@ -1026,11 +1026,11 @@ const jPicker = function ($) {
|
|||
}
|
||||
});
|
||||
if ($($this).val() === '') {
|
||||
settings.color.active = new Color({ hex: null });
|
||||
settings.color.current = new Color({ hex: null });
|
||||
settings.color.active = new Color({hex: null});
|
||||
settings.color.current = new Color({hex: null});
|
||||
} else if (ColorMethods.validateHex($($this).val())) {
|
||||
settings.color.active = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
|
||||
settings.color.current = new Color({ hex: $($this).val(), a: settings.color.active.val('a') });
|
||||
settings.color.active = new Color({hex: $($this).val(), a: settings.color.active.val('a')});
|
||||
settings.color.current = new Color({hex: $($this).val(), a: settings.color.active.val('a')});
|
||||
}
|
||||
}
|
||||
if (settings.window.expandable) {
|
||||
|
@ -1071,10 +1071,10 @@ const jPicker = function ($) {
|
|||
setImgLoc.call($this, colorBarL6, 260);
|
||||
setAlpha.call($this, colorBarL6, 100);
|
||||
}, 0);
|
||||
colorMap.range('all', { minX: 0, maxX: 100, minY: 0, maxY: 100 });
|
||||
colorBar.range('rangeY', { minY: 0, maxY: 360 });
|
||||
colorMap.range('all', {minX: 0, maxX: 100, minY: 0, maxY: 100});
|
||||
colorBar.range('rangeY', {minY: 0, maxY: 360});
|
||||
if (active.val('ahex') == null) break;
|
||||
colorMap.val('xy', { x: active.val('s'), y: 100 - active.val('v') }, colorMap);
|
||||
colorMap.val('xy', {x: active.val('s'), y: 100 - active.val('v')}, colorMap);
|
||||
colorBar.val('y', 360 - active.val('h'), colorBar);
|
||||
break;
|
||||
case 's':
|
||||
|
@ -1087,10 +1087,10 @@ const jPicker = function ($) {
|
|||
setImgLoc.call($this, colorBarL6, 260);
|
||||
setAlpha.call($this, colorBarL6, 100);
|
||||
}, 0);
|
||||
colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 });
|
||||
colorBar.range('rangeY', { minY: 0, maxY: 100 });
|
||||
colorMap.range('all', {minX: 0, maxX: 360, minY: 0, maxY: 100});
|
||||
colorBar.range('rangeY', {minY: 0, maxY: 100});
|
||||
if (active.val('ahex') == null) break;
|
||||
colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap);
|
||||
colorMap.val('xy', {x: active.val('h'), y: 100 - active.val('v')}, colorMap);
|
||||
colorBar.val('y', 100 - active.val('s'), colorBar);
|
||||
break;
|
||||
case 'v':
|
||||
|
@ -1105,37 +1105,37 @@ const jPicker = function ($) {
|
|||
setImgLoc.call($this, colorBarL6, 260);
|
||||
setAlpha.call($this, colorBarL6, 100);
|
||||
}, 0);
|
||||
colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 });
|
||||
colorBar.range('rangeY', { minY: 0, maxY: 100 });
|
||||
colorMap.range('all', {minX: 0, maxX: 360, minY: 0, maxY: 100});
|
||||
colorBar.range('rangeY', {minY: 0, maxY: 100});
|
||||
if (active.val('ahex') == null) break;
|
||||
colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('s') }, colorMap);
|
||||
colorMap.val('xy', {x: active.val('h'), y: 100 - active.val('s')}, colorMap);
|
||||
colorBar.val('y', 100 - active.val('v'), colorBar);
|
||||
break;
|
||||
case 'r':
|
||||
rgbMap = -1040;
|
||||
rgbBar = -780;
|
||||
colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 });
|
||||
colorBar.range('rangeY', { minY: 0, maxY: 255 });
|
||||
colorMap.range('all', {minX: 0, maxX: 255, minY: 0, maxY: 255});
|
||||
colorBar.range('rangeY', {minY: 0, maxY: 255});
|
||||
if (active.val('ahex') == null) break;
|
||||
colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('g') }, colorMap);
|
||||
colorMap.val('xy', {x: active.val('b'), y: 255 - active.val('g')}, colorMap);
|
||||
colorBar.val('y', 255 - active.val('r'), colorBar);
|
||||
break;
|
||||
case 'g':
|
||||
rgbMap = -1560;
|
||||
rgbBar = -1820;
|
||||
colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 });
|
||||
colorBar.range('rangeY', { minY: 0, maxY: 255 });
|
||||
colorMap.range('all', {minX: 0, maxX: 255, minY: 0, maxY: 255});
|
||||
colorBar.range('rangeY', {minY: 0, maxY: 255});
|
||||
if (active.val('ahex') == null) break;
|
||||
colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('r') }, colorMap);
|
||||
colorMap.val('xy', {x: active.val('b'), y: 255 - active.val('r')}, colorMap);
|
||||
colorBar.val('y', 255 - active.val('g'), colorBar);
|
||||
break;
|
||||
case 'b':
|
||||
rgbMap = -2080;
|
||||
rgbBar = -2860;
|
||||
colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 });
|
||||
colorBar.range('rangeY', { minY: 0, maxY: 255 });
|
||||
colorMap.range('all', {minX: 0, maxX: 255, minY: 0, maxY: 255});
|
||||
colorBar.range('rangeY', {minY: 0, maxY: 255});
|
||||
if (active.val('ahex') == null) break;
|
||||
colorMap.val('xy', { x: active.val('r'), y: 255 - active.val('g') }, colorMap);
|
||||
colorMap.val('xy', {x: active.val('r'), y: 255 - active.val('g')}, colorMap);
|
||||
colorBar.val('y', 255 - active.val('b'), colorBar);
|
||||
break;
|
||||
case 'a':
|
||||
|
@ -1149,10 +1149,10 @@ const jPicker = function ($) {
|
|||
setImgLoc.call($this, colorBarL6, 0);
|
||||
setAlpha.call($this, colorBarL6, 100);
|
||||
}, 0);
|
||||
colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 });
|
||||
colorBar.range('rangeY', { minY: 0, maxY: 255 });
|
||||
colorMap.range('all', {minX: 0, maxX: 360, minY: 0, maxY: 100});
|
||||
colorBar.range('rangeY', {minY: 0, maxY: 255});
|
||||
if (active.val('ahex') == null) break;
|
||||
colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap);
|
||||
colorMap.val('xy', {x: active.val('h'), y: 100 - active.val('v')}, colorMap);
|
||||
colorBar.val('y', 255 - active.val('a'), colorBar);
|
||||
break;
|
||||
default:
|
||||
|
@ -1211,23 +1211,23 @@ const jPicker = function ($) {
|
|||
const xy = ui.val('all');
|
||||
switch (settings.color.mode) {
|
||||
case 'h':
|
||||
active.val('sv', { s: xy.x, v: 100 - xy.y }, context);
|
||||
active.val('sv', {s: xy.x, v: 100 - xy.y}, context);
|
||||
break;
|
||||
case 's':
|
||||
case 'a':
|
||||
active.val('hv', { h: xy.x, v: 100 - xy.y }, context);
|
||||
active.val('hv', {h: xy.x, v: 100 - xy.y}, context);
|
||||
break;
|
||||
case 'v':
|
||||
active.val('hs', { h: xy.x, s: 100 - xy.y }, context);
|
||||
active.val('hs', {h: xy.x, s: 100 - xy.y}, context);
|
||||
break;
|
||||
case 'r':
|
||||
active.val('gb', { g: 255 - xy.y, b: xy.x }, context);
|
||||
active.val('gb', {g: 255 - xy.y, b: xy.x}, context);
|
||||
break;
|
||||
case 'g':
|
||||
active.val('rb', { r: 255 - xy.y, b: xy.x }, context);
|
||||
active.val('rb', {r: 255 - xy.y, b: xy.x}, context);
|
||||
break;
|
||||
case 'b':
|
||||
active.val('rg', { r: xy.x, g: 255 - xy.y }, context);
|
||||
active.val('rg', {r: xy.x, g: 255 - xy.y}, context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1237,22 +1237,22 @@ const jPicker = function ($) {
|
|||
if (context !== colorBar && active.val() == null) return;
|
||||
switch (settings.color.mode) {
|
||||
case 'h':
|
||||
active.val('h', { h: 360 - ui.val('y') }, context);
|
||||
active.val('h', {h: 360 - ui.val('y')}, context);
|
||||
break;
|
||||
case 's':
|
||||
active.val('s', { s: 100 - ui.val('y') }, context);
|
||||
active.val('s', {s: 100 - ui.val('y')}, context);
|
||||
break;
|
||||
case 'v':
|
||||
active.val('v', { v: 100 - ui.val('y') }, context);
|
||||
active.val('v', {v: 100 - ui.val('y')}, context);
|
||||
break;
|
||||
case 'r':
|
||||
active.val('r', { r: 255 - ui.val('y') }, context);
|
||||
active.val('r', {r: 255 - ui.val('y')}, context);
|
||||
break;
|
||||
case 'g':
|
||||
active.val('g', { g: 255 - ui.val('y') }, context);
|
||||
active.val('g', {g: 255 - ui.val('y')}, context);
|
||||
break;
|
||||
case 'b':
|
||||
active.val('b', { b: 255 - ui.val('y') }, context);
|
||||
active.val('b', {b: 255 - ui.val('y')}, context);
|
||||
break;
|
||||
case 'a':
|
||||
active.val('a', 255 - ui.val('y'), context);
|
||||
|
@ -1265,28 +1265,28 @@ const jPicker = function ($) {
|
|||
switch (settings.color.mode) {
|
||||
case 'h':
|
||||
const sv = ui.val('sv');
|
||||
colorMap.val('xy', { x: sv != null ? sv.s : 100, y: 100 - (sv != null ? sv.v : 100) }, context);
|
||||
colorMap.val('xy', {x: sv != null ? sv.s : 100, y: 100 - (sv != null ? sv.v : 100)}, context);
|
||||
break;
|
||||
case 's':
|
||||
case 'a':
|
||||
const hv = ui.val('hv');
|
||||
colorMap.val('xy', { x: (hv && hv.h) || 0, y: 100 - (hv != null ? hv.v : 100) }, context);
|
||||
colorMap.val('xy', {x: (hv && hv.h) || 0, y: 100 - (hv != null ? hv.v : 100)}, context);
|
||||
break;
|
||||
case 'v':
|
||||
const hs = ui.val('hs');
|
||||
colorMap.val('xy', { x: (hs && hs.h) || 0, y: 100 - (hs != null ? hs.s : 100) }, context);
|
||||
colorMap.val('xy', {x: (hs && hs.h) || 0, y: 100 - (hs != null ? hs.s : 100)}, context);
|
||||
break;
|
||||
case 'r':
|
||||
const bg = ui.val('bg');
|
||||
colorMap.val('xy', { x: (bg && bg.b) || 0, y: 255 - ((bg && bg.g) || 0) }, context);
|
||||
colorMap.val('xy', {x: (bg && bg.b) || 0, y: 255 - ((bg && bg.g) || 0)}, context);
|
||||
break;
|
||||
case 'g':
|
||||
const br = ui.val('br');
|
||||
colorMap.val('xy', { x: (br && br.b) || 0, y: 255 - ((br && br.r) || 0) }, context);
|
||||
colorMap.val('xy', {x: (br && br.b) || 0, y: 255 - ((br && br.r) || 0)}, context);
|
||||
break;
|
||||
case 'b':
|
||||
const rg = ui.val('rg');
|
||||
colorMap.val('xy', { x: (rg && rg.r) || 0, y: 255 - ((rg && rg.g) || 0) }, context);
|
||||
colorMap.val('xy', {x: (rg && rg.r) || 0, y: 255 - ((rg && rg.g) || 0)}, context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1322,14 +1322,14 @@ const jPicker = function ($) {
|
|||
function updatePreview (ui) {
|
||||
try {
|
||||
const all = ui.val('all');
|
||||
activePreview.css({ backgroundColor: (all && '#' + all.hex) || 'transparent' });
|
||||
activePreview.css({backgroundColor: (all && '#' + all.hex) || 'transparent'});
|
||||
setAlpha.call($this, activePreview, (all && Math.precision((all.a * 100) / 255, 4)) || 0);
|
||||
} catch (e) { }
|
||||
}
|
||||
function updateMapVisuals (ui) {
|
||||
switch (settings.color.mode) {
|
||||
case 'h':
|
||||
setBG.call($this, colorMapDiv, new Color({ h: ui.val('h') || 0, s: 100, v: 100 }).val('hex'));
|
||||
setBG.call($this, colorMapDiv, new Color({h: ui.val('h') || 0, s: 100, v: 100}).val('hex'));
|
||||
break;
|
||||
case 's':
|
||||
case 'a':
|
||||
|
@ -1361,14 +1361,14 @@ const jPicker = function ($) {
|
|||
break;
|
||||
case 's':
|
||||
const hva = ui.val('hva'),
|
||||
saturatedColor = new Color({ h: (hva && hva.h) || 0, s: 100, v: hva != null ? hva.v : 100 });
|
||||
saturatedColor = new Color({h: (hva && hva.h) || 0, s: 100, v: hva != null ? hva.v : 100});
|
||||
setBG.call($this, colorBarDiv, saturatedColor.val('hex'));
|
||||
setAlpha.call($this, colorBarL2, 100 - (hva != null ? hva.v : 100));
|
||||
setAlpha.call($this, colorBarL5, Math.precision(((255 - ((hva && hva.a) || 0)) * 100) / 255, 4));
|
||||
break;
|
||||
case 'v':
|
||||
const hsa = ui.val('hsa'),
|
||||
valueColor = new Color({ h: (hsa && hsa.h) || 0, s: hsa != null ? hsa.s : 100, v: 100 });
|
||||
valueColor = new Color({h: (hsa && hsa.h) || 0, s: hsa != null ? hsa.s : 100, v: 100});
|
||||
setBG.call($this, colorBarDiv, valueColor.val('hex'));
|
||||
setAlpha.call($this, colorBarL5, Math.precision(((255 - ((hsa && hsa.a) || 0)) * 100) / 255, 4));
|
||||
break;
|
||||
|
@ -1408,32 +1408,32 @@ const jPicker = function ($) {
|
|||
function setImg (img, src) {
|
||||
if (isLessThanIE7 && (src.includes('AlphaBar.png') || src.includes('Bars.png') || src.includes('Maps.png'))) {
|
||||
img.attr('pngSrc', src);
|
||||
img.css({ backgroundImage: 'none', filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')' });
|
||||
} else img.css({ backgroundImage: 'url(\'' + src + '\')' });
|
||||
img.css({backgroundImage: 'none', filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')'});
|
||||
} else img.css({backgroundImage: 'url(\'' + src + '\')'});
|
||||
}
|
||||
function setImgLoc (img, y) {
|
||||
img.css({ top: y + 'px' });
|
||||
img.css({top: y + 'px'});
|
||||
}
|
||||
function setAlpha (obj, alpha) {
|
||||
obj.css({ visibility: alpha > 0 ? 'visible' : 'hidden' });
|
||||
obj.css({visibility: alpha > 0 ? 'visible' : 'hidden'});
|
||||
if (alpha > 0 && alpha < 100) {
|
||||
if (isLessThanIE7) {
|
||||
const src = obj.attr('pngSrc');
|
||||
if (src != null && (
|
||||
src.includes('AlphaBar.png') || src.includes('Bars.png') || src.includes('Maps.png')
|
||||
)) {
|
||||
obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\') progid:DXImageTransform.Microsoft.Alpha(opacity=' + alpha + ')' });
|
||||
} else obj.css({ opacity: Math.precision(alpha / 100, 4) });
|
||||
} else obj.css({ opacity: Math.precision(alpha / 100, 4) });
|
||||
obj.css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\') progid:DXImageTransform.Microsoft.Alpha(opacity=' + alpha + ')'});
|
||||
} else obj.css({opacity: Math.precision(alpha / 100, 4)});
|
||||
} else obj.css({opacity: Math.precision(alpha / 100, 4)});
|
||||
} else if (alpha === 0 || alpha === 100) {
|
||||
if (isLessThanIE7) {
|
||||
const src = obj.attr('pngSrc');
|
||||
if (src != null && (
|
||||
src.includes('AlphaBar.png') || src.includes('Bars.png') || src.includes('Maps.png')
|
||||
)) {
|
||||
obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')' });
|
||||
} else obj.css({ opacity: '' });
|
||||
} else obj.css({ opacity: '' });
|
||||
obj.css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')'});
|
||||
} else obj.css({opacity: ''});
|
||||
} else obj.css({opacity: ''});
|
||||
}
|
||||
}
|
||||
// revert color to original color when opened
|
||||
|
@ -1466,13 +1466,13 @@ const jPicker = function ($) {
|
|||
}
|
||||
function currentColorChanged (ui, context) {
|
||||
const hex = ui.val('hex');
|
||||
currentPreview.css({ backgroundColor: (hex && '#' + hex) || 'transparent' });
|
||||
currentPreview.css({backgroundColor: (hex && '#' + hex) || 'transparent'});
|
||||
setAlpha.call($this, currentPreview, Math.precision(((ui.val('a') || 0) * 100) / 255, 4));
|
||||
}
|
||||
function expandableColorChanged (ui, context) {
|
||||
const hex = ui.val('hex');
|
||||
const va = ui.val('va');
|
||||
iconColor.css({ backgroundColor: (hex && '#' + hex) || 'transparent' });
|
||||
iconColor.css({backgroundColor: (hex && '#' + hex) || 'transparent'});
|
||||
setAlpha.call($this, iconAlpha, Math.precision(((255 - ((va && va.a) || 0)) * 100) / 255, 4));
|
||||
if (settings.window.bindToInput && settings.window.updateInputColor) {
|
||||
settings.window.input.css({
|
||||
|
@ -1493,8 +1493,8 @@ const jPicker = function ($) {
|
|||
e.preventDefault(); // prevent attempted dragging of the column
|
||||
}
|
||||
function documentMouseMove (e) {
|
||||
container.css({ left: elementStartX - (pageStartX - e.pageX) + 'px', top: elementStartY - (pageStartY - e.pageY) + 'px' });
|
||||
if (settings.window.expandable && !$.support.boxModel) container.prev().css({ left: container.css('left'), top: container.css('top') });
|
||||
container.css({left: elementStartX - (pageStartX - e.pageX) + 'px', top: elementStartY - (pageStartY - e.pageY) + 'px'});
|
||||
if (settings.window.expandable && !$.support.boxModel) container.prev().css({left: container.css('left'), top: container.css('top')});
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
return false;
|
||||
|
@ -1538,7 +1538,7 @@ const jPicker = function ($) {
|
|||
}
|
||||
function hide () {
|
||||
function removeIFrame () {
|
||||
if (settings.window.expandable) container.css({ zIndex: 10 });
|
||||
if (settings.window.expandable) container.css({zIndex: 10});
|
||||
if (!settings.window.expandable || $.support.boxModel) return;
|
||||
container.prev().remove();
|
||||
}
|
||||
|
@ -1657,8 +1657,8 @@ const jPicker = function ($) {
|
|||
const hex = all != null ? all.hex : null,
|
||||
preview = tbody.find('.Preview'),
|
||||
button = tbody.find('.Button');
|
||||
activePreview = preview.find('.Active:first').css({ backgroundColor: (hex && '#' + hex) || 'transparent' });
|
||||
currentPreview = preview.find('.Current:first').css({ backgroundColor: (hex && '#' + hex) || 'transparent' }).bind('click', currentClicked);
|
||||
activePreview = preview.find('.Active:first').css({backgroundColor: (hex && '#' + hex) || 'transparent'});
|
||||
currentPreview = preview.find('.Current:first').css({backgroundColor: (hex && '#' + hex) || 'transparent'}).bind('click', currentClicked);
|
||||
setAlpha.call($this, currentPreview, Math.precision(color.current.val('a') * 100) / 255, 4);
|
||||
okButton = button.find('.Ok:first').bind('click', okClicked);
|
||||
cancelButton = button.find('.Cancel:first').bind('click', cancelClicked);
|
||||
|
@ -1681,7 +1681,7 @@ const jPicker = function ($) {
|
|||
let html = '';
|
||||
for (let i = 0; i < color.quickList.length; i++) {
|
||||
/* if default colors are hex strings, change them to color objects */
|
||||
if ((typeof (color.quickList[i])).toString().toLowerCase() === 'string') color.quickList[i] = new Color({ hex: color.quickList[i] });
|
||||
if ((typeof (color.quickList[i])).toString().toLowerCase() === 'string') color.quickList[i] = new Color({hex: color.quickList[i]});
|
||||
const alpha = color.quickList[i].val('a');
|
||||
let ahex = color.quickList[i].val('ahex');
|
||||
if (!win.alphaSupport && ahex) ahex = ahex.substring(0, 6) + 'ff';
|
||||
|
@ -1700,7 +1700,7 @@ const jPicker = function ($) {
|
|||
// bind to input
|
||||
if (win.expandable) {
|
||||
$this.icon = popup.parents('.Icon:first');
|
||||
iconColor = $this.icon.find('.Color:first').css({ backgroundColor: (hex && '#' + hex) || 'transparent' });
|
||||
iconColor = $this.icon.find('.Color:first').css({backgroundColor: (hex && '#' + hex) || 'transparent'});
|
||||
iconAlpha = $this.icon.find('.Alpha:first');
|
||||
setImg.call($this, iconAlpha, images.clientPath + 'bar-opacity.png');
|
||||
setAlpha.call($this, iconAlpha, Math.precision(((255 - (all != null ? all.a : 0)) * 100) / 255, 4));
|
||||
|
@ -1937,77 +1937,77 @@ const jPicker = function ($) {
|
|||
mode: 'h',
|
||||
active: new Color({ahex: '#ffcc00ff'}),
|
||||
quickList: [
|
||||
new Color({ h: 360, s: 33, v: 100 }),
|
||||
new Color({ h: 360, s: 66, v: 100 }),
|
||||
new Color({ h: 360, s: 100, v: 100 }),
|
||||
new Color({ h: 360, s: 100, v: 75 }),
|
||||
new Color({ h: 360, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 100 }),
|
||||
new Color({ h: 30, s: 33, v: 100 }),
|
||||
new Color({ h: 30, s: 66, v: 100 }),
|
||||
new Color({ h: 30, s: 100, v: 100 }),
|
||||
new Color({ h: 30, s: 100, v: 75 }),
|
||||
new Color({ h: 30, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 90 }),
|
||||
new Color({ h: 60, s: 33, v: 100 }),
|
||||
new Color({ h: 60, s: 66, v: 100 }),
|
||||
new Color({ h: 60, s: 100, v: 100 }),
|
||||
new Color({ h: 60, s: 100, v: 75 }),
|
||||
new Color({ h: 60, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 80 }),
|
||||
new Color({ h: 90, s: 33, v: 100 }),
|
||||
new Color({ h: 90, s: 66, v: 100 }),
|
||||
new Color({ h: 90, s: 100, v: 100 }),
|
||||
new Color({ h: 90, s: 100, v: 75 }),
|
||||
new Color({ h: 90, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 70 }),
|
||||
new Color({ h: 120, s: 33, v: 100 }),
|
||||
new Color({ h: 120, s: 66, v: 100 }),
|
||||
new Color({ h: 120, s: 100, v: 100 }),
|
||||
new Color({ h: 120, s: 100, v: 75 }),
|
||||
new Color({ h: 120, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 60 }),
|
||||
new Color({ h: 150, s: 33, v: 100 }),
|
||||
new Color({ h: 150, s: 66, v: 100 }),
|
||||
new Color({ h: 150, s: 100, v: 100 }),
|
||||
new Color({ h: 150, s: 100, v: 75 }),
|
||||
new Color({ h: 150, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 50 }),
|
||||
new Color({ h: 180, s: 33, v: 100 }),
|
||||
new Color({ h: 180, s: 66, v: 100 }),
|
||||
new Color({ h: 180, s: 100, v: 100 }),
|
||||
new Color({ h: 180, s: 100, v: 75 }),
|
||||
new Color({ h: 180, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 40 }),
|
||||
new Color({ h: 210, s: 33, v: 100 }),
|
||||
new Color({ h: 210, s: 66, v: 100 }),
|
||||
new Color({ h: 210, s: 100, v: 100 }),
|
||||
new Color({ h: 210, s: 100, v: 75 }),
|
||||
new Color({ h: 210, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 30 }),
|
||||
new Color({ h: 240, s: 33, v: 100 }),
|
||||
new Color({ h: 240, s: 66, v: 100 }),
|
||||
new Color({ h: 240, s: 100, v: 100 }),
|
||||
new Color({ h: 240, s: 100, v: 75 }),
|
||||
new Color({ h: 240, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 20 }),
|
||||
new Color({ h: 270, s: 33, v: 100 }),
|
||||
new Color({ h: 270, s: 66, v: 100 }),
|
||||
new Color({ h: 270, s: 100, v: 100 }),
|
||||
new Color({ h: 270, s: 100, v: 75 }),
|
||||
new Color({ h: 270, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 10 }),
|
||||
new Color({ h: 300, s: 33, v: 100 }),
|
||||
new Color({ h: 300, s: 66, v: 100 }),
|
||||
new Color({ h: 300, s: 100, v: 100 }),
|
||||
new Color({ h: 300, s: 100, v: 75 }),
|
||||
new Color({ h: 300, s: 100, v: 50 }),
|
||||
new Color({ h: 180, s: 0, v: 0 }),
|
||||
new Color({ h: 330, s: 33, v: 100 }),
|
||||
new Color({ h: 330, s: 66, v: 100 }),
|
||||
new Color({ h: 330, s: 100, v: 100 }),
|
||||
new Color({ h: 330, s: 100, v: 75 }),
|
||||
new Color({ h: 330, s: 100, v: 50 }),
|
||||
new Color({h: 360, s: 33, v: 100}),
|
||||
new Color({h: 360, s: 66, v: 100}),
|
||||
new Color({h: 360, s: 100, v: 100}),
|
||||
new Color({h: 360, s: 100, v: 75}),
|
||||
new Color({h: 360, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 100}),
|
||||
new Color({h: 30, s: 33, v: 100}),
|
||||
new Color({h: 30, s: 66, v: 100}),
|
||||
new Color({h: 30, s: 100, v: 100}),
|
||||
new Color({h: 30, s: 100, v: 75}),
|
||||
new Color({h: 30, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 90}),
|
||||
new Color({h: 60, s: 33, v: 100}),
|
||||
new Color({h: 60, s: 66, v: 100}),
|
||||
new Color({h: 60, s: 100, v: 100}),
|
||||
new Color({h: 60, s: 100, v: 75}),
|
||||
new Color({h: 60, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 80}),
|
||||
new Color({h: 90, s: 33, v: 100}),
|
||||
new Color({h: 90, s: 66, v: 100}),
|
||||
new Color({h: 90, s: 100, v: 100}),
|
||||
new Color({h: 90, s: 100, v: 75}),
|
||||
new Color({h: 90, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 70}),
|
||||
new Color({h: 120, s: 33, v: 100}),
|
||||
new Color({h: 120, s: 66, v: 100}),
|
||||
new Color({h: 120, s: 100, v: 100}),
|
||||
new Color({h: 120, s: 100, v: 75}),
|
||||
new Color({h: 120, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 60}),
|
||||
new Color({h: 150, s: 33, v: 100}),
|
||||
new Color({h: 150, s: 66, v: 100}),
|
||||
new Color({h: 150, s: 100, v: 100}),
|
||||
new Color({h: 150, s: 100, v: 75}),
|
||||
new Color({h: 150, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 50}),
|
||||
new Color({h: 180, s: 33, v: 100}),
|
||||
new Color({h: 180, s: 66, v: 100}),
|
||||
new Color({h: 180, s: 100, v: 100}),
|
||||
new Color({h: 180, s: 100, v: 75}),
|
||||
new Color({h: 180, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 40}),
|
||||
new Color({h: 210, s: 33, v: 100}),
|
||||
new Color({h: 210, s: 66, v: 100}),
|
||||
new Color({h: 210, s: 100, v: 100}),
|
||||
new Color({h: 210, s: 100, v: 75}),
|
||||
new Color({h: 210, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 30}),
|
||||
new Color({h: 240, s: 33, v: 100}),
|
||||
new Color({h: 240, s: 66, v: 100}),
|
||||
new Color({h: 240, s: 100, v: 100}),
|
||||
new Color({h: 240, s: 100, v: 75}),
|
||||
new Color({h: 240, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 20}),
|
||||
new Color({h: 270, s: 33, v: 100}),
|
||||
new Color({h: 270, s: 66, v: 100}),
|
||||
new Color({h: 270, s: 100, v: 100}),
|
||||
new Color({h: 270, s: 100, v: 75}),
|
||||
new Color({h: 270, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 10}),
|
||||
new Color({h: 300, s: 33, v: 100}),
|
||||
new Color({h: 300, s: 66, v: 100}),
|
||||
new Color({h: 300, s: 100, v: 100}),
|
||||
new Color({h: 300, s: 100, v: 75}),
|
||||
new Color({h: 300, s: 100, v: 50}),
|
||||
new Color({h: 180, s: 0, v: 0}),
|
||||
new Color({h: 330, s: 33, v: 100}),
|
||||
new Color({h: 330, s: 66, v: 100}),
|
||||
new Color({h: 330, s: 100, v: 100}),
|
||||
new Color({h: 330, s: 100, v: 75}),
|
||||
new Color({h: 330, s: 100, v: 50}),
|
||||
new Color()
|
||||
]
|
||||
},
|
||||
|
|
|
@ -3355,7 +3355,7 @@ editor.init = function () {
|
|||
|
||||
const getPaint = function (color, opac, type) {
|
||||
// update the editor's fill paint
|
||||
const opts = { alpha: opac };
|
||||
const opts = {alpha: opac};
|
||||
if (color.startsWith('url(#')) {
|
||||
let refElem = svgCanvas.getRefElem(color);
|
||||
if (refElem) {
|
||||
|
@ -4612,8 +4612,8 @@ editor.init = function () {
|
|||
.jGraduate(
|
||||
{
|
||||
paint,
|
||||
window: { pickerTitle: title },
|
||||
images: { clientPath: curConfig.jGraduatePath },
|
||||
window: {pickerTitle: title},
|
||||
images: {clientPath: curConfig.jGraduatePath},
|
||||
newstop: 'inverse'
|
||||
},
|
||||
function (p) {
|
||||
|
|
|
@ -76,7 +76,7 @@ if (!window.console) {
|
|||
}
|
||||
|
||||
if (window.opera) {
|
||||
window.console.log = function (str) { opera.postError(str); };
|
||||
window.console.log = function (str) { window.opera.postError(str); };
|
||||
window.console.dir = function (str) {};
|
||||
}
|
||||
|
||||
|
@ -5670,14 +5670,14 @@ canvas.setBlur = function (val, complete) {
|
|||
}
|
||||
} else {
|
||||
// Not found, so create
|
||||
const newblur = addSVGElementFromJson({ element: 'feGaussianBlur',
|
||||
const newblur = addSVGElementFromJson({element: 'feGaussianBlur',
|
||||
attr: {
|
||||
in: 'SourceGraphic',
|
||||
stdDeviation: val
|
||||
}
|
||||
});
|
||||
|
||||
filter = addSVGElementFromJson({ element: 'filter',
|
||||
filter = addSVGElementFromJson({element: 'filter',
|
||||
attr: {
|
||||
id: elemId + '_blur'
|
||||
}
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,
|
||||
SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,
|
||||
SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,
|
||||
SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,
|
||||
SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,
|
||||
SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,
|
||||
SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,
|
||||
SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,
|
||||
SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */
|
||||
/**
|
||||
* SVGPathSeg API polyfill
|
||||
* https://github.com/progers/pathseg
|
||||
|
@ -85,8 +94,8 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegMovetoRel(undefined, this._x, this._y); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegMovetoRel.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegLinetoAbs extends SVGPathSeg {
|
||||
|
@ -100,8 +109,8 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegLinetoAbs(undefined, this._x, this._y); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegLinetoAbs.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegLinetoRel extends SVGPathSeg {
|
||||
|
@ -115,8 +124,8 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegLinetoRel(undefined, this._x, this._y); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegLinetoRel.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegCurvetoCubicAbs extends SVGPathSeg {
|
||||
|
@ -134,12 +143,12 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoCubicAbs.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
x1: { get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true },
|
||||
y1: { get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true },
|
||||
x2: { get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true },
|
||||
y2: { get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},
|
||||
y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},
|
||||
x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},
|
||||
y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegCurvetoCubicRel extends SVGPathSeg {
|
||||
|
@ -157,12 +166,12 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoCubicRel.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
x1: { get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true },
|
||||
y1: { get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true },
|
||||
x2: { get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true },
|
||||
y2: { get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},
|
||||
y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true},
|
||||
x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},
|
||||
y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {
|
||||
|
@ -178,10 +187,10 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoQuadraticAbs.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
x1: { get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true },
|
||||
y1: { get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},
|
||||
y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {
|
||||
|
@ -197,10 +206,10 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoQuadraticRel.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
x1: { get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true },
|
||||
y1: { get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
x1: {get () { return this._x1; }, set (x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true},
|
||||
y1: {get () { return this._y1; }, set (y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegArcAbs extends SVGPathSeg {
|
||||
|
@ -219,13 +228,13 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegArcAbs.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
r1: { get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true },
|
||||
r2: { get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true },
|
||||
angle: { get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true },
|
||||
largeArcFlag: { get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true },
|
||||
sweepFlag: { get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},
|
||||
r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},
|
||||
angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},
|
||||
largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},
|
||||
sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegArcRel extends SVGPathSeg {
|
||||
|
@ -244,13 +253,13 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegArcRel.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
r1: { get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true },
|
||||
r2: { get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true },
|
||||
angle: { get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true },
|
||||
largeArcFlag: { get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true },
|
||||
sweepFlag: { get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
r1: {get () { return this._r1; }, set (r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true},
|
||||
r2: {get () { return this._r2; }, set (r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true},
|
||||
angle: {get () { return this._angle; }, set (angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true},
|
||||
largeArcFlag: {get () { return this._largeArcFlag; }, set (largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true},
|
||||
sweepFlag: {get () { return this._sweepFlag; }, set (sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {
|
||||
|
@ -262,7 +271,7 @@ if (!('SVGPathSeg' in window)) {
|
|||
_asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }
|
||||
clone () { return new SVGPathSegLinetoHorizontalAbs(undefined, this._x); }
|
||||
}
|
||||
Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype, 'x', { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true });
|
||||
Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});
|
||||
|
||||
class SVGPathSegLinetoHorizontalRel extends SVGPathSeg {
|
||||
constructor (owningPathSegList, x) {
|
||||
|
@ -273,7 +282,7 @@ if (!('SVGPathSeg' in window)) {
|
|||
_asPathString () { return this.pathSegTypeAsLetter + ' ' + this._x; }
|
||||
clone () { return new SVGPathSegLinetoHorizontalRel(undefined, this._x); }
|
||||
}
|
||||
Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype, 'x', { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true });
|
||||
Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype, 'x', {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true});
|
||||
|
||||
class SVGPathSegLinetoVerticalAbs extends SVGPathSeg {
|
||||
constructor (owningPathSegList, y) {
|
||||
|
@ -284,7 +293,7 @@ if (!('SVGPathSeg' in window)) {
|
|||
_asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }
|
||||
clone () { return new SVGPathSegLinetoVerticalAbs(undefined, this._y); }
|
||||
}
|
||||
Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype, 'y', { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true });
|
||||
Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});
|
||||
|
||||
class SVGPathSegLinetoVerticalRel extends SVGPathSeg {
|
||||
constructor (owningPathSegList, y) {
|
||||
|
@ -295,7 +304,7 @@ if (!('SVGPathSeg' in window)) {
|
|||
_asPathString () { return this.pathSegTypeAsLetter + ' ' + this._y; }
|
||||
clone () { return new SVGPathSegLinetoVerticalRel(undefined, this._y); }
|
||||
}
|
||||
Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype, 'y', { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true });
|
||||
Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype, 'y', {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true});
|
||||
|
||||
class SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {
|
||||
constructor (owningPathSegList, x, y, x2, y2) {
|
||||
|
@ -310,10 +319,10 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoCubicSmoothAbs.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
x2: { get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true },
|
||||
y2: { get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},
|
||||
y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {
|
||||
|
@ -329,10 +338,10 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoCubicSmoothRel.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true },
|
||||
x2: { get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true },
|
||||
y2: { get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true},
|
||||
x2: {get () { return this._x2; }, set (x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true},
|
||||
y2: {get () { return this._y2; }, set (y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {
|
||||
|
@ -346,8 +355,8 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
class SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {
|
||||
|
@ -361,8 +370,8 @@ if (!('SVGPathSeg' in window)) {
|
|||
clone () { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); }
|
||||
}
|
||||
Object.defineProperties(SVGPathSegCurvetoQuadraticSmoothRel.prototype, {
|
||||
x: { get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true },
|
||||
y: { get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true }
|
||||
x: {get () { return this._x; }, set (x) { this._x = x; this._segmentChanged(); }, enumerable: true},
|
||||
y: {get () { return this._y; }, set (y) { this._y = y; this._segmentChanged(); }, enumerable: true}
|
||||
});
|
||||
|
||||
// Add createSVGPathSeg* functions to SVGPathElement.
|
||||
|
@ -443,7 +452,7 @@ if (!('SVGPathSeg' in window)) {
|
|||
// 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)) {
|
||||
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
||||
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
||||
class SVGPathSegList {
|
||||
constructor (pathElement) {
|
||||
|
@ -948,9 +957,9 @@ if (!('SVGPathSegList' in window) || !('appendItem' in SVGPathSegList.prototype)
|
|||
enumerable: true
|
||||
},
|
||||
// FIXME: The following are not implemented and simply return SVGPathElement.pathSegList.
|
||||
normalizedPathSegList: { get () { return this.pathSegList; }, enumerable: true },
|
||||
animatedPathSegList: { get () { return this.pathSegList; }, enumerable: true },
|
||||
animatedNormalizedPathSegList: { get () { return this.pathSegList; }, enumerable: true }
|
||||
normalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true},
|
||||
animatedPathSegList: {get () { return this.pathSegList; }, enumerable: true},
|
||||
animatedNormalizedPathSegList: {get () { return this.pathSegList; }, enumerable: true}
|
||||
});
|
||||
window.SVGPathSegList = SVGPathSegList;
|
||||
}
|
||||
|
|
|
@ -235,6 +235,15 @@
|
|||
return reverseNS;
|
||||
};
|
||||
|
||||
/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,
|
||||
SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,
|
||||
SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,
|
||||
SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,
|
||||
SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,
|
||||
SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,
|
||||
SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,
|
||||
SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,
|
||||
SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */
|
||||
/**
|
||||
* SVGPathSeg API polyfill
|
||||
* https://github.com/progers/pathseg
|
||||
|
@ -1545,11 +1554,11 @@
|
|||
// 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)) {
|
||||
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
||||
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
||||
var _SVGPathSegList = function () {
|
||||
function _SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, _SVGPathSegList);
|
||||
var SVGPathSegList = function () {
|
||||
function SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, SVGPathSegList);
|
||||
|
||||
this._pathElement = pathElement;
|
||||
this._list = this._parsePath(this._pathElement.getAttribute('d'));
|
||||
|
@ -1564,7 +1573,7 @@
|
|||
// MutationObservers are not synchronous so we can have pending asynchronous mutations.
|
||||
|
||||
|
||||
createClass(_SVGPathSegList, [{
|
||||
createClass(SVGPathSegList, [{
|
||||
key: '_checkPathSynchronizedToList',
|
||||
value: function _checkPathSynchronizedToList() {
|
||||
this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
|
||||
|
@ -1592,7 +1601,7 @@
|
|||
key: '_writeListToPath',
|
||||
value: function _writeListToPath() {
|
||||
this._pathElementMutationObserver.disconnect();
|
||||
this._pathElement.setAttribute('d', _SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
|
||||
}
|
||||
|
||||
|
@ -2069,12 +2078,12 @@
|
|||
return builder.pathSegList;
|
||||
}
|
||||
}]);
|
||||
return _SVGPathSegList;
|
||||
return SVGPathSegList;
|
||||
}();
|
||||
|
||||
_SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
|
||||
Object.defineProperty(_SVGPathSegList.prototype, 'numberOfItems', {
|
||||
Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {
|
||||
get: function get$$1() {
|
||||
this._checkPathSynchronizedToList();
|
||||
return this._list.length;
|
||||
|
@ -2083,7 +2092,7 @@
|
|||
enumerable: true
|
||||
});
|
||||
|
||||
_SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
var string = '';
|
||||
var first = true;
|
||||
pathSegArray.forEach(function (pathSeg) {
|
||||
|
@ -2103,7 +2112,7 @@
|
|||
pathSegList: {
|
||||
get: function get$$1() {
|
||||
if (!this._pathSegList) {
|
||||
this._pathSegList = new _SVGPathSegList(this);
|
||||
this._pathSegList = new SVGPathSegList(this);
|
||||
}
|
||||
return this._pathSegList;
|
||||
},
|
||||
|
@ -2127,7 +2136,7 @@
|
|||
},
|
||||
enumerable: true }
|
||||
});
|
||||
window.SVGPathSegList = _SVGPathSegList;
|
||||
window.SVGPathSegList = SVGPathSegList;
|
||||
}
|
||||
})();
|
||||
|
||||
|
@ -12292,7 +12301,7 @@
|
|||
|
||||
if (window.opera) {
|
||||
window.console.log = function (str) {
|
||||
opera.postError(str);
|
||||
window.opera.postError(str);
|
||||
};
|
||||
window.console.dir = function (str) {};
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
|
@ -58,13 +58,13 @@
|
|||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.13.0",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.8.0",
|
||||
"eslint-plugin-qunit": "^3.2.1",
|
||||
"eslint-plugin-standard": "3.1.0",
|
||||
"eslint": "5.5.0",
|
||||
"eslint-config-standard": "12.0.0",
|
||||
"eslint-plugin-import": "2.14.0",
|
||||
"eslint-plugin-node": "7.0.1",
|
||||
"eslint-plugin-promise": "4.0.0",
|
||||
"eslint-plugin-qunit": "^3.3.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"find-in-files": "^0.5.0",
|
||||
"imageoptim-cli": "^2.0.3",
|
||||
"jsdoc": "^3.5.5",
|
||||
|
@ -72,17 +72,16 @@
|
|||
"node-static": "^0.7.10",
|
||||
"opn-cli": "^3.1.0",
|
||||
"promise-fs": "^1.3.0",
|
||||
"qunit": "^2.6.1",
|
||||
"rollup": "0.63.2",
|
||||
"qunit": "^2.6.2",
|
||||
"rollup": "0.65.2",
|
||||
"rollup-plugin-babel": "^3.0.7",
|
||||
"rollup-plugin-commonjs": "^9.1.3",
|
||||
"rollup-plugin-commonjs": "^9.1.6",
|
||||
"rollup-plugin-json": "^3.0.0",
|
||||
"rollup-plugin-node-builtins": "^2.1.2",
|
||||
"rollup-plugin-node-resolve": "^3.3.0",
|
||||
"rollup-plugin-node-resolve": "^3.4.0",
|
||||
"rollup-plugin-re": "^1.0.7",
|
||||
"rollup-plugin-uglify": "^4.0.0",
|
||||
"sinon": "^6.1.3",
|
||||
"sinon-test": "^2.3.0",
|
||||
"uglify-es": "^3.3.9"
|
||||
"rollup-plugin-terser": "^2.0.2",
|
||||
"sinon": "^6.2.0",
|
||||
"sinon-test": "^2.3.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* eslint-env node */
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import replace from 'rollup-plugin-re';
|
||||
// import {minify} from 'uglify-es';
|
||||
// import {uglify} from 'rollup-plugin-uglify';
|
||||
|
||||
const plugins = [
|
||||
replace({
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
// user entrance file
|
||||
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import {uglify} from 'rollup-plugin-uglify';
|
||||
import {minify} from 'uglify-es';
|
||||
import {terser} from 'rollup-plugin-terser';
|
||||
import replace from 'rollup-plugin-re';
|
||||
|
||||
const {lstatSync, readdirSync} = require('fs');
|
||||
|
@ -44,7 +43,7 @@ function getRollupObject ({minifying, format = 'umd'} = {}) {
|
|||
]
|
||||
};
|
||||
if (minifying) {
|
||||
nonMinified.plugins.push(uglify(null, minify));
|
||||
nonMinified.plugins.push(terser());
|
||||
}
|
||||
return nonMinified;
|
||||
}
|
||||
|
|
|
@ -235,6 +235,15 @@
|
|||
return reverseNS;
|
||||
};
|
||||
|
||||
/* globals SVGPathSeg, SVGPathSegMovetoRel, SVGPathSegMovetoAbs,
|
||||
SVGPathSegMovetoRel, SVGPathSegLinetoRel, SVGPathSegLinetoAbs,
|
||||
SVGPathSegLinetoHorizontalRel, SVGPathSegLinetoHorizontalAbs,
|
||||
SVGPathSegLinetoVerticalRel, SVGPathSegLinetoVerticalAbs,
|
||||
SVGPathSegClosePath, SVGPathSegCurvetoCubicRel,
|
||||
SVGPathSegCurvetoCubicAbs, SVGPathSegCurvetoCubicSmoothRel,
|
||||
SVGPathSegCurvetoCubicSmoothAbs, SVGPathSegCurvetoQuadraticRel,
|
||||
SVGPathSegCurvetoQuadraticAbs, SVGPathSegCurvetoQuadraticSmoothRel,
|
||||
SVGPathSegCurvetoQuadraticSmoothAbs, SVGPathSegArcRel, SVGPathSegArcAbs */
|
||||
/**
|
||||
* SVGPathSeg API polyfill
|
||||
* https://github.com/progers/pathseg
|
||||
|
@ -1545,11 +1554,11 @@
|
|||
// 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)) {
|
||||
if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
|
||||
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
|
||||
var _SVGPathSegList = function () {
|
||||
function _SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, _SVGPathSegList);
|
||||
var SVGPathSegList = function () {
|
||||
function SVGPathSegList(pathElement) {
|
||||
classCallCheck(this, SVGPathSegList);
|
||||
|
||||
this._pathElement = pathElement;
|
||||
this._list = this._parsePath(this._pathElement.getAttribute('d'));
|
||||
|
@ -1564,7 +1573,7 @@
|
|||
// MutationObservers are not synchronous so we can have pending asynchronous mutations.
|
||||
|
||||
|
||||
createClass(_SVGPathSegList, [{
|
||||
createClass(SVGPathSegList, [{
|
||||
key: '_checkPathSynchronizedToList',
|
||||
value: function _checkPathSynchronizedToList() {
|
||||
this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
|
||||
|
@ -1592,7 +1601,7 @@
|
|||
key: '_writeListToPath',
|
||||
value: function _writeListToPath() {
|
||||
this._pathElementMutationObserver.disconnect();
|
||||
this._pathElement.setAttribute('d', _SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElement.setAttribute('d', SVGPathSegList._pathSegArrayAsString(this._list));
|
||||
this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
|
||||
}
|
||||
|
||||
|
@ -2069,12 +2078,12 @@
|
|||
return builder.pathSegList;
|
||||
}
|
||||
}]);
|
||||
return _SVGPathSegList;
|
||||
return SVGPathSegList;
|
||||
}();
|
||||
|
||||
_SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
SVGPathSegList.prototype.classname = 'SVGPathSegList';
|
||||
|
||||
Object.defineProperty(_SVGPathSegList.prototype, 'numberOfItems', {
|
||||
Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {
|
||||
get: function get$$1() {
|
||||
this._checkPathSynchronizedToList();
|
||||
return this._list.length;
|
||||
|
@ -2083,7 +2092,7 @@
|
|||
enumerable: true
|
||||
});
|
||||
|
||||
_SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
|
||||
var string = '';
|
||||
var first = true;
|
||||
pathSegArray.forEach(function (pathSeg) {
|
||||
|
@ -2103,7 +2112,7 @@
|
|||
pathSegList: {
|
||||
get: function get$$1() {
|
||||
if (!this._pathSegList) {
|
||||
this._pathSegList = new _SVGPathSegList(this);
|
||||
this._pathSegList = new SVGPathSegList(this);
|
||||
}
|
||||
return this._pathSegList;
|
||||
},
|
||||
|
@ -2127,7 +2136,7 @@
|
|||
},
|
||||
enumerable: true }
|
||||
});
|
||||
window.SVGPathSegList = _SVGPathSegList;
|
||||
window.SVGPathSegList = SVGPathSegList;
|
||||
}
|
||||
})();
|
||||
|
||||
|
@ -12292,7 +12301,7 @@
|
|||
|
||||
if (window.opera) {
|
||||
window.console.log = function (str) {
|
||||
opera.postError(str);
|
||||
window.opera.postError(str);
|
||||
};
|
||||
window.console.dir = function (str) {};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* eslint-env qunit */
|
||||
/* globals SVGPathSeg */
|
||||
import '../editor/svgpathseg.js';
|
||||
import {NS} from '../editor/namespaces.js';
|
||||
import * as utilities from '../editor/utilities.js';
|
||||
|
|
Loading…
Reference in New Issue