You can use events to ensure that parts of your code are executed as soon as certain events occur.
The following events are explained below:
Events.onProjectLoaded
The onProjectLoaded event is triggered once as soon as the project is loaded and the mainInterface is available.
Only after this event is it possible to communicate with the mainInterface and manipulate variables, for example.
Events.onProjectLoaded(function);
A function that is to be called when this event is triggered must be passed as a function parameter. When the event is triggered, this function is called without parameters.
Events.onPageLoaded
The onPageLoaded eventis triggered after loading individual pages.
Events.onPageLoaded(function);
A function that is to be called when this event is triggered must be passed as a function parameter. When the event is triggered, this function is called with the page name as the only parameter.
Events.onPageLoaded(selector, function);
The name of a page or a regular expression must be passed as the selector parameter. If a page is loaded and the name of the page matches the selector, the function passed as function is called.
A function that is to be called when this event is triggered must be passed as a function parameter. When the event is triggered, this function is called with the page name as the only parameter.
Events.onVarChanged
The onVarChanged event is used to react to the change of one or more variables.
Events.onVarChanged(selector, function);
A function that is to be called when this event is triggered must be passed as a function parameter. Information on how such a function must be structured and which parameters are passed to it can be found here.
The name of a variable or a regular expression must be passed as the selector parameter. If a variable changes and the name of the variable matches the selector , the function passed as function is called.
Events.onVariablesInitialized
The onVariablesInitialized event is triggered once as soon as all variables have been initialized. This event occurs shortly after the onProjectLoaded event.
Events.onVariablesInitialized(function);
A function that is to be called when this event is triggered must be passed as a function parameter. When the event is triggered, this function is called without parameters.
