From d9966b440c3526f6f5418703e72b5ee3444bcefe Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 22 May 2020 18:38:03 +0300 Subject: [PATCH] [PE mobile][SSE mobile] Add parameters to api customization: macros, plugins --- apps/presentationeditor/mobile/app/controller/Main.js | 11 +++++++++++ apps/spreadsheeteditor/mobile/app/controller/Main.js | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index 6cb144489..d1d2f755f 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -257,10 +257,16 @@ define([ docInfo.put_Token(data.doc.token); docInfo.put_Permissions(_permissions); docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys); + + var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); + docInfo.asc_putIsEnabledMacroses(!!enable); + enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false); + docInfo.asc_putIsEnabledPlugins(!!enable); } this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this)); + this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -1278,6 +1284,11 @@ define([ return false; }, + onRunAutostartMacroses: function() { + if (!this.editorConfig.customization || (this.editorConfig.customization.macros!==false)) + if (this.api) this.api.asc_runAutostartMacroses(); + }, + // Translation leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.', criticalErrorTitle: 'Error', diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index 927dc8965..8c655506e 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -270,10 +270,16 @@ define([ docInfo.put_Token(data.doc.token); docInfo.put_Permissions(_permissions); docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys); + + var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); + docInfo.asc_putIsEnabledMacroses(!!enable); + enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false); + docInfo.asc_putIsEnabledPlugins(!!enable); } this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this)); + this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -1483,6 +1489,11 @@ define([ return false; }, + onRunAutostartMacroses: function() { + if (!this.editorConfig.customization || (this.editorConfig.customization.macros!==false)) + if (this.api) this.api.asc_runAutostartMacroses(); + }, + leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.', criticalErrorTitle: 'Error', notcriticalErrorTitle: 'Warning',