From c8a12f7dbae97a63b4fc333ea66f3cb200163119 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Tue, 17 Oct 2017 18:08:12 +0300 Subject: [PATCH] new plugins scheme (system & parallel working) --- apps/common/main/lib/controller/Plugins.js | 5 +++-- apps/common/main/lib/view/Plugins.js | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index 7513c4b94..c5d98ef50 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -277,14 +277,14 @@ define([ this.api.asc_pluginRun(record.get('guid'), 0, ''); }, - onPluginShow: function(plugin, variationIndex) { + onPluginShow: function(plugin, variationIndex, frameId) { var variation = plugin.get_Variations()[variationIndex]; if (variation.get_Visual()) { var url = variation.get_Url(); url = ((plugin.get_BaseUrl().length == 0) ? url : plugin.get_BaseUrl()) + url; if (variation.get_InsideMode()) { - if (!this.panelPlugins.openInsideMode(plugin.get_Name(), url)) + if (!this.panelPlugins.openInsideMode(plugin.get_Name(), url, frameId)) this.api.asc_pluginButtonClick(-1); } else { var me = this, @@ -307,6 +307,7 @@ define([ width: size[0], // inner width height: size[1], // inner height url: url, + frameId : frameId, buttons: isCustomWindow ? undefined : newBtns, toolcallback: _.bind(this.onToolClose, this) }); diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index d56222143..cdadc1bf8 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -194,7 +194,7 @@ define([ } }, - openInsideMode: function(name, url) { + openInsideMode: function(name, url, frameId) { if (!this.pluginsPanel) return false; this.pluginsPanel.toggleClass('hidden', true); @@ -203,7 +203,7 @@ define([ this.pluginName.text(name); if (!this.iframePlugin) { this.iframePlugin = document.createElement("iframe"); - this.iframePlugin.id = 'plugin_iframe'; + this.iframePlugin.id = (frameId === undefined) ? 'plugin_iframe' : frameId; this.iframePlugin.name = 'pluginFrameEditor'; this.iframePlugin.width = '100%'; this.iframePlugin.height = '100%'; @@ -372,6 +372,7 @@ define([ _options.tpl = _.template(this.template)(_options); this.url = options.url || ''; + this.frameId = options.frameId || 'plugin_iframe'; Common.UI.Window.prototype.initialize.call(this, _options); }, @@ -385,7 +386,7 @@ define([ this._headerFooterHeight += ((parseInt(this.$window.css('border-top-width')) + parseInt(this.$window.css('border-bottom-width')))); var iframe = document.createElement("iframe"); - iframe.id = 'plugin_iframe'; + iframe.id = this.frameId; iframe.name = 'pluginFrameEditor'; iframe.width = '100%'; iframe.height = '100%';