From a147880f22d5921f84025a3ec2003c94eb62a4d4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 13 Sep 2017 14:35:20 +0300 Subject: [PATCH] Debug autostart plugins. --- apps/documenteditor/main/app/controller/Main.js | 16 +++++++++------- .../main/app/controller/Main.js | 16 +++++++++------- .../main/app/controller/Main.js | 16 +++++++++------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index e6c6f8323..663bb9faa 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1898,12 +1898,17 @@ define([ } }); - if (arr.length>0) + if (arr.length>0) { + var autostart = plugins.autostart || plugins.autoStartGuid; + if (typeof (autostart) == 'string') + autostart = [autostart]; + plugins.autoStartGuid && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration."); + this.updatePluginsList({ - autoStartGuid: plugins.autoStartGuid, - autostart: plugins.autostart, + autostart: autostart, pluginsData: arr }, !!uiCustomize); + } }, updatePluginsList: function(plugins, uiCustomize) { @@ -1965,10 +1970,7 @@ define([ } if (this.appOptions.canPlugins) { this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); - if (plugins.autoStartGuid) { - console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration."); - this.api.asc_pluginRun(plugins.autoStartGuid, 0, ''); - } else if (plugins.autostart && plugins.autostart.length>0) { + if (plugins.autostart && plugins.autostart.length>0) { // run array of plugins this.api.asc_pluginRun(plugins.autostart[0], 0, ''); } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 503ff5d70..ea5309e5d 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1670,12 +1670,17 @@ define([ } }); - if (arr.length>0) + if (arr.length>0) { + var autostart = plugins.autostart || plugins.autoStartGuid; + if (typeof (autostart) == 'string') + autostart = [autostart]; + plugins.autoStartGuid && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration."); + this.updatePluginsList({ - autoStartGuid: plugins.autoStartGuid, - autostart: plugins.autostart, + autostart: autostart, pluginsData: arr }, !!uiCustomize); + } }, updatePluginsList: function(plugins, uiCustomize) { @@ -1740,10 +1745,7 @@ define([ } if (this.appOptions.canPlugins) { this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); - if (plugins.autoStartGuid) { - console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration."); - this.api.asc_pluginRun(plugins.autoStartGuid, 0, ''); - } else if (plugins.autostart && plugins.autostart.length>0) { + if (plugins.autostart && plugins.autostart.length>0) { // run array of plugins this.api.asc_pluginRun(plugins.autostart[0], 0, ''); } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 05e20a272..ab395f577 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1850,12 +1850,17 @@ define([ } }); - if (arr.length>0) + if (arr.length>0) { + var autostart = plugins.autostart || plugins.autoStartGuid; + if (typeof (autostart) == 'string') + autostart = [autostart]; + plugins.autoStartGuid && console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration."); + this.updatePluginsList({ - autoStartGuid: plugins.autoStartGuid, - autostart: plugins.autostart, + autostart: autostart, pluginsData: arr }, !!uiCustomize); + } }, updatePluginsList: function(plugins, uiCustomize) { @@ -1919,10 +1924,7 @@ define([ } if (this.appOptions.canPlugins) { this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); - if (plugins.autoStartGuid) { - console.warn("Obsolete: The autoStartGuid parameter is deprecated. Please check the documentation for new plugin connection configuration."); - this.api.asc_pluginRun(plugins.autoStartGuid, 0, ''); - } else if (plugins.autostart && plugins.autostart.length>0) { + if (plugins.autostart && plugins.autostart.length>0) { // run array of plugins this.api.asc_pluginRun(plugins.autostart[0], 0, ''); }