Merge pull request #668 from SVG-Edit/update-and-fix-lint
dependencies update and fix lint unused disabled linemaster
commit
7638bb7cea
|
@ -5,7 +5,6 @@ import * as coords from '../../../instrumented/svgcanvas/coords.js';
|
|||
describe('coords', function () {
|
||||
let elemId = 1;
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
const root = document.createElement('div');
|
||||
root.id = 'root';
|
||||
root.style.visibility = 'hidden';
|
||||
|
|
|
@ -19,7 +19,6 @@ describe('draw.Drawing', function () {
|
|||
const PATH_ATTR = {
|
||||
// clone will convert relative to absolute, so the test for equality fails.
|
||||
// d: 'm7.38867,57.38867c0,-27.62431 22.37569,-50 50,-50c27.62431,0 50,22.37569 50,50c0,27.62431 -22.37569,50 -50,50c-27.62431,0 -50,-22.37569 -50,-50z',
|
||||
// eslint-disable-next-line max-len
|
||||
d: 'M7.389,57.389C7.389,29.764 29.764,7.389 57.389,7.389C85.013,7.389 107.389,29.764 107.389,57.389C107.389,85.013 85.013,107.389 57.389,107.389C29.764,107.389 7.389,85.013 7.389,57.389z',
|
||||
transform: 'rotate(45 57.388671875000036,57.388671874999986) ',
|
||||
'stroke-width': '5',
|
||||
|
|
|
@ -25,7 +25,7 @@ describe('history', function () {
|
|||
unapply (handler) {
|
||||
super.unapply(handler, () => { /* empty fn */ });
|
||||
}
|
||||
elements () { return []; } // eslint-disable-line class-methods-use-this
|
||||
elements () { return []; }
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -48,7 +48,7 @@ describe('path', function () {
|
|||
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
|
||||
pathModule.init(mockPathContext);
|
||||
utilities.init(mockUtilitiesContext);
|
||||
new Path(path); // eslint-disable-line no-new
|
||||
new Path(path);
|
||||
|
||||
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'L');
|
||||
assert.equal(path.pathSegList.getItem(1).x, 10);
|
||||
|
@ -68,7 +68,7 @@ describe('path', function () {
|
|||
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
|
||||
pathModule.init(mockPathContext);
|
||||
utilities.init(mockUtilitiesContext);
|
||||
new Path(path); // eslint-disable-line no-new
|
||||
new Path(path);
|
||||
|
||||
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'L');
|
||||
assert.equal(path.pathSegList.getItem(1).x, 10);
|
||||
|
@ -124,7 +124,7 @@ describe('path', function () {
|
|||
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
|
||||
pathModule.init(mockPathContext);
|
||||
utilities.init(mockUtilitiesContext);
|
||||
new Path(path); // eslint-disable-line no-new
|
||||
new Path(path);
|
||||
|
||||
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'L');
|
||||
assert.equal(path.pathSegList.getItem(1).x, 10);
|
||||
|
@ -144,7 +144,7 @@ describe('path', function () {
|
|||
const [ mockPathContext, mockUtilitiesContext ] = getMockContexts();
|
||||
pathModule.init(mockPathContext);
|
||||
utilities.init(mockUtilitiesContext);
|
||||
new Path(path); // eslint-disable-line no-new
|
||||
new Path(path);
|
||||
|
||||
assert.equal(path.pathSegList.getItem(1).pathSegTypeAsLetter, 'C');
|
||||
assert.equal(path.pathSegList.getItem(1).x1, 11);
|
||||
|
|
|
@ -5,7 +5,6 @@ import * as recalculate from '../../../instrumented/svgcanvas/recalculate.js';
|
|||
|
||||
|
||||
describe('recalculate', function () {
|
||||
// eslint-disable-next-line no-shadow
|
||||
const root = document.createElement('div');
|
||||
root.id = 'root';
|
||||
root.style.visibility = 'hidden';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable max-len */
|
||||
import 'pathseg';
|
||||
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
|
@ -174,7 +173,7 @@ describe('utilities bbox', function () {
|
|||
|
||||
const rect = { x: 10, y: 10, width: 10, height: 20 };
|
||||
const angle = 45;
|
||||
const origin = { x: 15, y: 20 }; // eslint-disable-line no-shadow
|
||||
const origin = { x: 15, y: 20 };
|
||||
elem = mockCreateSVGElement({
|
||||
element: 'rect',
|
||||
attr: { id: 'rect2', x: rect.x, y: rect.y, width: rect.width, height: rect.height, transform: 'rotate(' + angle + ' ' + origin.x + ',' + origin.y + ')' }
|
||||
|
@ -263,7 +262,7 @@ describe('utilities bbox', function () {
|
|||
|
||||
const rect = { x: 10, y: 10, width: 10, height: 20 };
|
||||
const angle = 45;
|
||||
const origin = { x: 15, y: 20 }; // eslint-disable-line no-shadow
|
||||
const origin = { x: 15, y: 20 };
|
||||
tx = 10; // tx right
|
||||
ty = 10; // tx down
|
||||
txInRotatedSpace = Math.sqrt(tx * tx + ty * ty); // translate in rotated 45 space.
|
||||
|
@ -466,7 +465,7 @@ describe('utilities bbox', function () {
|
|||
* @param {module:math.XYObject} origin
|
||||
* @returns {module:math.XYObject}
|
||||
*/
|
||||
function rotatePoint (point, angle, origin) { // eslint-disable-line no-shadow
|
||||
function rotatePoint (point, angle, origin) {
|
||||
if (!origin) {
|
||||
origin = { x: 0, y: 0 };
|
||||
}
|
||||
|
@ -485,7 +484,7 @@ describe('utilities bbox', function () {
|
|||
* @param {module:math.XYObject} origin
|
||||
* @returns {module:utilities.BBoxObject}
|
||||
*/
|
||||
function rotateRect (rect, angle, origin) { // eslint-disable-line no-shadow
|
||||
function rotateRect (rect, angle, origin) {
|
||||
const tl = rotatePoint({ x: rect.x, y: rect.y }, angle, origin);
|
||||
const tr = rotatePoint({ x: rect.x + rect.width, y: rect.y }, angle, origin);
|
||||
const br = rotatePoint({ x: rect.x + rect.width, y: rect.y + rect.height }, angle, origin);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable max-len */
|
||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||
|
||||
|
@ -29,7 +28,6 @@ describe('utilities', function () {
|
|||
let mockHistorySubCommands = [];
|
||||
const mockHistory = {
|
||||
BatchCommand: class {
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
addSubCommand (cmd) {
|
||||
mockHistorySubCommands.push(cmd);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable max-len */
|
||||
import assertionWrapper from './assertion-wrapper.js';
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,6 @@ module.exports = {
|
|||
'screencasts',
|
||||
'test'
|
||||
],
|
||||
// eslint-disable-next-line max-len
|
||||
excludePattern: 'svgedit-config-*|build-html.js|rollup*|external/babel-polyfill|extensions/mathjax|imagelib/jquery.min.js|jspdf/jspdf.min.js|jspdf/underscore-min.js|jquery-ui|jquery.min.js|js-hotkeys'
|
||||
},
|
||||
sourceType: 'module',
|
||||
|
|
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
|
@ -73,8 +73,8 @@
|
|||
"canvg": "3.0.9",
|
||||
"core-js": "3.19.1",
|
||||
"elix": "15.0.1",
|
||||
"html2canvas": "1.3.2",
|
||||
"i18next": "21.5.2",
|
||||
"html2canvas": "1.3.3",
|
||||
"i18next": "21.5.3",
|
||||
"jspdf": "2.4.0",
|
||||
"pathseg": "1.2.1",
|
||||
"regenerator-runtime": "0.13.9",
|
||||
|
@ -102,7 +102,7 @@
|
|||
"copyfiles": "2.4.1",
|
||||
"core-js-bundle": "3.19.1",
|
||||
"cp-cli": "2.0.0",
|
||||
"cypress": "9.0.0",
|
||||
"cypress": "9.1.0",
|
||||
"cypress-multi-reporters": "1.5.0",
|
||||
"cypress-plugin-snapshots": "1.4.4",
|
||||
"eslint": "^7",
|
||||
|
@ -132,10 +132,10 @@
|
|||
"promise-fs": "2.1.1",
|
||||
"qr-manipulation": "0.7.0",
|
||||
"query-result": "1.0.5",
|
||||
"remark-cli": "10.0.0",
|
||||
"remark-cli": "10.0.1",
|
||||
"remark-lint-ordered-list-marker-value": "3.1.0",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.60.0",
|
||||
"rollup": "2.60.1",
|
||||
"rollup-plugin-copy": "3.4.0",
|
||||
"rollup-plugin-filesize": "9.1.1",
|
||||
"rollup-plugin-node-polyfills": "0.2.1",
|
||||
|
|
|
@ -32,7 +32,6 @@ const extensionDirs = getDirectories('src/editor/extensions');
|
|||
const dest = [ 'dist/editor' ];
|
||||
|
||||
// remove existing distribution
|
||||
// eslint-disable-next-line no-console
|
||||
rimraf('./dist', () => console.info('recreating dist'));
|
||||
|
||||
// config for svgedit core module
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// eslint-disable-next-line node/no-unpublished-import
|
||||
import { mergeDeep } from './components/jgraduate/Util.js';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable max-len */
|
||||
/* globals seConfirm seAlert */
|
||||
/**
|
||||
* The main module for the visual SVG this.
|
||||
|
@ -69,7 +68,6 @@ class Editor extends EditorStartup {
|
|||
this.docprops = false;
|
||||
this.configObj.preferences = false;
|
||||
this.canvMenu = null;
|
||||
// eslint-disable-next-line max-len
|
||||
this.goodLangs = [ 'ar', 'cs', 'de', 'en', 'es', 'fa', 'fr', 'fy', 'hi', 'it', 'ja', 'nl', 'pl', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'zh-CN', 'zh-TW' ];
|
||||
const modKey = (isMac() ? 'meta+' : 'ctrl+');
|
||||
this.shortcuts = [
|
||||
|
@ -678,7 +676,6 @@ class Editor extends EditorStartup {
|
|||
* @returns {void}
|
||||
*/
|
||||
setIcon(elem, iconId) {
|
||||
// eslint-disable-next-line max-len
|
||||
const img = document.createElement("img");
|
||||
img.src = this.configObj.curConfig.imgPath + iconId;
|
||||
const icon = (typeof iconId === 'string') ? img : iconId.cloneNode(true);
|
||||
|
@ -829,7 +826,6 @@ class Editor extends EditorStartup {
|
|||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
hideSourceEditor() {
|
||||
const $editorDialog = $id('se-svg-editor-dialog');
|
||||
$editorDialog.setAttribute('dialog', 'closed');
|
||||
|
@ -918,7 +914,6 @@ class Editor extends EditorStartup {
|
|||
* @param {Event} e
|
||||
* @returns {void}
|
||||
*/
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
onDragEnter(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
@ -930,7 +925,6 @@ class Editor extends EditorStartup {
|
|||
* @param {Event} e
|
||||
* @returns {void}
|
||||
*/
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
onDragOver(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
@ -941,7 +935,6 @@ class Editor extends EditorStartup {
|
|||
* @param {Event} e
|
||||
* @returns {void}
|
||||
*/
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
onDragLeave(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
|
|
@ -199,7 +199,6 @@ class MainMenu {
|
|||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
clickImport() {
|
||||
/* empty fn */
|
||||
}
|
||||
|
@ -266,7 +265,6 @@ class MainMenu {
|
|||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
openHomePage() {
|
||||
window.open(homePage, "_blank");
|
||||
}
|
||||
|
@ -277,7 +275,6 @@ class MainMenu {
|
|||
init() {
|
||||
// add Top panel
|
||||
const template = document.createElement("template");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<se-menu id="main_button" label="SVG-Edit" src="logo.svg" alt="logo">
|
||||
<se-menu-item id="tool_import" label="tools.import_doc" src="importImg.svg"></se-menu-item>
|
||||
|
|
|
@ -70,7 +70,6 @@ class Rulers {
|
|||
|
||||
// Bit of a hack to fully clear the canvas in Safari & IE9
|
||||
const $hcanv = $hcanvOrig.cloneNode(true);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
$hcanvOrig.replaceWith($hcanv);
|
||||
|
||||
const hcanv = $hcanv;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable max-len */
|
||||
/* eslint-disable no-bitwise */
|
||||
/**
|
||||
* @external Math
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-bitwise */
|
||||
import { findPos } from './Util.js';
|
||||
/**
|
||||
* Whether a value is `null` or `undefined`.
|
||||
|
@ -282,14 +281,14 @@ export default class Slider {
|
|||
* @param {GenericCallback} callback
|
||||
* @returns {void}
|
||||
*/
|
||||
function bind (callback) { // eslint-disable-line promise/prefer-await-to-callbacks
|
||||
function bind (callback) {
|
||||
if (typeof callback === 'function') changeEvents.push(callback);
|
||||
}
|
||||
/**
|
||||
* @param {GenericCallback} callback
|
||||
* @returns {void}
|
||||
*/
|
||||
function unbind (callback) { // eslint-disable-line promise/prefer-await-to-callbacks
|
||||
function unbind (callback) {
|
||||
if (typeof callback !== 'function') return;
|
||||
let i;
|
||||
while ((i = changeEvents.includes(callback))) changeEvents.splice(i, 1);
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable no-loop-func */
|
||||
/* eslint-disable prefer-destructuring */
|
||||
/* eslint-disable no-unsanitized/property */
|
||||
/**
|
||||
* @file jGraduate 0.4
|
||||
|
@ -60,7 +58,6 @@ if (!window.console) {
|
|||
* @returns {external:jQuery}
|
||||
*/
|
||||
// export default function jQueryPluginJGraduate ($) {
|
||||
/* eslint-disable jsdoc/require-property */
|
||||
/**
|
||||
* @namespace {PlainObject} jGraduate
|
||||
* @memberof external:jQuery
|
||||
|
@ -195,7 +192,6 @@ export function jGraduateMethod (elem, options, okCallback, cancelCallback, i18n
|
|||
const idref = '#' + $this.getAttribute('id') + ' ';
|
||||
|
||||
if (!idref) {
|
||||
// eslint-disable-next-line no-alert
|
||||
alert('Container element must have an id attribute to maintain unique id strings for sub-elements.');
|
||||
return;
|
||||
}
|
||||
|
@ -234,7 +230,6 @@ export function jGraduateMethod (elem, options, okCallback, cancelCallback, i18n
|
|||
$this.paint = new jGraduate.Paint({ solidColor: 'ffffff' });
|
||||
}
|
||||
$this.classList.add('jGraduate_Picker');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
$this.innerHTML = `<ul class="jGraduate_tabs">
|
||||
<li class="jGraduate_tab_color jGraduate_tab_current" id="jGraduate_tab_color" data-type="col">${i18next.t('config.jgraduate_solid_color')}</li>
|
||||
<li class="jGraduate_tab_lingrad" id="jGraduate_tab_lingrad" data-type="lg">${i18next.t('config.jgraduate_linear_gradient')}</li>
|
||||
|
@ -244,10 +239,8 @@ export function jGraduateMethod (elem, options, okCallback, cancelCallback, i18n
|
|||
<div class="jGraduate_gradPick" id="jGraduate_gradPick"></div>
|
||||
<div class="jGraduate_LightBox" id="jGraduate_LightBox"></div>
|
||||
<div id="${id}_jGraduate_stopPicker" class="jGraduate_stopPicker"></div>`;
|
||||
/* JFH !!!! */
|
||||
const colPicker = $this.querySelector('#jGraduate_colPick');
|
||||
const gradPicker = $this.querySelector('#jGraduate_gradPick');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const html = `<div id="${id}_jGraduate_Swatch" class="jGraduate_Swatch">
|
||||
<h2 class="jGraduate_Title">${$settings.window.pickerTitle}</h2>
|
||||
<div id="${id}_jGraduate_GradContainer" class="jGraduate_GradContainer"></div>
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
* John Dyers' website: {@link http://johndyer.name}
|
||||
* Color Picker page: {@link http://johndyer.name/photoshop-like-javascript-color-picker/}
|
||||
*/
|
||||
/* eslint-disable no-bitwise */
|
||||
/* eslint-disable max-len */
|
||||
/* gl#bals svgEditor */
|
||||
import ColorValuePicker from './ColorValuePicker.js';
|
||||
|
@ -96,7 +95,7 @@ export const jPicker = /** @lends external:jQuery.jPicker */ {
|
|||
* @param {module:jPicker.JPickerInit} init
|
||||
* @returns {external:jQuery.jPicker.Color}
|
||||
*/
|
||||
Color: function (init) { // eslint-disable-line object-shorthand
|
||||
Color: function (init) {
|
||||
const that = this;
|
||||
/**
|
||||
*
|
||||
|
@ -628,7 +627,6 @@ export function jPickerMethod (elem, options, commitCallback, liveCallback, canc
|
|||
if (settings.window.expandable) {
|
||||
const content = document.createElement('span');
|
||||
content.classList.add('jPicker');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.innerHTML = `<span class="Icon" id="jq-ae-Icon">
|
||||
<span class="Color" id="jq-ae-Color"> </span>
|
||||
<span class="Alpha" id="jq-ae-Alpha"> </span>
|
||||
|
@ -1324,7 +1322,6 @@ export function jPickerMethod (elem, options, commitCallback, liveCallback, canc
|
|||
const all = color.active.val('all');
|
||||
if (win.alphaPrecision < 0) win.alphaPrecision = 0;
|
||||
else if (win.alphaPrecision > 2) win.alphaPrecision = 2;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const controlHtml = `<table class="jPicker" id="jPicker-table" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
${win.expandable ? '<tr><td class="Move" colspan="5"> </td></tr>' : ''}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* globals svgEditor */
|
||||
import { t } from '../locale.js';
|
||||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
:host(:hover) :not(.disabled)
|
||||
|
@ -113,7 +112,6 @@ export class ToolButton extends HTMLElement {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
/* globals svgEditor */
|
||||
/* eslint-disable max-len */
|
||||
import { jGraduate, jGraduateMethod } from './jgraduate/jQuery.jGraduate.js';
|
||||
import PaintBox from './PaintBox.js';
|
||||
import { t } from '../locale.js';
|
||||
|
||||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
.jPicker .Icon {
|
||||
|
@ -708,7 +706,6 @@ export class SeColorPicker extends HTMLElement {
|
|||
this.$label.setAttribute('title', newValue);
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,6 @@ export class ExplorerButton extends HTMLElement {
|
|||
)).join('');
|
||||
await this.updateLib(lib[0]);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error);
|
||||
}
|
||||
break;
|
||||
|
@ -177,7 +176,6 @@ export class ExplorerButton extends HTMLElement {
|
|||
this.$img.setAttribute('src', this.imgPath + '/' + newValue);
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
@ -273,7 +271,6 @@ export class ExplorerButton extends HTMLElement {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('unknown nodeName for:', ev.target, ev.target.className);
|
||||
}
|
||||
};
|
||||
|
@ -308,7 +305,6 @@ export class ExplorerButton extends HTMLElement {
|
|||
return `<se-button data-shape="${key}"src="data:image/svg+xml;base64,${encoded}"></se-button>`;
|
||||
}).join('');
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`could not read file:${libDir}${lib}.json`, error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,6 @@ export class FlyingButton extends HTMLElement {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
@ -270,7 +269,6 @@ export class FlyingButton extends HTMLElement {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('unkonw nodeName for:', ev.target, ev.target.className);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -88,7 +88,6 @@ export class SEInput extends HTMLElement {
|
|||
this.$input.value = newValue;
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,6 @@ export class SeList extends HTMLElement {
|
|||
});
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ export class SeListItem extends HTMLElement {
|
|||
this.$img.setAttribute('height', newValue);
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,6 @@ export class SeMenu extends HTMLElement {
|
|||
this.$label.prepend(newValue);
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@ export class SeMenuItem extends HTMLElement {
|
|||
this.$label.textContent = `${t(newValue)} ${shortcut ? `(${shortcut})` : ''}`;
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ const palette = [
|
|||
];
|
||||
|
||||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
.square {
|
||||
|
|
|
@ -101,7 +101,6 @@ export class SeSelect extends HTMLElement {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -122,7 +122,6 @@ export class SESpinInput extends HTMLElement {
|
|||
this.$input.value = newValue;
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { t } from '../locale.js';
|
||||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
#layersLabel {
|
||||
|
@ -60,7 +59,6 @@ export class SeText extends HTMLElement {
|
|||
//this.$div.setAttribute("value", newValue);
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`unknown attribute: ${name}`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
.contextMenu {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
.contextMenu {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
:not(:defined) {
|
||||
|
@ -563,7 +562,6 @@ export class SeEditPrefsDialog extends HTMLElement {
|
|||
const newdiv = document.createElement('div');
|
||||
if (e === 'chessboard') {
|
||||
newdiv.dataset.bgColor = e;
|
||||
// eslint-disable-next-line max-len
|
||||
newdiv.style.backgroundImage = 'url(data:image/gif;base64,R0lGODlhEAAQAIAAAP///9bW1iH5BAAAAAAALAAAAAAQABAAAAIfjG+gq4jM3IFLJgpswNly/XkcBpIiVaInlLJr9FZWAQA7)';
|
||||
newdiv.classList.add('color_block');
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import './se-elix/define/NumberSpinBox.js';
|
||||
|
||||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { isValidUnit } from '../../common/units.js';
|
||||
|
||||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
:not(:defined) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable class-methods-use-this */
|
||||
import {
|
||||
defaultState,
|
||||
setState,
|
||||
|
|
|
@ -42,7 +42,6 @@ export class SePromptDialog extends HTMLElement {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('unknown attr for:', name, 'newValue =', newValue);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const template = document.createElement('template');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
:not(:defined) {
|
||||
|
|
|
@ -17,9 +17,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, name, translationModule.default);
|
||||
|
@ -84,7 +82,6 @@ export default {
|
|||
// Add the button and its handler(s)
|
||||
const title = `${name}:buttons.0.title`;
|
||||
const key = `${name}:buttons.0.key`;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const buttonTemplate = `
|
||||
<se-button id="tool_eyedropper" title="${title}" src="eye_dropper.svg" shortcut=${key}></se-button>
|
||||
`;
|
||||
|
|
|
@ -16,9 +16,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, name, translationModule.default);
|
||||
|
|
|
@ -22,9 +22,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, name, translationModule.default);
|
||||
|
|
|
@ -18,9 +18,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, name, translationModule.default);
|
||||
|
@ -380,7 +378,6 @@ export default {
|
|||
if (!preview) {
|
||||
preview = document.createElement('div');
|
||||
preview.setAttribute('id', 'imglib_preview');
|
||||
// eslint-disable-next-line max-len
|
||||
preview.setAttribute('style', `position: absolute;top: 45px;right: 10px;width: 180px;bottom: 45px;background: #fff;overflow: auto;`);
|
||||
insertAfter($id('lib_framewrap'), preview);
|
||||
|
||||
|
@ -431,7 +428,6 @@ export default {
|
|||
header.setAttribute('style', `position: absolute;top: 0px;left: 0px;width: 100%;`);
|
||||
|
||||
const button = document.createElement('button');
|
||||
// eslint-disable-next-line max-len
|
||||
button.innerHTML = svgEditor.i18next.t('common.cancel');
|
||||
browser.appendChild(button);
|
||||
button.addEventListener('click', function () {
|
||||
|
@ -448,7 +444,6 @@ export default {
|
|||
|
||||
const back = document.createElement('button');
|
||||
back.style.visibility = "hidden";
|
||||
// eslint-disable-next-line max-len
|
||||
back.innerHTML = `<img class="svg_icon" src="${imgPath}/library.svg" alt="icon" width="16" height="16" />` + svgEditor.i18next.t(`${name}:show_list`);
|
||||
leftBlock.appendChild(back);
|
||||
back.addEventListener('click', function () {
|
||||
|
|
|
@ -43,7 +43,6 @@ Array.prototype.forEach.call(atags, function (aEle) {
|
|||
} else {
|
||||
fetch(href)
|
||||
.then( (r) => r.text())
|
||||
// eslint-disable-next-line promise/always-return
|
||||
.then( (data) => {
|
||||
post({ href, data });
|
||||
return data;
|
||||
|
|
|
@ -7,7 +7,7 @@ manipulation($, jml);
|
|||
|
||||
const baseAPIURL = 'https://openclipart.org/search/json/';
|
||||
|
||||
const jsVoid = 'javascript: void(0);'; // eslint-disable-line no-script-url
|
||||
const jsVoid = 'javascript: void(0);';
|
||||
|
||||
/**
|
||||
* Shows results after query submission.
|
||||
|
|
|
@ -27,9 +27,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, 'translation', translationModule.default, true, true);
|
||||
|
@ -159,7 +157,6 @@ export default {
|
|||
name: svgEditor.i18next.t(`${name}:name`),
|
||||
// The callback should be used to load the DOM with the appropriate UI items
|
||||
callback() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const buttonTemplate = `
|
||||
<se-menu-item id="tool_clear" label="opensave.new_doc" shortcut="N" src="new.svg"></se-menu-item>`;
|
||||
svgCanvas.insertChildAtIndex($id('main_button'), buttonTemplate, 0);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable max-len */
|
||||
/**
|
||||
* @file ext-overview_window.js
|
||||
*
|
||||
|
@ -31,7 +30,6 @@ export default {
|
|||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
$id("sidepanel_content").insertAdjacentHTML( 'beforeend', propsWindowHtml );
|
||||
|
||||
// Define dynamic animation of the view box.
|
||||
|
|
|
@ -19,9 +19,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, name, translationModule.default);
|
||||
|
|
|
@ -17,9 +17,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, name, translationModule.default);
|
||||
|
@ -83,7 +81,6 @@ export default {
|
|||
const fbtitle = `${name}:title`;
|
||||
const title_star = `${name}:buttons.0.title`;
|
||||
const title_polygon = `${name}:buttons.1.title`;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const buttonTemplate = `
|
||||
<se-flyingbutton id="tools_polygon" title="${fbtitle}">
|
||||
<se-button id="tool_star" title="${title_star}" src="star.svg">
|
||||
|
|
|
@ -15,9 +15,7 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/${lang}.js`);
|
||||
} catch (_error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation (${lang}) for ${name} - using 'en'`);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
translationModule = await import(`./locale/en.js`);
|
||||
}
|
||||
svgEditor.i18next.addResourceBundle(lang, name, translationModule.default);
|
||||
|
@ -43,7 +41,6 @@ export default {
|
|||
return {
|
||||
callback () {
|
||||
if ($id('tool_shapelib') === null) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const buttonTemplate = `
|
||||
<se-explorerbutton id="tool_shapelib" title="${svgEditor.i18next.t(`${name}:buttons.0.title`)}" lib="./extensions/ext-shapes/shapelib/"
|
||||
src="shapelib.svg"></se-explorerbutton>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable max-len */
|
||||
const template = document.createElement('template');
|
||||
template.innerHTML = `
|
||||
<style>
|
||||
|
|
|
@ -165,7 +165,6 @@ class BottomPanel {
|
|||
const template = document.createElement('template');
|
||||
const { i18next } = this.editor;
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<div id="tools_bottom">
|
||||
<!-- Zoom buttons -->
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-alert */
|
||||
import SvgCanvas from "../../svgcanvas/svgcanvas.js";
|
||||
|
||||
const { $id } = SvgCanvas;
|
||||
|
@ -45,7 +44,6 @@ class LayersPanel {
|
|||
const template = document.createElement("template");
|
||||
const { i18next } = this.editor;
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<div id="sidepanels">
|
||||
<se-text id="sidepanel_handle" title="ui.panel_action" text="ui.panel"></se-text>
|
||||
|
|
|
@ -25,7 +25,6 @@ class LeftPanel {
|
|||
* @param {string|Element} button The DOM element or string selector representing the toolbar button
|
||||
* @returns {boolean} Whether the button was disabled or not
|
||||
*/
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
updateLeftPanel(button) {
|
||||
if (button.disabled) return false;
|
||||
// remove the pressed state on other(s) button(s)
|
||||
|
|
|
@ -150,7 +150,6 @@ class TopPanel {
|
|||
promptImgURL({ cancelDeletes = false } = {}) {
|
||||
let curhref = this.editor.svgCanvas.getHref(this.editor.selectedElement);
|
||||
curhref = curhref.startsWith("data:") ? "" : curhref;
|
||||
// eslint-disable-next-line no-alert
|
||||
const url = prompt(
|
||||
this.editor.i18next.t('notification.enterNewImgURL'),
|
||||
curhref
|
||||
|
@ -263,7 +262,6 @@ class TopPanel {
|
|||
} else {
|
||||
const point = this.path.getNodePoint();
|
||||
$id("tool_add_subpath").pressed = false;
|
||||
// eslint-disable-next-line max-len
|
||||
(!this.path.canDeleteNodes) ? $id("tool_node_delete").classList.add("disabled") : $id("tool_node_delete").classList.remove("disabled");
|
||||
|
||||
// Show open/close button based on selected point
|
||||
|
@ -517,7 +515,6 @@ class TopPanel {
|
|||
*/
|
||||
changeRotationAngle(e) {
|
||||
this.editor.svgCanvas.setRotationAngle(e.target.value);
|
||||
// eslint-disable-next-line max-len
|
||||
(Number.parseInt(e.target.value) === 0) ? $id("tool_reorient").classList.add("disabled") : $id("tool_reorient").classList.remove("disabled");
|
||||
}
|
||||
|
||||
|
@ -580,7 +577,6 @@ class TopPanel {
|
|||
|
||||
if (!valid) {
|
||||
e.target.value = this.selectedElement.getAttribute(attr);
|
||||
// eslint-disable-next-line no-alert
|
||||
alert(this.editor.i18next.t('notification.invalidAttrValGiven'));
|
||||
return false;
|
||||
}
|
||||
|
@ -640,7 +636,6 @@ class TopPanel {
|
|||
*/
|
||||
makeHyperlink() {
|
||||
if (this.editor.selectedElement || this.multiselected) {
|
||||
// eslint-disable-next-line no-alert
|
||||
const url = prompt(
|
||||
this.editor.i18next.t('notification.enterNewLinkURL'),
|
||||
"http://"
|
||||
|
@ -827,7 +822,6 @@ class TopPanel {
|
|||
// add Top panel
|
||||
const template = document.createElement("template");
|
||||
const { i18next } = this.editor;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
template.innerHTML = `
|
||||
<div id="tools_top">
|
||||
<div id="editor_panel">
|
||||
|
|
|
@ -119,7 +119,7 @@ export const addToSelectionMethod = function (elemsToAdd, showGrips) {
|
|||
|
||||
selectedElements.sort(function (a, b) {
|
||||
if (a && b && a.compareDocumentPosition) {
|
||||
return 3 - (b.compareDocumentPosition(a) & 6); // eslint-disable-line no-bitwise
|
||||
return 3 - (b.compareDocumentPosition(a) & 6);
|
||||
}
|
||||
if (!a) {
|
||||
return 1;
|
||||
|
|
|
@ -18,7 +18,6 @@ import {
|
|||
init as pasteInit, pasteElementsMethod
|
||||
} from './paste-elem.js';
|
||||
|
||||
// eslint-disable-next-line no-duplicate-imports
|
||||
import {
|
||||
identifyLayers, createLayer, cloneLayer, deleteCurrentLayer,
|
||||
setCurrentLayer, renameCurrentLayer, setCurrentLayerPosition,
|
||||
|
|
|
@ -222,7 +222,6 @@ export const changeSelectedAttributeNoUndoMethod = function (attr, newValue, ele
|
|||
// that are not in the selectedElements array, we need to only request a
|
||||
// selector if the element is in that array
|
||||
if (selectedElements.includes(elem)) {
|
||||
// eslint-disable-next-line no-loop-func
|
||||
setTimeout(function () {
|
||||
// Due to element replacement, this element may no longer
|
||||
// be part of the DOM
|
||||
|
|
Loading…
Reference in New Issue