[PE embedded][SSE embedded] Add parameters to api customization: macros, plugins

This commit is contained in:
Julia Radzhabova 2020-05-22 18:34:00 +03:00
parent 0d6ab2808c
commit 6f093dba4a
2 changed files with 23 additions and 0 deletions

View file

@ -101,8 +101,14 @@ PE.ApplicationController = new(function(){
docInfo.put_Token(docConfig.token);
docInfo.put_Permissions(_permissions);
var enable = !config.customization || (config.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
enable = !config.customization || (config.customization.plugins!==false);
docInfo.asc_putIsEnabledPlugins(!!enable);
if (api) {
api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions);
api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses);
api.asc_setDocInfo(docInfo);
api.asc_getEditorPermissions(config.licenseUrl, config.customerId);
api.asc_enableKeyEvents(true);
@ -580,6 +586,12 @@ PE.ApplicationController = new(function(){
}
if (api) api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PPTX, true));
}
function onRunAutostartMacroses() {
if (!config.customization || (config.customization.macros!==false))
if (api) api.asc_runAutostartMacroses();
}
// Helpers
// -------------------------

View file

@ -99,8 +99,14 @@ SSE.ApplicationController = new(function(){
docInfo.put_Token(docConfig.token);
docInfo.put_Permissions(_permissions);
var enable = !config.customization || (config.customization.macros!==false);
docInfo.asc_putIsEnabledMacroses(!!enable);
enable = !config.customization || (config.customization.plugins!==false);
docInfo.asc_putIsEnabledPlugins(!!enable);
if (api) {
api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions);
api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses);
api.asc_setDocInfo(docInfo);
api.asc_getEditorPermissions(config.licenseUrl, config.customerId);
api.asc_enableKeyEvents(true);
@ -531,6 +537,11 @@ SSE.ApplicationController = new(function(){
}
}
function onRunAutostartMacroses() {
if (!config.customization || (config.customization.macros!==false))
if (api) api.asc_runAutostartMacroses();
}
// Helpers
// -------------------------