Plugin
Direct Subclass:
Base class for Viewer plugin classes.
Constructor Summary
Public Constructor | ||
public |
constructor(id: string, viewer: Viewer, cfg: Object) Creates this Plugin and installs it into the given Viewer. |
Member Summary
Public Members | ||
public |
ID for this Plugin, unique within its Viewer. |
|
public |
The Viewer that contains this Plugin. |
Method Summary
Public Methods | ||
public |
destroy() Destroys this Plugin and removes it from its Viewer. |
|
public |
Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Fires an event on this Plugin. |
|
public |
Returns true if there are any subscribers to the given event on this Plugin. |
|
public |
Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Cancels an event subscription that was previously made with Plugin#on or Plugin#once. |
|
public |
Subscribes to an event on this Plugin. |
|
public |
Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd. |
|
public |
scheduleTask(task: *) Schedule a task to perform on the next browser interval |
|
public |
Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin. |
Public Constructors
Public Members
Public Methods
public error(msg: String) source
Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.
Params:
Name | Type | Attribute | Description |
msg | String | The error message |
public fire(event: String, value: Object, forget: Boolean) source
Fires an event on this Plugin.
Notifies existing subscribers to the event, optionally retains the event to give to any subsequent notifications on the event as they are made.
public hasSubs(event: String): Boolean source
Returns true if there are any subscribers to the given event on this Plugin.
Params:
Name | Type | Attribute | Description |
event | String | The event |
public log(msg: String) source
Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.
Params:
Name | Type | Attribute | Description |
msg | String | The error message |
public off(subId: String) source
Cancels an event subscription that was previously made with Plugin#on or Plugin#once.
Params:
Name | Type | Attribute | Description |
subId | String | Subscription ID |
public on(event: String, callback: Function, scope: Object): String source
Subscribes to an event on this Plugin.
The callback is be called with this Plugin as scope.
public once(event: String, callback: Function, scope: Object) source
Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.
This is equivalent to calling Plugin#on, and then calling Plugin#off inside the callback function.
public scheduleTask(task: *) source
Schedule a task to perform on the next browser interval
Params:
Name | Type | Attribute | Description |
task | * |