From bdbde4cde68f3189d3b8b04a2fecd196a513d03c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 14 Nov 2019 11:48:58 +0300 Subject: [PATCH] [PE][SSE] Add symbol from symbol table --- .../main/app/controller/Toolbar.js | 27 ++++++++++++++++++- .../main/app/template/Toolbar.template | 1 + .../main/app/view/Toolbar.js | 17 ++++++++++-- apps/presentationeditor/main/locale/en.json | 5 +++- .../main/resources/less/app.less | 1 + .../main/app/controller/Toolbar.js | 27 ++++++++++++++++++- .../main/app/template/Toolbar.template | 1 + .../main/app/view/Toolbar.js | 16 +++++++++-- apps/spreadsheeteditor/main/locale/en.json | 3 +++ .../main/resources/less/app.less | 1 + 10 files changed, 92 insertions(+), 7 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 54e414d37..64d75d653 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -49,6 +49,7 @@ define([ 'common/main/lib/view/InsertTableDialog', 'common/main/lib/view/SelectFileDlg', 'common/main/lib/view/ListSettingsDialog', + 'common/main/lib/view/SymbolTableDialog', 'common/main/lib/util/define', 'presentationeditor/main/app/collection/SlideThemes', 'presentationeditor/main/app/view/Toolbar', @@ -310,6 +311,7 @@ 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.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')); @@ -1825,6 +1827,28 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation); }, + onInsertSymbolClick: function() { + if (this.api) { + var me = this, + win = new Common.Views.SymbolTableDialog({ + api: me.api, + lang: me.toolbar.mode.lang, + type: 1, + buttons: [{value: 'ok', caption: this.textInsert}, 'close'], + handler: function(dlg, result, settings) { + if (result == 'ok') { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + } else + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + }); + win.show(); + win.on('symbol:dblclick', function(cmp, settings) { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + }); + } + }, + onApiMathTypes: function(equation) { this._equationTemp = equation; var me = this; @@ -2528,7 +2552,8 @@ define([ txtMatrix_2_2_LineBracket : 'Empty Matrix with Brackets', txtMatrix_2_2_DLineBracket : 'Empty Matrix with Brackets', txtMatrix_Flat_Round : 'Sparse Matrix', - txtMatrix_Flat_Square : 'Sparse Matrix' + txtMatrix_Flat_Square : 'Sparse Matrix', + textInsert: 'Insert' }, PE.Controllers.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 0b8287bc6..4d5e1c3d2 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -129,6 +129,7 @@
+
diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 13f52082c..a5cb95d6b 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -543,6 +543,15 @@ define([ }); me.slideOnlyControls.push(this.btnInsertEquation); + me.btnInsertSymbol = new Common.UI.Button({ + id: 'tlbtn-insertsymbol', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'btn-symbol', + caption: me.capBtnInsSymbol, + lock: [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noParagraphSelected] + }); + me.paragraphControls.push(me.btnInsertSymbol); + me.btnInsertHyperlink = new Common.UI.Button({ id: 'tlbtn-insertlink', cls: 'btn-toolbar x-huge icon-top', @@ -815,7 +824,7 @@ define([ this.btnSubscript, this.btnFontColor, this.btnClearStyle, this.btnCopyStyle, this.btnMarkers, this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign, this.btnVerticalAlign, this.btnShapeArrange, this.btnShapeAlign, this.btnInsertTable, this.btnInsertChart, - this.btnInsertEquation, this.btnInsertHyperlink, this.btnColorSchemas, this.btnSlideSize, this.listTheme, this.mnuShowSettings + this.btnInsertEquation, this.btnInsertSymbol, this.btnInsertHyperlink, this.btnColorSchemas, this.btnSlideSize, this.listTheme, this.mnuShowSettings ]; // Disable all components before load document @@ -933,6 +942,7 @@ define([ _injectComponent('#slot-btn-arrange-shape', this.btnShapeArrange); _injectComponent('#slot-btn-align-shape', this.btnShapeAlign); _injectComponent('#slot-btn-insertequation', this.btnInsertEquation); + _injectComponent('#slot-btn-inssymbol', this.btnInsertSymbol); _injectComponent('#slot-btn-insertlink', this.btnInsertHyperlink); _injectComponent('#slot-btn-inserttable', this.btnInsertTable); _injectComponent('#slot-btn-insertchart', this.btnInsertChart); @@ -1044,6 +1054,7 @@ define([ this.btnInsertTable.updateHint(this.tipInsertTable); this.btnInsertChart.updateHint(this.tipInsertChart); this.btnInsertEquation.updateHint(this.tipInsertEquation); + this.btnInsertSymbol.updateHint(this.tipInsertSymbol); this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K')); this.btnInsertTextArt.updateHint(this.tipInsertTextArt); this.btnColorSchemas.updateHint(this.tipColorSchemas); @@ -1676,7 +1687,9 @@ define([ capBtnInsHeader: 'Header/Footer', capBtnSlideNum: 'Slide Number', capBtnDateTime: 'Date & Time', - textListSettings: 'List Settings' + textListSettings: 'List Settings', + capBtnInsSymbol: 'Symbol', + tipInsertSymbol: 'Insert symbol' } }()), 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 e1c99e63b..dd431ece4 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -908,6 +908,7 @@ "PE.Controllers.Toolbar.txtSymbol_vdots": "Vertical ellipsis", "PE.Controllers.Toolbar.txtSymbol_xsi": "Xi", "PE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", + "PE.Controllers.Toolbar.textInsert": "Insert", "PE.Controllers.Viewport.textFitPage": "Fit to Slide", "PE.Controllers.Viewport.textFitWidth": "Fit to Width", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings", @@ -1798,5 +1799,7 @@ "PE.Views.Toolbar.txtScheme8": "Flow", "PE.Views.Toolbar.txtScheme9": "Foundry", "PE.Views.Toolbar.txtSlideAlign": "Align to Slide", - "PE.Views.Toolbar.txtUngroup": "Ungroup" + "PE.Views.Toolbar.txtUngroup": "Ungroup", + "PE.Views.Toolbar.capBtnInsSymbol": "Symbol", + "PE.Views.Toolbar.tipInsertSymbol": "Insert symbol" } \ No newline at end of file diff --git a/apps/presentationeditor/main/resources/less/app.less b/apps/presentationeditor/main/resources/less/app.less index 0e0890b76..9f99ba211 100644 --- a/apps/presentationeditor/main/resources/less/app.less +++ b/apps/presentationeditor/main/resources/less/app.less @@ -114,6 +114,7 @@ @import "../../../../common/main/resources/less/toolbar.less"; @import "../../../../common/main/resources/less/language-dialog.less"; @import "../../../../common/main/resources/less/winxp_fix.less"; +@import "../../../../common/main/resources/less/symboltable.less"; // App // -------------------------------------------------- diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index f37309543..1c6b65022 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -44,6 +44,7 @@ define([ 'common/main/lib/view/CopyWarningDialog', 'common/main/lib/view/ImageFromUrlDialog', 'common/main/lib/view/SelectFileDlg', + 'common/main/lib/view/SymbolTableDialog', 'common/main/lib/util/define', 'spreadsheeteditor/main/app/view/Toolbar', 'spreadsheeteditor/main/app/collection/TableTemplates', @@ -323,6 +324,7 @@ define([ toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, 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.btnTableTemplate.menu.on('show:after', _.bind(this.onTableTplMenuOpen, this)); toolbar.btnPercentStyle.on('click', _.bind(this.onNumberFormat, this)); toolbar.btnCurrencyStyle.on('click', _.bind(this.onNumberFormat, this)); @@ -2763,6 +2765,28 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation); }, + onInsertSymbolClick: function() { + if (this.api) { + var me = this, + win = new Common.Views.SymbolTableDialog({ + api: me.api, + lang: me.toolbar.mode.lang, + type: 1, + buttons: [{value: 'ok', caption: this.textInsert}, 'close'], + handler: function(dlg, result, settings) { + if (result == 'ok') { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + } else + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + }); + win.show(); + win.on('symbol:dblclick', function(cmp, settings) { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + }); + } + }, + onApiMathTypes: function(equation) { this._equationTemp = equation; var me = this; @@ -3811,7 +3835,8 @@ define([ textPivot: 'Pivot Table', txtTable_TableStyleMedium: 'Table Style Medium', txtTable_TableStyleDark: 'Table Style Dark', - txtTable_TableStyleLight: 'Table Style Light' + txtTable_TableStyleLight: 'Table Style Light', + textInsert: 'Insert' }, SSE.Controllers.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index 9d812e6b3..b1f14757a 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -142,6 +142,7 @@
+
diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 08ac23eba..80741de00 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -714,6 +714,14 @@ define([ menu : new Common.UI.Menu({cls: 'menu-shapes'}) }); + me.btnInsertSymbol = new Common.UI.Button({ + id: 'tlbtn-insertsymbol', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'btn-symbol', + caption: me.capBtnInsSymbol, + lock: [_set.selImage, _set.selChart, _set.selShape, _set.editFormula, _set.selRangeEdit, _set.coAuth, _set.coAuthText, _set.lostConnect] + }); + me.btnTableTemplate = new Common.UI.Button({ id : 'id-toolbar-btn-ttempl', cls : 'btn-toolbar', @@ -1459,7 +1467,7 @@ define([ me.btnItalic, me.btnUnderline, me.btnStrikeout, me.btnSubscript, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft, me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust, me.btnVerticalAlign, me.btnAlignTop, me.btnAlignMiddle, me.btnAlignBottom, me.btnWrap, me.btnTextOrient, me.btnBackColor, me.btnInsertTable, - me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation, + me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation, me.btnInsertSymbol, me.btnInsertText, me.btnInsertTextArt, me.btnSortUp, me.btnSortDown, me.btnSetAutofilter, me.btnClearAutofilter, me.btnTableTemplate, me.btnPercentStyle, me.btnCurrencyStyle, me.btnDecDecimal, me.btnAddCell, me.btnDeleteCell, me.cmbNumberFormat, me.btnBorders, me.btnInsertImage, me.btnInsertHyperlink, @@ -1635,6 +1643,7 @@ define([ _injectComponent('#slot-btn-instext', this.btnInsertText); _injectComponent('#slot-btn-instextart', this.btnInsertTextArt); _injectComponent('#slot-btn-insequation', this.btnInsertEquation); + _injectComponent('#slot-btn-inssymbol', this.btnInsertSymbol); _injectComponent('#slot-btn-sortdesc', this.btnSortDown); _injectComponent('#slot-btn-sortasc', this.btnSortUp); _injectComponent('#slot-btn-setfilter', this.btnSetAutofilter); @@ -1717,6 +1726,7 @@ define([ _updateHint(this.btnInsertHyperlink, this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K')); _updateHint(this.btnInsertShape, this.tipInsertShape); _updateHint(this.btnInsertEquation, this.tipInsertEquation); + _updateHint(this.btnInsertSymbol, this.tipInsertSymbol); _updateHint(this.btnSortDown, this.txtSortAZ); _updateHint(this.btnSortUp, this.txtSortZA); _updateHint(this.btnSetAutofilter, this.txtFilter + ' (Ctrl+Shift+L)'); @@ -2520,6 +2530,8 @@ define([ textManyPages: 'pages', textHeight: 'Height', textWidth: 'Width', - textMorePages: 'More pages' + textMorePages: 'More pages', + capBtnInsSymbol: 'Symbol', + tipInsertSymbol: 'Insert symbol' }, 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 6463233b9..57ebf73da 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1098,6 +1098,7 @@ "SSE.Controllers.Toolbar.txtTable_TableStyleMedium": "Table Style Medium", "SSE.Controllers.Toolbar.warnLongOperation": "The operation you are about to perform might take rather much time to complete.
Are you sure you want to continue?", "SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell.
Are you sure you want to continue?", + "SSE.Controllers.Toolbar.textInsert": "Insert", "SSE.Controllers.Viewport.textFreezePanes": "Freeze Panes", "SSE.Controllers.Viewport.textHideFBar": "Hide Formula Bar", "SSE.Controllers.Viewport.textHideGridlines": "Hide Gridlines", @@ -2437,6 +2438,8 @@ "SSE.Views.Toolbar.txtTime": "Time", "SSE.Views.Toolbar.txtUnmerge": "Unmerge Cells", "SSE.Views.Toolbar.txtYen": "¥ Yen", + "SSE.Views.Toolbar.capBtnInsSymbol": "Symbol", + "SSE.Views.Toolbar.tipInsertSymbol": "Insert symbol", "SSE.Views.Top10FilterDialog.textType": "Show", "SSE.Views.Top10FilterDialog.txtBottom": "Bottom", "SSE.Views.Top10FilterDialog.txtItems": "Item", diff --git a/apps/spreadsheeteditor/main/resources/less/app.less b/apps/spreadsheeteditor/main/resources/less/app.less index 665d6f51e..5bd93bc68 100644 --- a/apps/spreadsheeteditor/main/resources/less/app.less +++ b/apps/spreadsheeteditor/main/resources/less/app.less @@ -115,6 +115,7 @@ @import "../../../../common/main/resources/less/toolbar.less"; @import "../../../../common/main/resources/less/language-dialog.less"; @import "../../../../common/main/resources/less/winxp_fix.less"; +@import "../../../../common/main/resources/less/symboltable.less"; // App // --------------------------------------------------