Timer Molecule

Add a Javascript timer.

Summary
Timer Molecule
Preference Dialog
Properties
typestring, ( r )
pref.namestring, ( r )
pref.enableWhenstring, ( r, w )
pref.disableWhenstring, ( r, w )
pref.intervalint, ( r, w )
pref.isOneShotbool, ( r, w )
pref.isTriggerEventbool, ( r, w )
pref.isBroadcastbool, ( r, w )
pref.eventNamestring, ( r, w )
pref.withDatastring, ( r, w )
pref.targetsarray, ( r, w )
pref.scriptNamestring, ( r, w )
Functions
attach
detach
delete
rename
clone
serialize
start
clear

Preference Dialog

Properties

type

string, ( r )

Type of this molecule, timer.

pref.name

string, ( r )

The scriptable name for this molecule.  This name can be set using rename function dynamically.

pref.enableWhen

string, ( r, w )

Specifies the event that activates this molecule.  Default is none.

pref.disableWhen

string, ( r, w )

Specifies the event that deactivates this molecule.  Default is none.

pref.interval

int, ( r, w )

Specifies the interval in milliseconds to trigger the timer.

pref.isOneShot

bool, ( r, w )

Specifies whether this is one-shot or periodic timer.

pref.isTriggerEvent

bool, ( r, w )

Specifies whether to send an event or execute a script when timer is triggered.

pref.isBroadcast

bool, ( r, w )

Specifies whether the event is sent to all droplets in the current page or a few selected droplets in a group.

pref.eventName

string, ( r, w )

Specifies the custom event name that timer sends out when triggered.

pref.withData

string, ( r, w )

Specifies the name of object, variable, or array molecule that is to be sent along with the event or passed to the JavaScript function as input parameter.

pref.targets

array, ( r, w )

Specifies the list of droplet names that the event is sent to when timer is triggered.

pref.scriptName

string, ( r, w )

Specifies JavaScript function name that is executed when timer is triggered.

Functions

attach

attach(droplet);

Attach this molecule to the given droplet.

Parameters

droplet(object) a droplet.

Returns

N/A

detach

detach();

Remove this molecule from its droplet.

Parameters

N/A

Returns

N/A

delete

delete();

Delete this molecule.

Parameters

N/A

Returns

N/A

rename

rename(name);

Rename this molecule.

Parameters

name(string) a new name.

Returns

N/A

clone

clone();

Create a clone of this molecule.

Parameters

N/A

Returns

(object) a molecule.

serialize

serialize();

Serialize this molecule into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a molecule.

start

start();

Start the timer.

Parameters

N/A

Returns

N/A

clear

clear();

Cancel the timer.

Parameters

N/A

Returns

N/A

Close