From 52e812fcb440aadf3dc8de1dbdb42300f5ad4ecd Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 20 Jul 2018 12:55:03 +0300 Subject: [PATCH] [DE] Add numbering settings to table context menu --- .../main/app/view/DocumentHolder.js | 42 ++++++++++++++++++- apps/documenteditor/main/locale/en.json | 1 + 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index e030bdca0..eecb104c9 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -2781,6 +2781,30 @@ define([ }) }); + var menuTableStartNewList = new Common.UI.MenuItem({ + caption: me.textStartNewList + }).on('click', _.bind(me.onStartNumbering, me, 1)); + + var menuTableStartNumberingFrom = new Common.UI.MenuItem({ + caption: me.textStartNumberingFrom + }).on('click', _.bind(me.onStartNumbering, me, 'advanced')); + + var menuTableContinueNumbering = new Common.UI.MenuItem({ + caption: me.textContinueNumbering + }).on('click', _.bind(me.onContinueNumbering, me)); + + var menuNumberingTable = new Common.UI.MenuItem({ + caption : me.bulletsText, + menu : new Common.UI.Menu({ + menuAlign: 'tl-tr', + items : [ + menuTableStartNewList, + menuTableStartNumberingFrom, + menuTableContinueNumbering + ] + }) + }); + this.tableMenu = new Common.UI.Menu({ initMenu: function(value){ // table properties @@ -2824,6 +2848,18 @@ define([ menuTableCut.setDisabled(disabled || !cancopy); menuTablePaste.setDisabled(disabled); + // bullets & numbering + var listId = me.api.asc_GetCurrentNumberingId(), + in_list = (listId !== null); + menuNumberingTable.setVisible(in_list); + if (in_list) { + var format = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()).get_Format(); + menuTableStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet); + menuTableStartNumberingFrom.value = format; + menuTableStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList); + menuTableContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering); + } + // hyperlink properties var text = null; if (me.api) { @@ -2831,7 +2867,7 @@ define([ } menuAddHyperlinkTable.setVisible(value.hyperProps===undefined && text!==false); menuHyperlinkTable.setVisible(value.hyperProps!==undefined); - menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible()); + menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() || menuNumberingTable.isVisible()); menuEditHyperlinkTable.hyperProps = value.hyperProps; menuRemoveHyperlinkTable.hyperProps = value.hyperProps; @@ -3006,6 +3042,7 @@ define([ /** coauthoring begin **/ menuAddCommentTable, /** coauthoring end **/ + menuNumberingTable, menuAddHyperlinkTable, menuHyperlinkTable, menuHyperlinkSeparator, @@ -3840,7 +3877,8 @@ define([ textContinueNumbering: 'Continue numbering', textSeparateList: 'Separate list', textJoinList: 'Join to previous list', - textNumberingValue: 'Numbering Value' + textNumberingValue: 'Numbering Value', + bulletsText: 'Bullets and Numbering' }, DE.Views.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 406531990..b2522d08c 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1049,6 +1049,7 @@ "DE.Views.DocumentHolder.textSeparateList": "Separate list", "DE.Views.DocumentHolder.textJoinList": "Join to previous list", "DE.Views.DocumentHolder.textNumberingValue": "Numbering Value", + "DE.Views.DocumentHolder.bulletsText": "Bullets and Numbering", "DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel", "DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok", "DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",