Use extension config

This commit is contained in:
Lukas Hirt
2020-11-26 11:05:10 +01:00
parent 0d1b2de6bf
commit 6522a41b26
2 changed files with 11 additions and 11 deletions
+8 -8
View File
@@ -1,37 +1,37 @@
const appInfo = {
name: 'ocis-onlyoffice',
name: 'OnlyOffice',
id: 'onlyoffice',
icon: 'x-office-document',
extensions: [
{
extension: 'docx',
handler: function(config, filePath, fileId) {
handler: function({ extensionConfig, filePath, fileId }) {
window.open(
`${config.server}/apps/onlyoffice/${fileId}?filePath=${encodeURIComponent(filePath)}`,
`${extensionConfig.server}/apps/onlyoffice/${fileId}?filePath=${encodeURIComponent(filePath)}`,
'_blank'
)
},
newFileMenu: {
menuTitle($gettext) {
return $gettext('New OnlyOFFICE document')
return $gettext('New OnlyOffice document')
},
icon: 'x-office-document'
}
},
{
extension: 'xlsx',
handler: function(config, filePath, fileId) {
handler: function({ extensionConfig, filePath, fileId }) {
window.open(
`${config.server}/apps/onlyoffice/${fileId}?filePath=${encodeURIComponent(filePath)}`,
`${extensionConfig.server}/apps/onlyoffice/${fileId}?filePath=${encodeURIComponent(filePath)}`,
'_blank'
)
}
},
{
extension: 'pptx',
handler: function(config, filePath, fileId) {
handler: function({ extensionConfig, filePath, fileId }) {
window.open(
`${config.server}/apps/onlyoffice/${fileId}?filePath=${encodeURIComponent(filePath)}`,
`${extensionConfig.server}/apps/onlyoffice/${fileId}?filePath=${encodeURIComponent(filePath)}`,
'_blank'
)
}