From 219de40dbccd58599eea7ded9399dafd435954d9 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Fri, 14 May 2021 13:39:05 +0300 Subject: [PATCH 1/2] change registration of actions 3a29beaeca25758751faccde66f861a6361abc87 --- js/main.js | 67 +++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/js/main.js b/js/main.js index cc940d00..6cb7138e 100644 --- a/js/main.js +++ b/js/main.js @@ -208,47 +208,41 @@ } }; - OCA.Onlyoffice.FileList = { - attach: function (fileList) { - if (fileList.id == "trashbin") { - return; - } + OCA.Onlyoffice.registerAction = function () { + var register = function () { + var formats = OCA.Onlyoffice.setting.formats; - var register = function () { - var formats = OCA.Onlyoffice.setting.formats; + $.each(formats, function (ext, config) { + if (!config.mime) { + return true; + } + OCA.Files.fileActions.registerAction({ + name: "onlyofficeOpen", + displayName: t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE"), + mime: config.mime, + permissions: OC.PERMISSION_READ, + iconClass: "icon-onlyoffice-open", + actionHandler: OCA.Onlyoffice.FileClick + }); - $.each(formats, function (ext, config) { - if (!config.mime) { - return true; - } + if (config.def) { + OCA.Files.fileActions.setDefault(config.mime, "onlyofficeOpen"); + } + + if (config.conv) { OCA.Files.fileActions.registerAction({ - name: "onlyofficeOpen", - displayName: t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE"), + name: "onlyofficeConvert", + displayName: t(OCA.Onlyoffice.AppName, "Convert with ONLYOFFICE"), mime: config.mime, - permissions: OC.PERMISSION_READ, - iconClass: "icon-onlyoffice-open", - actionHandler: OCA.Onlyoffice.FileClick + permissions: ($("#isPublic").val() ? OC.PERMISSION_UPDATE : OC.PERMISSION_READ), + iconClass: "icon-onlyoffice-convert", + actionHandler: OCA.Onlyoffice.FileConvertClick }); - - if (config.def) { - OCA.Files.fileActions.setDefault(config.mime, "onlyofficeOpen"); - } - - if (config.conv) { - OCA.Files.fileActions.registerAction({ - name: "onlyofficeConvert", - displayName: t(OCA.Onlyoffice.AppName, "Convert with ONLYOFFICE"), - mime: config.mime, - permissions: ($("#isPublic").val() ? OC.PERMISSION_UPDATE : OC.PERMISSION_READ), - iconClass: "icon-onlyoffice-convert", - actionHandler: OCA.Onlyoffice.FileConvertClick - }); - } - }); - } - - OCA.Onlyoffice.GetSettings(register); + } + }); } + + OCA.Onlyoffice.GetSettings(register); }; OCA.Onlyoffice.NewFileMenu = { @@ -378,9 +372,10 @@ OCA.Onlyoffice.GetSettings(initSharedButton); } else { - OC.Plugins.register("OCA.Files.FileList", OCA.Onlyoffice.FileList); OC.Plugins.register("OCA.Files.NewFileMenu", OCA.Onlyoffice.NewFileMenu); + OCA.Onlyoffice.registerAction(); + OCA.Onlyoffice.bindVersionClick(); if (OCA.Onlyoffice.Share) { From e6eb0666d8b4bff87df72f44923171b9903d279a Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Fri, 14 May 2021 16:04:18 +0300 Subject: [PATCH 2/2] 6.4.3 --- CHANGELOG.md | 4 ++++ appinfo/info.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 839e70b0..38fe5dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 6.4.3 +## Changed +- fixed registration of file actions + ## 6.4.1 ## Added - create file from editor diff --git a/appinfo/info.xml b/appinfo/info.xml index 4acf5221..69f7d43d 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -6,7 +6,7 @@ ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within ownCloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage. apl2 Ascensio System SIA - 6.4.1 + 6.4.3 Onlyoffice