docs(jsdoc): link/naming fixes
parent
381a0d9460
commit
171e1ce856
|
@ -4,8 +4,8 @@ This is an entry point that summarizes the documentation on the Editor.
|
||||||
|
|
||||||
For user-facing information about the Editor, see [Editor]{@tutorial Editor}.
|
For user-facing information about the Editor, see [Editor]{@tutorial Editor}.
|
||||||
|
|
||||||
The main API entrance point is with the [Editor JSDocs]{@link module:Editor}.
|
The main API entrance point is with the [Editor JSDocs]{@link module:SVGEditor}.
|
||||||
|
|
||||||
## Canvas-specific methods
|
## Canvas-specific methods
|
||||||
|
|
||||||
See [Canvas]{@tutorial Canvas}.
|
See [Canvas]{@tutorial CanvasAPI}.
|
||||||
|
|
|
@ -46,17 +46,17 @@ $(document).bind('svgEditorReady', function () {
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are acting within the frame, you may use `svgEditor.ready`
|
If you are acting within the frame, you may use `svgEditor.ready`
|
||||||
(see [Within-frame events](#Editor-within-frame-events-svgEditor) below).
|
(see "Editor (within-frame) events (`svgEditor`)" below).
|
||||||
|
|
||||||
## Editor (within-frame) events (`svgEditor`)
|
## Editor (within-frame) events (`svgEditor`)
|
||||||
|
|
||||||
### `svgEditor.canvas`
|
### `svgEditor.canvas`
|
||||||
|
|
||||||
- Canvas object. See [Canvas events](#Canvas-events).
|
- Canvas object. See "Canvas events".
|
||||||
|
|
||||||
### `svgEditor.canvas.bind(eventName, function () {})`
|
### `svgEditor.canvas.bind(eventName, function () {})`
|
||||||
|
|
||||||
- Method for listening to canvas events. See [Canvas events](#Canvas-events).
|
- Method for listening to canvas events. See "Canvas events".
|
||||||
|
|
||||||
### `svgEditor.ready(function () {})`
|
### `svgEditor.ready(function () {})`
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,11 @@ under `editor/extensions/`.
|
||||||
**Q: How can I serve SVG graphic editor from my own server?**
|
**Q: How can I serve SVG graphic editor from my own server?**
|
||||||
|
|
||||||
A: You need to download the latest version to your server and unzip.
|
A: You need to download the latest version to your server and unzip.
|
||||||
The exact commands/instructions are here: <http://howik.com/Improve_your_user%27s_experience_by_adding_svg_graphic_editor_to_your_website_in_less_than_2_minutes>
|
The exact commands/instructions are here: {@link https://visihow.com/Improve_your_user's_experience_by_adding_svg_graphic_editor_to_your_website_in_less_than_2_minutes}
|
||||||
|
|
||||||
**Q: How can I help?**
|
**Q: How can I help?**
|
||||||
|
|
||||||
A: See [Testing]{@tutorial Testing} and [ReleaseInstructions]{@tutorial ReleaseInstructions}
|
A: See [Testing](../Testing.md) and [ReleaseInstructions](../ReleaseInstructions.md).
|
||||||
|
|
||||||
<!-- The remaining should be moved to Editor.md as documentation,
|
<!-- The remaining should be moved to Editor.md as documentation,
|
||||||
assuming they are still valid -->
|
assuming they are still valid -->
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* 2010 Jeff Schiller
|
* 2010 Jeff Schiller
|
||||||
* 2010 Narendra Sisodiya
|
* 2010 Narendra Sisodiya
|
||||||
* 2014 Brett Zamir
|
* 2014 Brett Zamir
|
||||||
* @exports module:SVGEditor
|
* @module SVGEditor
|
||||||
* @borrows module:locale.putLocale as putLocale
|
* @borrows module:locale.putLocale as putLocale
|
||||||
* @borrows module:locale.readLang as readLang
|
* @borrows module:locale.readLang as readLang
|
||||||
* @borrows module:locale.setStrings as setStrings
|
* @borrows module:locale.setStrings as setStrings
|
||||||
|
@ -386,6 +386,7 @@ function getImportLocale ({defaultLang, defaultName}) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store and retrieve preferences.
|
* Store and retrieve preferences.
|
||||||
|
* @function module:SVGEditor.pref
|
||||||
* @param {string} key The preference name to be retrieved or set
|
* @param {string} key The preference name to be retrieved or set
|
||||||
* @param {string} [val] The value. If the value supplied is missing or falsey, no change to the preference will
|
* @param {string} [val] The value. If the value supplied is missing or falsey, no change to the preference will
|
||||||
* be made unless `mayBeEmpty` is set.
|
* be made unless `mayBeEmpty` is set.
|
||||||
|
@ -427,6 +428,7 @@ editor.setStrings = setStrings;
|
||||||
* storage. This will override URL settings (for security reasons) but
|
* storage. This will override URL settings (for security reasons) but
|
||||||
* not `svgedit-config-iife.js` configuration (unless initial user
|
* not `svgedit-config-iife.js` configuration (unless initial user
|
||||||
* overriding is explicitly permitted there via `allowInitialUserOverride`).
|
* overriding is explicitly permitted there via `allowInitialUserOverride`).
|
||||||
|
* @function module:SVGEditor.loadContentAndPrefs
|
||||||
* @todo Split `allowInitialUserOverride` into `allowOverrideByURL` and
|
* @todo Split `allowInitialUserOverride` into `allowOverrideByURL` and
|
||||||
* `allowOverrideByUserStorage` so `svgedit-config-iife.js` can disallow some
|
* `allowOverrideByUserStorage` so `svgedit-config-iife.js` can disallow some
|
||||||
* individual items for URL setting but allow for user storage AND/OR
|
* individual items for URL setting but allow for user storage AND/OR
|
||||||
|
@ -477,6 +479,7 @@ editor.loadContentAndPrefs = function () {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows setting of preferences or configuration (including extensions).
|
* Allows setting of preferences or configuration (including extensions).
|
||||||
|
* @function module:SVGEditor.setConfig
|
||||||
* @param {module:SVGEditor.Config|module:SVGEditor.Prefs} opts The preferences or configuration (including extensions). See the tutorial on {@tutorial ConfigOptions} for info on config and preferences.
|
* @param {module:SVGEditor.Config|module:SVGEditor.Prefs} opts The preferences or configuration (including extensions). See the tutorial on {@tutorial ConfigOptions} for info on config and preferences.
|
||||||
* @param {PlainObject} [cfgCfg] Describes configuration which applies to the
|
* @param {PlainObject} [cfgCfg] Describes configuration which applies to the
|
||||||
* particular batch of supplied options
|
* particular batch of supplied options
|
||||||
|
@ -617,6 +620,7 @@ editor.setConfig = function (opts, cfgCfg) {
|
||||||
/**
|
/**
|
||||||
* Allows one to override default SVGEdit `open`, `save`, and
|
* Allows one to override default SVGEdit `open`, `save`, and
|
||||||
* `export` editor behaviors.
|
* `export` editor behaviors.
|
||||||
|
* @function module:SVGEditor.setCustomHandlers
|
||||||
* @param {module:SVGEditor.CustomHandler} opts Extension mechanisms may call `setCustomHandlers` with three functions: `opts.open`, `opts.save`, and `opts.exportImage`
|
* @param {module:SVGEditor.CustomHandler} opts Extension mechanisms may call `setCustomHandlers` with three functions: `opts.open`, `opts.save`, and `opts.exportImage`
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
|
@ -643,15 +647,17 @@ editor.setCustomHandlers = function (opts) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} arg
|
* @function module:SVGEditor.randomizeIds
|
||||||
* @returns {void}
|
* @param {boolean} arg
|
||||||
*/
|
* @returns {void}
|
||||||
|
*/
|
||||||
editor.randomizeIds = function (arg) {
|
editor.randomizeIds = function (arg) {
|
||||||
svgCanvas.randomizeIds(arg);
|
svgCanvas.randomizeIds(arg);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto-run after a Promise microtask.
|
* Auto-run after a Promise microtask.
|
||||||
|
* @function module:SVGEditor.init
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
editor.init = function () {
|
editor.init = function () {
|
||||||
|
@ -803,6 +809,7 @@ editor.init = function () {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called internally.
|
* Called internally.
|
||||||
|
* @function module:SVGEditor.setIcon
|
||||||
* @param {string|Element|external:jQuery} elem
|
* @param {string|Element|external:jQuery} elem
|
||||||
* @param {string|external:jQuery} iconId
|
* @param {string|external:jQuery} iconId
|
||||||
* @param {Float} forcedSize Not in use
|
* @param {Float} forcedSize Not in use
|
||||||
|
@ -988,6 +995,7 @@ editor.init = function () {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called internally.
|
* Called internally.
|
||||||
|
* @function module:SVGEditor.setIconSize
|
||||||
* @param {module:SVGEditor.IconSize} size
|
* @param {module:SVGEditor.IconSize} size
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
|
@ -1831,7 +1839,7 @@ editor.init = function () {
|
||||||
* - Removes the `tool_button_current` class from whatever tool currently has it.
|
* - Removes the `tool_button_current` class from whatever tool currently has it.
|
||||||
* - Hides any flyouts.
|
* - Hides any flyouts.
|
||||||
* - Adds the `tool_button_current` class to the button passed in.
|
* - Adds the `tool_button_current` class to the button passed in.
|
||||||
* @function module:SVGEDitor.toolButtonClick
|
* @function module:SVGEditor.toolButtonClick
|
||||||
* @param {string|Element} button The DOM element or string selector representing the toolbar button
|
* @param {string|Element} button The DOM element or string selector representing the toolbar button
|
||||||
* @param {boolean} noHiding Whether not to hide any flyouts
|
* @param {boolean} noHiding Whether not to hide any flyouts
|
||||||
* @returns {boolean} Whether the button was disabled or not
|
* @returns {boolean} Whether the button was disabled or not
|
||||||
|
@ -3868,9 +3876,10 @@ editor.init = function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} active
|
* @function module:SVGEditor.setPanning
|
||||||
* @returns {void}
|
* @param {boolean} active
|
||||||
*/
|
* @returns {void}
|
||||||
|
*/
|
||||||
editor.setPanning = function (active) {
|
editor.setPanning = function (active) {
|
||||||
svgCanvas.spaceKey = keypan = active;
|
svgCanvas.spaceKey = keypan = active;
|
||||||
};
|
};
|
||||||
|
@ -3965,6 +3974,7 @@ editor.init = function () {
|
||||||
* @returns {void|boolean} Calls `preventDefault()` and `stopPropagation()`
|
* @returns {void|boolean} Calls `preventDefault()` and `stopPropagation()`
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
|
* @function module:SVGEditor.addDropDown
|
||||||
* @param {Element|string} elem DOM Element or selector
|
* @param {Element|string} elem DOM Element or selector
|
||||||
* @param {module:SVGEditor.DropDownCallback} callback Mouseup callback
|
* @param {module:SVGEditor.DropDownCallback} callback Mouseup callback
|
||||||
* @param {boolean} dropUp
|
* @param {boolean} dropUp
|
||||||
|
@ -6118,9 +6128,10 @@ editor.init = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Promise<boolean>} Resolves to boolean indicating `true` if there were no changes
|
* @function module:SVGEditor.openPrep
|
||||||
* and `false` after the user confirms.
|
* @returns {boolean|Promise<boolean>} Resolves to boolean indicating `true` if there were no changes
|
||||||
*/
|
* and `false` after the user confirms.
|
||||||
|
*/
|
||||||
editor.openPrep = function () {
|
editor.openPrep = function () {
|
||||||
$('#main_menu').hide();
|
$('#main_menu').hide();
|
||||||
if (undoMgr.getUndoStackSize() === 0) {
|
if (undoMgr.getUndoStackSize() === 0) {
|
||||||
|
@ -6417,6 +6428,7 @@ editor.init = function () {
|
||||||
* Queues a callback to be invoked when the editor is ready (or
|
* Queues a callback to be invoked when the editor is ready (or
|
||||||
* to be invoked immediately if it is already ready--i.e.,
|
* to be invoked immediately if it is already ready--i.e.,
|
||||||
* if `runCallbacks` has been run).
|
* if `runCallbacks` has been run).
|
||||||
|
* @function module:SVGEditor.ready
|
||||||
* @param {module:SVGEditor.ReadyCallback} cb Callback to be queued to invoke
|
* @param {module:SVGEditor.ReadyCallback} cb Callback to be queued to invoke
|
||||||
* @returns {Promise<ArbitraryCallbackResult>} Resolves when all callbacks, including the supplied have resolved
|
* @returns {Promise<ArbitraryCallbackResult>} Resolves when all callbacks, including the supplied have resolved
|
||||||
*/
|
*/
|
||||||
|
@ -6432,6 +6444,7 @@ editor.ready = function (cb) { // eslint-disable-line promise/prefer-await-to-ca
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes the callbacks previous set by `svgEditor.ready`
|
* Invokes the callbacks previous set by `svgEditor.ready`
|
||||||
|
* @function module:SVGEditor.runCallbacks
|
||||||
* @returns {Promise<void>} Resolves to `undefined` if all callbacks succeeded and rejects otherwise
|
* @returns {Promise<void>} Resolves to `undefined` if all callbacks succeeded and rejects otherwise
|
||||||
*/
|
*/
|
||||||
editor.runCallbacks = async function () {
|
editor.runCallbacks = async function () {
|
||||||
|
@ -6452,11 +6465,12 @@ editor.runCallbacks = async function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} str The SVG string to load
|
* @function module:SVGEditor.loadFromString
|
||||||
* @param {PlainObject} [opts={}]
|
* @param {string} str The SVG string to load
|
||||||
* @param {boolean} [opts.noAlert=false] Option to avoid alert to user and instead get rejected promise
|
* @param {PlainObject} [opts={}]
|
||||||
* @returns {Promise<void>}
|
* @param {boolean} [opts.noAlert=false] Option to avoid alert to user and instead get rejected promise
|
||||||
*/
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
editor.loadFromString = function (str, {noAlert} = {}) {
|
editor.loadFromString = function (str, {noAlert} = {}) {
|
||||||
return editor.ready(async function () {
|
return editor.ready(async function () {
|
||||||
try {
|
try {
|
||||||
|
@ -6471,6 +6485,7 @@ editor.loadFromString = function (str, {noAlert} = {}) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not presently in use.
|
* Not presently in use.
|
||||||
|
* @function module:SVGEditor.disableUI
|
||||||
* @param {PlainObject} featList
|
* @param {PlainObject} featList
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
|
@ -6487,14 +6502,15 @@ editor.disableUI = function (featList) {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @param {string} url URL from which to load an SVG string via Ajax
|
* @function module:SVGEditor.loadFromURL
|
||||||
* @param {PlainObject} [opts={}] May contain properties: `cache`, `callback`
|
* @param {string} url URL from which to load an SVG string via Ajax
|
||||||
* @param {boolean} [opts.cache]
|
* @param {PlainObject} [opts={}] May contain properties: `cache`, `callback`
|
||||||
* @param {boolean} [opts.noAlert]
|
* @param {boolean} [opts.cache]
|
||||||
* @returns {Promise<void>} Resolves to `undefined` or rejects upon bad loading of
|
* @param {boolean} [opts.noAlert]
|
||||||
* the SVG (or upon failure to parse the loaded string) when `noAlert` is
|
* @returns {Promise<void>} Resolves to `undefined` or rejects upon bad loading of
|
||||||
* enabled
|
* the SVG (or upon failure to parse the loaded string) when `noAlert` is
|
||||||
*/
|
* enabled
|
||||||
|
*/
|
||||||
editor.loadFromURL = function (url, {cache, noAlert} = {}) {
|
editor.loadFromURL = function (url, {cache, noAlert} = {}) {
|
||||||
return editor.ready(function () {
|
return editor.ready(function () {
|
||||||
return new Promise((resolve, reject) => { // eslint-disable-line promise/avoid-new
|
return new Promise((resolve, reject) => { // eslint-disable-line promise/avoid-new
|
||||||
|
@ -6529,6 +6545,7 @@ editor.loadFromURL = function (url, {cache, noAlert} = {}) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @function module:SVGEditor.loadFromDataURI
|
||||||
* @param {string} str The Data URI to base64-decode (if relevant) and load
|
* @param {string} str The Data URI to base64-decode (if relevant) and load
|
||||||
* @param {PlainObject} [opts={}]
|
* @param {PlainObject} [opts={}]
|
||||||
* @param {boolean} [opts.noAlert]
|
* @param {boolean} [opts.noAlert]
|
||||||
|
@ -6552,6 +6569,7 @@ editor.loadFromDataURI = function (str, {noAlert} = {}) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @function module:SVGEditor.addExtension
|
||||||
* @param {string} name Used internally; no need for i18n.
|
* @param {string} name Used internally; no need for i18n.
|
||||||
* @param {module:svgcanvas.ExtensionInitCallback} init Config to be invoked on this module
|
* @param {module:svgcanvas.ExtensionInitCallback} init Config to be invoked on this module
|
||||||
* @param {module:svgcanvas.ExtensionInitArgs} initArgs
|
* @param {module:svgcanvas.ExtensionInitArgs} initArgs
|
||||||
|
|
Loading…
Reference in New Issue