new Vecta.Plugin(node)
Vecta plugin object. Wraps a currently opened plugin
Name | Type | Description |
---|---|---|
node | string|Element | ID of plugin or node or JQuery object |
See also:
Properties
.$jQuery
The jQuery wrapped node for the plugin.
Name | Type | Description |
---|---|---|
$ | jQuery | jQuery wrapper for plugin node. |
Methods
.activate([auto]) Returns: Vecta.Plugin|boolean
Enable or disable auto execution of plugin when drawing is loaded
Name | Type | Attributes | Description |
---|---|---|---|
auto | boolean | optional | 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
Name | Type | Attributes | Description |
---|---|---|---|
category | string | optional | Undefined to get, valid category string to set. To set multiple categories, pass in a string of categories separated with commas, eg: |
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.
Name | Type | Attributes | Description |
---|---|---|---|
desc | string | optional | 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
Name | Type | Attributes | Description |
---|---|---|---|
shape | Vecta.Shape | optional | 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.
Name | Type | Attributes | Description |
---|---|---|---|
name | string | optional | 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
Name | Type | Attributes | Description |
---|---|---|---|
script | string | optional | 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.
Name | Type | Attributes | Description |
---|---|---|---|
script | string | optional | 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