Skip to content

Commit

Permalink
Add replace button to toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Feb 7, 2024
1 parent dd51378 commit 4d0f135
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 6 deletions.
5 changes: 5 additions & 0 deletions apps/documenteditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ define([
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, 'paste'));
toolbar.btnCut.on('click', _.bind(this.onCopyPaste, this, 'cut'));
toolbar.btnSelectAll.on('click', _.bind(this.onSelectAll, this));
toolbar.btnReplace.on('click', _.bind(this.onReplace, this));
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));
Expand Down Expand Up @@ -1139,6 +1140,10 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Select All');
},

onReplace: function(e) {
this.getApplication().getController('LeftMenu').onShortcut('replace');
},

onIncrease: function(e) {
if (this.api)
this.api.FontSizeIn();
Expand Down
14 changes: 13 additions & 1 deletion apps/documenteditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,16 @@ define([
});
this.toolbarControls.push(this.btnSelectAll);

this.btnReplace = new Common.UI.Button({
id: 'id-toolbar-btn-replace',
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-replace',
lock: [_set.viewFormMode, _set.disableOnStart],
dataHint: '1',
dataHintDirection: 'top'
});
this.toolbarControls.push(this.btnReplace);

this.btnIncFontSize = new Common.UI.Button({
id: 'id-toolbar-btn-incfont',
cls: 'btn-toolbar',
Expand Down Expand Up @@ -1716,6 +1726,7 @@ define([
_injectComponent('#slot-btn-paste', this.btnPaste);
_injectComponent('#slot-btn-cut', this.btnCut);
_injectComponent('#slot-btn-select-all', this.btnSelectAll);
_injectComponent('#slot-btn-replace', this.btnReplace);
_injectComponent('#slot-btn-incfont', this.btnIncFontSize);
_injectComponent('#slot-btn-decfont', this.btnDecFontSize);
_injectComponent('#slot-btn-bold', this.btnBold);
Expand Down Expand Up @@ -2108,6 +2119,7 @@ define([
this.btnPaste.updateHint(this.tipPaste + Common.Utils.String.platformKey('Ctrl+V'));
this.btnCut.updateHint(this.tipCut + Common.Utils.String.platformKey('Ctrl+X'));
this.btnSelectAll.updateHint(this.tipSelectAll + Common.Utils.String.platformKey('Ctrl+A'));
this.btnReplace.updateHint(this.tipReplace + ' (' + Common.Utils.String.textCtrl + '+H)');
this.btnIncFontSize.updateHint(this.tipIncFont + Common.Utils.String.platformKey('Ctrl+]'));
this.btnDecFontSize.updateHint(this.tipDecFont + Common.Utils.String.platformKey('Ctrl+['));
this.btnBold.updateHint(this.textBold + Common.Utils.String.platformKey('Ctrl+B'));
Expand Down Expand Up @@ -3387,7 +3399,7 @@ define([
textCustomHyphen: 'Hyphenation options',
tipHyphenation: 'Change hyphenation',
capColorScheme: 'Color Scheme',

tipReplace: 'Replace'
}
})(), DE.Views.Toolbar || {}));
});
1 change: 1 addition & 0 deletions apps/documenteditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3428,6 +3428,7 @@
"DE.Views.Toolbar.tipSave": "Save",
"DE.Views.Toolbar.tipSaveCoauth": "Save your changes for the other users to see them.",
"DE.Views.Toolbar.tipSelectAll": "Select all",
"DE.Views.Toolbar.tipReplace": "Replace",
"DE.Views.Toolbar.tipSendBackward": "Send backward",
"DE.Views.Toolbar.tipSendForward": "Bring forward",
"DE.Views.Toolbar.tipShowHiddenChars": "Nonprinting characters",
Expand Down
7 changes: 6 additions & 1 deletion apps/presentationeditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ define([
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, 'paste'));
toolbar.btnCut.on('click', _.bind(this.onCopyPaste, this, 'cut'));
toolbar.btnSelectAll.on('click', _.bind(this.onSelectAll, this));
toolbar.btnReplace.on('click', _.bind(this.onReplace, this));
toolbar.btnIncFontSize.on('click', _.bind(this.onIncrease, this));
toolbar.btnDecFontSize.on('click', _.bind(this.onDecrease, this));
toolbar.btnBold.on('click', _.bind(this.onBold, this));
Expand Down Expand Up @@ -766,7 +767,7 @@ define([
this._state.no_slides = (count<=0);
this.toolbar.lockToolbar(Common.enumLock.noSlides, this._state.no_slides, {array: this.toolbar.paragraphControls});
this.toolbar.lockToolbar(Common.enumLock.noSlides, this._state.no_slides, {array: [
this.toolbar.btnChangeSlide, this.toolbar.btnPreview, this.toolbar.btnPrint, this.toolbar.btnCopy, this.toolbar.btnCut, this.toolbar.btnSelectAll, this.toolbar.btnPaste,
this.toolbar.btnChangeSlide, this.toolbar.btnPreview, this.toolbar.btnPrint, this.toolbar.btnCopy, this.toolbar.btnCut, this.toolbar.btnSelectAll, this.toolbar.btnReplace, this.toolbar.btnPaste,
this.toolbar.btnCopyStyle, this.toolbar.btnInsertTable, this.toolbar.btnInsertChart, this.toolbar.btnInsertSmartArt,
this.toolbar.btnColorSchemas, this.toolbar.btnShapeAlign, this.toolbar.cmbInsertShape,
this.toolbar.btnShapeArrange, this.toolbar.btnSlideSize, this.toolbar.listTheme, this.toolbar.btnEditHeader, this.toolbar.btnInsDateTime, this.toolbar.btnInsSlideNum
Expand Down Expand Up @@ -1215,6 +1216,10 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Select All');
},

onReplace: function(e) {
this.getApplication().getController('LeftMenu').onShortcut('replace');
},

onIncrease: function(e) {
if (this.api)
this.api.FontSizeIn();
Expand Down
17 changes: 15 additions & 2 deletions apps/presentationeditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,16 @@ define([
});
me.slideOnlyControls.push(me.btnSelectAll);

me.btnReplace = new Common.UI.Button({
id: 'id-toolbar-btn-replace',
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-replace',
lock: [_set.noSlides, _set.disableOnStart],
dataHint: '1',
dataHintDirection: 'top'
});
me.slideOnlyControls.push(me.btnReplace);

me.cmbFontName = new Common.UI.ComboBoxFonts({
cls: 'input-group-nr',
menuCls: 'scrollable-menu',
Expand Down Expand Up @@ -1162,7 +1172,7 @@ define([
this.slideOnlyControls.push(this.cmbInsertShape);

this.lockControls = [this.btnChangeSlide, this.btnSave,
this.btnCopy, this.btnPaste, this.btnCut, this.btnSelectAll,this.btnUndo, this.btnRedo, this.cmbFontName, this.cmbFontSize, this.btnIncFontSize, this.btnDecFontSize,
this.btnCopy, this.btnPaste, this.btnCut, this.btnSelectAll, this.btnReplace,this.btnUndo, this.btnRedo, this.cmbFontName, this.cmbFontSize, this.btnIncFontSize, this.btnDecFontSize,
this.btnBold, this.btnItalic, this.btnUnderline, this.btnStrikeout, this.btnSuperscript, this.btnChangeCase, this.btnHighlightColor,
this.btnSubscript, this.btnFontColor, this.btnClearStyle, this.btnCopyStyle, this.btnMarkers,
this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign, this.btnColumns,
Expand Down Expand Up @@ -1269,6 +1279,7 @@ define([
_injectComponent('#slot-btn-paste', this.btnPaste);
_injectComponent('#slot-btn-cut', this.btnCut);
_injectComponent('#slot-btn-select-all', this.btnSelectAll);
_injectComponent('#slot-btn-replace', this.btnReplace);
_injectComponent('#slot-btn-bold', this.btnBold);
_injectComponent('#slot-btn-italic', this.btnItalic);
_injectComponent('#slot-btn-underline', this.btnUnderline);
Expand Down Expand Up @@ -1456,6 +1467,7 @@ define([
this.btnPaste.updateHint(this.tipPaste + Common.Utils.String.platformKey('Ctrl+V'));
this.btnCut.updateHint(this.tipCut + Common.Utils.String.platformKey('Ctrl+X'));
this.btnSelectAll.updateHint(this.tipSelectAll + Common.Utils.String.platformKey('Ctrl+A'));
this.btnReplace.updateHint(this.tipReplace + ' (' + Common.Utils.String.textCtrl + '+H)');
this.btnIncFontSize.updateHint(this.tipIncFont + Common.Utils.String.platformKey('Ctrl+]'));
this.btnDecFontSize.updateHint(this.tipDecFont + Common.Utils.String.platformKey('Ctrl+['));
this.btnBold.updateHint(this.textBold + Common.Utils.String.platformKey('Ctrl+B'));
Expand Down Expand Up @@ -2378,7 +2390,8 @@ define([
textTradeMark: 'Trade Mark Sign',
textYen: 'Yen Sign',
capBtnInsHeaderFooter: 'Header & Footer',
tipEditHeaderFooter: 'Edit header or footer'
tipEditHeaderFooter: 'Edit header or footer',
tipReplace: 'Replace'
}
}()), PE.Views.Toolbar || {}));
});
1 change: 1 addition & 0 deletions apps/presentationeditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2689,6 +2689,7 @@
"PE.Views.Toolbar.tipSave": "Save",
"PE.Views.Toolbar.tipSaveCoauth": "Save your changes for the other users to see them.",
"PE.Views.Toolbar.tipSelectAll": "Select all",
"PE.Views.Toolbar.tipReplace": "Replace",
"PE.Views.Toolbar.tipShapeAlign": "Align shape",
"PE.Views.Toolbar.tipShapeArrange": "Arrange shape",
"PE.Views.Toolbar.tipSlideNum": "Insert slide number",
Expand Down
5 changes: 5 additions & 0 deletions apps/spreadsheeteditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ define([
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, 'paste'));
toolbar.btnCut.on('click', _.bind(this.onCopyPaste, this, 'cut'));
toolbar.btnSelectAll.on('click', _.bind(this.onSelectAll, this));
toolbar.btnReplace.on('click', _.bind(this.onReplace, this));
toolbar.btnIncFontSize.on('click', _.bind(this.onIncreaseFontSize, this));
toolbar.btnDecFontSize.on('click', _.bind(this.onDecreaseFontSize, this));
toolbar.mnuChangeCase.on('item:click', _.bind(this.onChangeCase, this));
Expand Down Expand Up @@ -646,6 +647,10 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Select All');
},

onReplace: function(e) {
this.getApplication().getController('LeftMenu').onShortcut('replace');
},

onIncreaseFontSize: function(e) {
if (this.api)
this.api.asc_increaseFontSize();
Expand Down
16 changes: 14 additions & 2 deletions apps/spreadsheeteditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,15 @@ define([
dataHintDirection: 'bottom'
});

me.btnReplace = new Common.UI.Button({
id: 'id-toolbar-btn-replace',
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-replace',
lock: [_set.disableOnStart],
dataHint: '1',
dataHintDirection: 'top'
});

me.cmbFontSize = new Common.UI.ComboBox({
cls : 'input-group-nr',
menuStyle : 'min-width: 55px;',
Expand Down Expand Up @@ -2209,7 +2218,7 @@ define([
me.btnTableTemplate, me.btnCellStyle, me.btnPercentStyle, me.btnCurrencyStyle, me.btnDecDecimal, me.btnAddCell, me.btnDeleteCell, me.btnCondFormat,
me.cmbNumberFormat, me.btnBorders, me.btnInsertImage, me.btnInsertHyperlink,
me.btnInsertChart, me.btnInsertChartRecommend, me.btnColorSchemas, me.btnInsertSparkline,
me.btnCopy, me.btnPaste, me.btnCut, me.btnSelectAll, me.listStyles, me.btnPrint,
me.btnCopy, me.btnPaste, me.btnCut, me.btnSelectAll, me.btnReplace, me.listStyles, me.btnPrint,
/*me.btnSave,*/ me.btnClearStyle, me.btnCopyStyle,
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnPrintArea, me.btnPageBreak, me.btnPrintTitles, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup, me.btnScale,
me.chPrintGridlines, me.chPrintHeadings, me.btnVisibleArea, me.btnVisibleAreaClose, me.btnTextFormatting, me.btnHorizontalAlign, me.btnVerticalAlign
Expand Down Expand Up @@ -2346,6 +2355,7 @@ define([
_injectComponent('#slot-btn-paste', this.btnPaste);
_injectComponent('#slot-btn-cut', this.btnCut);
_injectComponent('#slot-btn-select-all', this.btnSelectAll);
_injectComponent('#slot-btn-replace', this.btnReplace);
_injectComponent('#slot-btn-incfont', this.btnIncFontSize);
_injectComponent('#slot-btn-decfont', this.btnDecFontSize);
_injectComponent('#slot-btn-bold', this.btnBold);
Expand Down Expand Up @@ -2446,6 +2456,7 @@ define([
_updateHint(this.btnPaste, this.tipPaste + Common.Utils.String.platformKey('Ctrl+V'));
_updateHint(this.btnCut, this.tipCut + Common.Utils.String.platformKey('Ctrl+X'));
_updateHint(this.btnSelectAll, this.tipSelectAll + Common.Utils.String.platformKey('Ctrl+A'));
_updateHint(this.btnReplace, this.tipReplace + ' (' + Common.Utils.String.textCtrl + '+H)');
_updateHint(this.btnUndo, this.tipUndo + Common.Utils.String.platformKey('Ctrl+Z'));
_updateHint(this.btnRedo, this.tipRedo + Common.Utils.String.platformKey('Ctrl+Y'));
_updateHint(this.btnIncFontSize, this.tipIncFont + Common.Utils.String.platformKey('Ctrl+]'));
Expand Down Expand Up @@ -3754,7 +3765,8 @@ define([
textFillLeft: 'Left',
textFillRight: 'Right',
textSeries: 'Series',
txtFillNum: 'Fill'
txtFillNum: 'Fill',
tipReplace: 'Replace'

}, SSE.Views.Toolbar || {}));
});
1 change: 1 addition & 0 deletions apps/spreadsheeteditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4187,6 +4187,7 @@
"SSE.Views.Toolbar.tipSaveCoauth": "Save your changes for the other users to see them.",
"SSE.Views.Toolbar.tipScale": "Scale to fit",
"SSE.Views.Toolbar.tipSelectAll": "Select all",
"SSE.Views.Toolbar.tipReplace": "Replace",
"SSE.Views.Toolbar.tipSendBackward": "Send backward",
"SSE.Views.Toolbar.tipSendForward": "Bring forward",
"SSE.Views.Toolbar.tipSynchronize": "The document has been changed by another user. Please click to save your changes and reload the updates.",
Expand Down

0 comments on commit 4d0f135

Please sign in to comment.