Plugin

Vecta.Plugin

new Vecta.Plugin(node)

Vecta plugin object. Wraps a currently opened plugin

NameTypeDescription
nodestring|Element

ID of plugin or node or JQuery object

See also:

Properties

.$jQuery

The jQuery wrapped node for the plugin.

NameTypeDescription
$jQuery

jQuery wrapper for plugin node.

Methods

.activate([auto]) Returns: Vecta.Plugin|boolean

Enable or disable auto execution of plugin when drawing is loaded

NameTypeAttributesDescription
autobooleanoptional

Indicator to allow script to execute during page load

Returns:

If get, returns of auto execution status of plugin script. If set, returns Vecta.Plugin for chaining

.category([category]) Returns: array|Vecta.Plugin

Get or set plugin category.

User must have access to the plugin to write

NameTypeAttributesDescription
categorystringoptional

Undefined to get, valid category string to set.

To set multiple categories, pass in a string of categories separated with commas, eg: "Google, Amazon, Vecta"

Returns:

Returns the categories when get or Vecta.Plugin for chaining.

.delete() Returns: Vecta.Plugin

Deletes the current plugin.

User must have access to plugin to delete

Returns:

for chaining

.desc([desc]) Returns: string|Vecta.Plugin

Get or set plugin description.

User must have access to plugin to write.

NameTypeAttributesDescription
descstringoptional

Undefined for read, values for write

Returns:

Returns plugin description if get, Vecta.Plugin if set for chaining

.icon([shape]) Returns: string|Vecta.Plugin

Set or get icon of plugin

NameTypeAttributesDescription
shapeVecta.Shapeoptional

Undefined to read icon, Vecta.Shape to set the icon

Returns:

Returns plugin icon if get, Vecta.Plugin if set for chaining

.id() Returns: string

Get plugin id, read only.

Returns:

Returns ID of plugin.

Examples:
var plugin = new Vecta.Plugin('plugin_1');
console.log(plugin.id()); //"plugin_1"

.locked() Returns: boolean

Determines if the plugin is locked, read only.

Public and shared plugins are locked by default. Only owner(s) of plugin can edit

Returns:

Returns true if locked. var plugin = new Vecta.Plugin('plugin_1'); console.log(plugin.locked()); //true

.name([name]) Returns: string|Vecta.Plugin

Get or set plugin name.

User must have access to plugin to write.

NameTypeAttributesDescription
namestringoptional

Undefined for read, values for write

Returns:

Returns plugin name if get, Vecta.Plugin if set for chaining

.public() Returns: boolean|Vecta.Plugin

Get plugin access.

User must have access to the plugin to write.

.run([script]) Returns: Vecta.Plugin

Execute the plugin script. Script given must be a valid JS expression. If not given, current script is used

NameTypeAttributesDescription
scriptstringoptional

If not given, execute plugin script, else execute given script

Returns:

Returns Vecta.Plugin for chaining

.script([script]) Returns: string|Vecta.Plugin

Get or set plugin script. Script must be a valid JS expression.

User must have access to plugin to write.

NameTypeAttributesDescription
scriptstringoptional

Undefined for read, values for write

Returns:

Returns plugin script if get, Vecta.Plugin if set for chaining

.shared() Returns: boolean

Determines if the plugin is shared, read only.

Returns:

Returns true if shared. var plugin = new Vecta.Plugin('plugin_1'); console.log(plugin.shared()); //false

vecta.io Early Access