When the ROBIN script is loaded, the init-method is called automatically. This script initializes the tab according to settings specified in the ROBIN app (and possibly overruled by specifying a robin_settings
object). The init-method also invokes events when can be specified in the robin_settings
object. Using these events, additional steps can be performed. An example of such a step is display information regarding online employees.
Specifying an event handler is done by defining it in the robin_settings
object as follows:
robin_settings = {
callback: function(event, data){
if (event == 'init'){
// specify initialization code here
}
}
}
At this time init is the only supported event (containing no data), but additional events may be added in the future which makes it good practice to check for event-parameter before executing the code.