Use extension config
This commit is contained in:
@@ -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'
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user