Skip to content

Commit

Permalink
Merge pull request #449 from ONLYOFFICE/feature/open-reference-data-s…
Browse files Browse the repository at this point in the history
…ource

Feature/open reference data source
  • Loading branch information
LinneyS authored Feb 7, 2024
2 parents 9101ec1 + 6459871 commit f5548e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- reference data from coediting
- selecting a document to combine from the storage
- Arabic and Serbian empty file templates
- opening a reference data source

## 8.2.3
## Added
Expand Down
9 changes: 9 additions & 0 deletions js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
config.events.onRequestSelectDocument = OCA.Onlyoffice.onRequestSelectDocument;
config.events.onRequestSendNotify = OCA.Onlyoffice.onRequestSendNotify;
config.events.onRequestReferenceData = OCA.Onlyoffice.onRequestReferenceData;
config.events.onRequestOpen = OCA.Onlyoffice.onRequestOpen;
config.events.onMetaChange = OCA.Onlyoffice.onMetaChange;

if (OC.currentUser) {
Expand Down Expand Up @@ -553,6 +554,14 @@
});
};

OCA.Onlyoffice.onRequestOpen = function (event) {
let filePath = event.data.path;
let fileId = event.data.referenceData.fileKey;
let windowName = event.data.windowName;
let sourceUrl = OC.generateUrl(`apps/${OCA.Onlyoffice.AppName}/${fileId}?filePath=${OC.encodePath(filePath)}`);
window.open(sourceUrl, windowName);
};

OCA.Onlyoffice.onMetaChange = function (event) {
if (event.data.favorite !== undefined) {
$.ajax({
Expand Down

0 comments on commit f5548e4

Please sign in to comment.