Merge pull request #1645 from ONLYOFFICE/feature/sse-edit-ole-objects

Feature/sse edit ole objects
This commit is contained in:
Julia Radzhabova 2022-03-23 23:28:40 +03:00 committed by GitHub
commit a86b6d45ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1028 additions and 244 deletions

View file

@ -913,7 +913,7 @@
if ( typeof(customization) == 'object' && ( customization.toolbarNoTabs ||
(config.editorConfig.targetApp!=='desktop') && (customization.loaderName || customization.loaderLogo))) {
index = "/index_loader.html";
} else if (config.editorConfig.mode === 'editdiagram' || config.editorConfig.mode === 'editmerge')
} else if (config.editorConfig.mode === 'editdiagram' || config.editorConfig.mode === 'editmerge' || config.editorConfig.mode === 'editole')
index = "/index_internal.html";
}
@ -947,7 +947,7 @@
}
}
if (config.editorConfig && (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge'))
if (config.editorConfig && (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge' || config.editorConfig.mode == 'editole'))
params += "&internal=true";
if (config.frameEditorId)

View file

@ -610,7 +610,7 @@ define([
return false;
},
addDataHint: function (index) { //Hint Manager
addDataHint: function (index, dataHint) { //Hint Manager
var oldHintTab = this.$bar.find('[data-hint]');
if (oldHintTab.length > 0) {
oldHintTab.removeAttr('data-hint');
@ -619,7 +619,7 @@ define([
oldHintTab.removeAttr('data-hint-title');
}
var newHintTab = this.tabs[index].$el;
newHintTab.attr('data-hint', '0');
newHintTab.attr('data-hint', dataHint || '0');
newHintTab.attr('data-hint-direction', 'top');
newHintTab.attr('data-hint-offset', 'medium');
newHintTab.attr('data-hint-title', 'M');

View file

@ -95,7 +95,7 @@ define([
if (this.mode.canCoAuthoring && this.mode.canChat)
this.api.asc_registerCallback('asc_onCoAuthoringChatReceiveMessage', _.bind(this.onReceiveMessage, this));
if ( !this.mode.isEditDiagram && !this.mode.isEditMailMerge ) {
if ( !this.mode.isEditDiagram && !this.mode.isEditMailMerge && !this.mode.isEditOle ) {
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
this.api.asc_coAuthoringGetUsers();

View file

@ -0,0 +1,259 @@
/*
*
* (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
*
*/
/**
* ExternalOleEditor.js
*
* Created by Julia Radzhabova on 3/10/22
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
Common.Controllers = Common.Controllers || {};
define([
'core',
'common/main/lib/view/ExternalOleEditor'
], function () { 'use strict';
Common.Controllers.ExternalOleEditor = Backbone.Controller.extend(_.extend((function() {
var appLang = '{{DEFAULT_LANG}}',
customization = undefined,
targetApp = '',
externalEditor = null,
isAppFirstOpened = true;
var createExternalEditor = function() {
!!customization && (customization.uiTheme = Common.localStorage.getItem("ui-theme-id", "theme-light"));
externalEditor = new DocsAPI.DocEditor('id-ole-editor-placeholder', {
width : '100%',
height : '100%',
documentType: 'cell',
document : {
url : '_chart_',
permissions : {
edit : true,
download: false
}
},
editorConfig: {
mode : 'editole',
targetApp : targetApp,
lang : appLang,
canCoAuthoring : false,
canBackToFolder : false,
canCreateNew : false,
customization : customization,
user : {id: ('uid-'+Date.now())}
},
events: {
'onAppReady' : function() {},
'onDocumentStateChange' : function() {},
'onError' : function() {},
'onInternalMessage' : _.bind(this.onInternalMessage, this)
}
});
Common.Gateway.on('processmouse', _.bind(this.onProcessMouse, this));
};
return {
views: ['Common.Views.ExternalOleEditor'],
initialize: function() {
this.addListeners({
'Common.Views.ExternalOleEditor': {
'setoledata': _.bind(this.setOleData, this),
'drag': _.bind(function(o, state){
externalEditor && externalEditor.serviceCommand('window:drag', 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<h) {
h = Math.min(innerHeight, 700);
this.oleEditorView.setHeight(h);
}
if (externalEditor) {
externalEditor.serviceCommand('setAppDisabled',false);
if (isAppFirstOpened && this.oleEditorView._isExternalDocReady) {
isAppFirstOpened = false;
this.oleEditorView._oleData && this.setOleData();
}
if (this.needDisableEditing && this.oleEditorView._isExternalDocReady) {
this.onOleEditingDisabled();
}
externalEditor.attachMouseEvents();
} else {
createExternalEditor.apply(this);
}
this.isExternalEditorVisible = true;
this.isHandlerCalled = false;
}, this),
'hide': _.bind(function(cmp){
if (externalEditor) {
externalEditor.detachMouseEvents();
this.isExternalEditorVisible = false;
}
}, this)
}
});
},
onLaunch: function() {
this.oleEditorView = this.createView('Common.Views.ExternalOleEditor', {handler: _.bind(this.handler, this)});
},
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onCloseOleEditor', _.bind(this.onOleEditingDisabled, this));
return this;
},
handler: function(result, value) {
if (this.isHandlerCalled) return;
this.isHandlerCalled = true;
if (this.oleEditorView._isExternalDocReady)
externalEditor && externalEditor.serviceCommand('queryClose',{mr:result});
else {
this.oleEditorView.hide();
this.isHandlerCalled = false;
}
},
setOleData: function() {
if (!isAppFirstOpened) {
externalEditor && externalEditor.serviceCommand('setOleData', this.oleEditorView._oleData);
this.oleEditorView._oleData = null;
}
},
loadConfig: function(data) {
if (data && data.config) {
if (data.config.lang) appLang = data.config.lang;
if (data.config.customization) customization = data.config.customization;
if (data.config.targetApp) targetApp = data.config.targetApp;
}
},
onOleEditingDisabled: function() {
if ( !this.oleEditorView.isVisible() || !this.oleEditorView._isExternalDocReady ) {
this.needDisableEditing = true;
return;
}
this.oleEditorView.setControlsDisabled(true);
Common.UI.alert({
title: this.warningTitle,
msg : this.warningText,
iconCls: 'warn',
buttons: ['ok'],
callback: _.bind(function(btn){
this.setControlsDisabled(false);
this.oleEditorView.hide();
}, this)
});
this.needDisableEditing = false;
},
onInternalMessage: function(data) {
var eventData = data.data;
if (this.oleEditorView) {
if (eventData.type == 'documentReady') {
this.oleEditorView._isExternalDocReady = true;
this.oleEditorView.setControlsDisabled(false);
this.isExternalEditorVisible && (isAppFirstOpened = false);
this.oleEditorView._oleData && this.setOleData();
if (this.needDisableEditing) {
this.onOleEditingDisabled();
}
} else
if (eventData.type == "shortcut") {
if (eventData.data.key == 'escape')
this.oleEditorView.hide();
} else
if (eventData.type == "canClose") {
if (eventData.data.answer === true) {
if (externalEditor) {
externalEditor.serviceCommand('setAppDisabled',true);
if (eventData.data.mr == 'ok')
externalEditor.serviceCommand('getOleData');
}
this.oleEditorView.hide();
}
this.isHandlerCalled = false;
} else
if (eventData.type == "processMouse") {
if (eventData.data.event == 'mouse:up') {
this.oleEditorView.binding.dragStop();
} else
if (eventData.data.event == 'mouse:move') {
var x = parseInt(this.oleEditorView.$window.css('left')) + eventData.data.pagex,
y = parseInt(this.oleEditorView.$window.css('top')) + eventData.data.pagey + 34;
this.oleEditorView.binding.drag({pageX:x, pageY:y});
}
} else
this.oleEditorView.fireEvent('internalmessage', this.oleEditorView, eventData);
}
} ,
onProcessMouse: function(data) {
if (data.type == 'mouseup' && this.isExternalEditorVisible) {
externalEditor && externalEditor.serviceCommand('processmouse', data);
}
},
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',
textAnonymous: 'Anonymous'
}
})(), Common.Controllers.ExternalOleEditor || {}));
});

View file

@ -647,7 +647,7 @@ Common.UI.HintManager = new(function() {
};
var _setMode = function (mode) {
_isEditDiagram = mode.isEditDiagram;
_isEditDiagram = mode.isEditDiagram || mode.isEditMailMerge || mode.isEditOle;
};
return {

View file

@ -63,7 +63,7 @@ define([
'render:before' : function (toolbar) {
var appOptions = me.getApplication().getController('Main').appOptions;
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram && !appOptions.isEditOle ) {
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption, dataHintTitle: 'E', layoutname: 'toolbar-plugins'};
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();

View file

@ -61,8 +61,8 @@ define([
'</div>',
'<div class="separator horizontal"></div>',
'<div class="footer" style="text-align: center;">',
'<button id="id-btn-merge-editor-apply" class="btn normal dlg-btn primary custom" result="ok">' + this.textSave + '</button>',
'<button id="id-btn-merge-editor-cancel" class="btn normal dlg-btn disabled" result="cancel">' + this.textClose + '</button>',
'<button id="id-btn-merge-editor-apply" class="btn normal dlg-btn primary custom" result="ok" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textSave + '</button>',
'<button id="id-btn-merge-editor-cancel" class="btn normal dlg-btn" result="cancel" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textClose + '</button>',
'</div>'
].join('');

View file

@ -0,0 +1,164 @@
/*
*
* (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
*
*/
/**
* ExternalOleEditor.js
*
* Created by Julia Radzhabova on 3/10/22
* Copyright (c) 2022 Ascensio System SIA. All rights reserved.
*
*/
define([
'common/main/lib/component/Window'
], function () { 'use strict';
Common.Views.ExternalOleEditor = Common.UI.Window.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)
}, options);
this.template = [
'<div id="id-ole-editor-container" class="box" style="height:' + (_options.height-85) + 'px;">',
'<div id="id-ole-editor-placeholder" style="width: 100%;height: 100%;"></div>',
'</div>',
'<div class="separator horizontal"></div>',
'<div class="footer" style="text-align: center;">',
'<button id="id-btn-ole-editor-apply" class="btn normal dlg-btn primary custom" result="ok" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textSave + '</button>',
'<button id="id-btn-ole-editor-cancel" class="btn normal dlg-btn" result="cancel" data-hint="1" data-hint-direction="bottom" data-hint-offset="big">' + this.textClose + '</button>',
'</div>'
].join('');
_options.tpl = _.template(this.template)(_options);
this.handler = _options.handler;
this._oleData = null;
this._isNewOle = 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-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);
},
setOleData: function(data) {
this._oleData = data;
if (this._isExternalDocReady)
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-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;
},
getPlaceholder: function() {
return this._placeholder;
},
textSave: 'Save & Exit',
textClose: 'Close',
textTitle: 'Spreadsheet Editor'
}, Common.Views.ExternalOleEditor || {}));
});

View file

@ -167,6 +167,7 @@ require([
,'Common.Controllers.Plugins'
,'Common.Controllers.ExternalDiagramEditor'
,'Common.Controllers.ExternalMergeEditor'
,'Common.Controllers.ExternalOleEditor'
,'Common.Controllers.ReviewChanges'
,'Common.Controllers.Protection'
]
@ -207,6 +208,7 @@ require([
,'documenteditor/main/app/view/ChartSettings'
,'common/main/lib/controller/ExternalDiagramEditor'
,'common/main/lib/controller/ExternalMergeEditor'
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
,'common/main/lib/controller/Themes'

View file

@ -163,6 +163,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));
}
},
getView: function (name) {

View file

@ -1234,6 +1234,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.ExternalMergeEditor').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);

View file

@ -804,6 +804,17 @@ define([
}
};
var onDoubleClickOnTableOleObject = function(chart) {
if (me.mode.isEdit && !me._isDisabled) {
var oleEditor = DE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
if (oleEditor && chart) {
oleEditor.setEditMode(true);
oleEditor.show();
oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(chart));
}
}
};
var onCoAuthoringDisconnect= function() {
me.mode.isEdit = false;
};
@ -1597,6 +1608,7 @@ define([
this.api.asc_registerCallback('asc_onImgWrapStyleChanged', _.bind(this.onImgWrapStyleChanged, this));
this.api.asc_registerCallback('asc_onDialogAddHyperlink', onDialogAddHyperlink);
this.api.asc_registerCallback('asc_doubleClickOnChart', onDoubleClickOnChart);
this.api.asc_registerCallback('asc_doubleClickOnTableOleObject', onDoubleClickOnTableOleObject);
this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, this));
this.api.asc_registerCallback('asc_onRulerDblClick', _.bind(this.onRulerDblClick, this));
this.api.asc_registerCallback('asc_ChangeCropState', _.bind(this.onChangeCropState, this));

View file

@ -157,6 +157,7 @@ require([
,'Common.Controllers.Plugins'
,'Common.Controllers.ExternalDiagramEditor'
,'Common.Controllers.ExternalMergeEditor'
,'Common.Controllers.ExternalOleEditor'
,'Common.Controllers.ReviewChanges'
,'Common.Controllers.Protection'
]
@ -197,6 +198,7 @@ require([
,'documenteditor/main/app/view/ChartSettings'
,'common/main/lib/controller/ExternalDiagramEditor'
,'common/main/lib/controller/ExternalMergeEditor'
,'common/main/lib/controller/ExternalOleEditor'
,'common/main/lib/controller/ReviewChanges'
,'common/main/lib/controller/Protection'
,'common/main/lib/controller/Themes'

View file

@ -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'

View file

@ -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));
}
}
});
});

