mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-18 05:20:43 +01:00
Add saveAs and insertGraphic handler to the documentation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
6598188b0d
commit
c11c7ce273
1 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
})
|
||||
|
||||
})()
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue