[SSE PE DE] For the button on the toolbar added the option to create vertical text

This commit is contained in:
Alexei Koshelev 2022-10-02 21:31:12 +03:00
parent 12b205629f
commit 15f495ee58
12 changed files with 75 additions and 18 deletions

View file

@ -334,7 +334,11 @@ define([
toolbar.mnuInsertTable.on('item:click', _.bind(this.onInsertTableClick, this));
toolbar.mnuInsertTable.on('show:after', _.bind(this.onInsertTableShow, this));
toolbar.mnuInsertImage.on('item:click', _.bind(this.onInsertImageClick, this));
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this, 'textRect'));
toolbar.btnInsertText.menu.on('item:click', _.bind(function(btn, e) {
this.toolbar.btnInsertText.toggle(true);
this.onBtnInsertTextClick(e.value, btn, e);
}, this));
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
toolbar.btnDropCap.menu.on('item:click', _.bind(this.onDropCapSelect, this));
toolbar.btnContentControls.menu.on('item:click', _.bind(this.onControlsSelect, this));
@ -1648,9 +1652,10 @@ define([
Common.NotificationCenter.trigger('storage:image-insert', data);
},
onBtnInsertTextClick: function(btn, e) {
if (this.api)
this._addAutoshape(btn.pressed, 'textRect');
onBtnInsertTextClick: function(type, btn, e) {
if (this.api){
this._addAutoshape(this.toolbar.btnInsertText.pressed, type);
}
if (this.toolbar.btnInsertShape.pressed)
this.toolbar.btnInsertShape.toggle(false, true);
@ -1659,6 +1664,8 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Add Text');
},
onInsertShapeHide: function(btn, e) {
if (this.toolbar.btnInsertShape.pressed && !this._isAddingShape) {
this.toolbar.btnInsertShape.toggle(false, true);

View file

@ -682,6 +682,7 @@ define([
_set.lostConnect, _set.disableOnStart],
caption: me.capBtnInsTextbox,
enableToggle: true,
split: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
@ -2011,7 +2012,7 @@ define([
this.btnInsertTable.updateHint(this.tipInsertTable);
this.btnInsertImage.updateHint(this.tipInsertImage);
this.btnInsertChart.updateHint(this.tipInsertChart);
this.btnInsertText.updateHint(this.tipInsertText);
this.btnInsertText.updateHint([this.tipInsertHorizontalText ,this.tipInsertText]);
this.btnInsertTextArt.updateHint(this.tipInsertTextArt);
this.btnEditHeader.updateHint(this.tipEditHeader);
this.btnInsDateTime.updateHint(this.tipDateTime);
@ -2221,6 +2222,13 @@ define([
};
this.btnInsertTextArt.menu.on('show:before', onShowBeforeTextArt);
this.btnInsertText.setMenu(new Common.UI.Menu({
items: [
{caption: this.tipInsertHorizontalText, value: 'textRect'},
{caption: this.tipInsertVerticalText, value: 'textRectVertical'},
]
}));
// set dataviews
var _conf = this.mnuMarkersPicker.conf;
@ -2710,7 +2718,9 @@ define([
textAutoColor: 'Automatic',
tipInsertChart: 'Insert Chart',
tipColorSchemas: 'Change Color Scheme',
tipInsertText: 'Insert Text',
tipInsertHorizontalText: 'Insert horizontal text box',
tipInsertVerticalText: 'Insert vertical text box',
tipInsertText: 'Insert text box',
tipInsertTextArt: 'Insert Text Art',
mniEditDropCap: 'Drop Cap Settings',
textNone: 'None',

View file

@ -2897,6 +2897,8 @@
"DE.Views.Toolbar.tipInsertShape": "Insert autoshape",
"DE.Views.Toolbar.tipInsertSymbol": "Insert symbol",
"DE.Views.Toolbar.tipInsertTable": "Insert table",
"DE.Views.Toolbar.tipInsertHorizontalText": "Insert horizontal text box",
"DE.Views.Toolbar.tipInsertVerticalText": "Insert vertical text box",
"DE.Views.Toolbar.tipInsertText": "Insert text box",
"DE.Views.Toolbar.tipInsertTextArt": "Insert Text Art",
"DE.Views.Toolbar.tipLineNumbers": "Show line numbers",

View file

@ -2869,6 +2869,8 @@
"DE.Views.Toolbar.tipInsertShape": "Вставить автофигуру",
"DE.Views.Toolbar.tipInsertSymbol": "Вставить символ",
"DE.Views.Toolbar.tipInsertTable": "Вставить таблицу",
"DE.Views.Toolbar.tipInsertHorizontalText": "Вставить горизонтальную надпись",
"DE.Views.Toolbar.tipInsertVerticalText": "Вставить вертикальную надпись",
"DE.Views.Toolbar.tipInsertText": "Вставить надпись",
"DE.Views.Toolbar.tipInsertTextArt": "Вставить объект Text Art",
"DE.Views.Toolbar.tipLineNumbers": "Показывать номера строк",

View file

@ -1784,14 +1784,14 @@ define([
Common.NotificationCenter.trigger('storage:image-insert', data);
},
onInsertText: function(status) {
onInsertText: function(status, type) {
if ( status == 'begin' ) {
this._addAutoshape(true, 'textRect');
this._addAutoshape(true, type);
if ( !this.toolbar.btnsInsertText.pressed() )
this.toolbar.btnsInsertText.toggle(true, true);
} else
this._addAutoshape(false, 'textRect');
this._addAutoshape(false, type);
if ( this.toolbar.btnsInsertShape.pressed() )
this.toolbar.btnsInsertShape.toggle(false, true);

View file

@ -1283,7 +1283,7 @@ define([
this.btnsInsertImage = Common.Utils.injectButtons($host.find('.slot-insertimg'), 'tlbtn-insertimage-', 'toolbar__icon btn-insertimage', this.capInsertImage,
[Common.enumLock.slideDeleted, Common.enumLock.lostConnect, Common.enumLock.noSlides, Common.enumLock.disableOnStart], false, true, undefined, '1', 'bottom', 'small');
this.btnsInsertText = Common.Utils.injectButtons($host.find('.slot-instext'), 'tlbtn-inserttext-', 'toolbar__icon btn-text', this.capInsertText,
[Common.enumLock.slideDeleted, Common.enumLock.lostConnect, Common.enumLock.noSlides, Common.enumLock.disableOnStart], false, false, true, '1', 'bottom', 'small');
[Common.enumLock.slideDeleted, Common.enumLock.lostConnect, Common.enumLock.noSlides, Common.enumLock.disableOnStart], true, false, true, '1', 'bottom', 'small');
this.btnsInsertShape = Common.Utils.injectButtons($host.find('.slot-insertshape'), 'tlbtn-insertshape-', 'toolbar__icon btn-insertshape', this.capInsertShape,
[Common.enumLock.slideDeleted, Common.enumLock.lostConnect, Common.enumLock.noSlides, Common.enumLock.disableOnStart], false, true, true, '1', 'bottom', 'small');
this.btnsAddSlide = Common.Utils.injectButtons($host.find('.slot-addslide'), 'tlbtn-addslide-', 'toolbar__icon btn-addslide', this.capAddSlide,
@ -1318,10 +1318,20 @@ define([
btn.menu.items[2].setVisible(config.canRequestInsertImage || config.fileChoiceUrl && config.fileChoiceUrl.indexOf("{documentType}")>-1);
});
me.btnsInsertText.forEach(function (btn) {
btn.updateHint(me.tipInsertText);
btn.on('click', function (btn, e) {
me.fireEvent('insert:text', [btn.pressed ? 'begin' : 'end']);
me.btnsInsertText.forEach(function (button) {
button.updateHint([me.tipInsertHorizontalText, me.tipInsertText]);
button.setMenu(new Common.UI.Menu({
items: [
{caption: me.tipInsertHorizontalText, value: 'textRect'},
{caption: me.tipInsertVerticalText, value: 'textRectVertical'},
]
}));
button.on('click', function (btn, e) {
me.fireEvent('insert:text', [btn.pressed ? 'begin' : 'end', 'textRect']);
});
button.menu.on('item:click', function(btn, e) {
button.toggle(true);
me.fireEvent('insert:text', ['begin', e.value]);
});
});
@ -1936,6 +1946,8 @@ define([
mniImageFromUrl: 'Image from url',
mniCustomTable: 'Insert Custom Table',
tipInsertHyperlink: 'Add Hyperlink',
tipInsertHorizontalText: 'Insert horizontal text box',
tipInsertVerticalText: 'Insert vertical text box',
tipInsertText: 'Insert Text',
tipInsertTextArt: 'Insert Text Art',
tipInsertShape: 'Insert Autoshape',

View file

@ -2303,6 +2303,8 @@
"PE.Views.Toolbar.tipInsertImage": "Insert image",
"PE.Views.Toolbar.tipInsertShape": "Insert autoshape",
"PE.Views.Toolbar.tipInsertSymbol": "Insert symbol",
"PE.Views.Toolbar.tipInsertHorizontalText": "Insert horizontal text box",
"PE.Views.Toolbar.tipInsertVerticalText": "Insert vertical text box",
"PE.Views.Toolbar.tipInsertTable": "Insert table",
"PE.Views.Toolbar.tipInsertText": "Insert text box",
"PE.Views.Toolbar.tipInsertTextArt": "Insert Text Art",

View file

@ -2283,6 +2283,8 @@
"PE.Views.Toolbar.tipInsertShape": "Вставить автофигуру",
"PE.Views.Toolbar.tipInsertSymbol": "Вставить символ",
"PE.Views.Toolbar.tipInsertTable": "Вставить таблицу",
"PE.Views.Toolbar.tipInsertHorizontalText": "Вставить горизонтальную надпись",
"PE.Views.Toolbar.tipInsertVerticalText": "Вставить вертикальную надпись",
"PE.Views.Toolbar.tipInsertText": "Вставить надпись",
"PE.Views.Toolbar.tipInsertTextArt": "Вставить объект Text Art",
"PE.Views.Toolbar.tipInsertVideo": "Вставить видео",

View file

@ -401,6 +401,10 @@ define([
toolbar.btnInsertImage.menu.on('item:click', _.bind(this.onInsertImageMenu, this));
toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlink, this));
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
toolbar.btnInsertText.menu.on('item:click', _.bind(function(btn, e) {
this.toolbar.btnInsertText.toggle(true);
this.onBtnInsertTextClick(e.value, btn, e);
}, 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));
@ -1247,9 +1251,9 @@ define([
}
},
onBtnInsertTextClick: function(btn, e) {
onBtnInsertTextClick: function(type, btn, e) {
if (this.api)
this._addAutoshape(btn.pressed, 'textRect');
this._addAutoshape(this.toolbar.btnInsertText.pressed, type);
if (this.toolbar.btnInsertShape.pressed)
this.toolbar.btnInsertShape.toggle(false, true);

View file

@ -1229,6 +1229,7 @@ define([
caption : me.capInsertText,
lock : [_set.editCell, _set.lostConnect, _set.coAuth, _set['Objects']],
enableToggle: true,
split : true,
dataHint : '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
@ -2342,7 +2343,7 @@ define([
_updateHint(this.btnInsertImage, this.tipInsertImage);
_updateHint(this.btnInsertChart, this.tipInsertChartSpark);
_updateHint(this.btnInsertSparkline, this.tipInsertSpark);
_updateHint(this.btnInsertText, this.tipInsertText);
_updateHint(this.btnInsertText, [this.tipInsertHorizontalText ,this.tipInsertText]);
_updateHint(this.btnInsertTextArt, this.tipInsertTextart);
_updateHint(this.btnInsertHyperlink, this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
_updateHint(this.btnInsertShape, this.tipInsertShape);
@ -2581,6 +2582,15 @@ define([
this.btnInsertSparkline.menu.on('show:before', onShowBefore);
}
if(this.btnInsertText) {
this.btnInsertText.setMenu(new Common.UI.Menu({
items: [
{caption: this.tipInsertHorizontalText, value: 'textRect'},
{caption: this.tipInsertVerticalText, value: 'textRectVertical'},
]
}));
}
if (this.btnInsertTextArt) {
var onShowBeforeTextArt = function (menu) {
var collection = SSE.getCollection('Common.Collections.TextArt');
@ -3143,7 +3153,9 @@ define([
tipSynchronize: 'The document has been changed by another user. Please click to save your changes and reload the updates.',
tipIncFont: 'Increment font size',
tipDecFont: 'Decrement font size',
tipInsertText: 'Insert Text',
tipInsertHorizontalText: 'Insert horizontal text box',
tipInsertVerticalText: 'Insert vertical text box',
tipInsertText: 'Insert text box',
tipInsertTextart: 'Insert Text Art',
tipInsertShape: 'Insert Autoshape',
tipDigStylePercent: 'Percent Style',

View file

@ -3567,6 +3567,8 @@
"SSE.Views.Toolbar.tipInsertSpark": "Insert sparkline",
"SSE.Views.Toolbar.tipInsertSymbol": "Insert symbol",
"SSE.Views.Toolbar.tipInsertTable": "Insert table",
"SSE.Views.Toolbar.tipInsertHorizontalText": "Insert horizontal text box",
"SSE.Views.Toolbar.tipInsertVerticalText": "Insert vertical text box",
"SSE.Views.Toolbar.tipInsertText": "Insert text box",
"SSE.Views.Toolbar.tipInsertTextart": "Insert Text Art",
"SSE.Views.Toolbar.tipMerge": "Merge and center",

View file

@ -3544,6 +3544,8 @@
"SSE.Views.Toolbar.tipInsertSpark": "Вставить спарклайн",
"SSE.Views.Toolbar.tipInsertSymbol": "Вставить символ",
"SSE.Views.Toolbar.tipInsertTable": "Вставить таблицу",
"SSE.Views.Toolbar.tipInsertHorizontalText": "Вставить горизонтальную надпись",
"SSE.Views.Toolbar.tipInsertVerticalText": "Вставить вертикальную надпись",
"SSE.Views.Toolbar.tipInsertText": "Вставить надпись",
"SSE.Views.Toolbar.tipInsertTextart": "Вставить объект Text Art",
"SSE.Views.Toolbar.tipMerge": "Объединить и поместить в центре",