From e1c6a8baf5aea1f0b497624e4b187f4875a1cdba Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 16 Jun 2022 22:59:46 +0300 Subject: [PATCH 1/2] [DE] Add ligatures to text settings --- apps/common/main/resources/less/common.less | 3 + .../ParagraphSettingsAdvanced.template | 15 +++-- .../app/view/ParagraphSettingsAdvanced.js | 58 ++++++++++++++++++- apps/documenteditor/main/locale/en.json | 17 ++++++ 4 files changed, 87 insertions(+), 6 deletions(-) diff --git a/apps/common/main/resources/less/common.less b/apps/common/main/resources/less/common.less index 0ec08f6e4f..6e37abbb4a 100644 --- a/apps/common/main/resources/less/common.less +++ b/apps/common/main/resources/less/common.less @@ -166,6 +166,9 @@ label { display: block; } + .padding-very-small { + padding-bottom: 4px; + } .padding-small { padding-bottom: 8px; } diff --git a/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template b/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template index 072f11c02b..22de247ca7 100644 --- a/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template +++ b/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template @@ -10,7 +10,7 @@
-
+
@@ -30,7 +30,7 @@
-
+
@@ -119,7 +119,7 @@
-
+
@@ -148,7 +148,7 @@
-
+
@@ -161,6 +161,13 @@
+
+ +
+
+ +
+
diff --git a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js index 3b28e4bda8..2fd57511c7 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js @@ -52,7 +52,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem DE.Views.ParagraphSettingsAdvanced = Common.Views.AdvancedSettingsWindow.extend(_.extend({ options: { contentWidth: 370, - height: 394, + height: 415, toggleGroup: 'paragraph-adv-settings-group', storageName: 'de-para-settings-adv-category' }, @@ -513,6 +513,36 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem }, this)); this.spinners.push(this.numPosition); + this._arrLigatures = [ + {displayValue: this.textNone, value: Asc.LigaturesType.None}, + {displayValue: this.textStandard, value: Asc.LigaturesType.Standard}, + {displayValue: this.textContext, value: Asc.LigaturesType.Contextual}, + {displayValue: this.textHistorical, value: Asc.LigaturesType.Historical}, + {displayValue: this.textDiscret, value: Asc.LigaturesType.Discretional}, + {displayValue: this.textStandardContext, value: Asc.LigaturesType.StandardContextual}, + {displayValue: this.textStandardHistorical, value: Asc.LigaturesType.StandardHistorical}, + {displayValue: this.textContextHistorical, value: Asc.LigaturesType.ContextualHistorical}, + {displayValue: this.textStandardDiscret, value: Asc.LigaturesType.StandardDiscretional}, + {displayValue: this.textContextDiscret, value: Asc.LigaturesType.ContextualDiscretional}, + {displayValue: this.textHistoricalDiscret, value: Asc.LigaturesType.HistoricalDiscretional}, + {displayValue: this.textStandardContextHist, value: Asc.LigaturesType.StandardContextualHistorical}, + {displayValue: this.textStandardContextDiscret, value: Asc.LigaturesType.StandardContextualDiscretional}, + {displayValue: this.textStandardHistDiscret, value: Asc.LigaturesType.StandardHistoricalDiscretional}, + {displayValue: this.textContextHistDiscret, value: Asc.LigaturesType.ContextualHistoricalDiscretional}, + {displayValue: this.textAll, value: Asc.LigaturesType.All} + ]; + this.cmbLigatures = new Common.UI.ComboBox({ + el: $('#paragraphadv-cmb-ligatures'), + cls: 'input-group-nr', + editable: false, + data: this._arrLigatures, + style: 'width: 210px;', + menuStyle : 'min-width: 210px;max-height:135px;', + takeFocusOnClose: true + }); + this.cmbLigatures.setValue(Asc.LigaturesType.None); + this.cmbLigatures.on('selected', _.bind(this.onLigaturesSelect, this)); + // Tabs this.numTab = new Common.UI.MetricSpinner({ el: $('#paraadv-spin-tab'), @@ -941,6 +971,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem this.cmbOutlinelevel.setValue((props.get_OutlineLvl() === undefined || props.get_OutlineLvl()===null) ? -1 : props.get_OutlineLvl()); this.cmbOutlinelevel.setDisabled(!!props.get_OutlineLvlStyle()); + this.cmbLigatures.setValue((props.get_Ligatures() === undefined || props.get_Ligatures()===null) ? '' : props.get_Ligatures()); this._noApply = false; @@ -1487,6 +1518,12 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem } }, + onLigaturesSelect: function(combo, record) { + if (this._changedProps) { + this._changedProps.put_Ligatures(record.value); + } + }, + textTitle: 'Paragraph - Advanced Settings', strIndentsLeftText: 'Left', strIndentsRightText: 'Right', @@ -1558,7 +1595,24 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem strIndentsOutlinelevel: 'Outline level', strIndent: 'Indents', strSpacing: 'Spacing', - strSuppressLineNumbers: 'Suppress line numbers' + strSuppressLineNumbers: 'Suppress line numbers', + textOpenType: 'OpenType Features', + textLigatures: 'Ligatures', + textStandard: 'Standard only', + textContext: 'Contextual', + textHistorical: 'Historical', + textDiscret: 'Discretionary', + textStandardContext: 'Standard and Contextual', + textStandardHistorical: 'Standard and Historical', + textStandardDiscret: 'Standard and Discretionary', + textContextHistorical: 'Contextual and Historical', + textContextDiscret: 'Contextual and Discretionary', + textHistoricalDiscret: 'Historical and Discretionary', + textStandardContextHist: 'Standard, Contextual and Historical', + textStandardContextDiscret: 'Standard, Contextual and Discretionary', + textStandardHistDiscret: 'Standard, Historical and Discretionary', + textContextHistDiscret: 'Contextual, Historical and Discretionary', + textAll: 'All' }, DE.Views.ParagraphSettingsAdvanced || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index a35f3135db..41a300d34d 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -2333,6 +2333,23 @@ "DE.Views.ParagraphSettingsAdvanced.tipTop": "Set top border only", "DE.Views.ParagraphSettingsAdvanced.txtAutoText": "Auto", "DE.Views.ParagraphSettingsAdvanced.txtNoBorders": "No borders", + "DE.Views.ParagraphSettingsAdvanced.textOpenType": "OpenType Features", + "DE.Views.ParagraphSettingsAdvanced.textLigatures": "Ligatures", + "DE.Views.ParagraphSettingsAdvanced.textStandard": "Standard only", + "DE.Views.ParagraphSettingsAdvanced.textContext": "Contextual", + "DE.Views.ParagraphSettingsAdvanced.textHistorical": "Historical", + "DE.Views.ParagraphSettingsAdvanced.textDiscret": "Discretionary", + "DE.Views.ParagraphSettingsAdvanced.textStandardContext": "Standard and Contextual", + "DE.Views.ParagraphSettingsAdvanced.textStandardHistorical": "Standard and Historical", + "DE.Views.ParagraphSettingsAdvanced.textStandardDiscret": "Standard and Discretionary", + "DE.Views.ParagraphSettingsAdvanced.textContextHistorical": "Contextual and Historical", + "DE.Views.ParagraphSettingsAdvanced.textContextDiscret": "Contextual and Discretionary", + "DE.Views.ParagraphSettingsAdvanced.textHistoricalDiscret": "Historical and Discretionary", + "DE.Views.ParagraphSettingsAdvanced.textStandardContextHist": "Standard, Contextual and Historical", + "DE.Views.ParagraphSettingsAdvanced.textStandardContextDiscret": "Standard, Contextual and Discretionary", + "DE.Views.ParagraphSettingsAdvanced.textStandardHistDiscret": "Standard, Historical and Discretionary", + "DE.Views.ParagraphSettingsAdvanced.textContextHistDiscret": "Contextual, Historical and Discretionary", + "DE.Views.ParagraphSettingsAdvanced.textAll": "All", "DE.Views.RightMenu.txtChartSettings": "Chart settings", "DE.Views.RightMenu.txtFormSettings": "Form Settings", "DE.Views.RightMenu.txtHeaderFooterSettings": "Header and footer settings", From 69d47e82c98e5d781630fa6e02d06d9435fad125 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 16 Jun 2022 23:06:22 +0300 Subject: [PATCH 2/2] Refactoring --- .../main/app/template/HeaderFooterDialog.template | 4 ++-- .../main/app/template/ParagraphSettingsAdvanced.template | 8 ++++---- .../main/app/template/FormatRulesEditDlg.template | 2 +- .../main/app/template/ParagraphSettingsAdvanced.template | 8 ++++---- .../main/app/template/SlicerSettingsAdvanced.template | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/presentationeditor/main/app/template/HeaderFooterDialog.template b/apps/presentationeditor/main/app/template/HeaderFooterDialog.template index 84822e306f..386e70baed 100644 --- a/apps/presentationeditor/main/app/template/HeaderFooterDialog.template +++ b/apps/presentationeditor/main/app/template/HeaderFooterDialog.template @@ -5,7 +5,7 @@ - @@ -20,7 +20,7 @@ - diff --git a/apps/presentationeditor/main/app/template/ParagraphSettingsAdvanced.template b/apps/presentationeditor/main/app/template/ParagraphSettingsAdvanced.template index 286baadade..397e41ebd3 100644 --- a/apps/presentationeditor/main/app/template/ParagraphSettingsAdvanced.template +++ b/apps/presentationeditor/main/app/template/ParagraphSettingsAdvanced.template @@ -6,7 +6,7 @@
-
+
@@ -26,7 +26,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
+
+
@@ -84,7 +84,7 @@
-
+
diff --git a/apps/spreadsheeteditor/main/app/template/FormatRulesEditDlg.template b/apps/spreadsheeteditor/main/app/template/FormatRulesEditDlg.template index f5a40a45a0..4203e1897a 100644 --- a/apps/spreadsheeteditor/main/app/template/FormatRulesEditDlg.template +++ b/apps/spreadsheeteditor/main/app/template/FormatRulesEditDlg.template @@ -91,7 +91,7 @@ - + diff --git a/apps/spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.template b/apps/spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.template index 286baadade..397e41ebd3 100644 --- a/apps/spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.template +++ b/apps/spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.template @@ -6,7 +6,7 @@
-
+
@@ -26,7 +26,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
@@ -84,7 +84,7 @@
-
+
diff --git a/apps/spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.template b/apps/spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.template index 1ebab47388..93668bc1ab 100644 --- a/apps/spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.template +++ b/apps/spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.template @@ -7,11 +7,11 @@
-
+
-
+
@@ -23,7 +23,7 @@
-
+