diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 48fc34f15..330ab1a74 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -73,7 +73,8 @@ define([ 'spreadsheeteditor/main/app/view/AutoFilterDialog', 'spreadsheeteditor/main/app/view/SpecialPasteDialog', 'spreadsheeteditor/main/app/view/SlicerSettingsAdvanced', - 'spreadsheeteditor/main/app/view/PivotGroupDialog' + 'spreadsheeteditor/main/app/view/PivotGroupDialog', + 'spreadsheeteditor/main/app/view/MacroDialog' ], function () { 'use strict'; @@ -244,7 +245,7 @@ define([ view.pmiNumFormat.menu.on('show:after', _.bind(me.onNumberFormatOpenAfter, me)); view.pmiAdvancedNumFormat.on('click', _.bind(me.onCustomNumberFormat, me)); view.tableTotalMenu.on('item:click', _.bind(me.onTotalMenuClick, me)); - + view.menuImgMacro.on('click', _.bind(me.onImgMacro, me)); } else { view.menuViewCopy.on('click', _.bind(me.onCopyPaste, me)); view.menuViewUndo.on('click', _.bind(me.onUndo, me)); @@ -987,6 +988,22 @@ define([ } }, + onImgMacro: function(item) { + var me = this; + + (new SSE.Views.MacroDialog({ + props: {macroList: me.api.asc_getAllMacrosNames(), current: me.api.asc_getCurrentDrawingMacrosName()}, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.asc_assignMacrosToCurrentDrawing(value); + } + } + Common.NotificationCenter.trigger('edit:complete', me); + } + })).show(); + }, + onApiCoAuthoringDisconnect: function() { this.permissions.isEdit = false; }, @@ -1807,6 +1824,8 @@ define([ documentHolder.menuSignatureEditSetup.setVisible(isInSign); documentHolder.menuEditSignSeparator.setVisible(isInSign); + documentHolder.menuImgMacro.setDisabled(isObjLocked); + if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event); documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible() || documentHolder.mnuImgAdvanced.isVisible()); documentHolder.mnuSlicerSeparator.setVisible(documentHolder.mnuSlicerAdvanced.isVisible()); diff --git a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js index 08711f76c..a317f9438 100644 --- a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js @@ -46,9 +46,6 @@ define([ 'backbone', 'gateway', 'common/main/lib/component/Menu' -// 'spreadsheeteditor/main/app/view/HyperlinkSettingsDialog', -// 'spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced', -// 'spreadsheeteditor/main/app/view/TableSettingsAdvanced' ], function ($, _, Backbone, gateway) { 'use strict'; SSE.Views.DocumentHolder = Backbone.View.extend(_.extend({ @@ -820,6 +817,10 @@ define([ }) }); + me.menuImgMacro = new Common.UI.MenuItem({ + caption: me.textMacro + }); + this.imgMenu = new Common.UI.Menu({ cls: 'shifted-right', items: [ @@ -833,6 +834,7 @@ define([ me.menuImageArrange, me.menuImageAlign, me.menuImgRotate, + me.menuImgMacro, me.mnuShapeSeparator, me.menuImgCrop, me.mnuChartEdit, @@ -1247,7 +1249,8 @@ define([ txtCustomSort: 'Custom sort', txtCondFormat: 'Conditional Formatting', textBullets: 'Bullets', - textNumbering: 'Numbering' + textNumbering: 'Numbering', + textMacro: 'Assign Macro' }, SSE.Views.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/MacroDialog.js b/apps/spreadsheeteditor/main/app/view/MacroDialog.js new file mode 100644 index 000000000..f47fa5c8b --- /dev/null +++ b/apps/spreadsheeteditor/main/app/view/MacroDialog.js @@ -0,0 +1,188 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2021 + * + * 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 + * + */ + +/** + * MacroDialog.js + * + * Created by Julia Radzhabova on 16.02.2021 + * Copyright (c) 2021 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'common/main/lib/util/utils', + 'common/main/lib/component/ListView', + 'common/main/lib/component/InputField', + 'common/main/lib/view/AdvancedSettingsWindow' +], function () { 'use strict'; + + SSE.Views.MacroDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ + options: { + contentWidth: 250, + height: 312 + }, + + initialize : function(options) { + var me = this; + + _.extend(this.options, { + title: this.textTitle, + template: [ + '
', + '', + ' | ', + '
', + '', + ' | ', + '
', + '', + ' | ', + '