register_event_callback

register_event_callback(event_type: unicode, callback) int

Register an event callback, returns its ID for unregistering.

Here are the available callbacks:

“document_loaded”: triggered once the document has been loaded and set as the active document. “save_prerequisite”: triggered before a document is saved. The value is an Array with [filename, doc_path], where filename if the destination file, doc_path, the maquina path of the document node to save. If the event callback returns false, the save operation is canceled. “document_renamed”: triggered after a document has been renamed. The value is the maquina path to the renamed document node. The event result is ignored.

Return type

int