Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-08-04 09:51:26 +0300
committerJulius Härtl <jus@bitgrid.net>2020-08-04 11:30:44 +0300
commit72c488dd200b570880925f0afaeaef8f68dc8991 (patch)
treedd6f3745c9d895e0b52c6f0793e43ac2ca0d9b0d
parent1c49d8399ed31c2f5006e19994d1b5f542360f5d (diff)
Add saveAs and insertGraphic handler to the documentationv3.7.3-frontendapi-3
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--docs/frontend-integration.md14
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
+ })
+
})()
```