Skip to content

Commit

Permalink
Merge pull request #469 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/6.4.2
  • Loading branch information
LinneyS authored May 14, 2021
2 parents 0cdaa4b + 271d288 commit 85ac320
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 6.4.2
## Changed
- fixed registration of file actions

## 6.4.0
## Added
- create file from editor
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within Nextcloud 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.</description>
<licence>apache</licence>
<author mail="dev@onlyoffice.com" homepage="https://www.onlyoffice.com/">Ascensio System SIA</author>
<version>6.4.0</version>
<version>6.4.2</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
Expand Down
67 changes: 31 additions & 36 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,47 +199,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 = {
Expand Down Expand Up @@ -376,9 +370,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();
}
};
Expand Down

0 comments on commit 85ac320

Please sign in to comment.