diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 4587dbcae..f62c1bdf9 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -107,63 +107,20 @@ chat: false, comments: false, zoom: 100, - compactToolbar: false + compactToolbar: false, + leftMenu: true, + rightMenu: true, + toolbar: true }, plugins: { + autoStartGuid: 'asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}', url: '../../../../sdkjs-plugins/', - pluginsData: [{ - name : "chess (fen)", - guid : "asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}", - baseUrl: "", - variations : [ - { - description : "chess", - url : "chess/index.html", - - icons : ["chess/icon.png", "chess/icon@2x.png"], - isViewer : true, - EditorsSupport : ["word", "cell", "slide"], - - isVisual : true, - isModal : true, - isInsideMode : false, - - initDataType : "ole", - initData : "", - - isUpdateOleOnResize : true, - - buttons : [ { text: "Ok", primary: true }, - { text: "Cancel", primary: false } ] - } - ] - }, - { - name : "glavred", - guid : "asc.{B631E142-E40B-4B4C-90B9-2D00222A286E}", - baseUrl: "", - variations : [ - { - description : "glavred", - url : "glavred/index.html", - - icons : ["glavred/icon.png", "glavred/icon@2x.png"], - isViewer : true, - EditorsSupport : ["word", "cell", "slide"], - - isVisual : true, - isModal : true, - isInsideMode : false, - - initDataType : "text", - initData : "", - - isUpdateOleOnResize : false, - - buttons : [ { text: "Ok", primary: true } ] - } - ] - } + pluginsData: [ + "helloworld/config.json", + "chess/config.json", + "speech/config.json", + "clipart/config.json", + ] } }, events: { diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index cc111a1fb..3ba2ad6fa 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -224,7 +224,8 @@ define([ url = ((plugin.get_BaseUrl().length == 0) ? this.panelPlugins.pluginsPath : plugin.get_BaseUrl()) + url; if (variation.get_InsideMode()) { - this.panelPlugins.openInsideMode(plugin.get_Name(), url); + if (!this.panelPlugins.openInsideMode(plugin.get_Name(), url)) + this.api.asc_pluginButtonClick(-1); } else { var me = this, arrBtns = variation.get_Buttons(), diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index e68c5104b..acba2de06 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -138,6 +138,8 @@ define([ }, openInsideMode: function(name, url) { + if (!this.pluginsPanel) return false; + this.pluginsPanel.toggleClass('hidden', true); this.currentPluginPanel.toggleClass('hidden', false); @@ -161,9 +163,12 @@ define([ this.iframePlugin.src = url; } + return true; }, closeInsideMode: function() { + if (!this.pluginsPanel) return; + if (this.iframePlugin) { this.currentPluginFrame.empty(); this.iframePlugin = null; diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index fda17c60e..8d5ff095c 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -61,7 +61,10 @@ define([ var mapCustomizationElements = { about: 'button#left-btn-about', feedback: 'button#left-btn-support', - goback: '#fm-btn-back > a, #header-back > div' + goback: '#fm-btn-back > a, #header-back > div', + toolbar: '#viewport #toolbar', + leftMenu: '#viewport #left-menu', + rightMenu: '#viewport #right-menu' }; Common.localStorage.setId('text'); @@ -1819,6 +1822,7 @@ define([ if (arr.length>0) this.updatePluginsList({ + autoStartGuid: plugins.autoStartGuid, url: plugins.url, pluginsData: arr }); @@ -1877,8 +1881,11 @@ define([ this.appOptions.pluginsPath = ''; this.appOptions.canPlugins = false; } - if (this.appOptions.canPlugins) + if (this.appOptions.canPlugins) { this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); + if (plugins.autoStartGuid) + this.api.asc_pluginRun(plugins.autoStartGuid, 0, ''); + } this.getApplication().getController('LeftMenu').enablePlugins(); }, diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 8b9679064..aaeefbbc4 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -309,7 +309,7 @@ define([ showMenu: function(menu, opts) { var re = /^(\w+):?(\w*)$/.exec(menu); - if (re[1] == 'file') { + if (re[1] == 'file' && this.btnFile.isVisible() ) { if (!this.btnFile.pressed) { this.btnFile.toggle(true); // this.onBtnMenuClick(this.btnFile); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index bdc4e7bd8..be87f745f 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -61,7 +61,10 @@ define([ var mapCustomizationElements = { about: 'button#left-btn-about', feedback: 'button#left-btn-support', - goback: '#fm-btn-back > a, #header-back > div' + goback: '#fm-btn-back > a, #header-back > div', + toolbar: '#viewport #toolbar', + leftMenu: '#viewport #left-menu', + rightMenu: '#viewport #right-menu' }; Common.localStorage.setId('presentation'); @@ -1600,6 +1603,7 @@ define([ if (arr.length>0) this.updatePluginsList({ + autoStartGuid: plugins.autoStartGuid, url: plugins.url, pluginsData: arr }); @@ -1658,8 +1662,11 @@ define([ this.appOptions.pluginsPath = ''; this.appOptions.canPlugins = false; } - if (this.appOptions.canPlugins) + if (this.appOptions.canPlugins) { this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); + if (plugins.autoStartGuid) + this.api.asc_pluginRun(plugins.autoStartGuid, 0, ''); + } this.getApplication().getController('LeftMenu').enablePlugins(); }, diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js index 2d246bb06..a3d0624d0 100644 --- a/apps/presentationeditor/main/app/view/LeftMenu.js +++ b/apps/presentationeditor/main/app/view/LeftMenu.js @@ -330,7 +330,7 @@ define([ showMenu: function(menu) { var re = /^(\w+):?(\w*)$/.exec(menu); - if (re[1] == 'file') { + if (re[1] == 'file' && this.btnFile.isVisible()) { if (!this.btnFile.pressed) { this.btnFile.toggle(true); // this.onBtnMenuClick(this.btnFile); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 41d842f24..8059c9e1a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -66,7 +66,10 @@ define([ var mapCustomizationElements = { about: 'button#left-btn-about', feedback: 'button#left-btn-support', - goback: '#fm-btn-back > a, #header-back > div' + goback: '#fm-btn-back > a, #header-back > div', + toolbar: '#viewport #toolbar', + leftMenu: '#viewport #left-menu', + rightMenu: '#viewport #right-menu' }; Common.localStorage.setId('table'); @@ -1807,6 +1810,7 @@ define([ if (arr.length>0) this.updatePluginsList({ + autoStartGuid: plugins.autoStartGuid, url: plugins.url, pluginsData: arr }); @@ -1865,8 +1869,11 @@ define([ this.appOptions.pluginsPath = ''; this.appOptions.canPlugins = false; } - if (this.appOptions.canPlugins) + if (this.appOptions.canPlugins) { this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions); + if (plugins.autoStartGuid) + this.api.asc_pluginRun(plugins.autoStartGuid, 0, ''); + } this.getApplication().getController('LeftMenu').enablePlugins(); }, diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index 6e63ce136..4eb41ca9b 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -294,7 +294,7 @@ define([ showMenu: function(menu) { var re = /^(\w+):?(\w*)$/.exec(menu); - if (re[1] == 'file') { + if (re[1] == 'file' && this.btnFile.isVisible()) { if (!this.btnFile.pressed) { this.btnFile.toggle(true); this.btnFile.$el.focus();