move to standard linter for simpler configuration

This commit is contained in:
JFH
2021-12-28 11:02:29 -03:00
parent 258e2bd6a1
commit fdcfc8a253
251 changed files with 19760 additions and 19935 deletions

View File

@@ -27,14 +27,14 @@
<input id="text" style="width:0;height:0;opacity: 0"/>
<script type="module">
/* globals canvas */
import SvgCanvas from '../src/svgcanvas/svgcanvas.js';
import SvgCanvas from '../src/svgcanvas/svgcanvas.js'
const container = document.querySelector('#editorContainer');
const { width, height } = { width: 500, height: 300 };
window.width = width;
window.height = height;
const container = document.querySelector('#editorContainer')
const { width, height } = { width: 500, height: 300 }
window.width = width
window.height = height
const hiddenTextTagId = "text";
const hiddenTextTagId = 'text'
const config = {
initFill: { color: 'FFFFFF', opacity: 1 },
@@ -44,28 +44,27 @@ const config = {
imgPath: '../src/editor/images',
dimensions: [ width, height ],
baseUnit: 'px'
};
}
window.canvas = new SvgCanvas(container, config);
canvas.updateCanvas(width, height);
window.canvas = new SvgCanvas(container, config)
canvas.updateCanvas(width, height)
window.fill = function (colour) {
canvas.getSelectedElements().forEach((el) => {
el.setAttribute('fill', colour);
});
};
el.setAttribute('fill', colour)
})
}
const hiddenTextTag = window.canvas.$id(hiddenTextTagId);
window.canvas.textActions.setInputElem(hiddenTextTag);
const hiddenTextTag = window.canvas.$id(hiddenTextTagId)
window.canvas.textActions.setInputElem(hiddenTextTag)
const addListenerMulti = (element, eventNames, listener)=> {
eventNames.split(' ').forEach((eventName)=> element.addEventListener(eventName, listener, false));
};
const addListenerMulti = (element, eventNames, listener) => {
eventNames.split(' ').forEach((eventName) => element.addEventListener(eventName, listener, false))
}
addListenerMulti(hiddenTextTag, 'keyup input', (evt) => {
window.canvas.setTextContent(evt.currentTarget.value);
});
window.canvas.setTextContent(evt.currentTarget.value)
})
</script>
</body>
</html>