Skip to content

Commit

Permalink
Merge pull request 'onUserActionRequired event' from feature/onUserAc…
Browse files Browse the repository at this point in the history
…tionRequired into feature/editor-8.3.0

Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/api.onlyoffice.com/pulls/106
  • Loading branch information
LinneyS committed Dec 24, 2024
2 parents edfe4be + 6f91021 commit 8ce3516
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Change Log

- docs api: added the events.onUserActionRequired event
- docs api: added the refreshFile method
- docs api: added the events.onRequestRefreshFile event
- docs api: the document editing will be prohibited for all users editing the document with the specified key, if the users parameter is not specified for the drop command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ The list of changes of ONLYOFFICE Docs API.

## Version 8.3

- Added the [events.onUserActionRequired](../../Usage%20API/Config/Events/index.md#onuseractionrequired) event.
- Added the [refreshFile](../../Usage%20API/Methods/index.md#refreshfile) method.
- Added the [events.onRequestRefreshFile](../../Usage%20API/Config/Events/index.md#onrequestrefreshfile) event.
- The document editing will be prohibited for all users editing the document with the specified *key*, if the *users* parameter is not specified for the [drop](../../Additional%20API/Command%20service/drop/index.md) command.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const config = {
onRequestStartFilling,
onRequestUsers,
onSubmit,
onUserActionRequired,
onWarning,
},
height: "100%",
Expand Down
22 changes: 22 additions & 0 deletions site/pages/Docs/Docs API/Usage API/Config/Events/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The events section allows to change all the functions pertaining to the events.
- [onRequestStartFilling](#onrequeststartfilling) - the user is trying to start filling out the ready forms by clicking the *Start filling* button in the pdf editing mode.
- [onRequestUsers](#onrequestusers) - the user can select other users to mention in the comments, grant the access rights to edit the specific sheet ranges, or set the user avatars.
- [onSubmit](#onsubmit) - the force saving request of the *3* [forcesavetype](../../Callback%20handler/index.md#forcesavetype) is successfully performed.
- [onUserActionRequired](#onuseractionrequired) - a user action is required to open a document.
- [onWarning](#onwarning) - a warning occurs.

## onAppReady
Expand Down Expand Up @@ -940,6 +941,27 @@ const docEditor = new DocsAPI.DocEditor("placeholder", {
})
```

## onUserActionRequired

The function called when a user action is required to open a document in the following cases:

- when the user needs to enter a password to open the protected document;
- when the user needs to select an encoding for the *txt* file;
- when the user needs to select an encoding and a delimiter for the *csv* file.

Example:

``` ts
function onUserActionRequired() {
console.log("Enter a password")
}
const docEditor = new DocsAPI.DocEditor("placeholder", {
events: {
onUserActionRequired,
},
})
```

## onWarning

The function called when a warning occurs. The warning message is sent in the *data* parameter. A list of error codes can be found [here](https://github.com/ONLYOFFICE/sdkjs/blob/master/common/errorCodes.js).
Expand Down

0 comments on commit 8ce3516

Please sign in to comment.