diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template
index 4594d9b51..a92b9b5f2 100644
--- a/apps/presentationeditor/main/app/template/Toolbar.template
+++ b/apps/presentationeditor/main/app/template/Toolbar.template
@@ -88,7 +88,7 @@
-
+
+
diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js
index 5293c42c7..585ee0761 100644
--- a/apps/presentationeditor/main/app/view/Toolbar.js
+++ b/apps/presentationeditor/main/app/view/Toolbar.js
@@ -586,6 +586,20 @@ define([
});
me.paragraphControls.push(me.btnInsertHyperlink);
+ me.btnInsertTextArt = new Common.UI.Button({
+ id: 'tlb-btn-instextart',
+ cls: 'btn-toolbar x-huge icon-top',
+ iconCls: 'btn-textart',
+ caption: me.capInsertTextArt,
+ menu: new Common.UI.Menu({
+ cls: 'menu-shapes',
+ items: [
+ {template: _.template('
')}
+ ]
+ })
+ });
+ me.paragraphControls.push(me.btnInsertTextArt);
+
me.btnColorSchemas = new Common.UI.Button({
id : 'id-toolbar-btn-colorschemas',
cls : 'btn-toolbar',
@@ -982,6 +996,7 @@ define([
_injectComponent('#slot-btn-insertlink', this.btnInsertHyperlink);
_injectComponent('#slot-btn-inserttable', this.btnInsertTable);
_injectComponent('#slot-btn-insertchart', this.btnInsertChart);
+ _injectComponent('#slot-btn-instextart', this.btnInsertTextArt);
_injectComponent('#slot-btn-colorschemas', this.btnColorSchemas);
_injectComponent('#slot-btn-slidesize', this.btnSlideSize);
_injectComponent('#slot-field-styles', this.listTheme);
@@ -1014,15 +1029,13 @@ define([
});
me.btnsInsertText = _injectBtns({
- slot: '.slot-inserttext',
+ slot: '.slot-instext',
btnconfig: {
cls : 'btn-toolbar x-huge icon-top',
iconCls : 'btn-text',
caption : me.capInsertText,
lock : [PE.enumLock.slideDeleted, PE.enumLock.lostConnect, PE.enumLock.noSlides, PE.enumLock.disableOnStart],
- enableToggle: true,
- split : true,
- menu : true
+ enableToggle: true
}
});
@@ -1067,25 +1080,6 @@ define([
me.btnsInsertText.forEach(function (btn) {
btn.updateHint(me.tipInsertText);
- btn.setMenu(
- new Common.UI.Menu({
- items: [
- {caption: me.textInsText, value: 'text'},
- {caption: me.textInsTextArt, value: 'art',
- menu: new Common.UI.Menu({
- menuAlign: 'tl-tr',
- cls: 'menu-shapes',
- items: [
- {template: _.template('
')}
- ]
- })
- }
- ]
- }).on('item:click', function (menu, item, e) {
- if (item.value == 'text')
- me.fireEvent('insert:text', ['begin']);
- })
- );
btn.on('click', function (btn, e) {
me.fireEvent('insert:text', [btn.pressed ? 'begin' : 'end']);
});
@@ -1134,6 +1128,7 @@ define([
this.btnInsertChart.updateHint(this.tipInsertChart);
this.btnInsertEquation.updateHint(this.tipInsertEquation);
this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
+ this.btnInsertTextArt.updateHint(this.tipInsertTextArt);
this.btnColorSchemas.updateHint(this.tipColorSchemas);
this.btnHide.updateHint(this.tipViewSettings);
this.btnAdvSettings.updateHint(this.tipAdvSettings);
@@ -1641,31 +1636,30 @@ define([
updateTextartMenu: function (collection) {
var me = this;
- me.btnsInsertText.forEach(function (btn) {
- if ( btn.textartPicker ) {
- if ( btn.textartPicker.store.size() == collection.size() ) {
- btn.textartPicker.store.each(function (model, index) {
- model.set('imageUrl', collection.at(index).get('imageUrl'));
- });
- } else {
- btn.textartPicker.store.reset( collection.models );
- }
+ var btn = me.btnInsertTextArt;
+ if ( btn.textartPicker ) {
+ if ( btn.textartPicker.store.size() == collection.size() ) {
+ btn.textartPicker.store.each(function (model, index) {
+ model.set('imageUrl', collection.at(index).get('imageUrl'));
+ });
} else {
- btn.textartPicker = new Common.UI.DataView({
- el: $('.view-insert-art', btn.menu.items[1].$el),
- store: collection,
- parentMenu: btn.menu.items[1],
- showLast: false,
- itemTemplate: _.template('
')
- });
-
- btn.textartPicker.on('item:click', function(picker, item, record, e) {
- me.fireEvent('insert:textart', [record.get('data')]);
-
- if (e.type !== 'click') this.menu.hide();
- });
+ btn.textartPicker.store.reset( collection.models );
}
- });
+ } else {
+ btn.textartPicker = new Common.UI.DataView({
+ el: $('#view-insert-art', btn.menu.$el),
+ store: collection,
+ parentMenu: btn.menu,
+ showLast: false,
+ itemTemplate: _.template('
')
+ });
+
+ btn.textartPicker.on('item:click', function(picker, item, record, e) {
+ me.fireEvent('insert:textart', [record.get('data')]);
+
+ if (e.type !== 'click') this.menu.hide();
+ });
+ }
},
updateAutoshapeMenu: function (collection) {
@@ -1740,6 +1734,7 @@ define([
mniCustomTable: 'Insert Custom Table',
tipInsertHyperlink: 'Add Hyperlink',
tipInsertText: 'Insert Text',
+ tipInsertTextArt: 'Insert Text Art',
tipInsertShape: 'Insert Autoshape',
tipPreview: 'Start Slideshow',
tipAddSlide: 'Add Slide',
@@ -1817,7 +1812,8 @@ define([
tipInsertEquation: 'Insert Equation',
textCharts: 'Charts',
tipChangeChart: 'Change Chart Type',
- capInsertText: 'Text Box',
+ capInsertText: 'Text',
+ capInsertTextArt: 'Text Art',
capInsertImage: 'Picture',
capInsertShape: 'Shape',
capInsertTable: 'Table',
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index de56fd72f..b3d04ecb2 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -1306,7 +1306,8 @@
"PE.Views.Toolbar.textTitleError": "Error",
"PE.Views.Toolbar.textUnderline": "Underline",
"PE.Views.Toolbar.textZoom": "Zoom",
- "PE.Views.Toolbar.capInsertText": "Text Box",
+ "PE.Views.Toolbar.capInsertText": "Text",
+ "PE.Views.Toolbar.capInsertTextArt": "Text Art",
"PE.Views.Toolbar.capInsertImage": "Picture",
"PE.Views.Toolbar.capInsertShape": "Shape",
"PE.Views.Toolbar.capInsertTable": "Table",
@@ -1340,6 +1341,7 @@
"PE.Views.Toolbar.tipInsertShape": "Insert Autoshape",
"PE.Views.Toolbar.tipInsertTable": "Insert Table",
"PE.Views.Toolbar.tipInsertText": "Insert Text",
+ "PE.Views.Toolbar.tipInsertTextArt": "Insert Text Art",
"PE.Views.Toolbar.tipLineSpace": "Line Spacing",
"PE.Views.Toolbar.tipMarkers": "Bullets",
"del_PE.Views.Toolbar.tipNewDocument": "New Presentation",
diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
index e9082ccd3..80b10f1d2 100644
--- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
@@ -263,7 +263,6 @@ define([
toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlink, this));
toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, 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.btnInsertEquation.on('click', _.bind(this.onInsertEquationClick, this));
toolbar.btnSortDown.on('click', _.bind(this.onSortType, this, Asc.c_oAscSortOptions.Ascending));
@@ -910,20 +909,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);
@@ -2383,11 +2368,11 @@ define([
},
fillTextArt: function() {
- if (!this.toolbar.btnInsertText.rendered) return;
+ if (!this.toolbar.btnInsertTextArt.rendered) return;
var me = this;
- if (this.toolbar.mnuTextArtPicker) {
+ if ( this.toolbar.mnuTextArtPicker ) {
var models = this.getApplication().getCollection('Common.Collections.TextArt').models,
count = this.toolbar.mnuTextArtPicker.store.length;
if (count>0 && count==models.length) {
@@ -2400,27 +2385,28 @@ define([
}
} else {
this.toolbar.mnuTextArtPicker = new Common.UI.DataView({
- el: $('#id-toolbar-menu-insart'),
+ el: $('#id-toolbar-menu-insart', me.toolbar),
store: this.getApplication().getCollection('Common.Collections.TextArt'),
- parentMenu: this.toolbar.mnuInsertTextArt.menu,
+ // parentMenu: this.toolbar.mnuInsertTextArt.menu,
showLast: false,
itemTemplate: _.template('
')
});
- this.toolbar.mnuTextArtPicker.on('item:click', function(picker, item, record, e) {
- if (me.api) {
+ this.toolbar.mnuTextArtPicker.on('item:click',
+ function(picker, item, record, e) {
me.toolbar.fireEvent('inserttextart', me.toolbar);
me.api.asc_addTextArt(record.get('data'));
- if (me.toolbar.btnInsertShape.pressed)
+ if ( me.toolbar.btnInsertShape.pressed )
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);
+ if ( e.type !== 'click' )
+ me.toolbar.btnInsertTextArt.menu.hide();
+
+ Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnInsertTextArt);
Common.component.Analytics.trackEvent('ToolBar', 'Add Text Art');
}
- });
+ );
}
},
diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template
index 6cfbb24e4..f0ccaacbc 100644
--- a/apps/spreadsheeteditor/main/app/template/Toolbar.template
+++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template
@@ -152,6 +152,7 @@
+