image folder variable used consistently
This commit is contained in:
@@ -31,6 +31,7 @@ export default {
|
||||
const { svgCanvas } = svgEditor;
|
||||
const { getElem, $id, mergeDeep } = svgCanvas;
|
||||
const { svgroot } = S;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
const addElem = svgCanvas.addSVGElementFromJson;
|
||||
const selManager = S.selectorManager;
|
||||
await loadExtensionTranslation(svgEditor);
|
||||
@@ -360,7 +361,7 @@ export default {
|
||||
const btitle = svgEditor.i18next.t(`${name}:langListTitle`);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const buttonTemplate = `
|
||||
<se-button id="mode_connect" title="${btitle}" src="./images/conn.svg"></se-button>
|
||||
<se-button id="mode_connect" title="${btitle}" src="${imgPath}/conn.svg"></se-button>
|
||||
`;
|
||||
svgCanvas.insertChildAtIndex($id('tools_left'), buttonTemplate, 13);
|
||||
$id('mode_connect').addEventListener("click", () => {
|
||||
|
||||
@@ -29,6 +29,7 @@ export default {
|
||||
name,
|
||||
async init(S) {
|
||||
const svgEditor = this;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
await loadExtensionTranslation(svgEditor);
|
||||
const { ChangeElementCommand } = S; // , svgcontent,
|
||||
// svgdoc = S.svgroot.parentNode.ownerDocument,
|
||||
@@ -86,7 +87,7 @@ export default {
|
||||
const key = svgEditor.i18next.t(`${name}:buttons.0.key`);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const buttonTemplate = `
|
||||
<se-button id="tool_eyedropper" title="${title}" src="./images/eye_dropper.svg" shortcut=${key}></se-button>
|
||||
<se-button id="tool_eyedropper" title="${title}" src="${imgPath}/eye_dropper.svg" shortcut=${key}></se-button>
|
||||
`;
|
||||
svgCanvas.insertChildAtIndex($id('tools_left'), buttonTemplate, 12);
|
||||
$id('tool_eyedropper').addEventListener("click", () => {
|
||||
|
||||
@@ -28,6 +28,7 @@ export default {
|
||||
name,
|
||||
async init ({ NS, getTypeMap }) {
|
||||
const svgEditor = this;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
await loadExtensionTranslation(svgEditor);
|
||||
const { svgCanvas } = svgEditor;
|
||||
const { $id } = svgCanvas;
|
||||
@@ -167,14 +168,13 @@ export default {
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
buttonTemplate.innerHTML = `
|
||||
<se-button id="view_grid" title="${title}" src="./images/grid.svg"></se-button>
|
||||
<se-button id="view_grid" title="${title}" src="${imgPath}/grid.svg"></se-button>
|
||||
`;
|
||||
$id('editor_panel').append(buttonTemplate.content.cloneNode(true));
|
||||
$id('view_grid').addEventListener("click", () => {
|
||||
svgEditor.configObj.curConfig.showGrid = showGrid = !showGrid;
|
||||
gridUpdate();
|
||||
});
|
||||
|
||||
if (showGrid) {
|
||||
gridUpdate();
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ export default {
|
||||
name,
|
||||
async init ({ _importLocale }) {
|
||||
const svgEditor = this;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
await loadExtensionTranslation(svgEditor);
|
||||
const { svgCanvas } = svgEditor;
|
||||
const { $id } = svgCanvas;
|
||||
@@ -45,7 +46,7 @@ export default {
|
||||
const title = svgEditor.i18next.t(`${name}:buttons.0.title`);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
buttonTemplate.innerHTML = `
|
||||
<se-button id="hello_world" title="${title}" src="./images/hello_world.svg"></se-button>
|
||||
<se-button id="hello_world" title="${title}" src="${imgPath}/hello_world.svg"></se-button>
|
||||
`;
|
||||
$id('tools_left').append(buttonTemplate.content.cloneNode(true));
|
||||
$id('hello_world').addEventListener("click", () => {
|
||||
|
||||
@@ -32,6 +32,8 @@ export default {
|
||||
const svgEditor = this;
|
||||
const { $id } = svgEditor.svgCanvas;
|
||||
const { $svgEditor } = svgEditor;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
|
||||
await loadExtensionTranslation(svgEditor);
|
||||
|
||||
const { svgCanvas } = svgEditor;
|
||||
@@ -447,7 +449,7 @@ export default {
|
||||
const back = document.createElement('button');
|
||||
back.style.visibility = "hidden";
|
||||
// eslint-disable-next-line max-len
|
||||
back.innerHTML = '<img class="svg_icon" src="./images/library.svg" alt="icon" width="16" height="16" />' + svgEditor.i18next.t(`${name}:show_list`);
|
||||
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 () {
|
||||
frame.setAttribute('src', 'about:blank');
|
||||
@@ -521,7 +523,7 @@ export default {
|
||||
// Add the button and its handler(s)
|
||||
const buttonTemplate = document.createElement("template");
|
||||
buttonTemplate.innerHTML = `
|
||||
<se-menu-item id="tool_imagelib" label="Image library" src="./images/library.svg"></se-menu-item>
|
||||
<se-menu-item id="tool_imagelib" label="Image library" src="${imgPath}/library.svg"></se-menu-item>
|
||||
`;
|
||||
insertAfter($id('tool_export'), buttonTemplate.content.cloneNode(true));
|
||||
$id('tool_imagelib').addEventListener("click", () => {
|
||||
|
||||
@@ -31,6 +31,8 @@ export default {
|
||||
name,
|
||||
async init() {
|
||||
const svgEditor = this;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
|
||||
await loadExtensionTranslation(svgEditor);
|
||||
const {
|
||||
svgCanvas
|
||||
@@ -42,7 +44,6 @@ export default {
|
||||
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
||||
};
|
||||
return {
|
||||
newUI: true,
|
||||
name: svgEditor.i18next.t(`${name}:name`),
|
||||
callback() {
|
||||
const btitle = svgEditor.i18next.t(`${name}:buttons.0.title`);
|
||||
@@ -50,7 +51,7 @@ export default {
|
||||
const buttonTemplate = document.createElement("template");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
buttonTemplate.innerHTML = `
|
||||
<se-button id="ext-panning" title="${btitle}" src="./images/panning.svg"></se-button>
|
||||
<se-button id="ext-panning" title="${btitle}" src="${imgPath}/panning.svg"></se-button>
|
||||
`;
|
||||
insertAfter($id('tool_zoom'), buttonTemplate.content.cloneNode(true));
|
||||
$id('ext-panning').addEventListener("click", () => {
|
||||
|
||||
@@ -29,6 +29,7 @@ export default {
|
||||
name,
|
||||
async init(_S) {
|
||||
const svgEditor = this;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
const { ChangeElementCommand } = _S; // , svgcontent,
|
||||
const addToHistory = function (cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); };
|
||||
const { svgCanvas } = svgEditor;
|
||||
@@ -86,9 +87,9 @@ export default {
|
||||
// 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="./images/star.svg">
|
||||
<se-button id="tool_star" title="${title_star}" src="${imgPath}/star.svg">
|
||||
</se-button>
|
||||
<se-button id="tool_polygon" title="${title_polygon}" src="./images/polygon.svg">
|
||||
<se-button id="tool_polygon" title="${title_polygon}" src="${imgPath}/polygon.svg">
|
||||
</se-button>
|
||||
</se-flyingbutton>
|
||||
`;
|
||||
|
||||
@@ -27,6 +27,7 @@ export default {
|
||||
name,
|
||||
async init () {
|
||||
const svgEditor = this;
|
||||
const { imgPath } = svgEditor.configObj.curConfig;
|
||||
const canv = svgEditor.svgCanvas;
|
||||
const { $id } = canv;
|
||||
const svgroot = canv.getRootElem();
|
||||
@@ -46,7 +47,7 @@ export default {
|
||||
// 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="./images/shapelib.svg"></se-explorerbutton>
|
||||
src="${imgPath}/shapelib.svg"></se-explorerbutton>
|
||||
`;
|
||||
canv.insertChildAtIndex($id('tools_left'), buttonTemplate, 9);
|
||||
$id('tool_shapelib').addEventListener("click", () => {
|
||||
|
||||
Reference in New Issue
Block a user