[DE] replaced 'insert' buttons

This commit is contained in:
Maxim Kadushkin 2017-06-26 16:11:50 +03:00
parent 768291c1ca
commit 0ec42dad0e
5 changed files with 33 additions and 52 deletions

View file

@ -245,7 +245,6 @@ define([
toolbar.mnuInsertTable.on('item:click', _.bind(this.onInsertTableClick, this));
toolbar.mnuInsertImage.on('item:click', _.bind(this.onInsertImageClick, this));
toolbar.btnInsertText.on('click', _.bind(this.onBtnInsertTextClick, this));
toolbar.btnInsertText.menu.on('item:click', _.bind(this.onInsertTextClick, this));
toolbar.btnInsertShape.menu.on('hide:after', _.bind(this.onInsertShapeHide, this));
toolbar.btnDropCap.menu.on('item:click', _.bind(this.onDropCapSelect, this));
toolbar.mnuDropCapAdvanced.on('click', _.bind(this.onDropCapAdvancedClick, this));
@ -698,8 +697,7 @@ define([
toolbar.btnInsertImage.setDisabled(need_disable);
toolbar.btnInsertShape.setDisabled(need_disable);
toolbar.btnInsertText.setDisabled(need_disable);
toolbar.mnuInsertTextArt.setDisabled(need_disable || in_image);
toolbar.btnInsertTextArt.setDisabled(need_disable || in_image);
if (in_chart !== this._state.in_chart) {
toolbar.btnInsertChart.updateHint(in_chart ? toolbar.tipChangeChart : toolbar.tipInsertChart);
@ -1376,20 +1374,6 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Add Text');
},
onInsertTextClick: function(menu, item, e) {
if (item.value === 'text') {
if (this.api)
this._addAutoshape(true, 'textRect');
this.toolbar.btnInsertText.toggle(true, true);
if (this.toolbar.btnInsertShape.pressed)
this.toolbar.btnInsertShape.toggle(false, true);
Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertShape);
Common.component.Analytics.trackEvent('ToolBar', 'Add Text');
}
},
onInsertShapeHide: function(btn, e) {
if (this.toolbar.btnInsertShape.pressed && !this._isAddingShape) {
this.toolbar.btnInsertShape.toggle(false, true);
@ -2497,7 +2481,7 @@ define([
},
fillTextArt: function() {
if (!this.toolbar.btnInsertText.rendered) return;
if (!this.toolbar.btnInsertTextArt.rendered) return;
var me = this;
if (this.toolbar.mnuTextArtPicker) {
@ -2515,7 +2499,7 @@ define([
this.toolbar.mnuTextArtPicker = new Common.UI.DataView({
el: $('#id-toolbar-menu-insart'),
store: this.getApplication().getCollection('Common.Collections.TextArt'),
parentMenu: this.toolbar.mnuInsertTextArt.menu,
parentMenu: this.toolbar.btnInsertTextArt.menu,
showLast: false,
itemTemplate: _.template('<div class="item-art"><img src="<%= imageUrl %>" id="<%= id %>" style="width:50px;height:50px;"></div>')
});
@ -2529,8 +2513,8 @@ define([
me.toolbar.btnInsertShape.toggle(false, true);
if (e.type !== 'click')
me.toolbar.btnInsertText.menu.hide();
Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertText);
me.toolbar.btnInsertTextArt.menu.hide();
Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertTextArt);
Common.component.Analytics.trackEvent('ToolBar', 'Add Text Art');
}
});

View file

@ -132,18 +132,17 @@
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-inshyperlink"></span>
</div>
<div class="group">
<div class="elset">
<span class="btn-slot text" id="slot-btn-notes"></span>
</div>
<div class="elset">
<span class="btn-slot text slot-comment"></span>
</div>
<span class="btn-slot text x-huge" id="slot-btn-notes"></span>
<span class="btn-slot text x-huge slot-comment"></span>
</div>
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-instext"></span>
<span class="btn-slot text x-huge" id="slot-btn-instextart"></span>
</div>
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-insequation"></span>
</div>
<div class="group">
<div class="elset">
@ -151,10 +150,6 @@
</div>
<div class="elset"></div>
</div>
<div class="separator long"></div>
<div class="group">
<span class="btn-slot text x-huge" id="slot-btn-insequation"></span>
</div>
</section>
<section class="panel" data-tab="layout">
<div class="group">

View file

@ -501,26 +501,22 @@ define([
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-text',
caption: me.capBtnInsTextbox,
enableToggle: true,
split: true,
enableToggle: true
});
this.paragraphControls.push(this.btnInsertText);
this.btnInsertTextArt = new Common.UI.Button({
id: 'tlb-btn-instextart',
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-textart',
caption: me.capBtnInsTextart,
menu: new Common.UI.Menu({
cls: 'menu-shapes',
items: [
{caption: this.textInsText, value: 'text'},
this.mnuInsertTextArt = new Common.UI.MenuItem({
caption: this.textInsTextArt,
value: 'art',
menu: new Common.UI.Menu({
menuAlign: 'tl-tr',
cls: 'menu-shapes',
items: [
{template: _.template('<div id="id-toolbar-menu-insart" style="width: 239px; margin-left: 5px;"></div>')}
]
})
})
{template: _.template('<div id="id-toolbar-menu-insart" style="width: 239px; margin-left: 5px;"></div>')}
]
})
});
this.paragraphControls.push(this.btnInsertText);
this.paragraphControls.push(this.btnInsertTextArt);
this.btnInsertHyperlink = new Common.UI.Button({
id: 'tlb-btn-inshyperlink',
@ -1268,6 +1264,7 @@ define([
_injectComponent('#slot-btn-insimage', this.btnInsertImage);
_injectComponent('#slot-btn-inschart', this.btnInsertChart);
_injectComponent('#slot-btn-instext', this.btnInsertText);
_injectComponent('#slot-btn-instextart', this.btnInsertTextArt);
_injectComponent('#slot-btn-dropcap', this.btnDropCap);
_injectComponent('#slot-btn-columns', this.btnColumns);
_injectComponent('#slot-btn-inshyperlink', this.btnInsertHyperlink);
@ -1517,6 +1514,7 @@ define([
this.btnInsertImage.updateHint(this.tipInsertImage);
this.btnInsertChart.updateHint(this.tipInsertChart);
this.btnInsertText.updateHint(this.tipInsertText);
this.btnInsertTextArt.updateHint(this.tipInsertTextArt);
this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
this.btnEditHeader.updateHint(this.tipEditHeader);
this.btnInsertShape.updateHint(this.tipInsertShape);
@ -2098,6 +2096,7 @@ define([
this.btnInsertImage.setDisabled(true);
this.btnInsertChart.setDisabled(true);
this.btnInsertText.setDisabled(true);
this.btnInsertTextArt.setDisabled(true);
this.btnDropCap.setDisabled(true);
this.btnColumns.setDisabled(true);
this.btnInsertHyperlink.setDisabled(true);
@ -2375,6 +2374,7 @@ define([
textStock: 'Stock',
tipColorSchemas: 'Change Color Scheme',
tipInsertText: 'Insert Text',
tipInsertTextArt: 'Insert Text-art',
tipHAligh: 'Horizontal Align',
tipViewSettings: 'View Settings',
tipAdvSettings: 'Advanced Settings',
@ -2426,8 +2426,6 @@ define([
textStyleMenuRestoreAll: 'Restore all to default styles',
textStyleMenuDeleteAll: 'Delete all custom styles',
textStyleMenuNew: 'New style from selection',
textInsText: 'Insert text box',
textInsTextArt: 'Insert Text Art',
tipColumns: 'Insert columns',
textColumnsOne: 'One',
textColumnsTwo: 'Two',
@ -2469,6 +2467,7 @@ define([
textTabReview: 'Review',
capBtnInsShape: 'Shape',
capBtnInsTextbox: 'Text',
capBtnInsTextart: 'Text-art',
capBtnInsDropcap: 'Drop Cap',
capBtnInsFootnote: 'Footnotes',
capBtnInsEquation: 'Equation',

View file

@ -1515,8 +1515,8 @@
"DE.Views.Toolbar.textInsertPageNumber": "Insert page number",
"DE.Views.Toolbar.textInsPageBreak": "Insert Page Break",
"DE.Views.Toolbar.textInsSectionBreak": "Insert Section Break",
"DE.Views.Toolbar.textInsText": "Insert text box",
"DE.Views.Toolbar.textInsTextArt": "Insert Text Art",
"del_DE.Views.Toolbar.textInsText": "Insert text box",
"del_DE.Views.Toolbar.textInsTextArt": "Insert Text Art",
"DE.Views.Toolbar.textInText": "In Text",
"DE.Views.Toolbar.textItalic": "Italic",
"DE.Views.Toolbar.textLandscape": "Landscape",
@ -1584,6 +1584,7 @@
"DE.Views.Toolbar.tipInsertShape": "Insert Autoshape",
"DE.Views.Toolbar.tipInsertTable": "Insert Table",
"DE.Views.Toolbar.tipInsertText": "Insert Text",
"DE.Views.Toolbar.tipInsertTextArt": "Insert Text-art",
"DE.Views.Toolbar.tipLineSpace": "Paragraph Line Spacing",
"DE.Views.Toolbar.tipMailRecepients": "Mail Merge",
"DE.Views.Toolbar.tipMarkers": "Bullets",
@ -1617,6 +1618,7 @@
"DE.Views.Toolbar.capBtnInsLink": "Hyperlink",
"DE.Views.Toolbar.capBtnInsShape": "Shape",
"DE.Views.Toolbar.capBtnInsTextbox": "Text",
"DE.Views.Toolbar.capBtnInsTextart": "Text-art",
"DE.Views.Toolbar.capBtnInsDropcap": "Drop Cap",
"DE.Views.Toolbar.capBtnInsFootnote": "Footnotes",
"DE.Views.Toolbar.capBtnInsEquation": "Equation",

View file

@ -308,6 +308,7 @@
.button-normal-icon(btn-text, 3, @toolbar-big-icon-size);
.button-normal-icon(btn-inserthyperlink, 4, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-menu-comments', 5, @toolbar-big-icon-size);
.button-normal-icon(btn-textart, 6, @toolbar-big-icon-size);
.button-normal-icon(btn-insertequation, 7, @toolbar-big-icon-size);
.button-normal-icon(btn-insertchart, 9, @toolbar-big-icon-size);
.button-normal-icon(btn-ic-doclang, 11, @toolbar-big-icon-size);