From 5c1485065e5abeb7a4b80c28b1c515f38d26a7e5 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Thu, 1 Jun 2023 13:07:12 +0300 Subject: [PATCH 1/6] update btnInsertSymbol --- .../main/app/controller/Toolbar.js | 8 ++- apps/documenteditor/main/app/view/Toolbar.js | 51 ++++++++++++++++++- apps/documenteditor/main/locale/en.json | 1 + .../main/resources/less/toolbar.less | 25 +++++++++ .../main/app/controller/Toolbar.js | 8 ++- .../main/app/view/Toolbar.js | 51 ++++++++++++++++++- apps/presentationeditor/main/locale/en.json | 1 + .../main/resources/less/toolbar.less | 25 +++++++++ .../main/app/controller/Toolbar.js | 8 ++- .../main/app/view/Toolbar.js | 51 ++++++++++++++++++- apps/spreadsheeteditor/main/locale/en.json | 1 + .../main/resources/less/toolbar.less | 25 +++++++++ 12 files changed, 249 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index ff6f62350e..e538406040 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -374,7 +374,8 @@ define([ toolbar.listStyles.on('contextmenu', _.bind(this.onListStyleContextMenu, this)); toolbar.styleMenu.on('hide:before', _.bind(this.onListStyleBeforeHide, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); - toolbar.btnInsertSymbol.on('click', _.bind(this.onInsertSymbolClick, this)); + toolbar.btnInsertSymbol.menu.items[2].on('click', _.bind(this.onInsertSymbolClick, this)); + toolbar.mnuInsertSymbolsPicker.on('item:click', _.bind(this.onInsertSymbolItemClick, this)); toolbar.mnuNoControlsColor.on('click', _.bind(this.onNoControlsColor, this)); toolbar.mnuControlsColorPicker.on('select', _.bind(this.onSelectControlsColor, this)); toolbar.btnLineNumbers.menu.on('item:click', _.bind(this.onLineNumbersSelect, this)); @@ -2908,6 +2909,11 @@ define([ } }, + onInsertSymbolItemClick: function(picker, item, record, e) { + if (this.api && record) + this.api.asc_insertSymbol(record.font ? record.get('font') : this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), record.get('code'), record.get('special')); + }, + onApiMathTypes: function(equation) { this._equationTemp = equation; var me = this; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index f86d7ffec8..b235b41cc0 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -825,6 +825,16 @@ define([ lock: [_set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.richDelLock, _set.plainDelLock, _set.noParagraphSelected, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments], caption: me.capBtnInsSymbol, + menu: new Common.UI.Menu({ + style: 'min-width: 100px;', + items: [ + {template: _.template('
')}, + {caption: '--'}, + this.mnuHighlightTransparent = new Common.UI.MenuItem({ + caption: this.textMoreSymbols + }) + ] + }), dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -2353,6 +2363,44 @@ define([ // set dataviews + this.mnuInsertSymbolsPicker = new Common.UI.DataView({ + el: $('#id-toolbar-menu-symbols'), + parentMenu: this.btnInsertSymbol.menu, + outerMenu: {menu: this.btnInsertSymbol.menu, index:0}, + restoreHeight: 290, + delayRenderTips: true, + scrollAlwaysVisible: true, + store: new Common.UI.DataViewStore([ + { symbol: '2022', code: 8226}, + { symbol: '20AC', code: 8364}, + { symbol: 'FF04', code: 65284}, + { symbol: '00A5', code: 165}, + { symbol: '00A9', code: 169}, + { symbol: '00AE', code: 174}, + { symbol: '00BD', code: 189}, + { symbol: '00BC', code: 188}, + { symbol: '2260', code: 8800}, + { symbol: '00B1', code: 177}, + { symbol: '00F7', code: 247}, + { symbol: '221A', code: 8730}, + { symbol: '2264', code: 8804}, //{ symbol: '2A7D', htmlCode: 10877}, + { symbol: '2265', code: 8805}, //{ symbol: '2A7E', code: 10878}, + { symbol: '2122', code: 8482}, + { symbol: '221E', code: 8734}, + { symbol: '007E', code: 126}, + { symbol: '00B0', code: 176}, + { symbol: '00A7', code: 167}, + { symbol: '03B1', code: 945}, + { symbol: '03B2', code: 946}, + { symbol: '03C0', code: 960}, //{ symbol: '03C0', code: 937}, + { symbol: '0394', code: 916}, + { symbol: '263A', code: 9786}, + { symbol: '2665', code: 9829} + ]), + itemTemplate: _.template('
&#<%= code %>') + }); + this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); + var _conf = this.mnuMarkersPicker.conf; this._markersArr = [ '{"Type":"remove"}', @@ -3144,7 +3192,8 @@ define([ txtGroupBulletDoc: 'Document bullets', txtGroupNumDoc: 'Document numbering formats', txtGroupMultiDoc: 'Lists in current document', - textTabDraw: 'Draw' + textTabDraw: 'Draw', + textMoreSymbols: 'More symbols' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 10defb4ca0..8a646ec63b 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -3232,6 +3232,7 @@ "DE.Views.Toolbar.textMarginsNormal": "Normal", "DE.Views.Toolbar.textMarginsUsNormal": "US Normal", "DE.Views.Toolbar.textMarginsWide": "Wide", + "DE.Views.Toolbar.textMoreSymbols": "More symbols", "DE.Views.Toolbar.textNewColor": "More Colors", "DE.Views.Toolbar.textNextPage": "Next page", "DE.Views.Toolbar.textNoHighlight": "No highlighting", diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index d98a27ffbe..69cc1803f8 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -29,6 +29,31 @@ background-color: transparent; } +#id-toolbar-menu-symbols { + display: inline-block; + width: 160px; + padding-left: 3px; + .item { + .box-shadow(none); + margin-left: 6px; + &:hover{ + .box-shadow( 0 0 0 2px @border-preview-select-ie); + .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); + } + } + .item-symbol { + font-family: @font-family-base;//Arial; + font-size: 14px; + display: block; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + vertical-align: middle; + + } +} + .item-markerlist { width: 40px; height: 40px; diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 5874d6af69..7079dbd4b2 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -358,7 +358,8 @@ define([ toolbar.btnSlideSize.menu.on('item:click', _.bind(this.onSlideSize, this)); toolbar.listTheme.on('click', _.bind(this.onListThemeSelect, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); - toolbar.btnInsertSymbol.on('click', _.bind(this.onInsertSymbolClick, this)); + toolbar.btnInsertSymbol.menu.items[2].on('click', _.bind(this.onInsertSymbolClick, this)); + toolbar.mnuInsertSymbolsPicker.on('item:click', _.bind(this.onInsertSymbolItemClick, this)); toolbar.btnEditHeader.on('click', _.bind(this.onEditHeaderClick, this, 'header')); toolbar.btnInsDateTime.on('click', _.bind(this.onEditHeaderClick, this, 'datetime')); toolbar.btnInsSlideNum.on('click', _.bind(this.onEditHeaderClick, this, 'slidenum')); @@ -2363,6 +2364,11 @@ define([ } }, + onInsertSymbolItemClick: function(picker, item, record, e) { + if (this.api && record) + this.api.asc_insertSymbol(record.font ? record.get('font') : this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), record.get('code'), record.get('special')); + }, + onApiMathTypes: function(equation) { this._equationTemp = equation; var me = this; diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 4292484524..9241737c4b 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -800,6 +800,16 @@ define([ iconCls: 'toolbar__icon btn-symbol', caption: me.capBtnInsSymbol, lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected], + menu: new Common.UI.Menu({ + style: 'min-width: 100px;', + items: [ + {template: _.template('
')}, + {caption: '--'}, + this.mnuHighlightTransparent = new Common.UI.MenuItem({ + caption: this.textMoreSymbols + }) + ] + }), dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -1622,6 +1632,44 @@ define([ // set dataviews + this.mnuInsertSymbolsPicker = new Common.UI.DataView({ + el: $('#id-toolbar-menu-symbols'), + parentMenu: this.btnInsertSymbol.menu, + outerMenu: {menu: this.btnInsertSymbol.menu, index:0}, + restoreHeight: 290, + delayRenderTips: true, + scrollAlwaysVisible: true, + store: new Common.UI.DataViewStore([ + { symbol: '2022', code: 8226}, + { symbol: '20AC', code: 8364}, + { symbol: 'FF04', code: 65284}, + { symbol: '00A5', code: 165}, + { symbol: '00A9', code: 169}, + { symbol: '00AE', code: 174}, + { symbol: '00BD', code: 189}, + { symbol: '00BC', code: 188}, + { symbol: '2260', code: 8800}, + { symbol: '00B1', code: 177}, + { symbol: '00F7', code: 247}, + { symbol: '221A', code: 8730}, + { symbol: '2264', code: 8804}, //{ symbol: '2A7D', htmlCode: 10877}, + { symbol: '2265', code: 8805}, //{ symbol: '2A7E', code: 10878}, + { symbol: '2122', code: 8482}, + { symbol: '221E', code: 8734}, + { symbol: '007E', code: 126}, + { symbol: '00B0', code: 176}, + { symbol: '00A7', code: 167}, + { symbol: '03B1', code: 945}, + { symbol: '03B2', code: 946}, + { symbol: '03C0', code: 960}, //{ symbol: '03C0', code: 937}, + { symbol: '0394', code: 916}, + { symbol: '263A', code: 9786}, + { symbol: '2665', code: 9829} + ]), + itemTemplate: _.template('
&#<%= code %>') + }); + this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); + this._markersArr = [ 'undefined', '{"bulletTypeface":{"type":"bufont","typeface":"Symbol"},"bulletType":{"type":"char","char":"ยท","startAt":null}}', @@ -2222,7 +2270,8 @@ define([ mniInsertSSE: 'Insert Spreadsheet', tipSelectAll: 'Select all', tipCut: 'Cut', - textTabDraw: 'Draw' + textTabDraw: 'Draw', + textMoreSymbols: 'More symbols' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 689229ab30..3be842894c 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2544,6 +2544,7 @@ "PE.Views.Toolbar.textColumnsTwo": "Two Columns", "PE.Views.Toolbar.textItalic": "Italic", "PE.Views.Toolbar.textListSettings": "List Settings", + "PE.Views.Toolbar.textMoreSymbols": "More symbols", "PE.Views.Toolbar.textRecentlyUsed": "Recently Used", "PE.Views.Toolbar.textShapeAlignBottom": "Align Bottom", "PE.Views.Toolbar.textShapeAlignCenter": "Align Center", diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 888ff9635f..ce31f9fe7f 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -48,6 +48,31 @@ } } +#id-toolbar-menu-symbols { + display: inline-block; + width: 160px; + padding-left: 3px; + .item { + .box-shadow(none); + margin-left: 6px; + &:hover{ + .box-shadow( 0 0 0 2px @border-preview-select-ie); + .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); + } + } + .item-symbol { + display: block; + font-family: @font-family-base; + font-size: 14px; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + vertical-align: middle; + + } +} + .item-markerlist { width: 40px; height: 40px; diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index bb04151917..b23df7dc7f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -423,7 +423,8 @@ define([ toolbar.btnInsertText.menu.on('item:click', _.bind(this.onMenuInsertTextClick, this)); toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this)); toolbar.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this)); - toolbar.btnInsertSymbol.on('click', _.bind(this.onInsertSymbolClick, this)); + toolbar.btnInsertSymbol.menu.items[2].on('click', _.bind(this.onInsertSymbolClick, this)); + toolbar.mnuInsertSymbolsPicker.on('item:click', _.bind(this.onInsertSymbolItemClick, this)); toolbar.btnInsertSlicer.on('click', _.bind(this.onInsertSlicerClick, this)); toolbar.btnTableTemplate.menu.on('show:after', _.bind(this.onTableTplMenuOpen, this)); toolbar.btnPercentStyle.on('click', _.bind(this.onNumberFormat, this)); @@ -4092,6 +4093,11 @@ define([ } }, + onInsertSymbolItemClick: function(picker, item, record, e) { + if (this.api && record) + this.api.asc_insertSymbol(record.font ? record.get('font') : this.api.asc_getCellInfo().asc_getXfs().asc_getFontName(), record.get('code'), record.get('special')); + }, + onInsertSlicerClick: function() { var me = this, props = me.api.asc_beforeInsertSlicer(); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 321578f3dd..0b1607176a 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1333,6 +1333,16 @@ define([ iconCls: 'toolbar__icon btn-symbol', caption: me.capBtnInsSymbol, lock: [_set.selImage, _set.selChart, _set.selShape, _set.editFormula, _set.selRangeEdit, _set.selSlicer, _set.coAuth, _set.coAuthText, _set.lostConnect], + menu: new Common.UI.Menu({ + style: 'min-width: 100px;', + items: [ + {template: _.template('
')}, + {caption: '--'}, + this.mnuHighlightTransparent = new Common.UI.MenuItem({ + caption: this.textMoreSymbols + }) + ] + }), dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -2749,6 +2759,44 @@ define([ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt); } + this.mnuInsertSymbolsPicker = new Common.UI.DataView({ + el: $('#id-toolbar-menu-symbols'), + parentMenu: this.btnInsertSymbol.menu, + outerMenu: {menu: this.btnInsertSymbol.menu, index:0}, + restoreHeight: 290, + delayRenderTips: true, + scrollAlwaysVisible: true, + store: new Common.UI.DataViewStore([ + { symbol: '2022', code: 8226}, + { symbol: '20AC', code: 8364}, + { symbol: 'FF04', code: 65284}, + { symbol: '00A5', code: 165}, + { symbol: '00A9', code: 169}, + { symbol: '00AE', code: 174}, + { symbol: '00BD', code: 189}, + { symbol: '00BC', code: 188}, + { symbol: '2260', code: 8800}, + { symbol: '00B1', code: 177}, + { symbol: '00F7', code: 247}, + { symbol: '221A', code: 8730}, + { symbol: '2264', code: 8804}, + { symbol: '2265', code: 8805}, + { symbol: '2122', code: 8482}, + { symbol: '221E', code: 8734}, + { symbol: '007E', code: 126}, + { symbol: '00B0', code: 176}, + { symbol: '00A7', code: 167}, + { symbol: '03B1', code: 945}, + { symbol: '03B2', code: 946}, + { symbol: '03C0', code: 960}, + { symbol: '0394', code: 916}, + { symbol: '263A', code: 9786}, + { symbol: '2665', code: 9829} + ]), + itemTemplate: _.template('
&#<%= code %>') + }); + this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); + if (this.btnCondFormat && this.btnCondFormat.rendered) { this.btnCondFormat.setMenu( new Common.UI.Menu({ items: [ @@ -3511,6 +3559,7 @@ define([ mniLowerCase: 'lowercase', mniUpperCase: 'UPPERCASE', mniCapitalizeWords: 'Capitalize Each Word', - mniToggleCase: 'tOGGLE cASE' + mniToggleCase: 'tOGGLE cASE', + textMoreSymbols: 'More symbols' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 70d200da6b..afc3c67394 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3881,6 +3881,7 @@ "SSE.Views.Toolbar.textMiddleBorders": "Inside horizontal borders", "SSE.Views.Toolbar.textMoreFormats": "More formats", "SSE.Views.Toolbar.textMorePages": "More pages", + "SSE.Views.Toolbar.textMoreSymbols": "More symbols", "SSE.Views.Toolbar.textNewColor": "More colors", "SSE.Views.Toolbar.textNewRule": "New rule", "SSE.Views.Toolbar.textNoBorders": "No borders", diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index 3f3e075dec..5cffc0bec7 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -126,6 +126,31 @@ } } +#id-toolbar-menu-symbols { + display: inline-block; + width: 160px; + padding-left: 3px; + .item { + .box-shadow(none); + margin-left: 6px; + &:hover{ + .box-shadow( 0 0 0 2px @border-preview-select-ie); + .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); + } + } + .item-symbol { + font-family: @font-family-base;//Arial; + font-size: 14px; + display: block; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + vertical-align: middle; + + } +} + .item-markerlist { width: 40px; height: 40px; From 17dbd0846f2babf0870acf54a5193ad52066f1f5 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Tue, 6 Jun 2023 20:15:20 +0300 Subject: [PATCH 2/6] btnInsertSymbol fix bug --- apps/documenteditor/main/app/view/Toolbar.js | 11 +++++++---- apps/documenteditor/main/resources/less/toolbar.less | 2 +- apps/presentationeditor/main/app/view/Toolbar.js | 11 +++++++---- .../main/resources/less/toolbar.less | 2 +- apps/spreadsheeteditor/main/app/view/Toolbar.js | 5 ++++- .../main/resources/less/toolbar.less | 4 ++-- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index b235b41cc0..1c6c2ef341 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -830,7 +830,7 @@ define([ items: [ {template: _.template('
')}, {caption: '--'}, - this.mnuHighlightTransparent = new Common.UI.MenuItem({ + new Common.UI.MenuItem({ caption: this.textMoreSymbols }) ] @@ -2383,8 +2383,8 @@ define([ { symbol: '00B1', code: 177}, { symbol: '00F7', code: 247}, { symbol: '221A', code: 8730}, - { symbol: '2264', code: 8804}, //{ symbol: '2A7D', htmlCode: 10877}, - { symbol: '2265', code: 8805}, //{ symbol: '2A7E', code: 10878}, + { symbol: '2264', code: 8804}, + { symbol: '2265', code: 8805}, { symbol: '2122', code: 8482}, { symbol: '221E', code: 8734}, { symbol: '007E', code: 126}, @@ -2392,7 +2392,7 @@ define([ { symbol: '00A7', code: 167}, { symbol: '03B1', code: 945}, { symbol: '03B2', code: 946}, - { symbol: '03C0', code: 960}, //{ symbol: '03C0', code: 937}, + { symbol: '03C0', code: 960}, { symbol: '0394', code: 916}, { symbol: '263A', code: 9786}, { symbol: '2665', code: 9829} @@ -2400,6 +2400,9 @@ define([ itemTemplate: _.template('
&#<%= code %>') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); + this.btnInsertSymbol.menu.on('show:before', _.bind(function() { + this.mnuInsertSymbolsPicker.deselectAll(); + }, this)); var _conf = this.mnuMarkersPicker.conf; this._markersArr = [ diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index 69cc1803f8..d07b41c464 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -36,7 +36,7 @@ .item { .box-shadow(none); margin-left: 6px; - &:hover{ + &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); } diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 9241737c4b..a39331c40e 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -805,7 +805,7 @@ define([ items: [ {template: _.template('
')}, {caption: '--'}, - this.mnuHighlightTransparent = new Common.UI.MenuItem({ + new Common.UI.MenuItem({ caption: this.textMoreSymbols }) ] @@ -1652,8 +1652,8 @@ define([ { symbol: '00B1', code: 177}, { symbol: '00F7', code: 247}, { symbol: '221A', code: 8730}, - { symbol: '2264', code: 8804}, //{ symbol: '2A7D', htmlCode: 10877}, - { symbol: '2265', code: 8805}, //{ symbol: '2A7E', code: 10878}, + { symbol: '2264', code: 8804}, + { symbol: '2265', code: 8805}, { symbol: '2122', code: 8482}, { symbol: '221E', code: 8734}, { symbol: '007E', code: 126}, @@ -1661,7 +1661,7 @@ define([ { symbol: '00A7', code: 167}, { symbol: '03B1', code: 945}, { symbol: '03B2', code: 946}, - { symbol: '03C0', code: 960}, //{ symbol: '03C0', code: 937}, + { symbol: '03C0', code: 960}, { symbol: '0394', code: 916}, { symbol: '263A', code: 9786}, { symbol: '2665', code: 9829} @@ -1669,6 +1669,9 @@ define([ itemTemplate: _.template('
&#<%= code %>') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); + this.btnInsertSymbol.menu.on('show:before', _.bind(function() { + this.mnuInsertSymbolsPicker.deselectAll(); + }, this)); this._markersArr = [ 'undefined', diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index ce31f9fe7f..dc564332b4 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -55,7 +55,7 @@ .item { .box-shadow(none); margin-left: 6px; - &:hover{ + &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); } diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 0b1607176a..a3bc165925 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1338,7 +1338,7 @@ define([ items: [ {template: _.template('
')}, {caption: '--'}, - this.mnuHighlightTransparent = new Common.UI.MenuItem({ + new Common.UI.MenuItem({ caption: this.textMoreSymbols }) ] @@ -2796,6 +2796,9 @@ define([ itemTemplate: _.template('
&#<%= code %>') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); + this.btnInsertSymbol.menu.on('show:before', _.bind(function() { + this.mnuInsertSymbolsPicker.deselectAll(); + }, this)); if (this.btnCondFormat && this.btnCondFormat.rendered) { this.btnCondFormat.setMenu( new Common.UI.Menu({ diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index 5cffc0bec7..bfe7a3de9a 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -133,9 +133,9 @@ .item { .box-shadow(none); margin-left: 6px; - &:hover{ + &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); - .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); + .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select-ie); } } .item-symbol { From e2ff4c1e69500e7da129243edc51982cd08c4853 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Thu, 8 Jun 2023 02:26:10 +0300 Subject: [PATCH 3/6] Add recent symbols --- .../main/app/controller/Toolbar.js | 12 ++- apps/documenteditor/main/app/view/Toolbar.js | 91 ++++++++++++------ .../main/app/controller/Toolbar.js | 13 ++- .../main/app/view/Toolbar.js | 92 +++++++++++++------ .../main/app/controller/Toolbar.js | 12 ++- .../main/app/view/Toolbar.js | 92 +++++++++++++------ 6 files changed, 216 insertions(+), 96 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index e538406040..f4a3b6a643 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2894,14 +2894,14 @@ define([ buttons: [{value: 'ok', caption: this.textInsert}, 'close'], handler: function(dlg, result, settings) { if (result == 'ok') { - me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special); } else Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); me.dlgSymbolTable.show(); me.dlgSymbolTable.on('symbol:dblclick', function(cmp, result, settings) { - me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special); }); me.dlgSymbolTable.on('close', function(obj){ Common.NotificationCenter.trigger('edit:complete', me.toolbar); @@ -2911,7 +2911,13 @@ define([ onInsertSymbolItemClick: function(picker, item, record, e) { if (this.api && record) - this.api.asc_insertSymbol(record.font ? record.get('font') : this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), record.get('code'), record.get('special')); + this.insertSymbol(record.get('font'), record.get('symbol'), record.get('special')); + }, + + insertSymbol: function(fontRecord, symbol, special){ + var font = fontRecord ? fontRecord: this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(); + this.api.asc_insertSymbol(font, symbol, special); + this.toolbar.saveSymbol(symbol, font); }, onApiMathTypes: function(equation) { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 1c6c2ef341..e18e163ccf 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2362,7 +2362,7 @@ define([ })); // set dataviews - + this.symbolsArr = this.loadRecentSymbolsFromStorage(); this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -2370,34 +2370,8 @@ define([ restoreHeight: 290, delayRenderTips: true, scrollAlwaysVisible: true, - store: new Common.UI.DataViewStore([ - { symbol: '2022', code: 8226}, - { symbol: '20AC', code: 8364}, - { symbol: 'FF04', code: 65284}, - { symbol: '00A5', code: 165}, - { symbol: '00A9', code: 169}, - { symbol: '00AE', code: 174}, - { symbol: '00BD', code: 189}, - { symbol: '00BC', code: 188}, - { symbol: '2260', code: 8800}, - { symbol: '00B1', code: 177}, - { symbol: '00F7', code: 247}, - { symbol: '221A', code: 8730}, - { symbol: '2264', code: 8804}, - { symbol: '2265', code: 8805}, - { symbol: '2122', code: 8482}, - { symbol: '221E', code: 8734}, - { symbol: '007E', code: 126}, - { symbol: '00B0', code: 176}, - { symbol: '00A7', code: 167}, - { symbol: '03B1', code: 945}, - { symbol: '03B2', code: 946}, - { symbol: '03C0', code: 960}, - { symbol: '0394', code: 916}, - { symbol: '263A', code: 9786}, - { symbol: '2665', code: 9829} - ]), - itemTemplate: _.template('
&#<%= code %>') + store: new Common.UI.DataViewStore(this.symbolsArr), + itemTemplate: _.template('
style ="font-family: <%= font %>"<% } %>>&#<%= symbol %>
') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); this.btnInsertSymbol.menu.on('show:before', _.bind(function() { @@ -2916,6 +2890,65 @@ define([ this.btnPageMargins.menu.items[0].setVisible(false); }, + loadRecentSymbolsFromStorage: function(){ + var recents = Common.localStorage.getItem('de-fastRecentSymbols'); + if(!!recents) + return JSON.parse(recents); + return [ + { symbol: 8226, font: 'Arial', tip: 'Symbol: 8226'}, + { symbol: 8364, font: 'Arial', tip: 'Symbol: 8364'}, + { symbol: 65284, font: 'Arial', tip: 'Symbol: 65284'}, + { symbol: 165, font: 'Arial', tip: 'Symbol: 165'}, + { symbol: 169, font: 'Arial', tip: 'Symbol: 169'}, + { symbol: 174, font: 'Arial', tip: 'Symbol: 174'}, + { symbol: 189, font: 'Arial', tip: 'Symbol: 189'}, + { symbol: 188, font: 'Arial', tip: 'Symbol: 188'}, + { symbol: 8800, font: 'Arial', tip: 'Symbol: 8800'}, + { symbol: 177, font: 'Arial', tip: 'Symbol: 177'}, + { symbol: 247, font: 'Arial', tip: 'Symbol: 247'}, + { symbol: 8730, font: 'Arial', tip: 'Symbol: 8730'}, + { symbol: 8804, font: 'Arial', tip: 'Symbol: 8804'}, + { symbol: 8805, font: 'Arial', tip: 'Symbol: 8805'}, + { symbol: 8482, font: 'Arial', tip: 'Symbol: 8482'}, + { symbol: 8734, font: 'Arial', tip: 'Symbol: 8734'}, + { symbol: 126, font: 'Arial', tip: 'Symbol: 126'}, + { symbol: 176, font: 'Arial', tip: 'Symbol: 176'}, + { symbol: 167, font: 'Arial', tip: 'Symbol: 167'}, + { symbol: 945, font: 'Arial', tip: 'Symbol: 945'}, + { symbol: 946, font: 'Arial', tip: 'Symbol: 946'}, + { symbol: 960, font: 'Arial', tip: 'Symbol: 960'}, + { symbol: 916, font: 'Arial', tip: 'Symbol: 916'}, + { symbol: 9786, font: 'Arial', tip: 'Symbol: 9786'}, + { symbol: 9829, font: 'Arial', tip: 'Symbol: 9829'} + ]; + }, + + saveSymbol: function(symbol, font) { + var maxLength =25; + if(this.symbolsArr.length === 0){ + this.symbolsArr.push({symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); + this.saveRecentSymbolsToStorage(); + return; + } + for(var i = 0; i < this.symbolsArr.length; ++i){ + if(this.symbolsArr[i].symbol === symbol && this.symbolsArr[i].font === font){ + this.symbolsArr.splice(i, 1); + break; + } + } + this.symbolsArr.splice(0, 0, {symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); + if(this.symbolsArr.length > maxLength){ + this.symbolsArr.splice(maxLength, this.symbolsArr.length - maxLength); + } + this.saveRecentSymbolsToStorage(); + }, + + saveRecentSymbolsToStorage: function(){ + var sJSON = JSON.stringify(this.symbolsArr); + Common.localStorage.setItem( 'de-fastRecentSymbols', sJSON); + this.mnuInsertSymbolsPicker.store.reset(this.symbolsArr); + }, + loadListPresetsFromStorage: function(path, groupId) { var recents = Common.localStorage.getItem(path), arr = []; diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 7079dbd4b2..5bd84063d6 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -2352,21 +2352,26 @@ define([ symbol: selected && selected.length>0 ? selected.charAt(0) : undefined, handler: function(dlg, result, settings) { if (result == 'ok') { - me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special); } else Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); win.show(); win.on('symbol:dblclick', function(cmp, result, settings) { - me.api.asc_insertSymbol(settings.font ? settings.font : me.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), settings.code, settings.special); - }); + me.insertSymbol(settings.font, settings.code, settings.special); }); } }, onInsertSymbolItemClick: function(picker, item, record, e) { if (this.api && record) - this.api.asc_insertSymbol(record.font ? record.get('font') : this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(), record.get('code'), record.get('special')); + this.insertSymbol(record.get('font') , record.get('symbol'), record.get('special')); + }, + + insertSymbol: function(fontRecord, symbol, special){ + var font = fontRecord ? fontRecord: this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(); + this.api.asc_insertSymbol(font, symbol, special); + this.toolbar.saveSymbol(symbol, font); }, onApiMathTypes: function(equation) { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index a39331c40e..182953bf96 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1631,7 +1631,7 @@ define([ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt); // set dataviews - + this.symbolsArr = this.loadRecentSymbolsFromStorage(); this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -1639,34 +1639,8 @@ define([ restoreHeight: 290, delayRenderTips: true, scrollAlwaysVisible: true, - store: new Common.UI.DataViewStore([ - { symbol: '2022', code: 8226}, - { symbol: '20AC', code: 8364}, - { symbol: 'FF04', code: 65284}, - { symbol: '00A5', code: 165}, - { symbol: '00A9', code: 169}, - { symbol: '00AE', code: 174}, - { symbol: '00BD', code: 189}, - { symbol: '00BC', code: 188}, - { symbol: '2260', code: 8800}, - { symbol: '00B1', code: 177}, - { symbol: '00F7', code: 247}, - { symbol: '221A', code: 8730}, - { symbol: '2264', code: 8804}, - { symbol: '2265', code: 8805}, - { symbol: '2122', code: 8482}, - { symbol: '221E', code: 8734}, - { symbol: '007E', code: 126}, - { symbol: '00B0', code: 176}, - { symbol: '00A7', code: 167}, - { symbol: '03B1', code: 945}, - { symbol: '03B2', code: 946}, - { symbol: '03C0', code: 960}, - { symbol: '0394', code: 916}, - { symbol: '263A', code: 9786}, - { symbol: '2665', code: 9829} - ]), - itemTemplate: _.template('
&#<%= code %>') + store: new Common.UI.DataViewStore(this.symbolsArr), + itemTemplate: _.template('
style ="font-family: <%= font %>"<% } %>>&#<%= symbol %>
') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); this.btnInsertSymbol.menu.on('show:before', _.bind(function() { @@ -2096,6 +2070,66 @@ define([ } }, + loadRecentSymbolsFromStorage: function(){ + var recents = Common.localStorage.getItem('pe-fastRecentSymbols'); + if(!!recents) + return JSON.parse(recents); + return [ + { symbol: 8226, font: 'Arial', tip: 'Symbol: 8226'}, + { symbol: 8364, font: 'Arial', tip: 'Symbol: 8364'}, + { symbol: 65284, font: 'Arial', tip: 'Symbol: 65284'}, + { symbol: 165, font: 'Arial', tip: 'Symbol: 165'}, + { symbol: 169, font: 'Arial', tip: 'Symbol: 169'}, + { symbol: 174, font: 'Arial', tip: 'Symbol: 174'}, + { symbol: 189, font: 'Arial', tip: 'Symbol: 189'}, + { symbol: 188, font: 'Arial', tip: 'Symbol: 188'}, + { symbol: 8800, font: 'Arial', tip: 'Symbol: 8800'}, + { symbol: 177, font: 'Arial', tip: 'Symbol: 177'}, + { symbol: 247, font: 'Arial', tip: 'Symbol: 247'}, + { symbol: 8730, font: 'Arial', tip: 'Symbol: 8730'}, + { symbol: 8804, font: 'Arial', tip: 'Symbol: 8804'}, + { symbol: 8805, font: 'Arial', tip: 'Symbol: 8805'}, + { symbol: 8482, font: 'Arial', tip: 'Symbol: 8482'}, + { symbol: 8734, font: 'Arial', tip: 'Symbol: 8734'}, + { symbol: 126, font: 'Arial', tip: 'Symbol: 126'}, + { symbol: 176, font: 'Arial', tip: 'Symbol: 176'}, + { symbol: 167, font: 'Arial', tip: 'Symbol: 167'}, + { symbol: 945, font: 'Arial', tip: 'Symbol: 945'}, + { symbol: 946, font: 'Arial', tip: 'Symbol: 946'}, + { symbol: 960, font: 'Arial', tip: 'Symbol: 960'}, + { symbol: 916, font: 'Arial', tip: 'Symbol: 916'}, + { symbol: 9786, font: 'Arial', tip: 'Symbol: 9786'}, + { symbol: 9829, font: 'Arial', tip: 'Symbol: 9829'} + ]; + + }, + + saveSymbol: function(symbol, font) { + var maxLength =25; + if(this.symbolsArr.length === 0){ + this.symbolsArr.push({symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); + this.saveRecentSymbolsToStorage(); + return; + } + for(var i = 0; i < this.symbolsArr.length; ++i){ + if(this.symbolsArr[i].symbol === symbol && this.symbolsArr[i].font === font){ + this.symbolsArr.splice(i, 1); + break; + } + } + this.symbolsArr.splice(0, 0, {symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); + if(this.symbolsArr.length > maxLength){ + this.symbolsArr.splice(maxLength, this.symbolsArr.length - maxLength); + } + this.saveRecentSymbolsToStorage(); + }, + + saveRecentSymbolsToStorage: function(){ + var sJSON = JSON.stringify(this.symbolsArr); + Common.localStorage.setItem( 'pe-fastRecentSymbols', sJSON); + this.mnuInsertSymbolsPicker.store.reset(this.symbolsArr); + }, + textBold: 'Bold', textItalic: 'Italic', textUnderline: 'Underline', diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index b23df7dc7f..c2d75a65f7 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -4081,21 +4081,27 @@ define([ symbol: selected && selected.length>0 ? selected.charAt(0) : undefined, handler: function(dlg, result, settings) { if (result == 'ok') { - me.api.asc_insertSymbol(settings.font ? settings.font : me.api.asc_getCellInfo().asc_getXfs().asc_getFontName(), settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special); } else Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); win.show(); win.on('symbol:dblclick', function(cmp, result, settings) { - me.api.asc_insertSymbol(settings.font ? settings.font : me.api.asc_getCellInfo().asc_getXfs().asc_getFontName(), settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special); }); } }, onInsertSymbolItemClick: function(picker, item, record, e) { if (this.api && record) - this.api.asc_insertSymbol(record.font ? record.get('font') : this.api.asc_getCellInfo().asc_getXfs().asc_getFontName(), record.get('code'), record.get('special')); + this.insertSymbol(record.get('font'), record.get('symbol'), record.get('special')); + }, + + insertSymbol: function(fontRecord, symbol, special){ + var font = fontRecord ? fontRecord: this.api.asc_getCellInfo().asc_getXfs().asc_getFontName(); + this.api.asc_insertSymbol(font, symbol, special); + this.toolbar.saveSymbol(symbol, font); }, onInsertSlicerClick: function() { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index a3bc165925..9f800a1eaa 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2759,6 +2759,8 @@ define([ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt); } + + this.symbolsArr = this.loadRecentSymbolsFromStorage(); this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -2766,34 +2768,8 @@ define([ restoreHeight: 290, delayRenderTips: true, scrollAlwaysVisible: true, - store: new Common.UI.DataViewStore([ - { symbol: '2022', code: 8226}, - { symbol: '20AC', code: 8364}, - { symbol: 'FF04', code: 65284}, - { symbol: '00A5', code: 165}, - { symbol: '00A9', code: 169}, - { symbol: '00AE', code: 174}, - { symbol: '00BD', code: 189}, - { symbol: '00BC', code: 188}, - { symbol: '2260', code: 8800}, - { symbol: '00B1', code: 177}, - { symbol: '00F7', code: 247}, - { symbol: '221A', code: 8730}, - { symbol: '2264', code: 8804}, - { symbol: '2265', code: 8805}, - { symbol: '2122', code: 8482}, - { symbol: '221E', code: 8734}, - { symbol: '007E', code: 126}, - { symbol: '00B0', code: 176}, - { symbol: '00A7', code: 167}, - { symbol: '03B1', code: 945}, - { symbol: '03B2', code: 946}, - { symbol: '03C0', code: 960}, - { symbol: '0394', code: 916}, - { symbol: '263A', code: 9786}, - { symbol: '2665', code: 9829} - ]), - itemTemplate: _.template('
&#<%= code %>') + store: new Common.UI.DataViewStore(this.symbolsArr), + itemTemplate: _.template('
style ="font-family: <%= font %>"<% } %>>&#<%= symbol %>
') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); this.btnInsertSymbol.menu.on('show:before', _.bind(function() { @@ -3283,6 +3259,66 @@ define([ }, + loadRecentSymbolsFromStorage: function(){ + var recents = Common.localStorage.getItem('sse-fastRecentSymbols'); + if(!!recents) + return JSON.parse(recents); + return [ + { symbol: 8226, font: 'Arial', tip: 'Symbol: 8226'}, + { symbol: 8364, font: 'Arial', tip: 'Symbol: 8364'}, + { symbol: 65284, font: 'Arial', tip: 'Symbol: 65284'}, + { symbol: 165, font: 'Arial', tip: 'Symbol: 165'}, + { symbol: 169, font: 'Arial', tip: 'Symbol: 169'}, + { symbol: 174, font: 'Arial', tip: 'Symbol: 174'}, + { symbol: 189, font: 'Arial', tip: 'Symbol: 189'}, + { symbol: 188, font: 'Arial', tip: 'Symbol: 188'}, + { symbol: 8800, font: 'Arial', tip: 'Symbol: 8800'}, + { symbol: 177, font: 'Arial', tip: 'Symbol: 177'}, + { symbol: 247, font: 'Arial', tip: 'Symbol: 247'}, + { symbol: 8730, font: 'Arial', tip: 'Symbol: 8730'}, + { symbol: 8804, font: 'Arial', tip: 'Symbol: 8804'}, + { symbol: 8805, font: 'Arial', tip: 'Symbol: 8805'}, + { symbol: 8482, font: 'Arial', tip: 'Symbol: 8482'}, + { symbol: 8734, font: 'Arial', tip: 'Symbol: 8734'}, + { symbol: 126, font: 'Arial', tip: 'Symbol: 126'}, + { symbol: 176, font: 'Arial', tip: 'Symbol: 176'}, + { symbol: 167, font: 'Arial', tip: 'Symbol: 167'}, + { symbol: 945, font: 'Arial', tip: 'Symbol: 945'}, + { symbol: 946, font: 'Arial', tip: 'Symbol: 946'}, + { symbol: 960, font: 'Arial', tip: 'Symbol: 960'}, + { symbol: 916, font: 'Arial', tip: 'Symbol: 916'}, + { symbol: 9786, font: 'Arial', tip: 'Symbol: 9786'}, + { symbol: 9829, font: 'Arial', tip: 'Symbol: 9829'} + ]; + + }, + + saveSymbol: function(symbol, font) { + var maxLength =25; + if(this.symbolsArr.length === 0){ + this.symbolsArr.push({symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); + this.saveRecentSymbolsToStorage(); + return; + } + for(var i = 0; i < this.symbolsArr.length; ++i){ + if(this.symbolsArr[i].symbol === symbol && this.symbolsArr[i].font === font){ + this.symbolsArr.splice(i, 1); + break; + } + } + this.symbolsArr.splice(0, 0, {symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); + if(this.symbolsArr.length > maxLength){ + this.symbolsArr.splice(maxLength, this.symbolsArr.length - maxLength); + } + this.saveRecentSymbolsToStorage(); + }, + + saveRecentSymbolsToStorage: function(){ + var sJSON = JSON.stringify(this.symbolsArr); + Common.localStorage.setItem( 'sse-fastRecentSymbols', sJSON); + this.mnuInsertSymbolsPicker.store.reset(this.symbolsArr); + }, + textBold: 'Bold', textItalic: 'Italic', textUnderline: 'Underline', From 88d6b51c6a3b52654fac541d632ba475e47c7e9d Mon Sep 17 00:00:00 2001 From: OVSharova Date: Thu, 8 Jun 2023 14:27:58 +0300 Subject: [PATCH 4/6] refactoring --- apps/documenteditor/main/app/view/Toolbar.js | 37 +++++++----------- .../main/app/view/Toolbar.js | 37 +++++++----------- .../main/app/view/Toolbar.js | 38 +++++++------------ 3 files changed, 42 insertions(+), 70 deletions(-) diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index e18e163ccf..74cd2164f2 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2362,7 +2362,6 @@ define([ })); // set dataviews - this.symbolsArr = this.loadRecentSymbolsFromStorage(); this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -2370,7 +2369,7 @@ define([ restoreHeight: 290, delayRenderTips: true, scrollAlwaysVisible: true, - store: new Common.UI.DataViewStore(this.symbolsArr), + store: new Common.UI.DataViewStore(this.loadRecentSymbolsFromStorage()), itemTemplate: _.template('
style ="font-family: <%= font %>"<% } %>>&#<%= symbol %>
') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); @@ -2924,29 +2923,21 @@ define([ }, saveSymbol: function(symbol, font) { - var maxLength =25; - if(this.symbolsArr.length === 0){ - this.symbolsArr.push({symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); - this.saveRecentSymbolsToStorage(); - return; - } - for(var i = 0; i < this.symbolsArr.length; ++i){ - if(this.symbolsArr[i].symbol === symbol && this.symbolsArr[i].font === font){ - this.symbolsArr.splice(i, 1); - break; - } - } - this.symbolsArr.splice(0, 0, {symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); - if(this.symbolsArr.length > maxLength){ - this.symbolsArr.splice(maxLength, this.symbolsArr.length - maxLength); - } - this.saveRecentSymbolsToStorage(); - }, + var maxLength =25, + picker = this.mnuInsertSymbolsPicker; + var item = picker.store.find(function(item){ + return item.get('symbol') == symbol && item.get('font') == font + }); - saveRecentSymbolsToStorage: function(){ - var sJSON = JSON.stringify(this.symbolsArr); + item && picker.store.remove(item); + picker.store.add({symbol: symbol, font: font, tip: 'Symbol: ' + symbol},{at:0}); + picker.store.length > maxLength && picker.store.remove(picker.store.last()); + + var arr = picker.store.map(function (item){ + return {symbol: item.get('symbol'), font: item.get('font'), tip: item.get('tip')}; + }); + var sJSON = JSON.stringify(arr); Common.localStorage.setItem( 'de-fastRecentSymbols', sJSON); - this.mnuInsertSymbolsPicker.store.reset(this.symbolsArr); }, loadListPresetsFromStorage: function(path, groupId) { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 182953bf96..d5c4e21974 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1631,7 +1631,6 @@ define([ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt); // set dataviews - this.symbolsArr = this.loadRecentSymbolsFromStorage(); this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -1639,7 +1638,7 @@ define([ restoreHeight: 290, delayRenderTips: true, scrollAlwaysVisible: true, - store: new Common.UI.DataViewStore(this.symbolsArr), + store: new Common.UI.DataViewStore(this.loadRecentSymbolsFromStorage()), itemTemplate: _.template('
style ="font-family: <%= font %>"<% } %>>&#<%= symbol %>
') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); @@ -2105,29 +2104,21 @@ define([ }, saveSymbol: function(symbol, font) { - var maxLength =25; - if(this.symbolsArr.length === 0){ - this.symbolsArr.push({symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); - this.saveRecentSymbolsToStorage(); - return; - } - for(var i = 0; i < this.symbolsArr.length; ++i){ - if(this.symbolsArr[i].symbol === symbol && this.symbolsArr[i].font === font){ - this.symbolsArr.splice(i, 1); - break; - } - } - this.symbolsArr.splice(0, 0, {symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); - if(this.symbolsArr.length > maxLength){ - this.symbolsArr.splice(maxLength, this.symbolsArr.length - maxLength); - } - this.saveRecentSymbolsToStorage(); - }, + var maxLength =25, + picker = this.mnuInsertSymbolsPicker; + var item = picker.store.find(function(item){ + return item.get('symbol') == symbol && item.get('font') == font + }); - saveRecentSymbolsToStorage: function(){ - var sJSON = JSON.stringify(this.symbolsArr); + item && picker.store.remove(item); + picker.store.add({symbol: symbol, font: font, tip: 'Symbol: ' + symbol},{at:0}); + picker.store.length > maxLength && picker.store.remove(picker.store.last()); + + var arr = picker.store.map(function (item){ + return {symbol: item.get('symbol'), font: item.get('font'), tip: item.get('tip')}; + }); + var sJSON = JSON.stringify(arr); Common.localStorage.setItem( 'pe-fastRecentSymbols', sJSON); - this.mnuInsertSymbolsPicker.store.reset(this.symbolsArr); }, textBold: 'Bold', diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 9f800a1eaa..12dca5dc30 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2759,8 +2759,6 @@ define([ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt); } - - this.symbolsArr = this.loadRecentSymbolsFromStorage(); this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -2768,7 +2766,7 @@ define([ restoreHeight: 290, delayRenderTips: true, scrollAlwaysVisible: true, - store: new Common.UI.DataViewStore(this.symbolsArr), + store: new Common.UI.DataViewStore(this.loadRecentSymbolsFromStorage()), itemTemplate: _.template('
style ="font-family: <%= font %>"<% } %>>&#<%= symbol %>
') }); this.btnInsertSymbol.menu.setInnerMenu([{menu: this.mnuInsertSymbolsPicker, index: 0}]); @@ -3294,29 +3292,21 @@ define([ }, saveSymbol: function(symbol, font) { - var maxLength =25; - if(this.symbolsArr.length === 0){ - this.symbolsArr.push({symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); - this.saveRecentSymbolsToStorage(); - return; - } - for(var i = 0; i < this.symbolsArr.length; ++i){ - if(this.symbolsArr[i].symbol === symbol && this.symbolsArr[i].font === font){ - this.symbolsArr.splice(i, 1); - break; - } - } - this.symbolsArr.splice(0, 0, {symbol: symbol, font: font, tip: 'Symbol: ' + symbol}); - if(this.symbolsArr.length > maxLength){ - this.symbolsArr.splice(maxLength, this.symbolsArr.length - maxLength); - } - this.saveRecentSymbolsToStorage(); - }, + var maxLength =25, + picker = this.mnuInsertSymbolsPicker; + var item = picker.store.find(function(item){ + return item.get('symbol') == symbol && item.get('font') == font + }); - saveRecentSymbolsToStorage: function(){ - var sJSON = JSON.stringify(this.symbolsArr); + item && picker.store.remove(item); + picker.store.add({symbol: symbol, font: font, tip: 'Symbol: ' + symbol},{at:0}); + picker.store.length > maxLength && picker.store.remove(picker.store.last()); + + var arr = picker.store.map(function (item){ + return {symbol: item.get('symbol'), font: item.get('font'), tip: item.get('tip')}; + }); + var sJSON = JSON.stringify(arr); Common.localStorage.setItem( 'sse-fastRecentSymbols', sJSON); - this.mnuInsertSymbolsPicker.store.reset(this.symbolsArr); }, textBold: 'Bold', From b6ab1845c42bdfd6984ec119b754b45fb9a4508e Mon Sep 17 00:00:00 2001 From: OVSharova Date: Fri, 16 Jun 2023 05:21:55 +0300 Subject: [PATCH 5/6] [DE,PE,SSE] update tooltips for mnuInsertSymbolsPicker --- .../common/main/lib/view/SymbolTableDialog.js | 2 +- .../main/app/controller/Toolbar.js | 8 +- apps/documenteditor/main/app/view/Toolbar.js | 125 ++++++++++++----- apps/documenteditor/main/locale/en.json | 25 ++++ .../main/resources/less/toolbar.less | 10 +- .../main/app/controller/Toolbar.js | 8 +- .../main/app/view/Toolbar.js | 129 ++++++++++++----- apps/presentationeditor/main/locale/en.json | 25 ++++ .../main/resources/less/toolbar.less | 8 ++ .../main/app/controller/Toolbar.js | 8 +- .../main/app/view/Toolbar.js | 130 +++++++++++++----- apps/spreadsheeteditor/main/locale/en.json | 25 ++++ .../main/resources/less/toolbar.less | 12 +- 13 files changed, 397 insertions(+), 118 deletions(-) diff --git a/apps/common/main/lib/view/SymbolTableDialog.js b/apps/common/main/lib/view/SymbolTableDialog.js index 824555a3c3..eb61e4d8cb 100644 --- a/apps/common/main/lib/view/SymbolTableDialog.js +++ b/apps/common/main/lib/view/SymbolTableDialog.js @@ -815,7 +815,7 @@ define([ getSpecialSymbol: function() { var rec = this.specialList.getSelectedRec(); - return {font: undefined, symbol: this.encodeSurrogateChar(rec.get('code')), code: parseInt(rec.get('code'), 16), special: rec.get('special')}; + return {font: undefined, symbol: this.encodeSurrogateChar(rec.get('code')), code: parseInt(rec.get('code'), 16), special: rec.get('special'), speccharacter: true}; }, onBtnClick: function(event) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index f4a3b6a643..09a07ae3bd 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2894,14 +2894,14 @@ define([ buttons: [{value: 'ok', caption: this.textInsert}, 'close'], handler: function(dlg, result, settings) { if (result == 'ok') { - me.insertSymbol(settings.font, settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special, settings.speccharacter); } else Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); me.dlgSymbolTable.show(); me.dlgSymbolTable.on('symbol:dblclick', function(cmp, result, settings) { - me.insertSymbol(settings.font, settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special, settings.speccharacter); }); me.dlgSymbolTable.on('close', function(obj){ Common.NotificationCenter.trigger('edit:complete', me.toolbar); @@ -2914,10 +2914,10 @@ define([ this.insertSymbol(record.get('font'), record.get('symbol'), record.get('special')); }, - insertSymbol: function(fontRecord, symbol, special){ + insertSymbol: function(fontRecord, symbol, special, specCharacter){ var font = fontRecord ? fontRecord: this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(); this.api.asc_insertSymbol(font, symbol, special); - this.toolbar.saveSymbol(symbol, font); + !specCharacter && this.toolbar.saveSymbol(symbol, font); }, onApiMathTypes: function(equation) { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 74cd2164f2..8999319571 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2362,6 +2362,33 @@ define([ })); // set dataviews + this.specSymbols = [ + {symbol: 8226, description: this.textBullet}, + {symbol: 8364, description: this.textEuro}, + {symbol: 65284, description: this.textDollar}, + {symbol: 165, description: this.textYen}, + {symbol: 169, description: this.textCopyright}, + {symbol: 174, description: this.textRegistered}, + {symbol: 189, description: this.textOneHalf}, + {symbol: 188, description: this.textOneQuarter}, + {symbol: 8800, description: this.textNotEqualTo}, + {symbol: 177, description: this.textPlusMinus}, + {symbol: 247, description: this.textDivision}, + {symbol: 8730, description: this.textSquareRoot}, + {symbol: 8804, description: this.textLessEqual}, + {symbol: 8805, description: this.textGreaterEqual}, + {symbol: 8482, description: this.textTradeMark}, + {symbol: 8734, description: this.textInfinity}, + {symbol: 126, description: this.textTilde}, + {symbol: 176, description: this.textDegree}, + {symbol: 167, description: this.textSection}, + {symbol: 945, description: this.textAlpha}, + {symbol: 946, description: this.textBetta}, + {symbol: 960, description: this.textLetterPi}, + {symbol: 916, description: this.textDelta}, + {symbol: 9786, description: this.textSmile}, + {symbol: 9829, description: this.textBlackHeart} + ]; this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -2890,36 +2917,40 @@ define([ }, loadRecentSymbolsFromStorage: function(){ + //Common.localStorage.removeItem('de-fastRecentSymbols'); var recents = Common.localStorage.getItem('de-fastRecentSymbols'); - if(!!recents) - return JSON.parse(recents); - return [ - { symbol: 8226, font: 'Arial', tip: 'Symbol: 8226'}, - { symbol: 8364, font: 'Arial', tip: 'Symbol: 8364'}, - { symbol: 65284, font: 'Arial', tip: 'Symbol: 65284'}, - { symbol: 165, font: 'Arial', tip: 'Symbol: 165'}, - { symbol: 169, font: 'Arial', tip: 'Symbol: 169'}, - { symbol: 174, font: 'Arial', tip: 'Symbol: 174'}, - { symbol: 189, font: 'Arial', tip: 'Symbol: 189'}, - { symbol: 188, font: 'Arial', tip: 'Symbol: 188'}, - { symbol: 8800, font: 'Arial', tip: 'Symbol: 8800'}, - { symbol: 177, font: 'Arial', tip: 'Symbol: 177'}, - { symbol: 247, font: 'Arial', tip: 'Symbol: 247'}, - { symbol: 8730, font: 'Arial', tip: 'Symbol: 8730'}, - { symbol: 8804, font: 'Arial', tip: 'Symbol: 8804'}, - { symbol: 8805, font: 'Arial', tip: 'Symbol: 8805'}, - { symbol: 8482, font: 'Arial', tip: 'Symbol: 8482'}, - { symbol: 8734, font: 'Arial', tip: 'Symbol: 8734'}, - { symbol: 126, font: 'Arial', tip: 'Symbol: 126'}, - { symbol: 176, font: 'Arial', tip: 'Symbol: 176'}, - { symbol: 167, font: 'Arial', tip: 'Symbol: 167'}, - { symbol: 945, font: 'Arial', tip: 'Symbol: 945'}, - { symbol: 946, font: 'Arial', tip: 'Symbol: 946'}, - { symbol: 960, font: 'Arial', tip: 'Symbol: 960'}, - { symbol: 916, font: 'Arial', tip: 'Symbol: 916'}, - { symbol: 9786, font: 'Arial', tip: 'Symbol: 9786'}, - { symbol: 9829, font: 'Arial', tip: 'Symbol: 9829'} - ]; + var arr =(!!recents) ? JSON.parse(recents) : + [ + { symbol: 8226, font: 'Arial'}, + { symbol: 8364, font: 'Arial'}, + { symbol: 65284, font: 'Arial'}, + { symbol: 165, font: 'Arial'}, + { symbol: 169, font: 'Arial'}, + { symbol: 174, font: 'Arial'}, + { symbol: 189, font: 'Arial'}, + { symbol: 188, font: 'Arial'}, + { symbol: 8800, font: 'Arial'}, + { symbol: 177, font: 'Arial'}, + { symbol: 247, font: 'Arial'}, + { symbol: 8730, font: 'Arial'}, + { symbol: 8804, font: 'Arial'}, + { symbol: 8805, font: 'Arial'}, + { symbol: 8482, font: 'Arial'}, + { symbol: 8734, font: 'Arial'}, + { symbol: 126, font: 'Arial'}, + { symbol: 176, font: 'Arial'}, + { symbol: 167, font: 'Arial'}, + { symbol: 945, font: 'Arial'}, + { symbol: 946, font: 'Arial'}, + { symbol: 960, font: 'Arial'}, + { symbol: 916, font: 'Arial'}, + { symbol: 9786, font: 'Arial'}, + { symbol: 9829, font: 'Arial'} + ]; + arr.forEach(function (item){ + item.tip = this.getSymbolDescription(item.symbol); + }.bind(this)); + return arr; }, saveSymbol: function(symbol, font) { @@ -2930,16 +2961,21 @@ define([ }); item && picker.store.remove(item); - picker.store.add({symbol: symbol, font: font, tip: 'Symbol: ' + symbol},{at:0}); + picker.store.add({symbol: symbol, font: font, tip: this.getSymbolDescription(symbol)},{at:0}); picker.store.length > maxLength && picker.store.remove(picker.store.last()); var arr = picker.store.map(function (item){ - return {symbol: item.get('symbol'), font: item.get('font'), tip: item.get('tip')}; + return {symbol: item.get('symbol'), font: item.get('font')}; }); var sJSON = JSON.stringify(arr); Common.localStorage.setItem( 'de-fastRecentSymbols', sJSON); }, + getSymbolDescription: function(symbol){ + var specSymbol = this.specSymbols.find(function (item){return item.symbol == symbol}); + return !!specSymbol ? specSymbol.description : this.capBtnInsSymbol + ': ' + symbol; + }, + loadListPresetsFromStorage: function(path, groupId) { var recents = Common.localStorage.getItem(path), arr = []; @@ -3220,7 +3256,32 @@ define([ txtGroupNumDoc: 'Document numbering formats', txtGroupMultiDoc: 'Lists in current document', textTabDraw: 'Draw', - textMoreSymbols: 'More symbols' + textMoreSymbols: 'More symbols', + textAlpha: 'Greek Small Letter Alpha', + textBetta: 'Greek Small Letter Betta', + textBlackHeart: 'Black Heart Suit', + textBullet: 'Bullet', + textCopyright: 'Copyright Sign', + textDegree: 'Degree Sign', + textDelta: 'Greek Small Letter Delta', + textDivision: 'Division Sign', + textDollar: 'Dollar Sign', + textEuro: 'Euro Sign', + textGreaterEqual: 'Greater-Than Or Equal To', + textInfinity: 'Infinity', + textLessEqual: 'Less-Than Or Equal To', + textLetterPi: 'Greek Small Letter Pi', + textNotEqualTo: 'Not Equal To', + textOneHalf: 'Vulgar Fraction One Half', + textOneQuarter: 'Vulgar Fraction One Quarter', + textPlusMinus: 'Plus-Minus Sign', + textRegistered: 'Registered Sign', + textSection: 'Section Sign', + textSmile: 'White Smiling Fase', + textSquareRoot: 'Square Root', + textTilde: 'Tilde', + textTradeMark: 'Trade Mark Sign', + textYen: 'Yen Sign' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 8a646ec63b..10c336f7e5 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -3196,11 +3196,16 @@ "DE.Views.Toolbar.mniToggleCase": "tOGGLE cASE", "DE.Views.Toolbar.mniUpperCase": "UPPERCASE", "DE.Views.Toolbar.strMenuNoFill": "No fill", + "DE.Views.Toolbar.textAlpha": "Greek Small Letter Alpha", "DE.Views.Toolbar.textAutoColor": "Automatic", + "DE.Views.Toolbar.textBetta": "Greek Small Letter Betta", + "DE.Views.Toolbar.textBlackHeart": "Black Heart Suit", "DE.Views.Toolbar.textBold": "Bold", "DE.Views.Toolbar.textBottom": "Bottom: ", + "DE.Views.Toolbar.textBullet": "Bullet", "DE.Views.Toolbar.textChangeLevel": "Change List Level", "DE.Views.Toolbar.textCheckboxControl": "Check box", + "DE.Views.Toolbar.textCopyright": "Copyright Sign", "DE.Views.Toolbar.textColumnsCustom": "Custom columns", "DE.Views.Toolbar.textColumnsLeft": "Left", "DE.Views.Toolbar.textColumnsOne": "One", @@ -3212,9 +3217,16 @@ "DE.Views.Toolbar.textContPage": "Continuous page", "DE.Views.Toolbar.textCustomLineNumbers": "Line numbering options", "DE.Views.Toolbar.textDateControl": "Date", + "DE.Views.Toolbar.textDegree": "Degree Sign", + "DE.Views.Toolbar.textDelta": "Greek Small Letter Delta", + "DE.Views.Toolbar.textDivision": "Division Sign", + "DE.Views.Toolbar.textDollar": "Dollar Sign", "DE.Views.Toolbar.textDropdownControl": "Drop-down list", "DE.Views.Toolbar.textEditWatermark": "Custom watermark", + "DE.Views.Toolbar.textEuro": "Euro Sign", "DE.Views.Toolbar.textEvenPage": "Even page", + "DE.Views.Toolbar.textGreaterEqual": "Greater-Than Or Equal To", + "DE.Views.Toolbar.textInfinity": "Infinity", "DE.Views.Toolbar.textInMargin": "In Margin", "DE.Views.Toolbar.textInsColumnBreak": "Insert column break", "DE.Views.Toolbar.textInsertPageCount": "Insert number of pages", @@ -3225,6 +3237,8 @@ "DE.Views.Toolbar.textItalic": "Italic", "DE.Views.Toolbar.textLandscape": "Landscape", "DE.Views.Toolbar.textLeft": "Left: ", + "DE.Views.Toolbar.textLessEqual": "Less-Than Or Equal To", + "DE.Views.Toolbar.textLetterPi": "Greek Small Letter Pi", "DE.Views.Toolbar.textListSettings": "List Settings", "DE.Views.Toolbar.textMarginsLast": "Last Custom", "DE.Views.Toolbar.textMarginsModerate": "Moderate", @@ -3237,18 +3251,26 @@ "DE.Views.Toolbar.textNextPage": "Next page", "DE.Views.Toolbar.textNoHighlight": "No highlighting", "DE.Views.Toolbar.textNone": "None", + "DE.Views.Toolbar.textNotEqualTo": "Not Equal To", "DE.Views.Toolbar.textOddPage": "Odd page", + "DE.Views.Toolbar.textOneHalf": "Vulgar Fraction One Half", + "DE.Views.Toolbar.textOneQuarter": "Vulgar Fraction One Quarter", "DE.Views.Toolbar.textPageMarginsCustom": "Custom margins", "DE.Views.Toolbar.textPageSizeCustom": "Custom page size", "DE.Views.Toolbar.textPictureControl": "Picture", "DE.Views.Toolbar.textPlainControl": "Plain text", + "DE.Views.Toolbar.textPlusMinus": "Plus-Minus Sign", "DE.Views.Toolbar.textPortrait": "Portrait", + "DE.Views.Toolbar.textRegistered": "Registered Sign", "DE.Views.Toolbar.textRemoveControl": "Remove Content Control", "DE.Views.Toolbar.textRemWatermark": "Remove watermark", "DE.Views.Toolbar.textRestartEachPage": "Restart each page", "DE.Views.Toolbar.textRestartEachSection": "Restart each section", "DE.Views.Toolbar.textRichControl": "Rich text", "DE.Views.Toolbar.textRight": "Right: ", + "DE.Views.Toolbar.textSection": "Section Sign", + "DE.Views.Toolbar.textSmile": "White Smiling Fase", + "DE.Views.Toolbar.textSquareRoot": "Square Root", "DE.Views.Toolbar.textStrikeout": "Strikethrough", "DE.Views.Toolbar.textStyleMenuDelete": "Delete style", "DE.Views.Toolbar.textStyleMenuDeleteAll": "Delete all custom styles", @@ -3269,10 +3291,13 @@ "DE.Views.Toolbar.textTabProtect": "Protection", "DE.Views.Toolbar.textTabReview": "Review", "DE.Views.Toolbar.textTabView": "View", + "DE.Views.Toolbar.textTilde": "Tilde", "DE.Views.Toolbar.textTitleError": "Error", "DE.Views.Toolbar.textToCurrent": "To current position", "DE.Views.Toolbar.textTop": "Top: ", + "DE.Views.Toolbar.textTradeMark": "Trade Mark Sign", "DE.Views.Toolbar.textUnderline": "Underline", + "DE.Views.Toolbar.textYen": "Yen Sign", "DE.Views.Toolbar.tipAlignCenter": "Align center", "DE.Views.Toolbar.tipAlignJust": "Justified", "DE.Views.Toolbar.tipAlignLeft": "Align left", diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index d07b41c464..25fb72d539 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -33,16 +33,24 @@ display: inline-block; width: 160px; padding-left: 3px; + .rtl & { + padding-left: 0; + padding-right: 3px; + } .item { .box-shadow(none); margin-left: 6px; + .rtl & { + margin-left: 4px; + margin-right: 6px; + } &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); } } .item-symbol { - font-family: @font-family-base;//Arial; + font-family: @font-family-base; font-size: 14px; display: block; width: 20px; diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 5bd84063d6..ec109a52b3 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -2352,14 +2352,14 @@ define([ symbol: selected && selected.length>0 ? selected.charAt(0) : undefined, handler: function(dlg, result, settings) { if (result == 'ok') { - me.insertSymbol(settings.font, settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special, settings.speccharacter); } else Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); win.show(); win.on('symbol:dblclick', function(cmp, result, settings) { - me.insertSymbol(settings.font, settings.code, settings.special); }); + me.insertSymbol(settings.font, settings.code, settings.special, settings.speccharacter); }); } }, @@ -2368,10 +2368,10 @@ define([ this.insertSymbol(record.get('font') , record.get('symbol'), record.get('special')); }, - insertSymbol: function(fontRecord, symbol, special){ + insertSymbol: function(fontRecord, symbol, special, specCharacter){ var font = fontRecord ? fontRecord: this.api.get_TextProps().get_TextPr().get_FontFamily().get_Name(); this.api.asc_insertSymbol(font, symbol, special); - this.toolbar.saveSymbol(symbol, font); + !specCharacter && this.toolbar.saveSymbol(symbol, font); }, onApiMathTypes: function(equation) { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index d5c4e21974..96e8398337 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1631,6 +1631,33 @@ define([ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt); // set dataviews + this.specSymbols = [ + {symbol: 8226, description: this.textBullet}, + {symbol: 8364, description: this.textEuro}, + {symbol: 65284, description: this.textDollar}, + {symbol: 165, description: this.textYen}, + {symbol: 169, description: this.textCopyright}, + {symbol: 174, description: this.textRegistered}, + {symbol: 189, description: this.textOneHalf}, + {symbol: 188, description: this.textOneQuarter}, + {symbol: 8800, description: this.textNotEqualTo}, + {symbol: 177, description: this.textPlusMinus}, + {symbol: 247, description: this.textDivision}, + {symbol: 8730, description: this.textSquareRoot}, + {symbol: 8804, description: this.textLessEqual}, + {symbol: 8805, description: this.textGreaterEqual}, + {symbol: 8482, description: this.textTradeMark}, + {symbol: 8734, description: this.textInfinity}, + {symbol: 126, description: this.textTilde}, + {symbol: 176, description: this.textDegree}, + {symbol: 167, description: this.textSection}, + {symbol: 945, description: this.textAlpha}, + {symbol: 946, description: this.textBetta}, + {symbol: 960, description: this.textLetterPi}, + {symbol: 916, description: this.textDelta}, + {symbol: 9786, description: this.textSmile}, + {symbol: 9829, description: this.textBlackHeart} + ]; this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -2070,37 +2097,39 @@ define([ }, loadRecentSymbolsFromStorage: function(){ - var recents = Common.localStorage.getItem('pe-fastRecentSymbols'); - if(!!recents) - return JSON.parse(recents); - return [ - { symbol: 8226, font: 'Arial', tip: 'Symbol: 8226'}, - { symbol: 8364, font: 'Arial', tip: 'Symbol: 8364'}, - { symbol: 65284, font: 'Arial', tip: 'Symbol: 65284'}, - { symbol: 165, font: 'Arial', tip: 'Symbol: 165'}, - { symbol: 169, font: 'Arial', tip: 'Symbol: 169'}, - { symbol: 174, font: 'Arial', tip: 'Symbol: 174'}, - { symbol: 189, font: 'Arial', tip: 'Symbol: 189'}, - { symbol: 188, font: 'Arial', tip: 'Symbol: 188'}, - { symbol: 8800, font: 'Arial', tip: 'Symbol: 8800'}, - { symbol: 177, font: 'Arial', tip: 'Symbol: 177'}, - { symbol: 247, font: 'Arial', tip: 'Symbol: 247'}, - { symbol: 8730, font: 'Arial', tip: 'Symbol: 8730'}, - { symbol: 8804, font: 'Arial', tip: 'Symbol: 8804'}, - { symbol: 8805, font: 'Arial', tip: 'Symbol: 8805'}, - { symbol: 8482, font: 'Arial', tip: 'Symbol: 8482'}, - { symbol: 8734, font: 'Arial', tip: 'Symbol: 8734'}, - { symbol: 126, font: 'Arial', tip: 'Symbol: 126'}, - { symbol: 176, font: 'Arial', tip: 'Symbol: 176'}, - { symbol: 167, font: 'Arial', tip: 'Symbol: 167'}, - { symbol: 945, font: 'Arial', tip: 'Symbol: 945'}, - { symbol: 946, font: 'Arial', tip: 'Symbol: 946'}, - { symbol: 960, font: 'Arial', tip: 'Symbol: 960'}, - { symbol: 916, font: 'Arial', tip: 'Symbol: 916'}, - { symbol: 9786, font: 'Arial', tip: 'Symbol: 9786'}, - { symbol: 9829, font: 'Arial', tip: 'Symbol: 9829'} - ]; - + var recents = Common.localStorage.getItem('de-fastRecentSymbols'); + var arr = (!!recents) ? JSON.parse(recents) : + [ + { symbol: 8226, font: 'Arial'}, + { symbol: 8364, font: 'Arial'}, + { symbol: 65284, font: 'Arial'}, + { symbol: 165, font: 'Arial'}, + { symbol: 169, font: 'Arial'}, + { symbol: 174, font: 'Arial'}, + { symbol: 189, font: 'Arial'}, + { symbol: 188, font: 'Arial'}, + { symbol: 8800, font: 'Arial'}, + { symbol: 177, font: 'Arial'}, + { symbol: 247, font: 'Arial'}, + { symbol: 8730, font: 'Arial'}, + { symbol: 8804, font: 'Arial'}, + { symbol: 8805, font: 'Arial'}, + { symbol: 8482, font: 'Arial'}, + { symbol: 8734, font: 'Arial'}, + { symbol: 126, font: 'Arial'}, + { symbol: 176, font: 'Arial'}, + { symbol: 167, font: 'Arial'}, + { symbol: 945, font: 'Arial'}, + { symbol: 946, font: 'Arial'}, + { symbol: 960, font: 'Arial'}, + { symbol: 916, font: 'Arial'}, + { symbol: 9786, font: 'Arial'}, + { symbol: 9829, font: 'Arial'} + ]; + arr.forEach(function (item){ + item.tip = this.getSymbolDescription(item.symbol); + }.bind(this)); + return arr; }, saveSymbol: function(symbol, font) { @@ -2111,14 +2140,19 @@ define([ }); item && picker.store.remove(item); - picker.store.add({symbol: symbol, font: font, tip: 'Symbol: ' + symbol},{at:0}); + picker.store.add({symbol: symbol, font: font, tip: this.getSymbolDescription(symbol)},{at:0}); picker.store.length > maxLength && picker.store.remove(picker.store.last()); var arr = picker.store.map(function (item){ - return {symbol: item.get('symbol'), font: item.get('font'), tip: item.get('tip')}; + return {symbol: item.get('symbol'), font: item.get('font')}; }); var sJSON = JSON.stringify(arr); - Common.localStorage.setItem( 'pe-fastRecentSymbols', sJSON); + Common.localStorage.setItem( 'de-fastRecentSymbols', sJSON); + }, + + getSymbolDescription: function(symbol){ + var specSymbol = this.specSymbols.find(function (item){return item.symbol == symbol}); + return !!specSymbol ? specSymbol.description : this.capBtnInsSymbol + ': ' + symbol; }, textBold: 'Bold', @@ -2299,7 +2333,32 @@ define([ tipSelectAll: 'Select all', tipCut: 'Cut', textTabDraw: 'Draw', - textMoreSymbols: 'More symbols' + textMoreSymbols: 'More symbols', + textAlpha: 'Greek Small Letter Alpha', + textBetta: 'Greek Small Letter Betta', + textBlackHeart: 'Black Heart Suit', + textBullet: 'Bullet', + textCopyright: 'Copyright Sign', + textDegree: 'Degree Sign', + textDelta: 'Greek Small Letter Delta', + textDivision: 'Division Sign', + textDollar: 'Dollar Sign', + textEuro: 'Euro Sign', + textGreaterEqual: 'Greater-Than Or Equal To', + textInfinity: 'Infinity', + textLessEqual: 'Less-Than Or Equal To', + textLetterPi: 'Greek Small Letter Pi', + textNotEqualTo: 'Not Equal To', + textOneHalf: 'Vulgar Fraction One Half', + textOneQuarter: 'Vulgar Fraction One Quarter', + textPlusMinus: 'Plus-Minus Sign', + textRegistered: 'Registered Sign', + textSection: 'Section Sign', + textSmile: 'White Smiling Fase', + textSquareRoot: 'Square Root', + textTilde: 'Tilde', + textTradeMark: 'Trade Mark Sign', + textYen: 'Yen Sign' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 3be842894c..ad65987a90 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2533,19 +2533,39 @@ "PE.Views.Toolbar.textAlignMiddle": "Align text to the middle", "PE.Views.Toolbar.textAlignRight": "Align text right", "PE.Views.Toolbar.textAlignTop": "Align text to the top", + "PE.Views.Toolbar.textAlpha": "Greek Small Letter Alpha", "PE.Views.Toolbar.textArrangeBack": "Send to background", "PE.Views.Toolbar.textArrangeBackward": "Send backward", "PE.Views.Toolbar.textArrangeForward": "Bring forward", "PE.Views.Toolbar.textArrangeFront": "Bring to foreground", + "PE.Views.Toolbar.textBetta": "Greek Small Letter Betta", + "PE.Views.Toolbar.textBlackHeart": "Black Heart Suit", "PE.Views.Toolbar.textBold": "Bold", + "PE.Views.Toolbar.textBullet": "Bullet", "PE.Views.Toolbar.textColumnsCustom": "Custom columns", "PE.Views.Toolbar.textColumnsOne": "One Column", "PE.Views.Toolbar.textColumnsThree": "Three Columns", "PE.Views.Toolbar.textColumnsTwo": "Two Columns", + "PE.Views.Toolbar.textCopyright": "Copyright Sign", + "PE.Views.Toolbar.textDegree": "Degree Sign", + "PE.Views.Toolbar.textDelta": "Greek Small Letter Delta", + "PE.Views.Toolbar.textDivision": "Division Sign", + "PE.Views.Toolbar.textDollar": "Dollar Sign", + "PE.Views.Toolbar.textEuro": "Euro Sign", + "PE.Views.Toolbar.textGreaterEqual": "Greater-Than Or Equal To", + "PE.Views.Toolbar.textInfinity": "Infinity", "PE.Views.Toolbar.textItalic": "Italic", + "PE.Views.Toolbar.textLessEqual": "Less-Than Or Equal To", + "PE.Views.Toolbar.textLetterPi": "Greek Small Letter Pi", "PE.Views.Toolbar.textListSettings": "List Settings", "PE.Views.Toolbar.textMoreSymbols": "More symbols", + "PE.Views.Toolbar.textNotEqualTo": "Not Equal To", + "PE.Views.Toolbar.textOneHalf": "Vulgar Fraction One Half", + "PE.Views.Toolbar.textOneQuarter": "Vulgar Fraction One Quarter", + "PE.Views.Toolbar.textPlusMinus": "Plus-Minus Sign", "PE.Views.Toolbar.textRecentlyUsed": "Recently Used", + "PE.Views.Toolbar.textRegistered": "Registered Sign", + "PE.Views.Toolbar.textSection": "Section Sign", "PE.Views.Toolbar.textShapeAlignBottom": "Align Bottom", "PE.Views.Toolbar.textShapeAlignCenter": "Align Center", "PE.Views.Toolbar.textShapeAlignLeft": "Align Left", @@ -2556,6 +2576,8 @@ "PE.Views.Toolbar.textShowCurrent": "Show from Current Slide", "PE.Views.Toolbar.textShowPresenterView": "Show Presenter View", "PE.Views.Toolbar.textShowSettings": "Show Settings", + "PE.Views.Toolbar.textSmile": "White Smiling Fase", + "PE.Views.Toolbar.textSquareRoot": "Square Root", "PE.Views.Toolbar.textStrikeout": "Strikethrough", "PE.Views.Toolbar.textSubscript": "Subscript", "PE.Views.Toolbar.textSuperscript": "Superscript", @@ -2568,8 +2590,11 @@ "PE.Views.Toolbar.textTabProtect": "Protection", "PE.Views.Toolbar.textTabTransitions": "Transitions", "PE.Views.Toolbar.textTabView": "View", + "PE.Views.Toolbar.textTilde": "Tilde", "PE.Views.Toolbar.textTitleError": "Error", + "PE.Views.Toolbar.textTradeMark": "Trade Mark Sign", "PE.Views.Toolbar.textUnderline": "Underline", + "PE.Views.Toolbar.textYen": "Yen Sign", "PE.Views.Toolbar.tipAddSlide": "Add slide", "PE.Views.Toolbar.tipBack": "Back", "PE.Views.Toolbar.tipChangeCase": "Change case", diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index dc564332b4..5c5357ff40 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -52,9 +52,17 @@ display: inline-block; width: 160px; padding-left: 3px; + .rtl & { + padding-left: 0; + padding-right: 3px; + } .item { .box-shadow(none); margin-left: 6px; + .rtl & { + margin-left: 4px; + margin-right: 6px; + } &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index c2d75a65f7..4759b5269e 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -4081,14 +4081,14 @@ define([ symbol: selected && selected.length>0 ? selected.charAt(0) : undefined, handler: function(dlg, result, settings) { if (result == 'ok') { - me.insertSymbol(settings.font, settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special, settings.speccharacter); } else Common.NotificationCenter.trigger('edit:complete', me.toolbar); } }); win.show(); win.on('symbol:dblclick', function(cmp, result, settings) { - me.insertSymbol(settings.font, settings.code, settings.special); + me.insertSymbol(settings.font, settings.code, settings.special, settings.speccharacter); }); } }, @@ -4098,10 +4098,10 @@ define([ this.insertSymbol(record.get('font'), record.get('symbol'), record.get('special')); }, - insertSymbol: function(fontRecord, symbol, special){ + insertSymbol: function(fontRecord, symbol, special, specCharacter){ var font = fontRecord ? fontRecord: this.api.asc_getCellInfo().asc_getXfs().asc_getFontName(); this.api.asc_insertSymbol(font, symbol, special); - this.toolbar.saveSymbol(symbol, font); + !specCharacter && this.toolbar.saveSymbol(symbol, font); }, onInsertSlicerClick: function() { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 12dca5dc30..0e61cb3721 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2759,6 +2759,34 @@ define([ this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt); } + this.specSymbols = [ + {symbol: 8226, description: this.textBullet}, + {symbol: 8364, description: this.textEuro}, + {symbol: 65284, description: this.textDollar}, + {symbol: 165, description: this.textYen}, + {symbol: 169, description: this.textCopyright}, + {symbol: 174, description: this.textRegistered}, + {symbol: 189, description: this.textOneHalf}, + {symbol: 188, description: this.textOneQuarter}, + {symbol: 8800, description: this.textNotEqualTo}, + {symbol: 177, description: this.textPlusMinus}, + {symbol: 247, description: this.textDivision}, + {symbol: 8730, description: this.textSquareRoot}, + {symbol: 8804, description: this.textLessEqual}, + {symbol: 8805, description: this.textGreaterEqual}, + {symbol: 8482, description: this.textTradeMark}, + {symbol: 8734, description: this.textInfinity}, + {symbol: 126, description: this.textTilde}, + {symbol: 176, description: this.textDegree}, + {symbol: 167, description: this.textSection}, + {symbol: 945, description: this.textAlpha}, + {symbol: 946, description: this.textBetta}, + {symbol: 960, description: this.textLetterPi}, + {symbol: 916, description: this.textDelta}, + {symbol: 9786, description: this.textSmile}, + {symbol: 9829, description: this.textBlackHeart} + ]; + this.mnuInsertSymbolsPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-symbols'), parentMenu: this.btnInsertSymbol.menu, @@ -3258,37 +3286,39 @@ define([ }, loadRecentSymbolsFromStorage: function(){ - var recents = Common.localStorage.getItem('sse-fastRecentSymbols'); - if(!!recents) - return JSON.parse(recents); - return [ - { symbol: 8226, font: 'Arial', tip: 'Symbol: 8226'}, - { symbol: 8364, font: 'Arial', tip: 'Symbol: 8364'}, - { symbol: 65284, font: 'Arial', tip: 'Symbol: 65284'}, - { symbol: 165, font: 'Arial', tip: 'Symbol: 165'}, - { symbol: 169, font: 'Arial', tip: 'Symbol: 169'}, - { symbol: 174, font: 'Arial', tip: 'Symbol: 174'}, - { symbol: 189, font: 'Arial', tip: 'Symbol: 189'}, - { symbol: 188, font: 'Arial', tip: 'Symbol: 188'}, - { symbol: 8800, font: 'Arial', tip: 'Symbol: 8800'}, - { symbol: 177, font: 'Arial', tip: 'Symbol: 177'}, - { symbol: 247, font: 'Arial', tip: 'Symbol: 247'}, - { symbol: 8730, font: 'Arial', tip: 'Symbol: 8730'}, - { symbol: 8804, font: 'Arial', tip: 'Symbol: 8804'}, - { symbol: 8805, font: 'Arial', tip: 'Symbol: 8805'}, - { symbol: 8482, font: 'Arial', tip: 'Symbol: 8482'}, - { symbol: 8734, font: 'Arial', tip: 'Symbol: 8734'}, - { symbol: 126, font: 'Arial', tip: 'Symbol: 126'}, - { symbol: 176, font: 'Arial', tip: 'Symbol: 176'}, - { symbol: 167, font: 'Arial', tip: 'Symbol: 167'}, - { symbol: 945, font: 'Arial', tip: 'Symbol: 945'}, - { symbol: 946, font: 'Arial', tip: 'Symbol: 946'}, - { symbol: 960, font: 'Arial', tip: 'Symbol: 960'}, - { symbol: 916, font: 'Arial', tip: 'Symbol: 916'}, - { symbol: 9786, font: 'Arial', tip: 'Symbol: 9786'}, - { symbol: 9829, font: 'Arial', tip: 'Symbol: 9829'} - ]; - + var recents = Common.localStorage.getItem('de-fastRecentSymbols'); + var arr = (!!recents) ? JSON.parse(recents) : + [ + { symbol: 8226, font: 'Arial'}, + { symbol: 8364, font: 'Arial'}, + { symbol: 65284, font: 'Arial'}, + { symbol: 165, font: 'Arial'}, + { symbol: 169, font: 'Arial'}, + { symbol: 174, font: 'Arial'}, + { symbol: 189, font: 'Arial'}, + { symbol: 188, font: 'Arial'}, + { symbol: 8800, font: 'Arial'}, + { symbol: 177, font: 'Arial'}, + { symbol: 247, font: 'Arial'}, + { symbol: 8730, font: 'Arial'}, + { symbol: 8804, font: 'Arial'}, + { symbol: 8805, font: 'Arial'}, + { symbol: 8482, font: 'Arial'}, + { symbol: 8734, font: 'Arial'}, + { symbol: 126, font: 'Arial'}, + { symbol: 176, font: 'Arial'}, + { symbol: 167, font: 'Arial'}, + { symbol: 945, font: 'Arial'}, + { symbol: 946, font: 'Arial'}, + { symbol: 960, font: 'Arial'}, + { symbol: 916, font: 'Arial'}, + { symbol: 9786, font: 'Arial'}, + { symbol: 9829, font: 'Arial'} + ]; + arr.forEach(function (item){ + item.tip = this.getSymbolDescription(item.symbol); + }.bind(this)); + return arr; }, saveSymbol: function(symbol, font) { @@ -3299,14 +3329,19 @@ define([ }); item && picker.store.remove(item); - picker.store.add({symbol: symbol, font: font, tip: 'Symbol: ' + symbol},{at:0}); + picker.store.add({symbol: symbol, font: font, tip: this.getSymbolDescription(symbol)},{at:0}); picker.store.length > maxLength && picker.store.remove(picker.store.last()); var arr = picker.store.map(function (item){ - return {symbol: item.get('symbol'), font: item.get('font'), tip: item.get('tip')}; + return {symbol: item.get('symbol'), font: item.get('font')}; }); var sJSON = JSON.stringify(arr); - Common.localStorage.setItem( 'sse-fastRecentSymbols', sJSON); + Common.localStorage.setItem( 'de-fastRecentSymbols', sJSON); + }, + + getSymbolDescription: function(symbol){ + var specSymbol = this.specSymbols.find(function (item){return item.symbol == symbol}); + return !!specSymbol ? specSymbol.description : this.capBtnInsSymbol + ': ' + symbol; }, textBold: 'Bold', @@ -3589,6 +3624,31 @@ define([ mniUpperCase: 'UPPERCASE', mniCapitalizeWords: 'Capitalize Each Word', mniToggleCase: 'tOGGLE cASE', - textMoreSymbols: 'More symbols' + textMoreSymbols: 'More symbols', + textAlpha: 'Greek Small Letter Alpha', + textBetta: 'Greek Small Letter Betta', + textBlackHeart: 'Black Heart Suit', + textBullet: 'Bullet', + textCopyright: 'Copyright Sign', + textDegree: 'Degree Sign', + textDelta: 'Greek Small Letter Delta', + textDivision: 'Division Sign', + textDollar: 'Dollar Sign', + textEuro: 'Euro Sign', + textGreaterEqual: 'Greater-Than Or Equal To', + textInfinity: 'Infinity', + textLessEqual: 'Less-Than Or Equal To', + textLetterPi: 'Greek Small Letter Pi', + textNotEqualTo: 'Not Equal To', + textOneHalf: 'Vulgar Fraction One Half', + textOneQuarter: 'Vulgar Fraction One Quarter', + textPlusMinus: 'Plus-Minus Sign', + textRegistered: 'Registered Sign', + textSection: 'Section Sign', + textSmile: 'White Smiling Fase', + textSquareRoot: 'Square Root', + textTilde: 'Tilde', + textTradeMark: 'Trade Mark Sign', + textYen: 'Yen Sign' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index afc3c67394..c98d00a1d6 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3837,33 +3837,45 @@ "SSE.Views.Toolbar.textAlignRight": "Align Right", "SSE.Views.Toolbar.textAlignTop": "Align Top", "SSE.Views.Toolbar.textAllBorders": "All Borders", + "SSE.Views.Toolbar.textAlpha": "Greek Small Letter Alpha", "SSE.Views.Toolbar.textAuto": "Auto", "SSE.Views.Toolbar.textAutoColor": "Automatic", + "SSE.Views.Toolbar.textBetta": "Greek Small Letter Betta", + "SSE.Views.Toolbar.textBlackHeart": "Black Heart Suit", "SSE.Views.Toolbar.textBold": "Bold", "SSE.Views.Toolbar.textBordersColor": "Border color", "SSE.Views.Toolbar.textBordersStyle": "Border style", "SSE.Views.Toolbar.textBottom": "Bottom: ", "SSE.Views.Toolbar.textBottomBorders": "Bottom borders", + "SSE.Views.Toolbar.textBullet": "Bullet", "SSE.Views.Toolbar.textCenterBorders": "Inside vertical borders", "SSE.Views.Toolbar.textClearPrintArea": "Clear print area", "SSE.Views.Toolbar.textClearRule": "Clear rules", "SSE.Views.Toolbar.textClockwise": "Angle clockwise", "SSE.Views.Toolbar.textColorScales": "Color scales", + "SSE.Views.Toolbar.textCopyright": "Copyright Sign", "SSE.Views.Toolbar.textCounterCw": "Angle counterclockwise", "SSE.Views.Toolbar.textCustom": "Custom", "SSE.Views.Toolbar.textDataBars": "Data bars", + "SSE.Views.Toolbar.textDegree": "Degree Sign", "SSE.Views.Toolbar.textDelLeft": "Shift cells left", + "SSE.Views.Toolbar.textDelta": "Greek Small Letter Delta", "SSE.Views.Toolbar.textDelUp": "Shift cells up", "SSE.Views.Toolbar.textDiagDownBorder": "Diagonal down border", "SSE.Views.Toolbar.textDiagUpBorder": "Diagonal up border", + "SSE.Views.Toolbar.textDivision": "Division Sign", + "SSE.Views.Toolbar.textDollar": "Dollar Sign", "SSE.Views.Toolbar.textDone": "Done", "SSE.Views.Toolbar.textEditVA": "Edit Visible Area", "SSE.Views.Toolbar.textEntireCol": "Entire column", "SSE.Views.Toolbar.textEntireRow": "Entire row", + "SSE.Views.Toolbar.textEuro": "Euro Sign", "SSE.Views.Toolbar.textFewPages": "pages", + "SSE.Views.Toolbar.textGreaterEqual": "Greater-Than Or Equal To", "SSE.Views.Toolbar.textHeight": "Height", "SSE.Views.Toolbar.textHideVA": "Hide Visible Area", "SSE.Views.Toolbar.textHorizontal": "Horizontal text", + "SSE.Views.Toolbar.textInfinity": "Infinity", "SSE.Views.Toolbar.textInsDown": "Shift cells down", "SSE.Views.Toolbar.textInsideBorders": "Inside borders", "SSE.Views.Toolbar.textInsRight": "Shift cells right", @@ -3872,6 +3884,8 @@ "SSE.Views.Toolbar.textLandscape": "Landscape", "SSE.Views.Toolbar.textLeft": "Left: ", "SSE.Views.Toolbar.textLeftBorders": "Left borders", + "SSE.Views.Toolbar.textLessEqual": "Less-Than Or Equal To", + "SSE.Views.Toolbar.textLetterPi": "Greek Small Letter Pi", "SSE.Views.Toolbar.textManageRule": "Manage rules", "SSE.Views.Toolbar.textManyPages": "pages", "SSE.Views.Toolbar.textMarginsLast": "Last Custom", @@ -3885,23 +3899,31 @@ "SSE.Views.Toolbar.textNewColor": "More colors", "SSE.Views.Toolbar.textNewRule": "New rule", "SSE.Views.Toolbar.textNoBorders": "No borders", + "SSE.Views.Toolbar.textNotEqualTo": "Not Equal To", + "SSE.Views.Toolbar.textOneHalf": "Vulgar Fraction One Half", "SSE.Views.Toolbar.textOnePage": "page", + "SSE.Views.Toolbar.textOneQuarter": "Vulgar Fraction One Quarter", "SSE.Views.Toolbar.textOutBorders": "Outside borders", "SSE.Views.Toolbar.textPageMarginsCustom": "Custom margins", + "SSE.Views.Toolbar.textPlusMinus": "Plus-Minus Sign", "SSE.Views.Toolbar.textPortrait": "Portrait", "SSE.Views.Toolbar.textPrint": "Print", "SSE.Views.Toolbar.textPrintGridlines": "Print Gridlines", "SSE.Views.Toolbar.textPrintHeadings": "Print Headings", "SSE.Views.Toolbar.textPrintOptions": "Print Settings", + "SSE.Views.Toolbar.textRegistered": "Registered Sign", "SSE.Views.Toolbar.textRight": "Right: ", "SSE.Views.Toolbar.textRightBorders": "Right borders", "SSE.Views.Toolbar.textRotateDown": "Rotate text down", "SSE.Views.Toolbar.textRotateUp": "Rotate text up", "SSE.Views.Toolbar.textScale": "Scale", "SSE.Views.Toolbar.textScaleCustom": "Custom", + "SSE.Views.Toolbar.textSection": "Section Sign", "SSE.Views.Toolbar.textSelection": "From current selection", "SSE.Views.Toolbar.textSetPrintArea": "Set print area", "SSE.Views.Toolbar.textShowVA": "Show Visible Area", + "SSE.Views.Toolbar.textSmile": "White Smiling Fase", + "SSE.Views.Toolbar.textSquareRoot": "Square Root", "SSE.Views.Toolbar.textStrikeout": "Strikethrough", "SSE.Views.Toolbar.textSubscript": "Subscript", "SSE.Views.Toolbar.textSubSuperscript": "Subscript/Superscript", @@ -3919,11 +3941,14 @@ "SSE.Views.Toolbar.textThisPivot": "From this pivot", "SSE.Views.Toolbar.textThisSheet": "From this worksheet", "SSE.Views.Toolbar.textThisTable": "From this table", + "SSE.Views.Toolbar.textTilde": "Tilde", "SSE.Views.Toolbar.textTop": "Top: ", "SSE.Views.Toolbar.textTopBorders": "Top borders", + "SSE.Views.Toolbar.textTradeMark": "Trade Mark Sign", "SSE.Views.Toolbar.textUnderline": "Underline", "SSE.Views.Toolbar.textVertical": "Vertical text", "SSE.Views.Toolbar.textWidth": "Width", + "SSE.Views.Toolbar.textYen": "Yen Sign", "SSE.Views.Toolbar.textZoom": "Zoom", "SSE.Views.Toolbar.tipAlignBottom": "Align bottom", "SSE.Views.Toolbar.tipAlignCenter": "Align center", diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index bfe7a3de9a..4108a4cc95 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -130,16 +130,24 @@ display: inline-block; width: 160px; padding-left: 3px; + .rtl & { + padding-left: 0; + padding-right: 3px; + } .item { .box-shadow(none); margin-left: 6px; + .rtl & { + margin-left: 4px; + margin-right: 6px; + } &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); - .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select-ie); + .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); } } .item-symbol { - font-family: @font-family-base;//Arial; + font-family: @font-family-base; font-size: 14px; display: block; width: 20px; From 0f8774533203313ce77fb194ed099bbe4ef2f7b5 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Fri, 16 Jun 2023 14:34:15 +0300 Subject: [PATCH 6/6] update style for menu symbols --- apps/common/main/resources/less/asc-mixins.less | 10 ++++++++++ apps/documenteditor/main/app/view/Toolbar.js | 1 - .../main/resources/less/toolbar.less | 14 +++----------- apps/presentationeditor/main/app/view/Toolbar.js | 4 ++-- .../main/resources/less/toolbar.less | 14 +++----------- apps/spreadsheeteditor/main/app/view/Toolbar.js | 4 ++-- .../main/resources/less/toolbar.less | 14 +++----------- 7 files changed, 23 insertions(+), 38 deletions(-) diff --git a/apps/common/main/resources/less/asc-mixins.less b/apps/common/main/resources/less/asc-mixins.less index 44a69b1b1e..7d940f0759 100644 --- a/apps/common/main/resources/less/asc-mixins.less +++ b/apps/common/main/resources/less/asc-mixins.less @@ -559,6 +559,16 @@ .margins-h-var() } +.margin-x(@left, @right) { + margin-left: @left; + margin-right: @right; + + .rtl & { + margin-left: @right; + margin-right: @left; + } +} + .margin-right(@value) { margin-right: @value; margin-left: 0; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index defb4fdffa..7fc05d72a0 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2927,7 +2927,6 @@ define([ }, loadRecentSymbolsFromStorage: function(){ - //Common.localStorage.removeItem('de-fastRecentSymbols'); var recents = Common.localStorage.getItem('de-fastRecentSymbols'); var arr =(!!recents) ? JSON.parse(recents) : [ diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index 24525d65f9..eb04da1d98 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -31,19 +31,11 @@ #id-toolbar-menu-symbols { display: inline-block; - width: 160px; - padding-left: 3px; - .rtl & { - padding-left: 0; - padding-right: 3px; - } + width: 158px; + .padding-left(3px); .item { .box-shadow(none); - margin-left: 6px; - .rtl & { - margin-left: 4px; - margin-right: 6px; - } + .margin-x(6px, 4px); &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index aeefa19712..f9e314675d 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -2104,7 +2104,7 @@ define([ }, loadRecentSymbolsFromStorage: function(){ - var recents = Common.localStorage.getItem('de-fastRecentSymbols'); + var recents = Common.localStorage.getItem('pe-fastRecentSymbols'); var arr = (!!recents) ? JSON.parse(recents) : [ { symbol: 8226, font: 'Arial'}, @@ -2154,7 +2154,7 @@ define([ return {symbol: item.get('symbol'), font: item.get('font')}; }); var sJSON = JSON.stringify(arr); - Common.localStorage.setItem( 'de-fastRecentSymbols', sJSON); + Common.localStorage.setItem( 'pe-fastRecentSymbols', sJSON); }, getSymbolDescription: function(symbol){ diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 47fd614a47..3516172df2 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -50,19 +50,11 @@ #id-toolbar-menu-symbols { display: inline-block; - width: 160px; - padding-left: 3px; - .rtl & { - padding-left: 0; - padding-right: 3px; - } + width: 158px; + .padding-left(3px); .item { .box-shadow(none); - margin-left: 6px; - .rtl & { - margin-left: 4px; - margin-right: 6px; - } + .margin-x(6px, 4px); &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index b03ef5ccd9..358375b10f 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -3291,7 +3291,7 @@ define([ }, loadRecentSymbolsFromStorage: function(){ - var recents = Common.localStorage.getItem('de-fastRecentSymbols'); + var recents = Common.localStorage.getItem('sse-fastRecentSymbols'); var arr = (!!recents) ? JSON.parse(recents) : [ { symbol: 8226, font: 'Arial'}, @@ -3341,7 +3341,7 @@ define([ return {symbol: item.get('symbol'), font: item.get('font')}; }); var sJSON = JSON.stringify(arr); - Common.localStorage.setItem( 'de-fastRecentSymbols', sJSON); + Common.localStorage.setItem( 'sse-fastRecentSymbols', sJSON); }, getSymbolDescription: function(symbol){ diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index e9bfd02278..83cc618279 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -128,19 +128,11 @@ #id-toolbar-menu-symbols { display: inline-block; - width: 160px; - padding-left: 3px; - .rtl & { - padding-left: 0; - padding-right: 3px; - } + width: 158px; + .padding-left(3px); .item { .box-shadow(none); - margin-left: 6px; - .rtl & { - margin-left: 4px; - margin-right: 6px; - } + .margin-x(6px, 4px); &:hover, &.selected{ .box-shadow( 0 0 0 2px @border-preview-select-ie); .box-shadow( 0 0 0 @scaled-two-px-value @border-preview-select);