View file

@ -854,6 +854,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);

View file

@ -1623,6 +1623,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));
@ -1763,6 +1764,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) {

View file

@ -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'

View file

@ -97,7 +97,7 @@ define([
this.mode = mode;
this.editor.$btnfunc[this.mode.isEdit?'removeClass':'addClass']('disabled');
this.editor.btnNamedRanges.setVisible(this.mode.isEdit && !this.mode.isEditDiagram && !this.mode.isEditMailMerge);
this.editor.btnNamedRanges.setVisible(this.mode.isEdit && !this.mode.isEditDiagram && !this.mode.isEditMailMerge && !this.mode.isEditOle);
if ( this.mode.isEdit ) {
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onApiSelectionChanged, this));
@ -156,7 +156,7 @@ define([
if (this.viewmode) return; // signed file
var seltype = info.asc_getSelectionType(),
coauth_disable = (!this.mode.isEditMailMerge && !this.mode.isEditDiagram) ? (info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true) : false;
coauth_disable = (!this.mode.isEditMailMerge && !this.mode.isEditDiagram && !this.mode.isEditOle) ? (info.asc_getLocked() === true || info.asc_getLockedTable() === true || info.asc_getLockedPivotTable()===true) : false;
var is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,
is_chart = seltype == Asc.c_oAscSelectionType.RangeChart,
@ -326,14 +326,14 @@ define([
SetDisabled: function(disabled) {
this.editor.$btnfunc[!disabled && this.mode.isEdit ?'removeClass':'addClass']('disabled');
this.editor.btnNamedRanges.setVisible(!disabled && this.mode.isEdit && !this.mode.isEditDiagram && !this.mode.isEditMailMerge);
this.editor.btnNamedRanges.setVisible(!disabled && this.mode.isEdit && !this.mode.isEditDiagram && !this.mode.isEditMailMerge && !this.mode.isEditOle);
},
setPreviewMode: function(mode) {
if (this.viewmode === mode) return;
this.viewmode = mode;
this.editor.$btnfunc[!mode && this.mode.isEdit?'removeClass':'addClass']('disabled');
this.editor.cellNameDisabled(mode && !(this.mode.isEdit && !this.mode.isEditDiagram && !this.mode.isEditMailMerge));
this.editor.cellNameDisabled(mode && !(this.mode.isEdit && !this.mode.isEditDiagram && !this.mode.isEditMailMerge && !this.mode.isEditOle));
}
});
});

View file

@ -440,7 +440,7 @@ define([
},
onApiSheetChanged: function() {
if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge) return;
if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge || this.toolbar.mode.isEditOle) return;
var currentSheet = this.api.asc_getActiveWorksheetIndex();
this.onWorksheetLocked(currentSheet, this.api.asc_isWorksheetLockedOrDeleted(currentSheet));

View file

@ -241,6 +241,8 @@ define([
view.pmiTextAdvanced.on('click', _.bind(me.onTextAdvanced, me));
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me));
view.mnuChartData.on('click', _.bind(me.onChartData, me));
view.mnuChartType.on('click', _.bind(me.onChartType, me));
view.mnuImgAdvanced.on('click', _.bind(me.onImgAdvanced, me));
view.mnuSlicerAdvanced.on('click', _.bind(me.onSlicerAdvanced, me));
view.textInShapeMenu.on('render:after', _.bind(me.onTextInShapeAfterRender, me));
@ -1034,6 +1036,60 @@ define([
}
},
onChartData: function(btn) {
var me = this;
var props;
if (me.api){
props = me.api.asc_getChartObject();
if (props) {
me._isEditRanges = true;
props.startEdit();
var win = new SSE.Views.ChartDataDialog({
chartSettings: props,
api: me.api,
handler: function(result, value) {
if (result == 'ok') {
props.endEdit();
me._isEditRanges = false;
}
Common.NotificationCenter.trigger('edit:complete', me);
}
}).on('close', function() {
me._isEditRanges && props.cancelEdit();
me._isEditRanges = false;
});
win.show();
}
}
},
onChartType: function(btn) {
var me = this;
var props;
if (me.api){
props = me.api.asc_getChartObject();
if (props) {
me._isEditType = true;
props.startEdit();
var win = new SSE.Views.ChartTypeDialog({
chartSettings: props,
api: me.api,
handler: function(result, value) {
if (result == 'ok') {
props.endEdit();
me._isEditType = false;
}
Common.NotificationCenter.trigger('edit:complete', me);
}
}).on('close', function() {
me._isEditType && props.cancelEdit();
me._isEditType = false;
});
win.show();
}
}
},
onImgMacro: function(item) {
var me = this;
@ -1832,7 +1888,8 @@ define([
isPivotLocked = cellinfo.asc_getLockedPivotTable()===true,
isObjLocked = false,
commentsController = this.getApplication().getController('Common.Controllers.Comments'),
internaleditor = this.permissions.isEditMailMerge || this.permissions.isEditDiagram,
internaleditor = this.permissions.isEditMailMerge || this.permissions.isEditDiagram || this.permissions.isEditOle,
diagramOrMergeEditor = this.permissions.isEditMailMerge || this.permissions.isEditDiagram,
xfs = cellinfo.asc_getXfs(),
isSmartArt = false,
isSmartArtInternal = false;
@ -1843,11 +1900,11 @@ define([
case Asc.c_oAscSelectionType.RangeCol: iscolmenu = true; break;
case Asc.c_oAscSelectionType.RangeMax: isallmenu = true; break;
case Asc.c_oAscSelectionType.RangeSlicer:
case Asc.c_oAscSelectionType.RangeImage: isimagemenu = !internaleditor; break;
case Asc.c_oAscSelectionType.RangeShape: isshapemenu = !internaleditor; break;
case Asc.c_oAscSelectionType.RangeChart: ischartmenu = !internaleditor; break;
case Asc.c_oAscSelectionType.RangeChartText:istextchartmenu = !internaleditor; break;
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = !internaleditor; break;
case Asc.c_oAscSelectionType.RangeImage: isimagemenu = !(this.permissions.isEditMailMerge || this.permissions.isEditDiagram); break;
case Asc.c_oAscSelectionType.RangeShape: isshapemenu = !(this.permissions.isEditMailMerge || this.permissions.isEditDiagram); break;
case Asc.c_oAscSelectionType.RangeChart: ischartmenu = !(this.permissions.isEditMailMerge || this.permissions.isEditDiagram); break;
case Asc.c_oAscSelectionType.RangeChartText:istextchartmenu = !(this.permissions.isEditMailMerge || this.permissions.isEditDiagram); break;
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = !(this.permissions.isEditMailMerge || this.permissions.isEditDiagram); break;
}
if (this.api.asc_getHeaderFooterMode()) {
@ -1918,6 +1975,10 @@ define([
documentHolder.mnuShapeAdvanced.setDisabled(isObjLocked);
documentHolder.mnuChartEdit.setVisible(ischartmenu && !isimagemenu && !isshapemenu && has_chartprops);
documentHolder.mnuChartEdit.setDisabled(isObjLocked);
documentHolder.mnuChartData.setVisible(this.permissions.isEditOle && ischartmenu && !isimagemenu && !isshapemenu && has_chartprops);
documentHolder.mnuChartData.setDisabled(isObjLocked);
documentHolder.mnuChartType.setVisible(this.permissions.isEditOle && ischartmenu && !isimagemenu && !isshapemenu && has_chartprops);
documentHolder.mnuChartType.setDisabled(isObjLocked);
documentHolder.pmiImgCut.setDisabled(isObjLocked);
documentHolder.pmiImgPaste.setDisabled(isObjLocked);
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && (!isshapemenu || isimageonly) && !ischartmenu);
@ -1946,6 +2007,7 @@ define([
documentHolder.menuSignatureEditSetup.setVisible(isInSign);
documentHolder.menuEditSignSeparator.setVisible(isInSign);
documentHolder.menuImgMacro.setVisible(!internaleditor);
documentHolder.menuImgMacro.setDisabled(isObjLocked);
var canEditPoints = this.api && this.api.asc_canEditGeometry();
@ -2059,8 +2121,10 @@ define([
if (showMenu) this.showPopupMenu(documentHolder.textInShapeMenu, {}, event);
documentHolder.menuParagraphBullets.setDisabled(isSmartArt || isSmartArtInternal);
} else if (!this.permissions.isEditMailMerge && !this.permissions.isEditDiagram || (seltype !== Asc.c_oAscSelectionType.RangeImage && seltype !== Asc.c_oAscSelectionType.RangeShape &&
seltype !== Asc.c_oAscSelectionType.RangeChart && seltype !== Asc.c_oAscSelectionType.RangeChartText && seltype !== Asc.c_oAscSelectionType.RangeShapeText && seltype !== Asc.c_oAscSelectionType.RangeSlicer)) {
} else if (!this.permissions.isEditMailMerge && !this.permissions.isEditDiagram && !this.permissions.isEditOle ||
(seltype !== Asc.c_oAscSelectionType.RangeImage && seltype !== Asc.c_oAscSelectionType.RangeShape &&
seltype !== Asc.c_oAscSelectionType.RangeChart && seltype !== Asc.c_oAscSelectionType.RangeChartText &&
seltype !== Asc.c_oAscSelectionType.RangeShapeText && seltype !== Asc.c_oAscSelectionType.RangeSlicer)) {
if (!documentHolder.ssMenu || !showMenu && !documentHolder.ssMenu.isVisible()) return;
var iscelledit = this.api.isCellEdited,
@ -2083,14 +2147,14 @@ define([
documentHolder.pmiDeleteTable.setVisible(iscellmenu && !iscelledit && isintable);
documentHolder.pmiSparklines.setVisible(isinsparkline);
documentHolder.pmiSortCells.setVisible((iscellmenu||isallmenu) && !iscelledit && !inPivot);
documentHolder.pmiSortCells.menu.items[2].setVisible(!internaleditor);
documentHolder.pmiSortCells.menu.items[3].setVisible(!internaleditor);
documentHolder.pmiSortCells.menu.items[2].setVisible(!diagramOrMergeEditor);
documentHolder.pmiSortCells.menu.items[3].setVisible(!diagramOrMergeEditor);
documentHolder.pmiSortCells.menu.items[4].setVisible(!internaleditor);
documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !internaleditor && !inPivot);
documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !internaleditor && !inPivot);
documentHolder.pmiCondFormat.setVisible(!iscelledit && !internaleditor);
documentHolder.mnuGroupPivot.setVisible(iscellmenu && !iscelledit && !internaleditor && inPivot);
documentHolder.mnuUnGroupPivot.setVisible(iscellmenu && !iscelledit && !internaleditor && inPivot);
documentHolder.pmiFilterCells.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && !inPivot);
documentHolder.pmiReapply.setVisible((iscellmenu||isallmenu) && !iscelledit && !diagramOrMergeEditor && !inPivot);
documentHolder.pmiCondFormat.setVisible(!iscelledit && !diagramOrMergeEditor);
documentHolder.mnuGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot);
documentHolder.mnuUnGroupPivot.setVisible(iscellmenu && !iscelledit && !diagramOrMergeEditor && inPivot);
documentHolder.ssMenu.items[12].setVisible((iscellmenu||isallmenu||isinsparkline) && !iscelledit);
documentHolder.pmiInsFunction.setVisible(iscellmenu && !iscelledit && !inPivot);
documentHolder.pmiAddNamedRange.setVisible(iscellmenu && !iscelledit && !internaleditor);
@ -2108,8 +2172,8 @@ define([
}
var hyperinfo = cellinfo.asc_getHyperlink();
documentHolder.menuHyperlink.setVisible(iscellmenu && hyperinfo && !iscelledit && !ismultiselect && !internaleditor && !inPivot);
documentHolder.menuAddHyperlink.setVisible(iscellmenu && !hyperinfo && !iscelledit && !ismultiselect && !internaleditor && !inPivot);
documentHolder.menuHyperlink.setVisible(iscellmenu && hyperinfo && !iscelledit && !ismultiselect && !diagramOrMergeEditor && !inPivot);
documentHolder.menuAddHyperlink.setVisible(iscellmenu && !hyperinfo && !iscelledit && !ismultiselect && !diagramOrMergeEditor && !inPivot);
documentHolder.pmiRowHeight.setVisible(isrowmenu||isallmenu);
documentHolder.pmiColumnWidth.setVisible(iscolmenu||isallmenu);
@ -2213,9 +2277,9 @@ define([
isCellLocked = cellinfo.asc_getLocked(),
isTableLocked = cellinfo.asc_getLockedTable()===true,
commentsController = this.getApplication().getController('Common.Controllers.Comments'),
iscellmenu = (seltype==Asc.c_oAscSelectionType.RangeCells) && !this.permissions.isEditMailMerge && !this.permissions.isEditDiagram,
iscellmenu = (seltype==Asc.c_oAscSelectionType.RangeCells) && !this.permissions.isEditMailMerge && !this.permissions.isEditDiagram && !this.permissions.isEditOle,
iscelledit = this.api.isCellEdited,
isimagemenu = (seltype==Asc.c_oAscSelectionType.RangeShape || seltype==Asc.c_oAscSelectionType.RangeImage) && !this.permissions.isEditMailMerge && !this.permissions.isEditDiagram,
isimagemenu = (seltype==Asc.c_oAscSelectionType.RangeShape || seltype==Asc.c_oAscSelectionType.RangeImage) && !this.permissions.isEditMailMerge && !this.permissions.isEditDiagram && !this.permissions.isEditOle,
signGuid;
if (!documentHolder.viewModeMenu)

View file

@ -176,7 +176,7 @@ define([
}
}
/** coauthoring end **/
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram)
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram && !this.mode.isEditOle)
this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this));
this.leftMenu.getMenu('file').setApi(api);
if (this.mode.canUseHistory)
@ -249,7 +249,7 @@ define([
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
/** coauthoring end **/
Common.util.Shortcuts.resumeEvents();
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram)
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram && !this.mode.isEditOle)
Common.NotificationCenter.on('cells:range', _.bind(this.onCellsRange, this));
return this;
},
@ -867,6 +867,7 @@ define([
if (this.mode.isEditDiagram && s!='escape') return false;
if (this.mode.isEditMailMerge && s!='escape' && s!='search') return false;
if (this.mode.isEditOle && s!='escape' && s!='search') return false;
switch (s) {
case 'replace':
@ -932,7 +933,7 @@ define([
}
return false;
}
if (this.mode.isEditDiagram || this.mode.isEditMailMerge) {
if (this.mode.isEditDiagram || this.mode.isEditMailMerge || this.mode.isEditOle) {
menu_opened = $(document.body).find('.open > .dropdown-menu');
if (!this.api.isCellEdited && !menu_opened.length) {
Common.Gateway.internalMessage('shortcut', {key:'escape'});

View file

@ -398,6 +398,7 @@ define([
this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl;
this.appOptions.isEditDiagram = this.editorConfig.mode == 'editdiagram';
this.appOptions.isEditMailMerge = this.editorConfig.mode == 'editmerge';
this.appOptions.isEditOle = this.editorConfig.mode == 'editole';
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') && (typeof (this.editorConfig.customization.goback) == 'object')
&& (!_.isEmpty(this.editorConfig.customization.goback.url) || this.editorConfig.customization.goback.requestClose && this.appOptions.canRequestClose);
@ -414,7 +415,7 @@ define([
this.appOptions.canFeaturePivot = true;
this.appOptions.canFeatureViews = true;
if (this.appOptions.user.guest && this.appOptions.canRenameAnonymous && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge)
if (this.appOptions.user.guest && this.appOptions.canRenameAnonymous && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle)
Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));
this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header');
@ -464,10 +465,10 @@ define([
this.appOptions.wopi = this.editorConfig.wopi;
this.isFrameClosed = (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
this.isFrameClosed = (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle);
Common.Controllers.Desktop.init(this.appOptions);
if (this.appOptions.isEditDiagram) {
if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) {
Common.UI.HintManager.setMode(this.appOptions);
}
},
@ -855,7 +856,7 @@ define([
me.hidePreloader();
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) ? 100 : Common.localStorage.getItem("sse-settings-zoom");
value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram || this.appOptions.isEditOle) ? 100 : Common.localStorage.getItem("sse-settings-zoom");
Common.Utils.InternalSettings.set("sse-settings-zoom", value);
var zf = (value!==null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1);
this.api.asc_setZoom(zf>0 ? zf : 1);
@ -911,14 +912,14 @@ define([
leftMenuView.getMenu('file').loadDocument({doc:me.appOptions.spreadsheet});
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api);
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
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);
}
leftMenuView.disableMenu('all',false);
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && me.appOptions.canBranding) {
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isEditOle && me.appOptions.canBranding) {
me.getApplication().getController('LeftMenu').leftMenu.getMenu('about').setLicInfo(me.editorConfig.customization);
}
@ -955,7 +956,7 @@ define([
}
var timer_sl = setInterval(function(){
if (window.styles_loaded || me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge) {
if (window.styles_loaded || me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge || me.appOptions.isEditOle) {
clearInterval(timer_sl);
Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + me.api.asc_getActiveWorksheetId()]);
@ -964,13 +965,15 @@ define([
toolbarController.createDelayedElements();
me.setLanguages();
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isEditOle) {
var shapes = me.api.asc_getPropertyEditorShapes();
if (shapes)
me.fillAutoShapes(shapes[0], shapes[1]);
me.updateThemeColors();
toolbarController.activateControls();
} else if (me.appOptions.isEditOle) {
me.updateThemeColors();
}
rightmenuController.createDelayedElements();
@ -997,7 +1000,7 @@ define([
me.applyLicense();
}
// TODO bug 43960
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isEditOle) {
var dummyClass = ~~(1e6*Math.random());
$('.toolbar').prepend(Common.Utils.String.format('<div class="lazy-{0} x-huge"><div class="toolbar__icon" style="position: absolute; width: 1px; height: 1px;"></div>', dummyClass));
setTimeout(function() { $(Common.Utils.String.format('.toolbar .lazy-{0}', dummyClass)).remove(); }, 10);
@ -1034,12 +1037,12 @@ define([
} else checkWarns();
Common.Gateway.documentReady();
if (this.appOptions.user.guest && this.appOptions.canRenameAnonymous && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && (Common.Utils.InternalSettings.get("guest-username")===null))
if (this.appOptions.user.guest && this.appOptions.canRenameAnonymous && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle && (Common.Utils.InternalSettings.get("guest-username")===null))
this.showRenameUserDialog();
},
onLicenseChanged: function(params) {
if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return;
if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) return;
var licType = params.asc_getLicenseType();
if (licType !== undefined && (this.appOptions.canEdit || this.appOptions.isRestrictedEdit) && this.editorConfig.mode !== 'view' &&
@ -1092,7 +1095,7 @@ define([
}
});
}
} else if (!this.appOptions.isDesktopApp && !this.appOptions.canBrandingExt && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) &&
} else if (!this.appOptions.isDesktopApp && !this.appOptions.canBrandingExt && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) &&
this.editorConfig && this.editorConfig.customization && (this.editorConfig.customization.loaderName || this.editorConfig.customization.loaderLogo)) {
Common.UI.warning({
title: this.textPaidFeature,
@ -1188,7 +1191,7 @@ define([
onEditorPermissions: function(params) {
var licType = params ? params.asc_getLicenseType() : Asc.c_oLicenseResult.Error;
if ( params && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge)) {
if ( params && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle)) {
if (Asc.c_oLicenseResult.Expired === licType || Asc.c_oLicenseResult.Error === licType || Asc.c_oLicenseResult.ExpiredTrial === licType) {
Common.UI.warning({
title: this.titleLicenseExp,
@ -1254,10 +1257,10 @@ define([
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.permissions.edit !== false && this.editorConfig.mode !== 'view';
this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.permissions.edit !== false && this.editorConfig.mode !== 'view';
this.appOptions.canDownload = (this.permissions.download !== false);
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) &&
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) &&
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !this.permissions.editCommentAuthorOnly;
@ -1268,17 +1271,17 @@ define([
this.appOptions.canEditComments = this.appOptions.canDeleteComments = this.appOptions.isOffline;
}
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && (this.permissions.protect!==false)
&& !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
&& !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle);
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.api.asc_isProtectionSupport() && (this.permissions.protect!==false)
&& !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
&& !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle);
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.appOptions.canCoAuthoring &&
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring &&
!(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge) {
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) {
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
this.getApplication().getController('Common.Controllers.Plugins').setMode(this.appOptions);
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout);
@ -1357,7 +1360,7 @@ define([
statusbarView = app.getController('Statusbar').getView('Statusbar');
if (this.headerView) {
this.headerView.setVisible(!this.appOptions.isEditMailMerge && !this.appOptions.isDesktopApp && !this.appOptions.isEditDiagram);
this.headerView.setVisible(!this.appOptions.isEditMailMerge && !this.appOptions.isDesktopApp && !this.appOptions.isEditDiagram && !this.appOptions.isEditOle);
}
viewport && viewport.setMode(this.appOptions, true);
@ -1369,6 +1372,8 @@ define([
if (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) {
statusbarView.hide();
}
if (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram || this.appOptions.isEditOle) {
app.getController('LeftMenu').getView('LeftMenu').hide();
$(window)
@ -1382,15 +1387,15 @@ define([
},this));
}
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram) {
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram && !this.appOptions.isEditOle) {
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
this.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(this.onDocumentModifiedChanged, this));
var printController = app.getController('Print');
printController && this.api && printController.setApi(this.api);
}
} else if (this.appOptions.isEditOle)
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
var celleditorController = this.getApplication().getController('CellEditor');
celleditorController && celleditorController.setApi(this.api).setMode(this.appOptions);
@ -1437,10 +1442,11 @@ define([
application.getController('WBProtection').setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api);
if (statusbarController) {
statusbarController.getView('Statusbar').changeViewMode(true);
statusbarController.getView('Statusbar').changeViewMode(me.appOptions);
me.appOptions.isEditOle && statusbarController.onChangeViewMode(null, true, true); // set compact status bar for ole editing mode
}
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && me.appOptions.canFeaturePivot)
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isEditOle && me.appOptions.canFeaturePivot)
application.getController('PivotTable').setMode(me.appOptions);
var viewport = this.getApplication().getController('Viewport').getView('Viewport');
@ -1449,7 +1455,7 @@ define([
this.toolbarView = toolbarController.getView('Toolbar');
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.isEditOle) {
var options = {};
JSON.parse(Common.localStorage.getItem('sse-hidden-formula')) && (options.formula = true);
application.getController('Toolbar').hideElements(options);
@ -2066,7 +2072,7 @@ define([
onBeforeUnload: function() {
Common.localStorage.save();
var isEdit = this.permissions.edit !== false && this.editorConfig.mode !== 'view' && this.editorConfig.mode !== 'editdiagram' && this.editorConfig.mode !== 'editmerge';
var isEdit = this.permissions.edit !== false && this.editorConfig.mode !== 'view' && this.editorConfig.mode !== 'editdiagram' && this.editorConfig.mode !== 'editmerge' && this.editorConfig.mode !== 'editole';
if (isEdit && this.api.asc_isDocumentModified()) {
var me = this;
this.api.asc_stopSaving();
@ -2234,7 +2240,7 @@ define([
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram && window.editor_elements_prepared) {
this.application.getController('Statusbar').selectTab(index);
if (this.appOptions.canViewComments && !this.dontCloseDummyComment) {
if (!this.appOptions.isEditOle && this.appOptions.canViewComments && !this.dontCloseDummyComment) {
Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getWorksheetId(index)], false ); // hide popover
}
}
@ -2456,11 +2462,11 @@ define([
updateThemeColors: function() {
var me = this;
setTimeout(function(){
!me.appOptions.isEditOle && setTimeout(function(){
me.getApplication().getController('RightMenu').UpdateThemeColors();
}, 50);
setTimeout(function(){
!me.appOptions.isEditOle && setTimeout(function(){
me.getApplication().getController('Toolbar').updateThemeColors();
}, 50);
@ -2471,12 +2477,16 @@ define([
onSendThemeColors: function(colors, standart_colors) {
Common.Utils.ThemeColor.setColors(colors, standart_colors);
if (window.styles_loaded && !this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram) {
this.updateThemeColors();
var me = this;
setTimeout(function(){
me.fillTextArt();
}, 1);
if (window.styles_loaded) {
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram)
this.updateThemeColors();
if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram && !this.appOptions.isEditOle) {
var me = this;
setTimeout(function(){
me.fillTextArt();
}, 1);
}
}
},
@ -2497,6 +2507,8 @@ define([
case 'clearChartData': this.clearChartData(); break;
case 'setMergeData': this.setMergeData(data.data); break;
case 'getMergeData': this.getMergeData(); break;
case 'setOleData': this.setOleData(data.data); break;
case 'getOleData': this.getOleData(); break;
case 'setAppDisabled':
if (this.isAppDisabled===undefined && !data.data) { // first editor opening
Common.NotificationCenter.trigger('layout:changed', 'main');
@ -2551,6 +2563,24 @@ define([
this.api && this.api.asc_closeCellEditor();
},
setOleData: function(obj) {
if (typeof obj === 'object' && this.api) {
this.api.asc_addTableOleObject(obj);
this.isFrameClosed = false;
}
},
getOleData: function() {
if (this.api) {
var oleData = this.api.asc_getBinaryInfoOleObject();
if (typeof oleData === 'object') {
Common.Gateway.internalMessage('oleData', {
data: oleData
});
}
}
},
setMergeData: function(merge) {
if (typeof merge === 'object' && this.api) {
this.api.asc_setData(merge);

View file

@ -256,7 +256,7 @@ define([
this.statusbar.$el.css('z-index', '');
this.statusbar.tabMenu.on('item:click', _.bind(this.onTabMenu, this));
this.statusbar.btnAddWorksheet.on('click', _.bind(this.onAddWorksheetClick, this));
if (!Common.UI.LayoutManager.isElementVisible('statusBar-actionStatus')) {
if (!Common.UI.LayoutManager.isElementVisible('statusBar-actionStatus') || this.statusbar.mode.isEditOle) {
this.statusbar.customizeStatusBarMenu.items[0].setVisible(false);
this.statusbar.customizeStatusBarMenu.items[1].setVisible(false);
this.statusbar.boxAction.addClass('hide');
@ -780,9 +780,9 @@ define([
this._sheetViewTip.hide();
},
onChangeViewMode: function(item, compact) {
onChangeViewMode: function(item, compact, suppressEvent) {
this.statusbar.fireEvent('view:compact', [this.statusbar, compact]);
Common.localStorage.setBool('sse-compact-statusbar', compact);
!suppressEvent && Common.localStorage.setBool('sse-compact-statusbar', compact);
Common.NotificationCenter.trigger('layout:changed', 'status');
this.statusbar.onChangeCompact(compact);

View file

@ -301,6 +301,25 @@ define([
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this));
} else
if ( me.appConfig.isEditOle ) {
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
toolbar.btnSearch.on('click', _.bind(this.onSearch, this));
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
toolbar.btnSortUp.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Descending));
toolbar.btnSetAutofilter.on('click', _.bind(this.onAutoFilter, this));
toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this));
toolbar.btnInsertFormula.on('click', _.bind(this.onInsertFormulaMenu, this));
toolbar.btnInsertFormula.menu.on('item:click', _.bind(this.onInsertFormulaMenu, this));
toolbar.btnDecDecimal.on('click', _.bind(this.onDecrement, this));
toolbar.btnIncDecimal.on('click', _.bind(this.onIncrement, this));
toolbar.cmbNumberFormat.on('selected', _.bind(this.onNumberFormatSelect, this));
toolbar.cmbNumberFormat.on('show:before', _.bind(this.onNumberFormatOpenBefore, this, true));
if (toolbar.cmbNumberFormat.cmpEl)
toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this));
} else {
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled'));
@ -419,7 +438,7 @@ define([
var config = SSE.getController('Main').appOptions;
if (config.isEdit) {
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
if ( !config.isEditDiagram && !config.isEditMailMerge && !config.isEditOle ) {
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onApiMathTypes, this));
this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this));
@ -1846,7 +1865,7 @@ define([
this.toolbar.createDelayedElements();
this.attachUIEvents(this.toolbar);
if ( !this.appConfig.isEditDiagram && !this.appConfig.isEditMailMerge ) {
if ( !this.appConfig.isEditDiagram && !this.appConfig.isEditMailMerge && !this.appConfig.isEditOle ) {
this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.onApiSheetChanged, this));
this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', _.bind(this.onApiSheetChanged, this));
this.api.asc_registerCallback('asc_onEndAddShape', _.bind(this.onApiEndAddShape, this));
@ -1901,7 +1920,7 @@ define([
e.stopPropagation();
},
'command+k,ctrl+k': function (e) {
if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.toolbar.mode.isEditDiagram && !me.api.isCellEdited && !me._state.multiselect && !me._state.inpivot &&
if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.toolbar.mode.isEditDiagram && !me.toolbar.mode.isEditOle && !me.api.isCellEdited && !me._state.multiselect && !me._state.inpivot &&
!me.getApplication().getController('LeftMenu').leftMenu.menuFile.isVisible() && !me._state.wsProps['InsertHyperlinks']) {
var cellinfo = me.api.asc_getCellInfo(),
selectionType = cellinfo.asc_getSelectionType();
@ -1911,7 +1930,7 @@ define([
e.preventDefault();
},
'command+1,ctrl+1': function(e) {
if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.api.isCellEdited && !me.toolbar.cmbNumberFormat.isDisabled()) {
if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.toolbar.mode.isEditOle && !me.api.isCellEdited && !me.toolbar.cmbNumberFormat.isDisabled()) {
me.onCustomNumberFormat();
}
@ -2192,7 +2211,7 @@ define([
if ($('.asc-window.enable-key-events:visible').length>0) return;
var toolbar = this.toolbar;
if (toolbar.mode.isEditDiagram || toolbar.mode.isEditMailMerge) {
if (toolbar.mode.isEditDiagram || toolbar.mode.isEditMailMerge || toolbar.mode.isEditOle) {
is_cell_edited = (state == Asc.c_oAscCellEditorState.editStart);
toolbar.lockToolbar(Common.enumLock.editCell, state == Asc.c_oAscCellEditorState.editStart, {array: [toolbar.btnDecDecimal,toolbar.btnIncDecimal,toolbar.cmbNumberFormat, toolbar.btnEditChartData, toolbar.btnEditChartType]});
} else
@ -2243,7 +2262,7 @@ define([
onApiSheetChanged: function() {
if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge) return;
if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge || this.toolbar.mode.isEditOle) return;
var currentSheet = this.api.asc_getActiveWorksheetIndex(),
props = this.api.asc_getPageOptions(currentSheet),
@ -2401,7 +2420,7 @@ define([
Common.NotificationCenter.trigger('fonts:change', fontobj);
/* read font params */
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) {
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram && !toolbar.mode.isEditOle) {
val = fontobj.asc_getFontBold();
if (this._state.bold !== val) {
toolbar.btnBold.toggle(val === true, true);
@ -2508,10 +2527,12 @@ define([
if ( this.toolbar.mode.isEditDiagram )
return this.onApiSelectionChanged_DiagramEditor(info); else
if ( this.toolbar.mode.isEditMailMerge )
return this.onApiSelectionChanged_MailMergeEditor(info);
return this.onApiSelectionChanged_MailMergeEditor(info); else
if ( this.toolbar.mode.isEditOle )
return this.onApiSelectionChanged_OleEditor(info);
var selectionType = info.asc_getSelectionType(),
coauth_disable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram) ? (info.asc_getLocked()===true || info.asc_getLockedTable()===true || info.asc_getLockedPivotTable()===true) : false,
coauth_disable = (!this.toolbar.mode.isEditMailMerge && !this.toolbar.mode.isEditDiagram && !this.toolbar.mode.isEditOle) ? (info.asc_getLocked()===true || info.asc_getLockedTable()===true || info.asc_getLockedPivotTable()===true) : false,
editOptionsDisabled = this._disableEditOptions(selectionType, coauth_disable),
me = this,
toolbar = this.toolbar,
@ -2570,7 +2591,7 @@ define([
if (editOptionsDisabled) return;
/* read font params */
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) {
if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram && !toolbar.mode.isEditOle) {
val = xfs.asc_getFontBold();
if (this._state.bold !== val) {
toolbar.btnBold.toggle(val === true, true);
@ -3067,6 +3088,90 @@ define([
}
},
onApiSelectionChanged_OleEditor: function(info) {
if ( !this.editMode || this.api.isCellEdited || this.api.isRangeSelection) return;
var me = this;
var _disableEditOptions = function(seltype, coauth_disable) {
var is_chart_text = seltype == Asc.c_oAscSelectionType.RangeChartText,
is_chart = seltype == Asc.c_oAscSelectionType.RangeChart,
is_shape_text = seltype == Asc.c_oAscSelectionType.RangeShapeText,
is_shape = seltype == Asc.c_oAscSelectionType.RangeShape,
is_image = seltype == Asc.c_oAscSelectionType.RangeImage || seltype == Asc.c_oAscSelectionType.RangeSlicer,
is_mode_2 = is_shape_text || is_shape || is_chart_text || is_chart,
is_objLocked = false;
if (!(is_mode_2 || is_image) &&
me._state.selection_type === seltype &&
me._state.coauthdisable === coauth_disable)
return seltype === Asc.c_oAscSelectionType.RangeImage;
if ( is_mode_2 ) {
var selectedObjects = me.api.asc_getGraphicObjectProps();
is_objLocked = selectedObjects.some(function (object) {
return object.asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image && object.asc_getObjectValue().asc_getLocked();
});
}
var _set = Common.enumLock;
var type = seltype;
switch ( seltype ) {
case Asc.c_oAscSelectionType.RangeSlicer:
case Asc.c_oAscSelectionType.RangeImage: type = _set.selImage; break;
case Asc.c_oAscSelectionType.RangeShape: type = _set.selShape; break;
case Asc.c_oAscSelectionType.RangeShapeText: type = _set.selShapeText; break;
case Asc.c_oAscSelectionType.RangeChart: type = _set.selChart; break;
case Asc.c_oAscSelectionType.RangeChartText: type = _set.selChartText; break;
}
me.toolbar.lockToolbar(type, type != seltype, {
clear: [_set.selImage, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.coAuth]
});
me.toolbar.lockToolbar(Common.enumLock.coAuthText, is_objLocked);
return is_image;
};
var selectionType = info.asc_getSelectionType(),
xfs = info.asc_getXfs(),
coauth_disable = false,
editOptionsDisabled = _disableEditOptions(selectionType, coauth_disable),
val, need_disable = false;
if (editOptionsDisabled) return;
if (selectionType == Asc.c_oAscSelectionType.RangeChart || selectionType == Asc.c_oAscSelectionType.RangeChartText)
return;
if ( !me.toolbar.mode.isEditDiagram ) {
var filterInfo = info.asc_getAutoFilterInfo();
val = filterInfo ? filterInfo.asc_getIsAutoFilter() : null;
if ( this._state.filter !== val ) {
me.toolbar.btnSetAutofilter.toggle(val===true, true);
this._state.filter = val;
}
need_disable = this._state.controlsdisabled.filters || (val===null);
me.toolbar.lockToolbar(Common.enumLock.ruleFilter, need_disable,
{ array: [me.toolbar.btnSetAutofilter, me.toolbar.btnSortDown, me.toolbar.btnSortUp] });
need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true);
me.toolbar.lockToolbar(Common.enumLock.ruleDelFilter, need_disable, {array: [me.toolbar.btnClearAutofilter]});
}
var val = xfs.asc_getNumFormatInfo();
if ( val ) {
this._state.numformat = xfs.asc_getNumFormat();
this._state.numformatinfo = val;
val = val.asc_getType();
if (this._state.numformattype !== val) {
me.toolbar.cmbNumberFormat.setValue(val, me.toolbar.txtCustom);
this._state.numformattype = val;
}
}
},
onApiStyleChange: function() {
this.toolbar.btnCopyStyle.toggle(false, true);
this.modeAlwaysSetStyle = false;
@ -3511,7 +3616,7 @@ define([
case Asc.c_oAscSelectionType.RangeSlicer: type = _set.selSlicer; break;
}
if ( !this.appConfig.isEditDiagram && !this.appConfig.isEditMailMerge )
if ( !this.appConfig.isEditDiagram && !this.appConfig.isEditMailMerge && !this.appConfig.isEditOle )
toolbar.lockToolbar(type, type != seltype, {
array: [
toolbar.btnClearStyle.menu.items[1],
@ -3724,7 +3829,7 @@ define([
me.appConfig = config;
var compactview = !config.isEdit;
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge ) {
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge && !config.isEditOle ) {
if ( Common.localStorage.itemExists("sse-compact-toolbar") ) {
compactview = Common.localStorage.getBool("sse-compact-toolbar");
} else
@ -3734,7 +3839,7 @@ define([
me.toolbar.render(_.extend({isCompactView: compactview}, config));
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
if ( !config.isEditDiagram && !config.isEditMailMerge && !config.isEditOle ) {
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration, layoutname: 'toolbar-collaboration', dataHintTitle: 'U'};
var $panel = me.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
if ($panel) {
@ -3752,7 +3857,7 @@ define([
me.toolbar.btnPrint && me.toolbar.btnPrint.on('disabled', _.bind(me.onBtnChangeState, me, 'print:disabled'));
me.toolbar.setApi(me.api);
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
if ( !config.isEditDiagram && !config.isEditMailMerge && !config.isEditOle ) {
var datatab = me.getApplication().getController('DataTab');
datatab.setApi(me.api).setConfig({toolbar: me});
@ -3810,7 +3915,7 @@ define([
}
}
}
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
if ( !config.isEditDiagram && !config.isEditMailMerge && !config.isEditOle ) {
tab = {caption: me.toolbar.textTabView, action: 'view', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-view', dataHintTitle: 'W'};
var viewtab = me.getApplication().getController('ViewTab');
viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});

View file

@ -251,7 +251,7 @@ define([
},
onApiSheetChanged: function() {
if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge) return;
if (!this.toolbar.mode || !this.toolbar.mode.isEdit || this.toolbar.mode.isEditDiagram || this.toolbar.mode.isEditMailMerge || this.toolbar.mode.isEditOle) return;
var params = this.api.asc_getSheetViewSettings();
this.view.chHeadings.setValue(!!params.asc_getShowRowColHeaders(), true);

View file

@ -79,7 +79,7 @@ define([
'Toolbar': {
'render:before' : function (toolbar) {
var config = SSE.getController('Main').appOptions;
if (!config.isEditDiagram && !config.isEditMailMerge)
if (!config.isEditDiagram && !config.isEditMailMerge && !config.isEditOle)
toolbar.setExtra('right', me.header.getPanel('right', config));
if (!config.isEdit || config.customization && !!config.customization.compactHeader)
@ -148,11 +148,11 @@ define([
{
me.viewport.vlayout.getItem('toolbar').height = _intvars.get('toolbar-height-compact');
} else
if ( config.isEditDiagram || config.isEditMailMerge ) {
if ( config.isEditDiagram || config.isEditMailMerge || config.isEditOle ) {
me.viewport.vlayout.getItem('toolbar').height = 41;
}
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge && !(config.customization && config.customization.compactHeader)) {
if ( config.isEdit && !config.isEditDiagram && !config.isEditMailMerge && !config.isEditOle && !(config.customization && config.customization.compactHeader)) {
var $title = me.viewport.vlayout.getItem('title').el;
$title.html(me.header.getPanel('title', config)).show();
$title.find('.extra').html(me.header.getPanel('left', config));

View file

@ -71,5 +71,54 @@
</div>
<div class="group" style="width: 100%;"></div>
</section>
<% } else if ( isEditOle ) { %>
<!----------------------->
<!-- Edit ole object -->
<!----------------------->
<section class="simple-bar">
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-copy"></span>
<span class="btn-slot split" id="slot-btn-paste"></span>
<span class="btn-slot split" id="slot-btn-undo"></span>
<span class="btn-slot" id="slot-btn-redo"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-formula"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-sortdesc"></span>
<span class="btn-slot" id="slot-btn-sortasc"></span>
</div>
</div>
<div class="separator short" style="margin-left: 5px;"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-setfilter"></span>
<span class="btn-slot" id="slot-btn-clear-filter"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot split" id="slot-btn-digit-dec"></span>
<span class="btn-slot split" id="slot-btn-digit-inc"></span>
<span class="btn-slot" id="slot-btn-format" style="width: 84px; vertical-align: middle;"></span>
</div>
</div>
<div class="separator short"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot" id="slot-btn-search"></span>
</div>
</div>
<div class="group" style="width: 100%;"></div>
</section>
<% } %>
</div>

View file

@ -634,6 +634,15 @@ define([
caption : me.chartText
});
me.mnuChartData = new Common.UI.MenuItem({
iconCls : 'menu__icon btn-select-range',
caption : me.chartDataText
});
me.mnuChartType = new Common.UI.MenuItem({
caption : me.chartTypeText
});
me.pmiImgCut = new Common.UI.MenuItem({
iconCls: 'menu__icon btn-cut',
caption : me.txtCut,
@ -849,6 +858,8 @@ define([
me.menuImgMacro,
me.mnuShapeSeparator,
me.menuImgCrop,
me.mnuChartData,
me.mnuChartType,
me.mnuChartEdit,
me.mnuShapeAdvanced,
me.menuImgOriginalSize,
@ -1280,7 +1291,9 @@ define([
tipMarkersArrow: 'Arrow bullets',
tipMarkersCheckmark: 'Checkmark bullets',
tipMarkersFRhombus: 'Filled rhombus bullets',
tipMarkersDash: 'Dash bullets'
tipMarkersDash: 'Dash bullets',
chartDataText: 'Select Chart Data',
chartTypeText: 'Change Chart Type'
}, SSE.Views.DocumentHolder || {}));
});

View file

@ -516,8 +516,18 @@ define([
this.mode = _.extend({}, this.mode, mode);
// this.$el.find('.el-edit')[mode.isEdit?'show':'hide']();
//this.btnAddWorksheet.setVisible(this.mode.isEdit);
$('#status-addtabs-box')[this.mode.isEdit ? 'show' : 'hide']();
$('#status-addtabs-box')[(this.mode.isEdit) ? 'show' : 'hide']();
this.btnAddWorksheet.setDisabled(this.mode.isDisconnected || this.api && (this.api.asc_isWorkbookLocked() || this.api.isCellEdited) || this.rangeSelectionMode!=Asc.c_oAscSelectionDialogType.None);
if (this.mode.isEditOle) { // change hints order
this.btnAddWorksheet.$el.find('button').addBack().filter('button').attr('data-hint', '1');
this.btnScrollFirst.$el.find('button').addBack().filter('button').attr('data-hint', '1');
this.btnScrollLast.$el.find('button').addBack().filter('button').attr('data-hint', '1');
this.btnScrollBack.$el.find('button').addBack().filter('button').attr('data-hint', '1');
this.btnScrollNext.$el.find('button').addBack().filter('button').attr('data-hint', '1');
this.cntSheetList.$el.find('button').attr('data-hint', '1');
this.cntSheetList.$el.find('button').removeAttr('data-hint-title'); // 'v' hint is used for paste
this.cntZoom.$el.find('.dropdown-toggle').attr('data-hint', '1');
}
this.updateTabbarBorders();
},
@ -610,7 +620,7 @@ define([
if (this.mode.isEdit) {
this.tabbar.addDataHint(_.findIndex(items, function (item) {
return item.sheetindex === sindex;
}));
}), this.mode.isEditOle ? '1' : '0');
}
$('#status-label-zoom').text(Common.Utils.String.format(this.zoomText, Math.floor((this.api.asc_getZoom() +.005)*100)));
@ -699,7 +709,7 @@ define([
}
if (this.mode.isEdit) {
this.tabbar.addDataHint(index);
this.tabbar.addDataHint(index, this.mode.isEditOle ? '1' : '0');
}
this.fireEvent('sheet:changed', [this, tab.sheetindex]);
@ -710,7 +720,7 @@ define([
onTabMenu: function (o, index, tab, select) {
var me = this;
if (this.mode.isEdit && !this.isEditFormula && (this.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.Chart) &&
if (this.mode.isEdit && !this.isEditFormula && (this.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.Chart) &&
(this.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.FormatTable) &&
(this.rangeSelectionMode !== Asc.c_oAscSelectionDialogType.PrintTitles) &&
!this.mode.isDisconnected ) {
@ -745,6 +755,7 @@ define([
this.tabMenu.items[7].setDisabled(select.length>1);
this.tabMenu.items[8].setDisabled(issheetlocked || isdocprotected);
this.tabMenu.items[7].setVisible(!this.mode.isEditOle);
this.tabMenu.items[7].setCaption(this.api.asc_isProtectedSheet() ? this.itemUnProtect : this.itemProtect);
if (select.length === 1) {
@ -890,11 +901,12 @@ define([
}
},
changeViewMode: function (edit) {
changeViewMode: function (mode) {
var edit = mode.isEdit;
if (edit) {
this.tabBarBox.css('left', '175px');
} else {
this.tabBarBox.css('left', '');
this.tabBarBox.css('left', '');
}
this.tabbar.options.draggable = edit;
@ -968,7 +980,7 @@ define([
//this.boxAction.show();
}
this.updateTabbarBorders();
this.onTabInvisible(undefined, this.tabbar.checkInvisible(true));
(this.tabbar.getCount()>0) && this.onTabInvisible(undefined, this.tabbar.checkInvisible(true));
},
updateNumberOfSheet: function (active, count) {

View file

@ -197,7 +197,7 @@ define([
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-copy',
dataHint: '1',
dataHintDirection: config.isEditDiagram ? 'bottom' : 'top',
dataHintDirection: (config.isEditDiagram || config.isEditMailMerge || config.isEditOle) ? 'bottom' : 'top',
dataHintTitle: 'C'
});
@ -207,7 +207,7 @@ define([
iconCls : 'toolbar__icon btn-paste',
lock : [/*_set.editCell,*/ _set.coAuth, _set.lostConnect],
dataHint : '1',
dataHintDirection: config.isEditDiagram ? 'bottom' : 'top',
dataHintDirection: (config.isEditDiagram || config.isEditMailMerge || config.isEditOle) ? 'bottom' : 'top',
dataHintTitle: 'V'
});
@ -235,153 +235,162 @@ define([
dataHintTitle: 'Y'
});
if ( config.isEditDiagram ) {
if (config.isEditDiagram || config.isEditMailMerge || config.isEditOle ) {
me.$layout = $(_.template(simple)(config));
if ( config.isEditDiagram || config.isEditOle ) {
me.btnInsertFormula = new Common.UI.Button({
id : 'id-toolbar-btn-insertformula',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-formula',
split : true,
lock : [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth],
menu : new Common.UI.Menu({
style : 'min-width: 110px',
items : [
{caption: 'SUM', value: 'SUM'},
{caption: 'AVERAGE', value: 'AVERAGE'},
{caption: 'MIN', value: 'MIN'},
{caption: 'MAX', value: 'MAX'},
{caption: 'COUNT', value: 'COUNT'},
{caption: '--'},
{
caption: me.txtAdditional,
value: 'more',
hint: me.txtFormula + Common.Utils.String.platformKey('Shift+F3')
}
]
}),
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
me.btnInsertFormula = new Common.UI.Button({
id : 'id-toolbar-btn-insertformula',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-formula',
split : true,
lock : [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth],
menu : new Common.UI.Menu({
style : 'min-width: 110px',
items : [
{caption: 'SUM', value: 'SUM'},
{caption: 'AVERAGE', value: 'AVERAGE'},
{caption: 'MIN', value: 'MIN'},
{caption: 'MAX', value: 'MAX'},
{caption: 'COUNT', value: 'COUNT'},
{caption: '--'},
{
caption: me.txtAdditional,
value: 'more',
hint: me.txtFormula + Common.Utils.String.platformKey('Shift+F3')
}
]
}),
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
me.btnDecDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-decdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-decdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnDecDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-decdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-decdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnIncDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-incdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-incdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnIncDecimal = new Common.UI.Button({
id : 'id-toolbar-btn-incdecimal',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-incdecimal',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
dataHint : '1',
dataHintDirection: 'bottom'
});
var formatTemplate =
_.template([
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
'<div style="position: relative;"><div style="position: absolute; left: 0; width: 100px;"><%= scope.getDisplayValue(item) %></div>',
'<div style="display: inline-block; width: 100%; max-width: 300px; overflow: hidden; text-overflow: ellipsis; text-align: right; vertical-align: bottom; padding-left: 100px; color: silver;white-space: nowrap;"><%= item.exampleval ? item.exampleval : "" %></div>',
'</div></a></li>',
'<% }); %>',
'<li class="divider">',
'<li id="id-toolbar-mnu-item-more-formats" data-value="-1"><a tabindex="-1" type="menuitem">' + me.textMoreFormats + '</a></li>'
].join(''));
var formatTemplate =
_.template([
'<% _.each(items, function(item) { %>',
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
'<div style="position: relative;"><div style="position: absolute; left: 0; width: 100px;"><%= scope.getDisplayValue(item) %></div>',
'<div style="display: inline-block; width: 100%; max-width: 300px; overflow: hidden; text-overflow: ellipsis; text-align: right; vertical-align: bottom; padding-left: 100px; color: silver;white-space: nowrap;"><%= item.exampleval ? item.exampleval : "" %></div>',
'</div></a></li>',
'<% }); %>',
'<li class="divider">',
'<li id="id-toolbar-mnu-item-more-formats" data-value="-1"><a tabindex="-1" type="menuitem">' + me.textMoreFormats + '</a></li>'
].join(''));
me.cmbNumberFormat = new Common.UI.ComboBox({
cls : 'input-group-nr',
menuStyle : 'min-width: 180px;',
hint : me.tipNumFormat,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth],
itemsTemplate: formatTemplate,
editable : false,
data : me.numFormatData,
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
}
if ( config.isEditDiagram ) {
me.btnEditChart = new Common.UI.Button({
id : 'id-toolbar-rtn-edit-chart',
cls : 'btn-toolbar btn-text-default auto',
caption : me.tipEditChart,
lock : [_set.lostConnect],
style : 'min-width: 120px;',
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
me.cmbNumberFormat = new Common.UI.ComboBox({
cls : 'input-group-nr',
menuStyle : 'min-width: 180px;',
hint : me.tipNumFormat,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth],
itemsTemplate: formatTemplate,
editable : false,
data : me.numFormatData,
dataHint : '1',
dataHintDirection: config.isEditDiagram ? 'bottom' : 'top',
dataHintOffset: config.isEditDiagram ? 'big' : undefined
});
me.btnEditChartData = new Common.UI.Button({
id : 'id-toolbar-rtn-edit-chart-data',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-select-range',
caption : me.tipEditChartData,
lock : [_set.editCell, _set.selRange, _set.selRangeEdit, _set.lostConnect],
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'medium'
});
me.btnEditChart = new Common.UI.Button({
id : 'id-toolbar-rtn-edit-chart',
cls : 'btn-toolbar btn-text-default auto',
caption : me.tipEditChart,
lock : [_set.lostConnect],
style : 'min-width: 120px;',
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
me.btnEditChartType = new Common.UI.Button({
id : 'id-toolbar-rtn-edit-chart-type',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-menu-chart',
caption : me.tipEditChartType,
lock : [_set.editCell, _set.selRange, _set.selRangeEdit, _set.lostConnect],
style : 'min-width: 120px;',
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'medium'
});
}
if ( config.isEditMailMerge || config.isEditOle ) {
me.btnSearch = new Common.UI.Button({
id : 'id-toolbar-btn-search',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-menu-search',
lock : [_set.lostConnect],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnEditChartData = new Common.UI.Button({
id : 'id-toolbar-rtn-edit-chart-data',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-select-range',
caption : me.tipEditChartData,
lock : [_set.editCell, _set.selRange, _set.selRangeEdit, _set.lostConnect],
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'medium'
});
me.btnSortDown = new Common.UI.Button({
id : 'id-toolbar-btn-sort-down',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-sort-down',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnEditChartType = new Common.UI.Button({
id : 'id-toolbar-rtn-edit-chart-type',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-menu-chart',
caption : me.tipEditChartType,
lock : [_set.editCell, _set.selRange, _set.selRangeEdit, _set.lostConnect],
style : 'min-width: 120px;',
dataHint : '1',
dataHintDirection: 'left',
dataHintOffset: 'medium'
});
} else
if ( config.isEditMailMerge ) {
me.$layout = $(_.template(simple)(config));
me.btnSortUp = new Common.UI.Button({
id : 'id-toolbar-btn-sort-up',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-sort-up',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnSearch = new Common.UI.Button({
id : 'id-toolbar-btn-search',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-menu-search',
lock : [_set.lostConnect]
});
me.btnSetAutofilter = new Common.UI.Button({
id : 'id-toolbar-btn-setautofilter',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-autofilter',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
enableToggle: true,
dataHint : '1',
dataHintDirection: 'bottom'
});
me.btnSortDown = new Common.UI.Button({
id : 'id-toolbar-btn-sort-down',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-sort-down',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot]
});
me.btnSortUp = new Common.UI.Button({
id : 'id-toolbar-btn-sort-up',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-sort-up',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot]
});
me.btnSetAutofilter = new Common.UI.Button({
id : 'id-toolbar-btn-setautofilter',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-autofilter',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
enableToggle: true
});
me.btnClearAutofilter = new Common.UI.Button({
id : 'id-toolbar-btn-clearfilter',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-clear-filter',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleDelFilter, _set.editPivot]
});
} else
if ( config.isEdit ) {
me.btnClearAutofilter = new Common.UI.Button({
id : 'id-toolbar-btn-clearfilter',
cls : 'btn-toolbar',
iconCls : 'toolbar__icon btn-clear-filter',
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleDelFilter, _set.editPivot],
dataHint : '1',
dataHintDirection: 'bottom'
});
}
} else if ( config.isEdit ) {
Common.UI.Mixtbar.prototype.initialize.call(this, {
template: _.template(template),
tabs: [
@ -1781,7 +1790,7 @@ define([
});
if ( mode.isEdit ) {
if (!mode.isEditDiagram && !mode.isEditMailMerge) {
if (!mode.isEditDiagram && !mode.isEditMailMerge && !mode.isEditOle) {
var top = Common.localStorage.getItem("sse-pgmargins-top"),
left = Common.localStorage.getItem("sse-pgmargins-left"),
bottom = Common.localStorage.getItem("sse-pgmargins-bottom"),
@ -2361,7 +2370,7 @@ define([
}));
}
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram)
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram && !this.mode.isEditOle)
this.updateMetricUnit();
},
@ -2412,7 +2421,7 @@ define([
setApi: function(api) {
this.api = api;
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram) {
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram && !this.mode.isEditOle) {
this.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(this.onApiCollaborativeChanges, this));
this.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(this.onApiSendThemeColorSchemes, this));
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onApiUsersChanged, this));
@ -2572,7 +2581,7 @@ define([
},
onAppReady: function (config) {
if (!this.mode.isEdit || this.mode.isEditMailMerge || this.mode.isEditDiagram) return;
if (!this.mode.isEdit || this.mode.isEditMailMerge || this.mode.isEditDiagram || this.mode.isEditOle) return;
var me = this;
var _holder_view = SSE.getController('DocumentHolder').getView('DocumentHolder');

View file

@ -2001,6 +2001,8 @@
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
"SSE.Views.DocumentHolder.txtWidth": "Width",
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"SSE.Views.DocumentHolder.chartDataText": "Select Chart Data",
"SSE.Views.DocumentHolder.chartTypeText": "Change Chart Type",
"SSE.Views.FieldSettingsDialog.strLayout": "Layout",
"SSE.Views.FieldSettingsDialog.strSubtotals": "Subtotals",
"SSE.Views.FieldSettingsDialog.textReport": "Report Form",