Module: SVGEditor

The main module for the visual SVG this.

License:
  • MIT
Source:

Classes

Editor

Interfaces

Config
Prefs

Members

(inner) defaultExtensions :Array.<string>

Type:
  • Array.<string>
Source:

Methods

(static) clickSelect() → {void}

Unless the select toolbar button is disabled, sets the button and sets the select mode and cursor styles.

Source:
Returns:
Type
void

(static) loadContentAndPrefs() → {void}

Where permitted, sets canvas and/or configObj.defaultPrefs based on previous storage. This will override URL settings (for security reasons) but not svgedit-config-iife.js configuration (unless initial user overriding is explicitly permitted there via allowInitialUserOverride).

Source:
To Do:
  • Split `allowInitialUserOverride` into `allowOverrideByURL` and `allowOverrideByUserStorage` so `svgedit-config-iife.js` can disallow some individual items for URL setting but allow for user storage AND/OR change URL setting so that it always uses a different namespace, so it won't affect pre-existing user storage (but then if users saves that, it will then be subject to tampering
Returns:
Type
void

(static) setConfig(opts, cfgCfgopt) → {void}

Allows setting of preferences or configuration (including extensions).

Parameters:
Name Type Attributes Description
opts module:SVGEditor.Config | module:SVGEditor.Prefs

The preferences or configuration (including extensions). See the tutorial on Config Options for info on config and preferences.

cfgCfg PlainObject <optional>

Describes configuration which applies to the particular batch of supplied options

Properties
Name Type Attributes Default Description
allowInitialUserOverride boolean <optional>
false

Set to true if you wish to allow initial overriding of settings by the user via the URL (if permitted) or previously stored preferences (if permitted); note that it will be too late if you make such calls in extension code because the URL or preference storage settings will have already taken place.

overwrite boolean <optional>
true

Set to false if you wish to prevent the overwriting of prior-set preferences or configuration (URL settings will always follow this requirement for security reasons, so svgedit-config-iife.js settings cannot be overridden unless it explicitly permits via allowInitialUserOverride but extension config can be overridden as they will run after URL settings). Should not be needed in svgedit-config-iife.js.

Source:
Returns:
Type
void

(static) setIcon(elem, iconId) → {void}

Parameters:
Name Type Description
elem string | Element | external:jQuery
iconId string | external:jQuery
Source:
Returns:
Type
void

(inner) copySelected() → {void}

Source:
Returns:
Type
void

Events

event:svgEditorReadyEvent

Triggered on a containing document (of window.opener or window.parent) when the editor is loaded.

Type:
  • Event
Properties:
Name Type Description
bubbles true
cancelable true
Source: