Timer Molecule
From oWiki
Contents |
Preference Dialog
Attributes
type
string ( r )
Type of this molecule, 'timer'.
pref.name
string ( r )
The scriptable name for this timer. This name can be set using rename method 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
string ( 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.eventName
string ( r, w )
Specifies the custom event name that this molecule sends out when timer is triggered.
pref.withData
string ( r, w )
Specifies the object, variable, or array molecule that is to be sent along with the event or passed to the JavaScript function as input parameter.
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.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 to be executed when timer is triggered.
Methods
rename(n)
n: string
| Rename this molecule. |
clone()
Return: a molecule
| Create a clone of this molecule. |
attach(droplet)
droplet: a droplet object (e.g. app.box.droplet)
| Attach this molecule to a droplet. |
detach()
| Remove this molecule from its droplet. |
deleteMod()
| Delete this molecule. |
serialize()
Return: string
| Serialize this molecule into its JSON representation. |
startTimer()
| Start the timer. |
clearTimer()
| Cancel the timer. |

