Broadcast a custom event. This will trigger all listeners for this event. To avoid collissions, the event name should follow a reasonable naming convention.
Optioanlly you can use broadcast to send
The event to broadcast.
Optional
value: TThe value to send. Note this will be serialized and deserialized.
Optional
targetEditorParent: booleanFlag to indicate if the event should be sent to the parent editor. This is only applicable in an iFrame context. Default value is false.
Scripts can listen to arbitriary events from the same or other scripts. To avoid collissions, the event name should follow a reasonable naming convention.
The event to listen for.
The callback is triggered when the event is being received. The callback will receive the event name and the data passed to the event.
A unique identifier for this listener.
Register for an internal editor or field event. Events can be registered multiple times, by the same or separate scripts.
Some events can be cancelled, which means the default operation triggering the event will not be performed. Events can also be stopped from propagating to other scripts, which means that other scripts will not receive the event. For both actions, use the event object passed to the callback function.
The data provided depends on the event type. See the EditorEventType and FieldEventType for more information. The field events will also pass the relevant fields in a separate parameter.
The event to register for.
The callback function to call when the event is triggered.
A unique identifier for the event registration.
Register for custom actions. Custom actions are used to add custom functionality to the editor for standard behaviour. This allows a script to adjust the functionality. Depending on the type of custom action, the user may even have a choice in case multiple implementations are registered.
The type of custom action this applies to.
The name of the custom action. This is used to identify the custom action in the UI.
The description of the custom action. This is used to describe the custom action in the UI.
The callback function to call when the custom action is triggered.
Registers a custom field and makes it usable in this editor session. Custom fields which are part of the job but the type has not been registered cannot work as expected.
The custom field definition.
The callback function to call when the custom field is fully registered with a success flag
This function will ensure that the the custom field is fully functional. With asyncronous loading of scripts and depending on the actions of those scripts it could take some time until the custom field is fully registered and available. This method can be used to ensure that the setup of that field has finished and is available for use.
It will wait a maximum of 2 seconds for the field to be registered. If it is not registered by then, the callback will be called immediately.
The field we want to ensure the custom field definition is registered for. Either as the field directly or the sub type as string.
The callback will be triggered as soon as the field is available and fully registered with the value true. Otherwise, if the field is not found after 2 seconds, the callback will be triggered immediately with false. The field should not be used in that case.
Scripts can unregister a listener for custom events by passing the identifier returned by the Listen method.
The listener to unregister.
True if the listener has been unregistered, false if the listener was not registered in the first place.
Scripts can unregister for events by passing the identifier returned by the Register method. This would mean that the script will no longer receive the event.
The unique identifier for the event registration.
True if the event has been unregistered, false if the event was not registered in the first place.
Generated using TypeDoc
Interface to register, listen and broadcast events within the editor.