diff --git a/apps/presentationeditor/main/app.js b/apps/presentationeditor/main/app.js index 0b2f1c272..1e11ca2c5 100644 --- a/apps/presentationeditor/main/app.js +++ b/apps/presentationeditor/main/app.js @@ -161,6 +161,7 @@ require([ /** coauthoring end **/ ,'Common.Controllers.Plugins' ,'Common.Controllers.ExternalDiagramEditor' + ,'Common.Controllers.ExternalOleEditor' ,'Common.Controllers.ReviewChanges' ,'Common.Controllers.Protection' ,'Transitions' @@ -197,6 +198,7 @@ require([ 'common/main/lib/controller/Plugins', 'presentationeditor/main/app/view/ChartSettings', 'common/main/lib/controller/ExternalDiagramEditor' + ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' ,'common/main/lib/controller/Themes' diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index 3183accd0..f6be16df6 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -126,6 +126,27 @@ define([ }, 10); }, this)); } + + var oleEditor = this.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor) { + oleEditor.on('internalmessage', _.bind(function(cmp, message) { + var command = message.data.command; + var data = message.data.data; + if (this.api) { + if (oleEditor.isEditMode()) + this.api.asc_editTableOleObject(data); + } + }, this)); + oleEditor.on('hide', _.bind(function(cmp, message) { + if (this.api) { + this.api.asc_enableKeyEvents(true); + } + var me = this; + setTimeout(function(){ + me.documentHolder.fireEvent('editcomplete', me.documentHolder); + }, 10); + }, this)); + } } }); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index c5e6085a0..024675c1a 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -851,6 +851,7 @@ define([ chatController.setApi(this.api).setMode(this.appOptions); application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); + application.getController('Common.Controllers.ExternalOleEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); pluginsController.setApi(me.api); diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 28be6cf54..470364c18 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -1622,6 +1622,7 @@ define([ if (me.mode.isEdit===true) { me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(onDialogAddHyperlink, me)); me.api.asc_registerCallback('asc_doubleClickOnChart', _.bind(me.editChartClick, me)); + me.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(me.onDoubleClickOnTableOleObject, me)); me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, me)); me.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, me)); me.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, me)); @@ -1762,6 +1763,17 @@ define([ } }, + onDoubleClickOnTableOleObject: function(chart) { + if (this.mode.isEdit && !this._isDisabled) { + var oleEditor = PE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor && chart) { + oleEditor.setEditMode(true); + oleEditor.show(); + oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(chart)); + } + } + }, + onCutCopyPaste: function(item, e) { var me = this; if (me.api) { diff --git a/apps/presentationeditor/main/app_dev.js b/apps/presentationeditor/main/app_dev.js index 37ddc109a..d14b880a3 100644 --- a/apps/presentationeditor/main/app_dev.js +++ b/apps/presentationeditor/main/app_dev.js @@ -152,6 +152,7 @@ require([ /** coauthoring end **/ ,'Common.Controllers.Plugins' ,'Common.Controllers.ExternalDiagramEditor' + ,'Common.Controllers.ExternalOleEditor' ,'Common.Controllers.ReviewChanges' ,'Common.Controllers.Protection' ,'Transitions' @@ -188,6 +189,7 @@ require([ 'common/main/lib/controller/Plugins', 'presentationeditor/main/app/view/ChartSettings', 'common/main/lib/controller/ExternalDiagramEditor' + ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' ,'common/main/lib/controller/Themes'