[PE][SSE] Add symbol from symbol table

This commit is contained in:
Julia Radzhabova 2019-11-14 11:48:58 +03:00
parent 088a3b8020
commit bdbde4cde6
10 changed files with 92 additions and 7 deletions

View file

@ -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("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>");
} else
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
win.show();
win.on('symbol:dblclick', function(cmp, settings) {
me.api.pluginMethod_PasteHtml("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>");
});
}
},
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 || {}));
});

View file

@ -129,6 +129,7 @@
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-insertequation"></span>
<span class="btn-slot text x-huge" id="slot-btn-inssymbol"></span>
</div>
</section>
</section>

View file

@ -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 || {}));
});

View file

@ -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"
}

View file

@ -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
// --------------------------------------------------

View file

@ -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("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>");
} else
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
win.show();
win.on('symbol:dblclick', function(cmp, settings) {
me.api.pluginMethod_PasteHtml("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>");
});
}
},
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 || {}));
});

View file

@ -142,6 +142,7 @@
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-insequation"></span>
<span class="btn-slot text x-huge" id="slot-btn-inssymbol"></span>
</div>
</section>
<section class="panel" data-tab="layout">

View file

@ -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 || {}));
});

View file

@ -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.<br>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. <br>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",

View file

@ -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
// --------------------------------------------------