diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 1309760c5..69e6e7659 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -415,7 +415,7 @@ if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') { _config.document.fileType = _config.document.fileType.toLowerCase(); - var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott|fb2|xml))$/ + var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|oxps|docm|dot|dotm|dotx|fodt|ott|fb2|xml))$/ .exec(_config.document.fileType); if (!type) { window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it."); @@ -427,7 +427,7 @@ } } - var type = /^(?:(pdf|djvu|xps))$/.exec(_config.document.fileType); + var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(_config.document.fileType); if (type && typeof type[1] === 'string') { _config.editorConfig.canUseHistory = false; } diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 098d2f2f1..b991a49d9 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -130,7 +130,7 @@ DE.ApplicationController = new(function(){ enable = !config.customization || (config.customization.plugins!==false); docInfo.asc_putIsEnabledPlugins(!!enable); - var type = /^(?:(pdf|djvu|xps))$/.exec(docConfig.fileType); + var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(docConfig.fileType); if (type && typeof type[1] === 'string') { permissions.edit = permissions.review = false; } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 5e4cfbe02..d4754eeb0 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -458,7 +458,7 @@ define([ docInfo.asc_putIsEnabledPlugins(!!enable); // docInfo.put_Review(this.permissions.review); - var type = /^(?:(pdf|djvu|xps))$/.exec(data.doc.fileType); + var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(data.doc.fileType); if (type && typeof type[1] === 'string') { this.permissions.edit = this.permissions.review = false; } @@ -521,7 +521,7 @@ define([ } this._state.isFromGatewayDownloadAs = true; - var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); + var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(this.document.fileType); if (type && typeof type[1] === 'string') this.api.asc_DownloadOrigin(true); else { @@ -1335,7 +1335,7 @@ define([ this.appOptions.canChat = false; } - var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); + var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(this.document.fileType); this.appOptions.canDownloadOrigin = this.permissions.download !== false && (type && typeof type[1] === 'string'); this.appOptions.canDownload = this.permissions.download !== false && (!type || typeof type[1] !== 'string'); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 488da7081..599a2e9ee 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -140,7 +140,7 @@ define([ var _file_type = _main.document.fileType, _format; if ( !!_file_type ) { - if ( /^pdf|xps|djvu/i.test(_file_type) ) { + if ( /^pdf|xps|oxps|djvu/i.test(_file_type) ) { _main.api.asc_DownloadOrigin(); return; } else { diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 567861f45..81b1c1cd5 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -133,7 +133,7 @@ class MainController extends Component { enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins !== false); docInfo.asc_putIsEnabledPlugins(!!enable); - const type = /^(?:(pdf|djvu|xps))$/.exec(data.doc.fileType); + const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(data.doc.fileType); if (type && typeof type[1] === 'string') { this.permissions.edit = this.permissions.review = false; } @@ -675,7 +675,7 @@ class MainController extends Component { } this._state.isFromGatewayDownloadAs = true; - const type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); + const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(this.document.fileType); if (type && typeof type[1] === 'string') { this.api.asc_DownloadOrigin(true); diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index 63be7b9c6..3e0d1ac8d 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -124,7 +124,7 @@ export class storeAppOptions { this.canComments = false; this.trialMode = params.asc_getLicenseMode(); - const type = /^(?:(pdf|djvu|xps))$/.exec(document.fileType); + const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType); this.canDownloadOrigin = permissions.download !== false && (type && typeof type[1] === 'string'); this.canDownload = permissions.download !== false && (!type || typeof type[1] !== 'string'); this.canReader = (!type || typeof type[1] !== 'string'); diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js index b510250cb..4ab711617 100644 --- a/apps/presentationeditor/mobile/src/store/appOptions.js +++ b/apps/presentationeditor/mobile/src/store/appOptions.js @@ -98,7 +98,7 @@ export class storeAppOptions { this.isRestrictedEdit = !this.isEdit && this.canComments; this.trialMode = params.asc_getLicenseMode(); - const type = /^(?:(pdf|djvu|xps))$/.exec(document.fileType); + const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType); this.canDownloadOrigin = permissions.download !== false && (type && typeof type[1] === 'string'); this.canDownload = permissions.download !== false && (!type || typeof type[1] !== 'string');