npm update with fix to new eslint issues

This commit is contained in:
jfh
2020-10-25 17:54:04 +01:00
parent ea4a33dc83
commit f2698c2ca8
13 changed files with 151 additions and 195 deletions

View File

@@ -58,11 +58,7 @@ export default {
svgCanvas.bind('setnonce', setArrowNonce);
svgCanvas.bind('unsetnonce', unsetArrowNonce);
if (randomizeIds) {
arrowprefix = prefix + nonce + '_';
} else {
arrowprefix = prefix;
}
arrowprefix = (randomizeIds) ? `${prefix}${nonce}_` : prefix;
const pathdata = {
fw: {d: 'm0,0l10,5l-10,5l5,-5l-5,-5z', refx: 8, id: arrowprefix + 'fw'},

View File

@@ -189,10 +189,7 @@ export default {
let viewBox = '0 0 100 100';
let markerWidth = 5;
let markerHeight = 5;
let seType;
if (val.substr(0, 1) === '\\') {
seType = val.substr(1);
} else { seType = 'textmarker'; }
const seType = (val.substr(0, 1) === '\\') ? val.substr(1) : 'textmarker';
if (!markerTypes[seType]) { return undefined; } // an unknown type!

View File

@@ -1,4 +1,4 @@
/* eslint-disable no-bitwise, max-len */
/* eslint-disable no-bitwise, max-len, unicorn/prefer-math-trunc, unicorn/prefer-ternary */
/**
* @file jPicker (Adapted from version 1.1.6)
*

View File

@@ -2498,11 +2498,7 @@ editor.init = () => {
$(context).parentsUntil('#svgcontent > g').andSelf().each(function () {
if (this.id) {
str += ' > ' + this.id;
if (this !== context) {
linkStr += ' > <a href="#">' + this.id + '</a>';
} else {
linkStr += ' > ' + this.id;
}
linkStr += (this !== context) ? ` > <a href="#">${this.id}</a>` : ` > ${this.id}`;
}
});
@@ -2605,13 +2601,7 @@ editor.init = () => {
if (toolButtonClick(showSel)) {
options.fn();
}
let icon;
if (options.icon) {
icon = $.getSvgIcon(options.icon, true);
} else {
icon = $(options.sel).children().eq(0).clone();
}
const icon = (options.icon) ? $.getSvgIcon(options.icon, true) : $(options.sel).children().eq(0).clone();
icon[0].setAttribute('width', shower.width());
icon[0].setAttribute('height', shower.height());
shower.children(':not(.flyout_arrow_horiz)').remove();
@@ -3199,11 +3189,7 @@ editor.init = () => {
const opts = {alpha: opac};
if (color.startsWith('url(#')) {
let refElem = svgCanvas.getRefElem(color);
if (refElem) {
refElem = refElem.cloneNode(true);
} else {
refElem = $('#' + type + '_color defs *')[0];
}
refElem = (refElem) ? refElem.cloneNode(true) : $('#' + type + '_color defs *')[0];
opts[refElem.tagName] = refElem;
} else if (color.startsWith('#')) {
opts.solidColor = color.substr(1);
@@ -3267,14 +3253,10 @@ editor.init = () => {
const colorBlocks = ['#FFF', '#888', '#000', 'chessboard'];
str = '';
$.each(colorBlocks, function (i, e) {
if (e === 'chessboard') {
str += '<div class="color_block" data-bgcolor="' + e +
'" style="background-image:url(data:image/gif;base64,' +
'R0lGODlhEAAQAIAAAP///9bW1iH5BAAAAAAALAAAAAAQABAAAAIfjG+' +
'gq4jM3IFLJgpswNly/XkcBpIiVaInlLJr9FZWAQA7);"></div>';
} else {
str += '<div class="color_block" data-bgcolor="' + e + '" style="background-color:' + e + ';"></div>';
}
str += (e === 'chessboard')
// eslint-disable-next-line max-len
? `<div class="color_block" data-bgcolor="${e}" style="background-image:url(data:image/gif;base64,R0lGODlhEAAQAIAAAP///9bW1iH5BAAAAAAALAAAAAAQABAAAAIfjGgq4jM3IFLJgpswNly/XkcBpIiVaInlLJr9FZWAQA7);"></div>`
: `<div class="color_block" data-bgcolor="${e}" style="background-color:${e};"></div>`;
});
$('#bg_blocks').append(str);
const blocks = $('#bg_blocks div');
@@ -4344,7 +4326,7 @@ editor.init = () => {
};
/**
*
* @param {string} pos indicate the alignment relative to top, bottom, middle etc..
* @returns {void}
*/
const clickAlign = (pos) => {
@@ -5520,12 +5502,7 @@ editor.init = () => {
const menu = ($(sel).parents('#main_menu').length);
$(sel).each(function () {
let t;
if (menu) {
t = $(this).text().split(' [')[0];
} else {
t = this.title.split(' [')[0];
}
const t = (menu) ? $(this).text().split(' [')[0] : this.title.split(' [')[0];
let keyStr = '';
// Shift+Up
$.each(keyval.split('/'), function (i, key) {

View File

@@ -93,14 +93,11 @@ const fixIDs = function (svgEl, svgNum, force) {
const defs = svgEl.find('defs');
if (!defs.length) return svgEl;
let idElems;
if (isOpera) {
idElems = defs.find('*').filter(function () {
const idElems = (isOpera)
? defs.find('*').filter(function () {
return Boolean(this.id);
});
} else {
idElems = defs.find('[id]');
}
})
: defs.find('[id]');
const allElems = svgEl[0].getElementsByTagName('*'),
len = allElems.length;