From bbded75c54c8e1cbcde1e0de1712d71ad370c0e9 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Thu, 31 May 2018 17:09:53 +0800 Subject: [PATCH] - ExtensionDocs update --- docs/ExtensionDocs.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/ExtensionDocs.md b/docs/ExtensionDocs.md index 66e2ff36..758a4b62 100644 --- a/docs/ExtensionDocs.md +++ b/docs/ExtensionDocs.md @@ -44,6 +44,10 @@ svgEditor.addExtension('Hello World', function () { Note how the returned properties include information on the buttons, as well as the functions that should be run when certain events take place. +An object can be provided in place of a function in which case, `callback` will be bound with the same arguments supplied to the callback. + +The callback is invoked upon addition of the extension, or, if svgicons are set, then after the icons are ready. + ## Creating buttons Buttons can appear either in the mode panel (left panel) or the context panel (top panel, changes depending on selection). Their icons can either consist of SVG icons (recommended) or just raster images. @@ -113,7 +117,6 @@ Most plugins will want to run functions when certain events are triggered. This | `langChanged` | The language was changed | Two-letter code of the new language | None | | `langReady` | Invoked as soon as the locale is ready | An object with properties "lang" containing the two-letter language code and "uiStrings" as an alias for svgEditor.uiStrings | None | | `addlangData` | Means for an extension to add locale data | The two-letter language code | Object with "data" property set to an object containing two-letter language codes keyed to an array of objects with "id" and "title" or "textContent" properties | -| `callback` | Invoked upon addition of the extension, or, if svgicons are set, then after the icons are ready | None | None (IS THIS STILL PRESENT?) | | `canvasUpdated` | Invoked upon updates to the canvas | Object with properties: new_x, new_y, old_x, old_y, d_x, d_y | None | | `IDsUpdated` | When `pasteElements` called from paste action (context menu or key) | An object with `elems` array and `changes` object (mapping past ID (on attribute) to current ID) Object with `remove` array containing string IDs (used by `ext-connector.js`) | `onNewDocument` | Called when new image is created | None | None |