$

$

jQuery object

Properties

.download

Shorthand method to initiate download

Methods

.dialog($dialog, actions)

Shorthand method to open a dialog

NameTypeDescription
$dialogjQuery

Dialog element. Must be appended to the body in order for it to show

actionsobject

Actions performed by dialog

NameTypeDescription
opencallback

Called when dialog is opened

closecallback

Called when dialog is closed

clickcallback

Called when any point in the dialog is clicked

validcallback

Called when any changes in input

.doc() Returns: Vecta.Document

Shorthand method to get current document

Returns:

Returns Vecta.Document

Examples:
var document = $.doc(); //get current document

.page([id]) Returns: Vecta.Page

Shorthand method to get a page by ID

NameTypeAttributesDescription
idstringoptional

ID of page. If not provided, returns current activePage

Returns:

Returns Vecta.Page

Examples:
var page = $.page(); //get current active page

.shape(name, [all]) Returns: null|Vecta.Shape|Vecta.Shape[]

Get a shape with a given name, or get all shapes starting with given name, by ignoring post fixes.

Names in Vecta must be unique, and therefore, if there is a duplicate, the name will be post fixed with an id. For example, 'A' will be post fixed to 'A.XXXXXXXX'.

NameTypeAttributesDefaultDescription
namestring

The name to find.

allbooleanoptionalfalse

False to get a single shape, or true to get all shapes.

Returns:

Returns null if the shape cannot be found, a single Vecta.Shape if all is false, or an array of Vecta.Shape if all is true.

If nothing is found with all === true, a zero length array will be returned.

Examples:
$.shape('A'); //returns a single shape with name = 'A'
$.shapes('A'); //returns all shapes starting with name = 'A', including 'A.123' but not 'AA'.

.shapes([name]) Returns: *

Get direct child shapes on the page or shapes with name

NameTypeAttributesDescription
namestringoptional

Get direct child shapes if undefined or child shapes with name if supplied.

Returns:

Returns direct child shapes in an array of Vecta.Shape objects.

If none is found, a zero length array is returned.

Examples:
$.shapes(); //returns all immediate child shapes on the page.
Capital™ Electra™ X