From 0c040cec70c3164c90283a3c1f51a7e2afe6054c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 1 Apr 2022 16:12:20 +0300 Subject: [PATCH 01/14] Resize ole editor --- .../main/lib/controller/ExternalOleEditor.js | 6 +++++ .../common/main/lib/view/ExternalOleEditor.js | 22 ++++++++++++------- .../main/app/controller/Main.js | 5 ++++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/controller/ExternalOleEditor.js b/apps/common/main/lib/controller/ExternalOleEditor.js index 35de11350..3f1603b65 100644 --- a/apps/common/main/lib/controller/ExternalOleEditor.js +++ b/apps/common/main/lib/controller/ExternalOleEditor.js @@ -98,12 +98,16 @@ define([ 'drag': _.bind(function(o, state){ externalEditor && externalEditor.serviceCommand('window:drag', state == 'start'); },this), + 'resize': _.bind(function(o, state){ + externalEditor && externalEditor.serviceCommand('window:resize', state == 'start'); + },this), 'show': _.bind(function(cmp){ var h = this.oleEditorView.getHeight(), innerHeight = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); if (innerHeight>h && h<700 || innerHeight', + '
', '
', '
', '
', @@ -140,15 +143,18 @@ define([ this.$window.find('> .body').css('height', height-header_height); this.$window.find('> .body > .box').css('height', height-85); - - var top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2; - var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; - - this.$window.css('left',left); - this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); } }, + setInCenter: function() { + var height = this.$window.height(), + top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2, + left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; + + this.$window.css('left',left); + this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); + }, + setPlaceholder: function(placeholder) { this._placeholder = placeholder; }, diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index cb89960de..9bf2772b0 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1382,7 +1382,7 @@ define([ Common.Gateway.internalMessage('processMouse', {event: 'mouse:up'}); }) .mousemove($.proxy(function(e){ - if (this.isDiagramDrag) { + if (this.isDiagramDrag || this.isDiagramResize) { Common.Gateway.internalMessage('processMouse', {event: 'mouse:move', pagex: e.pageX*Common.Utils.zoom(), pagey: e.pageY*Common.Utils.zoom()}); } },this)); @@ -2529,6 +2529,9 @@ define([ case 'window:drag': this.isDiagramDrag = data.data; break; + case 'window:resize': + this.isDiagramResize = data.data; + break; case 'processmouse': this.onProcessMouse(data.data); break; From d3719967ddca186b4efb6ca0209091dea2c6cccc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 1 Apr 2022 17:48:31 +0300 Subject: [PATCH 02/14] Set initial size for ole object --- .../main/lib/controller/ExternalOleEditor.js | 14 +++++++----- .../common/main/lib/view/ExternalOleEditor.js | 22 +++++++++++++++++++ .../main/app/controller/Main.js | 7 +++++- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/apps/common/main/lib/controller/ExternalOleEditor.js b/apps/common/main/lib/controller/ExternalOleEditor.js index 3f1603b65..9ac32def8 100644 --- a/apps/common/main/lib/controller/ExternalOleEditor.js +++ b/apps/common/main/lib/controller/ExternalOleEditor.js @@ -104,10 +104,8 @@ define([ 'show': _.bind(function(cmp){ var h = this.oleEditorView.getHeight(), innerHeight = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); - if (innerHeight>h && h<700 || innerHeight0 && h>0) + this.oleEditorView.setInnerSize(w, h); } else this.oleEditorView.fireEvent('internalmessage', this.oleEditorView, eventData); } diff --git a/apps/common/main/lib/view/ExternalOleEditor.js b/apps/common/main/lib/view/ExternalOleEditor.js index 3dea5aed7..13643cf6d 100644 --- a/apps/common/main/lib/view/ExternalOleEditor.js +++ b/apps/common/main/lib/view/ExternalOleEditor.js @@ -80,6 +80,8 @@ define([ render: function() { Common.UI.Window.prototype.render.call(this); + this._headerFooterHeight = 85 + ((parseInt(this.$window.css('border-top-width')) + parseInt(this.$window.css('border-bottom-width')))); + this.boxEl = this.$window.find('.body > .box'); this.btnSave = new Common.UI.Button({ el: $('#id-btn-ole-editor-apply'), @@ -155,6 +157,26 @@ define([ this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); }, + setInnerSize: function(width, height) { + var maxHeight = Common.Utils.innerHeight(), + maxWidth = Common.Utils.innerWidth(), + borders_width = (parseInt(this.$window.css('border-left-width')) + parseInt(this.$window.css('border-right-width'))), + bordersOffset = this.bordersOffset*2; + height += 90; // add toolbar and statusbar height + if (maxHeight - bordersOffset Date: Fri, 1 Apr 2022 17:49:24 +0300 Subject: [PATCH 03/14] [DE] Add ole object --- apps/documenteditor/main/app/controller/DocumentHolder.js | 5 +++-- apps/documenteditor/main/app/controller/Toolbar.js | 7 +++++++ apps/documenteditor/main/app/view/Toolbar.js | 6 ++++-- apps/spreadsheeteditor/main/app/controller/Main.js | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/controller/DocumentHolder.js b/apps/documenteditor/main/app/controller/DocumentHolder.js index 2e221d0ff..5281b411d 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolder.js +++ b/apps/documenteditor/main/app/controller/DocumentHolder.js @@ -170,8 +170,9 @@ define([ var command = message.data.command; var data = message.data.data; if (this.api) { - if (oleEditor.isEditMode()) - this.api.asc_editTableOleObject(data); + oleEditor.isEditMode() + ? this.api.asc_editTableOleObject(data) + : this.api.asc_addTableOleObject(data); } }, this)); oleEditor.on('hide', _.bind(function(cmp, message) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 59f352856..5310f21b0 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1540,6 +1540,13 @@ define([ Common.NotificationCenter.trigger('edit:complete', me.toolbar); } })).show(); + } else if (item.value == 'sse') { + var oleEditor = this.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor) { + oleEditor.setEditMode(false); + oleEditor.show(); + oleEditor.setOleData("empty"); + } } }, diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 20cba8ade..5e5150741 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -607,7 +607,8 @@ define([ {caption: this.mniCustomTable, value: 'custom'}, {caption: this.mniDrawTable, value: 'draw', checkable: true}, {caption: this.mniEraseTable, value: 'erase', checkable: true}, - {caption: this.mniTextToTable, value: 'convert'} + {caption: this.mniTextToTable, value: 'convert'}, + {caption: this.mniInsertSSE, value: 'sse'} ] }), dataHint: '1', @@ -2829,7 +2830,8 @@ define([ tipMarkersDash: 'Dash bullets', textTabView: 'View', mniRemoveHeader: 'Remove Header', - mniRemoveFooter: 'Remove Footer' + mniRemoveFooter: 'Remove Footer', + mniInsertSSE: 'Insert Spreadsheet' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 9cc2fb5a2..66df3ae42 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2573,8 +2573,8 @@ define([ width: value.width, height: value.height }); }; - if (typeof obj === 'object' && this.api) { - this.api.asc_addTableOleObjectInOleEditor(obj, callback); + if ((typeof obj === 'object' || obj==="empty") && this.api) { + this.api.asc_addTableOleObjectInOleEditor(typeof obj === 'object' ? obj : undefined, callback); this.isFrameClosed = false; } }, From 6e197c53c8c8be4be024c190ea7e335de196fd05 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 1 Apr 2022 17:58:01 +0300 Subject: [PATCH 04/14] [PE] Add ole object --- .../main/app/controller/DocumentHolder.js | 5 +++-- apps/presentationeditor/main/app/controller/Toolbar.js | 7 +++++++ apps/presentationeditor/main/app/view/Toolbar.js | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index f6be16df6..508ceca27 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -133,8 +133,9 @@ define([ var command = message.data.command; var data = message.data.data; if (this.api) { - if (oleEditor.isEditMode()) - this.api.asc_editTableOleObject(data); + oleEditor.isEditMode() + ? this.api.asc_editTableOleObject(data) + : this.api.asc_addTableOleObject(data); } }, this)); oleEditor.on('hide', _.bind(function(cmp, message) { diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index c3c8b631a..8c8e0cf02 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1613,6 +1613,13 @@ define([ Common.NotificationCenter.trigger('edit:complete', me.toolbar); } })).show(); + } else if (item.value == 'sse') { + var oleEditor = this.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor) { + oleEditor.setEditMode(false); + oleEditor.show(); + oleEditor.setOleData("empty"); + } } }, diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 9aa4a7e22..29f20ab02 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -718,7 +718,8 @@ define([ cls: 'shifted-left', items: [ {template: _.template('
')}, - {caption: me.mniCustomTable, value: 'custom'} + {caption: me.mniCustomTable, value: 'custom'}, + {caption: me.mniInsertSSE, value: 'sse'} ] }), dataHint: '1', @@ -2011,7 +2012,8 @@ define([ tipMarkersFRhombus: 'Filled rhombus bullets', tipMarkersDash: 'Dash bullets', tipNone: 'None', - textTabView: 'View' + textTabView: 'View', + mniInsertSSE: 'Insert Spreadsheet' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file From c0c6a032798ccd4272cc4ad0ec22f5b66ec601fa Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 4 Apr 2022 21:10:04 +0300 Subject: [PATCH 05/14] Fix ole editor resizing --- .../common/main/lib/view/ExternalOleEditor.js | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/common/main/lib/view/ExternalOleEditor.js b/apps/common/main/lib/view/ExternalOleEditor.js index 13643cf6d..89b98d965 100644 --- a/apps/common/main/lib/view/ExternalOleEditor.js +++ b/apps/common/main/lib/view/ExternalOleEditor.js @@ -51,7 +51,7 @@ define([ width: 910, height: (_inner_height - 700)<0 ? _inner_height : 700, minwidth: 355, - minheight: 280, + minheight: 275, cls: 'advanced-settings-dlg', header: true, toolclose: 'hide', @@ -59,8 +59,10 @@ define([ resizable: true }, options); + this._headerFooterHeight = 85; + this.template = [ - '
', + '
', '
', '
', '
', @@ -80,7 +82,6 @@ define([ render: function() { Common.UI.Window.prototype.render.call(this); - this._headerFooterHeight = 85 + ((parseInt(this.$window.css('border-top-width')) + parseInt(this.$window.css('border-bottom-width')))); this.boxEl = this.$window.find('.body > .box'); this.btnSave = new Common.UI.Button({ @@ -144,7 +145,7 @@ define([ var header_height = (this.initConfig.header) ? parseInt(this.$window.find('> .header').css('height')) : 0; this.$window.find('> .body').css('height', height-header_height); - this.$window.find('> .body > .box').css('height', height-85); + this.$window.find('> .body > .box').css('height', height-this._headerFooterHeight); } }, @@ -161,20 +162,22 @@ define([ var maxHeight = Common.Utils.innerHeight(), maxWidth = Common.Utils.innerWidth(), borders_width = (parseInt(this.$window.css('border-left-width')) + parseInt(this.$window.css('border-right-width'))), - bordersOffset = this.bordersOffset*2; + paddings = (parseInt(this.boxEl.css('padding-left')) + parseInt(this.boxEl.css('padding-right'))); height += 90; // add toolbar and statusbar height - if (maxHeight - bordersOffset Date: Mon, 30 May 2022 18:06:01 +0300 Subject: [PATCH 06/14] [SSE] Refactoring (remove resize callback) --- apps/spreadsheeteditor/main/app/controller/Main.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index b4702bdeb..4b0d3e5e4 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2601,13 +2601,8 @@ define([ }, setOleData: function(obj) { - var callback = function(value) { - Common.Gateway.internalMessage('resize', { - width: value.width, height: value.height - }); - }; if ((typeof obj === 'object' || obj==="empty") && this.api) { - this.api.asc_addTableOleObjectInOleEditor(typeof obj === 'object' ? obj : undefined, callback); + this.api.asc_addTableOleObjectInOleEditor(typeof obj === 'object' ? obj : undefined); this.isFrameClosed = false; } }, From 89636b7099097d9b85f6284d9f1305c2ddb2dc3e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Jun 2022 14:06:46 +0300 Subject: [PATCH 07/14] [SSE] Save last size of the ole editor --- .../common/main/lib/view/ExternalOleEditor.js | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/view/ExternalOleEditor.js b/apps/common/main/lib/view/ExternalOleEditor.js index 5721dcd11..8bfe61471 100644 --- a/apps/common/main/lib/view/ExternalOleEditor.js +++ b/apps/common/main/lib/view/ExternalOleEditor.js @@ -44,12 +44,20 @@ define([ Common.Views.ExternalOleEditor = Common.UI.Window.extend(_.extend({ initialize : function(options) { - var _options = {}; + var filter = Common.localStorage.getKeysFilter(); + this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; + + var _options = {}, width = 880, height = 700; + var value = Common.localStorage.getItem(this.appPrefix + 'ole-editor-width'); + value && (width = parseInt(value)); + value = Common.localStorage.getItem(this.appPrefix + 'ole-editor-height'); + value && (height = parseInt(value)); + var _inner_height = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); _.extend(_options, { title: this.textTitle, - width: 910, - height: (_inner_height - 700)<0 ? _inner_height : 700, + width: width, + height: (_inner_height - height)<0 ? _inner_height : height, minwidth: 880, minheight: 275, cls: 'advanced-settings-dlg', @@ -77,6 +85,7 @@ define([ this.handler = _options.handler; this._oleData = null; this._isNewOle = true; + this.on('resize', _.bind(this.onWindowResize, this)); Common.UI.Window.prototype.initialize.call(this, _options); }, @@ -188,6 +197,14 @@ define([ return this._placeholder; }, + onWindowResize: function (args) { + if (args && args[1]=='end') { + var value = this.getSize(); + Common.localStorage.setItem(this.appPrefix + 'ole-editor-width', value[0]); + Common.localStorage.setItem(this.appPrefix + 'ole-editor-height', value[1]); + } + }, + textSave: 'Save & Exit', textClose: 'Close', textTitle: 'Spreadsheet Editor' From c8c05cf38d15b4f691a3ca27b3fe722a4eec8e41 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Jun 2022 14:26:24 +0300 Subject: [PATCH 08/14] Fix ole editor --- apps/common/main/lib/view/ExternalOleEditor.js | 4 ++-- .../main/app/template/ToolbarAnother.template | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/view/ExternalOleEditor.js b/apps/common/main/lib/view/ExternalOleEditor.js index 8bfe61471..aba61ec76 100644 --- a/apps/common/main/lib/view/ExternalOleEditor.js +++ b/apps/common/main/lib/view/ExternalOleEditor.js @@ -47,7 +47,7 @@ define([ var filter = Common.localStorage.getKeysFilter(); this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; - var _options = {}, width = 880, height = 700; + var _options = {}, width = 900, height = 700; var value = Common.localStorage.getItem(this.appPrefix + 'ole-editor-width'); value && (width = parseInt(value)); value = Common.localStorage.getItem(this.appPrefix + 'ole-editor-height'); @@ -58,7 +58,7 @@ define([ title: this.textTitle, width: width, height: (_inner_height - height)<0 ? _inner_height : height, - minwidth: 880, + minwidth: 840, minheight: 275, cls: 'advanced-settings-dlg', header: true, diff --git a/apps/spreadsheeteditor/main/app/template/ToolbarAnother.template b/apps/spreadsheeteditor/main/app/template/ToolbarAnother.template index eca22316b..d045a5368 100644 --- a/apps/spreadsheeteditor/main/app/template/ToolbarAnother.template +++ b/apps/spreadsheeteditor/main/app/template/ToolbarAnother.template @@ -86,9 +86,9 @@
-
- - +
+ +
@@ -113,7 +113,7 @@
- +
@@ -128,7 +128,7 @@
-
+
From da327e5168eec0da3b91f5712dff1612280b9579 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Jun 2022 18:18:13 +0300 Subject: [PATCH 09/14] Refactoring internal editors. Make diagramm editor resizable --- .../lib/controller/ExternalDiagramEditor.js | 13 +- .../main/lib/view/ExternalDiagramEditor.js | 101 +-------- apps/common/main/lib/view/ExternalEditor.js | 201 ++++++++++++++++++ .../common/main/lib/view/ExternalOleEditor.js | 160 +------------- apps/documenteditor/main/locale/en.json | 11 +- apps/presentationeditor/main/locale/en.json | 7 +- .../main/app/template/ToolbarAnother.template | 2 +- 7 files changed, 245 insertions(+), 250 deletions(-) create mode 100644 apps/common/main/lib/view/ExternalEditor.js diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index 35f403ad2..324362123 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -98,10 +98,13 @@ define([ 'drag': _.bind(function(o, state){ externalEditor && externalEditor.serviceCommand('window:drag', state == 'start'); },this), + 'resize': _.bind(function(o, state){ + externalEditor && externalEditor.serviceCommand('window:resize', state == 'start'); + },this), 'show': _.bind(function(cmp){ var h = this.diagramEditorView.getHeight(), innerHeight = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); - if (innerHeight>h && h<700 || innerHeight0 && h>0) + this.diagramEditorView.setInnerSize(w, h); } else this.diagramEditorView.fireEvent('internalmessage', this.diagramEditorView, eventData); } diff --git a/apps/common/main/lib/view/ExternalDiagramEditor.js b/apps/common/main/lib/view/ExternalDiagramEditor.js index 596c925c2..e977ec4d0 100644 --- a/apps/common/main/lib/view/ExternalDiagramEditor.js +++ b/apps/common/main/lib/view/ExternalDiagramEditor.js @@ -39,59 +39,29 @@ */ define([ - 'common/main/lib/component/Window' + 'common/main/lib/view/ExternalEditor' ], function () { 'use strict'; - Common.Views.ExternalDiagramEditor = Common.UI.Window.extend(_.extend({ + Common.Views.ExternalDiagramEditor = Common.Views.ExternalEditor.extend(_.extend({ initialize : function(options) { var _options = {}; - var _inner_height = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); _.extend(_options, { title: this.textTitle, - width: 910, - height: (_inner_height - 700)<0 ? _inner_height : 700, - cls: 'advanced-settings-dlg', - header: true, - toolclose: 'hide', - toolcallback: _.bind(this.onToolClose, this) + storageName: 'diagram-editor', + sdkplaceholder: 'id-diagram-editor-placeholder', + initwidth: 900, + initheight: 700, + minwidth: 730, + minheight: 275 }, options); - this.template = [ - '
', - '
', - '
', - '
', - '' - ].join(''); - - _options.tpl = _.template(this.template)(_options); - - this.handler = _options.handler; this._chartData = null; - this._isNewChart = true; - Common.UI.Window.prototype.initialize.call(this, _options); - }, - - render: function() { - Common.UI.Window.prototype.render.call(this); - - this.btnSave = new Common.UI.Button({ - el: $('#id-btn-diagram-editor-apply'), - disabled: true - }); - this.btnCancel = new Common.UI.Button({ - el: $('#id-btn-diagram-editor-cancel') - }); - - this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this)); + Common.Views.ExternalEditor.prototype.initialize.call(this, _options); }, show: function() { this.setPlaceholder(); - Common.UI.Window.prototype.show.apply(this, arguments); + Common.Views.ExternalEditor.prototype.show.apply(this, arguments); }, setChartData: function(data) { @@ -100,55 +70,6 @@ define([ this.fireEvent('setchartdata', this); }, - setEditMode: function(mode) { - this._isNewChart = !mode; - }, - - isEditMode: function() { - return !this._isNewChart; - }, - - setControlsDisabled: function(disable) { - this.btnSave.setDisabled(disable); - this.btnCancel.setDisabled(disable); - (disable) ? this.$window.find('.tool.close').addClass('disabled') : this.$window.find('.tool.close').removeClass('disabled'); - }, - - onDlgBtnClick: function(event) { - if ( this.handler ) { - this.handler.call(this, event.currentTarget.attributes['result'].value); - return; - } - this.hide(); - }, - - onToolClose: function() { - if ( this.handler ) { - this.handler.call(this, 'cancel'); - return; - } - this.hide(); - }, - - setHeight: function(height) { - if (height >= 0) { - var min = parseInt(this.$window.css('min-height')); - height < min && (height = min); - this.$window.height(height); - - var header_height = (this.initConfig.header) ? parseInt(this.$window.find('> .header').css('height')) : 0; - - this.$window.find('> .body').css('height', height-header_height); - this.$window.find('> .body > .box').css('height', height-85); - - var top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2; - var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; - - this.$window.css('left',left); - this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); - } - }, - setPlaceholder: function(placeholder) { this._placeholder = placeholder; }, @@ -157,8 +78,6 @@ define([ return this._placeholder; }, - textSave: 'Save & Exit', - textClose: 'Close', textTitle: 'Chart Editor' }, Common.Views.ExternalDiagramEditor || {})); }); diff --git a/apps/common/main/lib/view/ExternalEditor.js b/apps/common/main/lib/view/ExternalEditor.js new file mode 100644 index 000000000..32fc4c3ab --- /dev/null +++ b/apps/common/main/lib/view/ExternalEditor.js @@ -0,0 +1,201 @@ +/* + * + * (c) Copyright Ascensio System SIA 2010-2022 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * +*/ +/** + * ExternalEditor.js + * + * Created by Julia Radzhabova on 22/06/22 + * Copyright (c) 2022 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'common/main/lib/component/Window' +], function () { 'use strict'; + + Common.Views.ExternalEditor = Common.UI.Window.extend(_.extend({ + initialize : function(options) { + var filter = Common.localStorage.getKeysFilter(), + appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; + this.storageName = appPrefix + (options.storageName || 'external-editor'); + + var _options = {}, + width = options.initwidth || 900, + height = options.initheight || 700; + var value = Common.localStorage.getItem(this.storageName + '-width'); + value && (width = parseInt(value)); + value = Common.localStorage.getItem(this.storageName + '-height'); + value && (height = parseInt(value)); + + var _inner_height = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); + _.extend(_options, { + width: width, + height: (_inner_height - height)<0 ? _inner_height : height, + cls: 'advanced-settings-dlg', + header: true, + toolclose: 'hide', + toolcallback: _.bind(this.onToolClose, this), + resizable: true + }, options); + + this._headerFooterHeight = 85; + + this.template = [ + '
', + '
', + '
', + '
', + '' + ].join(''); + + _options.tpl = _.template(this.template)(_options); + + this.handler = _options.handler; + this._isNewObject = true; + this.on('resize', _.bind(this.onWindowResize, this)); + Common.UI.Window.prototype.initialize.call(this, _options); + }, + + render: function() { + Common.UI.Window.prototype.render.call(this); + this.boxEl = this.$window.find('.body > .box'); + + this.btnSave = new Common.UI.Button({ + el: this.$window.find('#id-btn-editor-apply'), + disabled: true + }); + this.btnCancel = new Common.UI.Button({ + el: this.$window.find('#id-btn-editor-cancel') + }); + + this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this)); + }, + + show: function() { + Common.UI.Window.prototype.show.apply(this, arguments); + }, + + setEditMode: function(mode) { + this._isNewObject = !mode; + }, + + isEditMode: function() { + return !this._isNewObject; + }, + + setControlsDisabled: function(disable) { + this.btnSave.setDisabled(disable); + this.btnCancel.setDisabled(disable); + (disable) ? this.$window.find('.tool.close').addClass('disabled') : this.$window.find('.tool.close').removeClass('disabled'); + }, + + onDlgBtnClick: function(event) { + if ( this.handler ) { + this.handler.call(this, event.currentTarget.attributes['result'].value); + return; + } + this.hide(); + }, + + onToolClose: function() { + if ( this.handler ) { + this.handler.call(this, 'cancel'); + return; + } + this.hide(); + }, + + setHeight: function(height) { + if (height >= 0) { + var min = parseInt(this.$window.css('min-height')); + height < min && (height = min); + this.$window.height(height); + + var header_height = (this.initConfig.header) ? parseInt(this.$window.find('> .header').css('height')) : 0; + + this.$window.find('> .body').css('height', height-header_height); + this.$window.find('> .body > .box').css('height', height-this._headerFooterHeight); + + // var top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2; + // var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; + // + // this.$window.css('left',left); + // this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); + } + }, + + setInCenter: function() { + var height = this.$window.height(), + top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2, + left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; + + this.$window.css('left',left); + this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); + }, + + setInnerSize: function(width, height) { + var maxHeight = Common.Utils.innerHeight(), + maxWidth = Common.Utils.innerWidth(), + borders_width = (parseInt(this.$window.css('border-left-width')) + parseInt(this.$window.css('border-right-width'))), + paddings = (parseInt(this.boxEl.css('padding-left')) + parseInt(this.boxEl.css('padding-right'))); + height += 90; // add toolbar and statusbar height + if (maxHeight', - '
', - '
', - '
', - '' - ].join(''); - - _options.tpl = _.template(this.template)(_options); - - this.handler = _options.handler; this._oleData = null; - this._isNewOle = true; - this.on('resize', _.bind(this.onWindowResize, this)); - Common.UI.Window.prototype.initialize.call(this, _options); - }, - - render: function() { - Common.UI.Window.prototype.render.call(this); - this.boxEl = this.$window.find('.body > .box'); - - this.btnSave = new Common.UI.Button({ - el: $('#id-btn-ole-editor-apply'), - disabled: true - }); - this.btnCancel = new Common.UI.Button({ - el: $('#id-btn-ole-editor-cancel') - }); - - this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this)); - }, - - show: function() { - this.setPlaceholder(); - Common.UI.Window.prototype.show.apply(this, arguments); + Common.Views.ExternalEditor.prototype.initialize.call(this, _options); }, setOleData: function(data) { @@ -115,98 +65,6 @@ define([ this.fireEvent('setoledata', this); }, - setEditMode: function(mode) { - this._isNewOle = !mode; - }, - - isEditMode: function() { - return !this._isNewOle; - }, - - setControlsDisabled: function(disable) { - this.btnSave.setDisabled(disable); - this.btnCancel.setDisabled(disable); - (disable) ? this.$window.find('.tool.close').addClass('disabled') : this.$window.find('.tool.close').removeClass('disabled'); - }, - - onDlgBtnClick: function(event) { - if ( this.handler ) { - this.handler.call(this, event.currentTarget.attributes['result'].value); - return; - } - this.hide(); - }, - - onToolClose: function() { - if ( this.handler ) { - this.handler.call(this, 'cancel'); - return; - } - this.hide(); - }, - - setHeight: function(height) { - if (height >= 0) { - var min = parseInt(this.$window.css('min-height')); - height < min && (height = min); - this.$window.height(height); - - var header_height = (this.initConfig.header) ? parseInt(this.$window.find('> .header').css('height')) : 0; - - this.$window.find('> .body').css('height', height-header_height); - this.$window.find('> .body > .box').css('height', height-this._headerFooterHeight); - } - }, - - setInCenter: function() { - var height = this.$window.height(), - top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2, - left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; - - this.$window.css('left',left); - this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); - }, - - setInnerSize: function(width, height) { - var maxHeight = Common.Utils.innerHeight(), - maxWidth = Common.Utils.innerWidth(), - borders_width = (parseInt(this.$window.css('border-left-width')) + parseInt(this.$window.css('border-right-width'))), - paddings = (parseInt(this.boxEl.css('padding-left')) + parseInt(this.boxEl.css('padding-right'))); - height += 90; // add toolbar and statusbar height - if (maxHeight - +
From b9698ae77b29d55cfd069168114de7f6a633a859 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Jun 2022 19:17:45 +0300 Subject: [PATCH 10/14] Remove unused --- apps/common/main/lib/view/ExternalEditor.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/common/main/lib/view/ExternalEditor.js b/apps/common/main/lib/view/ExternalEditor.js index 32fc4c3ab..050292454 100644 --- a/apps/common/main/lib/view/ExternalEditor.js +++ b/apps/common/main/lib/view/ExternalEditor.js @@ -147,12 +147,6 @@ define([ this.$window.find('> .body').css('height', height-header_height); this.$window.find('> .body > .box').css('height', height-this._headerFooterHeight); - - // var top = (Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top') - parseInt(height)) / 2; - // var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; - // - // this.$window.css('left',left); - // this.$window.css('top', Common.Utils.InternalSettings.get('window-inactive-area-top') + top); } }, From ce7bacd50fc2d24e11f40f043d1d577654cacde0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Jun 2022 19:18:39 +0300 Subject: [PATCH 11/14] Bug 36870 --- .../lib/controller/ExternalMergeEditor.js | 28 +++++++++++++++---- .../main/lib/view/ExternalMergeEditor.js | 4 +-- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/apps/common/main/lib/controller/ExternalMergeEditor.js b/apps/common/main/lib/controller/ExternalMergeEditor.js index 89017051a..4b7c682c1 100644 --- a/apps/common/main/lib/controller/ExternalMergeEditor.js +++ b/apps/common/main/lib/controller/ExternalMergeEditor.js @@ -51,7 +51,8 @@ define([ var appLang = '{{DEFAULT_LANG}}', customization = undefined, targetApp = '', - externalEditor = null; + externalEditor = null, + isAppFirstOpened = true; var createExternalEditor = function() { @@ -106,6 +107,10 @@ define([ if (externalEditor) { externalEditor.serviceCommand('setAppDisabled',false); + if (isAppFirstOpened && this.mergeEditorView._isExternalDocReady) { + isAppFirstOpened = false; + this.mergeEditorView._mergeData && this.setMergeData(); + } if (this.needDisableEditing && this.mergeEditorView._isExternalDocReady) { this.onMergeEditingDisabled(); } @@ -114,6 +119,7 @@ define([ createExternalEditor.apply(this); } this.isExternalEditorVisible = true; + this.isHandlerCalled = false; }, this), 'hide': _.bind(function(cmp){ if (externalEditor) { @@ -138,14 +144,22 @@ define([ }, handler: function(result, value) { - externalEditor && externalEditor.serviceCommand('queryClose',{mr:result}); - return true; + if (this.isHandlerCalled) return; + this.isHandlerCalled = true; + if (this.mergeEditorView._isExternalDocReady) + externalEditor && externalEditor.serviceCommand('queryClose',{mr:result}); + else { + this.mergeEditorView.hide(); + this.isHandlerCalled = false; + } }, setMergeData: function() { - externalEditor && externalEditor.serviceCommand('setMergeData', this.mergeEditorView._mergeData); - this.mergeEditorView.setEditMode(true); - this.mergeEditorView._mergeData = null; + if (!isAppFirstOpened) { + externalEditor && externalEditor.serviceCommand('setMergeData', this.mergeEditorView._mergeData); + this.mergeEditorView.setEditMode(true); + this.mergeEditorView._mergeData = null; + } }, loadConfig: function(data) { @@ -184,6 +198,7 @@ define([ if (this.mergeEditorView) { if (eventData.type == 'documentReady') { this.mergeEditorView._isExternalDocReady = true; + this.isExternalEditorVisible && (isAppFirstOpened = false); this.mergeEditorView.setControlsDisabled(false); if (this.mergeEditorView._mergeData) { externalEditor && externalEditor.serviceCommand('setMergeData', this.mergeEditorView._mergeData); @@ -206,6 +221,7 @@ define([ } this.mergeEditorView.hide(); } + this.isHandlerCalled = false; } else if (eventData.type == "processMouse") { if (eventData.data.event == 'mouse:up') { diff --git a/apps/common/main/lib/view/ExternalMergeEditor.js b/apps/common/main/lib/view/ExternalMergeEditor.js index d3e800794..f22bfa467 100644 --- a/apps/common/main/lib/view/ExternalMergeEditor.js +++ b/apps/common/main/lib/view/ExternalMergeEditor.js @@ -82,11 +82,9 @@ define([ disabled: true }); this.btnCancel = new Common.UI.Button({ - el: $('#id-btn-merge-editor-cancel'), - disabled: true + el: $('#id-btn-merge-editor-cancel') }); - this.$window.find('.tool.close').addClass('disabled'); this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this)); }, From 30d79281042f26f92884778e29b14bc9707d664d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Jun 2022 19:32:44 +0300 Subject: [PATCH 12/14] Fix resize internal editors --- apps/common/main/lib/controller/ExternalDiagramEditor.js | 3 +-- apps/common/main/lib/controller/ExternalOleEditor.js | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index 324362123..0af413c16 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -105,8 +105,7 @@ define([ var h = this.diagramEditorView.getHeight(), innerHeight = Common.Utils.innerHeight() - Common.Utils.InternalSettings.get('window-inactive-area-top'); if (innerHeight Date: Wed, 22 Jun 2022 19:37:33 +0300 Subject: [PATCH 13/14] Make merge editor resizable --- .../lib/controller/ExternalMergeEditor.js | 16 +++- .../main/lib/view/ExternalMergeEditor.js | 95 ++----------------- 2 files changed, 22 insertions(+), 89 deletions(-) diff --git a/apps/common/main/lib/controller/ExternalMergeEditor.js b/apps/common/main/lib/controller/ExternalMergeEditor.js index 4b7c682c1..bcc29c803 100644 --- a/apps/common/main/lib/controller/ExternalMergeEditor.js +++ b/apps/common/main/lib/controller/ExternalMergeEditor.js @@ -97,12 +97,14 @@ define([ 'drag': _.bind(function(o, state){ externalEditor && externalEditor.serviceCommand('window:drag', state == 'start'); },this), + 'resize': _.bind(function(o, state){ + externalEditor && externalEditor.serviceCommand('window:resize', state == 'start'); + },this), 'show': _.bind(function(cmp){ var h = this.mergeEditorView.getHeight(), innerHeight = Common.Utils.innerHeight(); - if (innerHeight>h && h<700 || innerHeight0 && h>0) + this.mergeEditorView.setInnerSize(w, h); } else this.mergeEditorView.fireEvent('internalmessage', this.mergeEditorView, eventData); } diff --git a/apps/common/main/lib/view/ExternalMergeEditor.js b/apps/common/main/lib/view/ExternalMergeEditor.js index f22bfa467..0b91a6e3a 100644 --- a/apps/common/main/lib/view/ExternalMergeEditor.js +++ b/apps/common/main/lib/view/ExternalMergeEditor.js @@ -39,53 +39,24 @@ */ define([ - 'common/main/lib/component/Window' + 'common/main/lib/view/ExternalEditor' ], function () { 'use strict'; - Common.Views.ExternalMergeEditor = Common.UI.Window.extend(_.extend({ + Common.Views.ExternalMergeEditor = Common.Views.ExternalEditor.extend(_.extend({ initialize : function(options) { var _options = {}; _.extend(_options, { title: this.textTitle, - width: 910, - height: (Common.Utils.innerHeight()-700)<0 ? Common.Utils.innerHeight(): 700, - cls: 'advanced-settings-dlg', - header: true, - toolclose: 'hide', - toolcallback: _.bind(this.onToolClose, this) + storageName: 'merge-editor', + sdkplaceholder: 'id-merge-editor-placeholder', + initwidth: 900, + initheight: 700, + minwidth: 370, + minheight: 275 }, options); - this.template = [ - '
', - '
', - '
', - '
', - '' - ].join(''); - - _options.tpl = _.template(this.template)(_options); - - this.handler = _options.handler; this._mergeData = null; - this._isNewMerge = true; - Common.UI.Window.prototype.initialize.call(this, _options); - }, - - render: function() { - Common.UI.Window.prototype.render.call(this); - - this.btnSave = new Common.UI.Button({ - el: $('#id-btn-merge-editor-apply'), - disabled: true - }); - this.btnCancel = new Common.UI.Button({ - el: $('#id-btn-merge-editor-cancel') - }); - - this.$window.find('.dlg-btn').on('click', _.bind(this.onDlgBtnClick, this)); + Common.Views.ExternalEditor.prototype.initialize.call(this, _options); }, setMergeData: function(data) { @@ -94,54 +65,6 @@ define([ this.fireEvent('setmergedata', this); }, - setEditMode: function(mode) { - this._isNewMerge = !mode; - }, - - isEditMode: function() { - return !this._isNewMerge; - }, - - setControlsDisabled: function(disable) { - this.btnSave.setDisabled(disable); - this.btnCancel.setDisabled(disable); - (disable) ? this.$window.find('.tool.close').addClass('disabled') : this.$window.find('.tool.close').removeClass('disabled'); - }, - - onDlgBtnClick: function(event) { - var state = event.currentTarget.attributes['result'].value; - if ( this.handler && this.handler.call(this, state) ) - return; - this.hide(); - }, - - onToolClose: function() { - if ( this.handler && this.handler.call(this, 'cancel') ) - return; - this.hide(); - }, - - setHeight: function(height) { - if (height >= 0) { - var min = parseInt(this.$window.css('min-height')); - height < min && (height = min); - this.$window.height(height); - - var header_height = (this.initConfig.header) ? parseInt(this.$window.find('> .header').css('height')) : 0; - - this.$window.find('> .body').css('height', height-header_height); - this.$window.find('> .body > .box').css('height', height-85); - - var top = (Common.Utils.innerHeight() - parseInt(height)) / 2; - var left = (Common.Utils.innerWidth() - parseInt(this.initConfig.width)) / 2; - - this.$window.css('left',left); - this.$window.css('top',top); - } - }, - - textSave: 'Save & Exit', - textClose: 'Close', textTitle: 'Mail Merge Recipients' }, Common.Views.ExternalMergeEditor || {})); }); \ No newline at end of file From cb51144092d0967dd14dc59a4e26e10fe3e1c906 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Jun 2022 20:31:46 +0300 Subject: [PATCH 14/14] Remove unused --- apps/common/main/lib/controller/ExternalDiagramEditor.js | 9 --------- apps/common/main/lib/controller/ExternalOleEditor.js | 9 --------- apps/documenteditor/main/app/controller/Toolbar.js | 6 ++---- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index 0af413c16..38957d4aa 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -253,15 +253,6 @@ define([ } }, - showExternalEditor: function () { - if ( externalEditor ) { - var value = Common.localStorage.getItem("ui-theme-id", "theme-light"); - externalEditor.serviceCommand('theme:change', value); - } - - this.diagramEditorView.show(); - }, - warningTitle: 'Warning', warningText: 'The object is disabled because of editing by another user.', textClose: 'Close', diff --git a/apps/common/main/lib/controller/ExternalOleEditor.js b/apps/common/main/lib/controller/ExternalOleEditor.js index 02aa2f585..c041414e2 100644 --- a/apps/common/main/lib/controller/ExternalOleEditor.js +++ b/apps/common/main/lib/controller/ExternalOleEditor.js @@ -249,15 +249,6 @@ define([ } }, - showExternalEditor: function () { - if ( externalEditor ) { - var value = Common.localStorage.getItem("ui-theme-id", "theme-light"); - externalEditor.serviceCommand('theme:change', value); - } - - this.oleEditorView.show(); - }, - warningTitle: 'Warning', warningText: 'The object is disabled because of editing by another user.', textClose: 'Close', diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 5010b6dc7..0dff9909e 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2159,14 +2159,12 @@ define([ chart.changeType(type); Common.NotificationCenter.trigger('edit:complete', this.toolbar); } else { - var controller = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor'); if (!this.diagramEditor) - this.diagramEditor = controller.getView('Common.Views.ExternalDiagramEditor'); + this.diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor'); if (this.diagramEditor && me.api) { this.diagramEditor.setEditMode(false); - // this.diagramEditor.show(); - controller.showExternalEditor(); + this.diagramEditor.show(); chart = me.api.asc_getChartObject(type); if (chart) {