diff options
-rw-r--r-- | docs/frontend-integration.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/frontend-integration.md b/docs/frontend-integration.md index 888a1a0b..ce9e6c02 100644 --- a/docs/frontend-integration.md +++ b/docs/frontend-integration.md @@ -89,9 +89,13 @@ The following handlers are currently supported: - initAfterReady: will be called once the Collabora frame has been loaded - close: will be called after the Collabora view has been closed +- saveAs: will be called on a save_as response by collabora - share: will be called before the default share action is triggered - rename: will be called before the default rename action is triggered (the new filename is available as a property of the filesAppIntegration parameter) - showRevHistory: will be called before the default show revision history action is triggered +- insertGraphic: will be called when an image from the Nextcloud storage should be inserted + - Arguments + - insertFileFromPath(path): Callback to trigger the actual inserting of the graphic from an absolute file path In addition, the following handlers can be used to overwrite the handling of file actions that are rendered in the Nextcloud header bar: - actionDetails @@ -102,6 +106,10 @@ The filesAppIntegration parameter can be used to extract the current context of - fileName - fileId +The callback function of each handler will be called with the following parameters: +- filesAppIntegration: current instance of the filesAppIntegration object +- arguments (optional): see list of supported handlers for details + The following code shows an example on how to register the different handlers: ```javascript @@ -133,5 +141,11 @@ The following code shows an example on how to register the different handlers: return false }) + OCA.RichDocuments.FilesAppIntegration.registerHandler('insertGraphic', (filesAppIntegration, { insertFileFromPath }) => { + const path = prompt('Enter a file path', '') + insertFileFromPath(path) + return true + }) + })() ``` |