[SSE] Edit ole objects

This commit is contained in:
Julia Radzhabova 2022-03-28 19:41:59 +03:00
parent 49bd75e457
commit ac0e61182b
4 changed files with 41 additions and 1 deletions

View file

@ -165,6 +165,7 @@ require([
'Common.Controllers.Chat',
'Common.Controllers.Comments',
'Common.Controllers.Plugins'
,'Common.Controllers.ExternalOleEditor'
,'Common.Controllers.ReviewChanges'
,'Common.Controllers.Protection'
]
@ -203,6 +204,7 @@ require([
'common/main/lib/controller/Comments',
'common/main/lib/controller/Chat',
'common/main/lib/controller/Plugins'
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
,'common/main/lib/controller/Themes'

View file

@ -256,6 +256,28 @@ define([
view.tableTotalMenu.on('item:click', _.bind(me.onTotalMenuClick, me));
view.menuImgMacro.on('click', _.bind(me.onImgMacro, me));
view.menuImgEditPoints.on('click', _.bind(me.onImgEditPoints, me));
if (!me.permissions.isEditMailMerge && !me.permissions.isEditDiagram && !me.permissions.isEditOle) {
var oleEditor = me.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 (me.api) {
if (oleEditor.isEditMode())
me.api.asc_editTableOleObject(data);
}
}, me));
oleEditor.on('hide', _.bind(function(cmp, message) {
if (me.api) {
me.api.asc_enableKeyEvents(true);
}
setTimeout(function(){
view.fireEvent('editcomplete', view);
}, 10);
}, me));
}
}
} else {
view.menuViewCopy.on('click', _.bind(me.onCopyPaste, me));
view.menuViewUndo.on('click', _.bind(me.onUndo, me));
@ -342,6 +364,8 @@ define([
this.api.asc_registerCallback('asc_onInputMessage', _.bind(this.onInputMessage, this));
this.api.asc_registerCallback('asc_onTableTotalMenu', _.bind(this.onTableTotalMenu, this));
this.api.asc_registerCallback('asc_onShowPivotGroupDialog', _.bind(this.onShowPivotGroupDialog, this));
if (!this.permissions.isEditMailMerge && !this.permissions.isEditDiagram && !this.permissions.isEditOle)
this.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(this.onDoubleClickOnTableOleObject, this));
}
this.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(this.onShowForeignCursorLabel, this));
this.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(this.onHideForeignCursorLabel, this));
@ -3952,6 +3976,17 @@ define([
}
},
onDoubleClickOnTableOleObject: function(obj) {
if (this.permissions.isEdit && !this._isDisabled) {
var oleEditor = SSE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
if (oleEditor && obj) {
oleEditor.setEditMode(true);
oleEditor.show();
oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(obj));
}
}
},
getUserName: function(id){
var usersStore = SSE.getCollection('Common.Collections.Users');
if (usersStore){

View file

@ -915,6 +915,7 @@ define([
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isEditOle) {
pluginsController.setApi(me.api);
this.api && this.api.asc_setFrozenPaneBorderType(Common.localStorage.getBool('sse-freeze-shadow', true) ? Asc.c_oAscFrozenPaneBorderType.shadow : Asc.c_oAscFrozenPaneBorderType.line);
application.getController('Common.Controllers.ExternalOleEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization});
}
leftMenuView.disableMenu('all',false);
@ -2565,7 +2566,7 @@ define([
setOleData: function(obj) {
if (typeof obj === 'object' && this.api) {
this.api.asc_addTableOleObject(obj);
this.api.asc_addTableOleObjectInOleEditor(obj);
this.isFrameClosed = false;
}
},

View file

@ -155,6 +155,7 @@ require([
'Common.Controllers.Chat',
'Common.Controllers.Comments',
'Common.Controllers.Plugins'
,'Common.Controllers.ExternalOleEditor'
,'Common.Controllers.ReviewChanges'
,'Common.Controllers.Protection'
]
@ -193,6 +194,7 @@ require([
'common/main/lib/controller/Comments',
'common/main/lib/controller/Chat',
'common/main/lib/controller/Plugins'
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
,'common/main/lib/controller/Themes'