diff --git a/src/editor/ConfigObj.js b/src/editor/ConfigObj.js index 81330035..abd1d4c6 100644 --- a/src/editor/ConfigObj.js +++ b/src/editor/ConfigObj.js @@ -132,6 +132,7 @@ export default class ConfigObj { // PATH CONFIGURATION // The following path configuration items are disallowed in the URL (as should any future path configurations) imgPath: './images', + extPath: './extensions', // DOCUMENT PROPERTIES // Change the following to a preference (already in the Document Properties dialog)? dimensions: [640, 480], diff --git a/src/editor/EditorStartup.js b/src/editor/EditorStartup.js index 3cb84981..c9b09b3c 100644 --- a/src/editor/EditorStartup.js +++ b/src/editor/EditorStartup.js @@ -628,7 +628,8 @@ class EditorStartup { /** * @type {module:SVGthis.ExtensionObject} */ - const imported = await import(`./extensions/${encodeURIComponent(extname)}/${encodeURIComponent(extname)}.js`) + const extPath = this.configObj.curConfig.extPath + const imported = await import(`${extPath}/${encodeURIComponent(extname)}/${encodeURIComponent(extname)}.js`) const { name = extname, init: initfn } = imported.default return this.addExtension(name, (initfn && initfn.bind(this)), { langParam: 'en' }) /** @todo change to current lng */ } catch (err) { diff --git a/src/editor/extensions/ext-shapes/ext-shapes.js b/src/editor/extensions/ext-shapes/ext-shapes.js index 1a929152..36dd0de8 100644 --- a/src/editor/extensions/ext-shapes/ext-shapes.js +++ b/src/editor/extensions/ext-shapes/ext-shapes.js @@ -40,8 +40,9 @@ export default { return { callback () { if ($id('tool_shapelib') === null) { + const extPath = svgEditor.configObj.curConfig.extPath const buttonTemplate = ` - ` canv.insertChildAtIndex($id('tools_left'), buttonTemplate, 9)