[DE] Bug 42912

This commit is contained in:
Julia Radzhabova 2021-01-18 16:41:49 +03:00
parent fa3dc87b8e
commit 9b561aab66
4 changed files with 36 additions and 3 deletions

View file

@ -260,6 +260,7 @@ define([
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
toolbar.btnIncFontSize.on('click', _.bind(this.onIncrease, this));
toolbar.btnDecFontSize.on('click', _.bind(this.onDecrease, this));
toolbar.mnuChangeCase.on('item:click', _.bind(this.onChangeCase, this));
toolbar.btnBold.on('click', _.bind(this.onBold, this));
toolbar.btnItalic.on('click', _.bind(this.onItalic, this));
toolbar.btnUnderline.on('click', _.bind(this.onUnderline, this));
@ -1337,6 +1338,12 @@ define([
}
},
onChangeCase: function(menu, item, e) {
if (this.api)
this.api.asc_ChangeTextCase(item.value);
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onSelectBullets: function(btn, picker, itemView, record) {
var rawData = {},
isPickerSelect = _.isFunction(record.toJSON);

View file

@ -35,6 +35,7 @@
<span class="btn-slot" id="slot-field-fontsize"></span>
<span class="btn-slot" id="slot-btn-incfont"></span>
<span class="btn-slot" id="slot-btn-decfont"></span>
<span class="btn-slot split" id="slot-btn-changecase"></span>
</div>
<div class="elset font-attr">
<span class="btn-slot" id="slot-btn-bold"></span>

View file

@ -290,6 +290,22 @@ define([
this.paragraphControls.push(this.btnParagraphColor);
this.textOnlyControls.push(this.btnParagraphColor);
this.btnChangeCase = new Common.UI.Button({
id: 'id-toolbar-btn-case',
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-case',
menu: new Common.UI.Menu({
items: [
{caption: this.mniSentenceCase, value: Asc.c_oAscChangeTextCaseType.SentenceCase},
{caption: this.mniLowerCase, value: Asc.c_oAscChangeTextCaseType.LowerCase},
{caption: this.mniUpperCase, value: Asc.c_oAscChangeTextCaseType.UpperCase},
{caption: this.mniCapitalizeWords, value: Asc.c_oAscChangeTextCaseType.CapitalizeWords},
{caption: this.mniToggleCase, value: Asc.c_oAscChangeTextCaseType.ToggleCase}
]
})
});
this.paragraphControls.push(this.btnChangeCase);
this.btnAlignLeft = new Common.UI.Button({
id: 'id-toolbar-btn-align-left',
cls: 'btn-toolbar',
@ -1095,6 +1111,7 @@ define([
this.mnuInsertImage = this.btnInsertImage.menu;
this.mnuPageSize = this.btnPageSize.menu;
this.mnuColorSchema = this.btnColorSchemas.menu;
this.mnuChangeCase = this.btnChangeCase.menu;
this.cmbFontSize = new Common.UI.ComboBox({
cls: 'input-group-nr',
@ -1347,6 +1364,7 @@ define([
_injectComponent('#slot-btn-subscript', this.btnSubscript);
_injectComponent('#slot-btn-highlight', this.btnHighlightColor);
_injectComponent('#slot-btn-fontcolor', this.btnFontColor);
_injectComponent('#slot-btn-changecase', this.btnChangeCase);
_injectComponent('#slot-btn-align-left', this.btnAlignLeft);
_injectComponent('#slot-btn-align-center', this.btnAlignCenter);
_injectComponent('#slot-btn-align-right', this.btnAlignRight);
@ -1638,6 +1656,7 @@ define([
this.btnHighlightColor.updateHint(this.tipHighlightColor);
this.btnFontColor.updateHint(this.tipFontColor);
this.btnParagraphColor.updateHint(this.tipPrColor);
this.btnChangeCase.updateHint(this.tipChangeCase);
this.btnAlignLeft.updateHint(this.tipAlignLeft + Common.Utils.String.platformKey('Ctrl+L'));
this.btnAlignCenter.updateHint(this.tipAlignCenter + Common.Utils.String.platformKey('Ctrl+E'));
this.btnAlignRight.updateHint(this.tipAlignRight + Common.Utils.String.platformKey('Ctrl+R'));
@ -2392,7 +2411,13 @@ define([
textRestartEachSection: 'Restart Each Section',
textSuppressForCurrentParagraph: 'Suppress for Current Paragraph',
textCustomLineNumbers: 'Line Numbering Options',
tipLineNumbers: 'Show line numbers'
tipLineNumbers: 'Show line numbers',
tipChangeCase: 'Change case',
mniSentenceCase: 'Sentence case.',
mniLowerCase: 'lowercase',
mniUpperCase: 'UPPERCASE',
mniCapitalizeWords: 'Capitalize Each Word',
mniToggleCase: 'tOGGLE cASE'
}
})(), DE.Views.Toolbar || {}));
});

View file

@ -217,7 +217,7 @@
#slot-field-fontname {
float: left;
width: 117px;
width: 84px;
}
#slot-field-fontsize {
@ -226,7 +226,7 @@
margin-left: 2px;
}
#slot-btn-incfont, #slot-btn-decfont {
#slot-btn-incfont, #slot-btn-decfont, #slot-btn-changecase {
margin-left: 2px;
}