[SSE] Add Text to Columns button to the cell settings panel

This commit is contained in:
Julia Radzhabova 2019-04-17 16:16:02 +03:00
parent 3a2bce2d8c
commit df151f23d4
4 changed files with 42 additions and 2 deletions

View file

@ -45,6 +45,7 @@ define([
'common/main/lib/util/utils',
'common/main/lib/util/Shortcuts',
'common/main/lib/view/CopyWarningDialog',
'common/main/lib/view/OpenDialog',
'spreadsheeteditor/main/app/view/DocumentHolder',
'spreadsheeteditor/main/app/view/HyperlinkSettingsDialog',
'spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced',

View file

@ -60,5 +60,15 @@
<div id="cell-spin-angle" style="display: inline-block;margin-left:5px;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<button type="button" class="btn btn-text-default" id="cell-btn-text-to-column" style="width:100%;"><%= scope.textTextToColumn %></button>
</td>
</tr>
<tr class="finish-cell"></tr>
</table>

View file

@ -46,7 +46,8 @@ define([
'common/main/lib/component/Button',
'common/main/lib/component/ThemeColorPalette',
'common/main/lib/component/ColorButton',
'common/main/lib/component/ComboBorderSize'
'common/main/lib/component/ComboBorderSize',
'common/main/lib/view/OpenDialog'
], function (menuTemplate, $, _, Backbone) {
'use strict';
@ -138,6 +139,24 @@ define([
this.api && this.api.asc_setCellAngle(field.getNumberValue());
},
onTextToColumn: function() {
var me = this;
(new Common.Views.OpenDialog({
title: me.txtImportWizard,
closable: true,
type: Common.Utils.importTextType.Columns,
preview: true,
api: me.api,
handler: function (result, encoding, delimiter, delimiterChar) {
if (result == 'ok') {
if (me && me.api) {
me.api.asc_TextToColumns(new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar));
}
}
}
})).show();
},
render: function () {
var el = $(this.el);
el.html(this.template({
@ -236,6 +255,12 @@ define([
});
this.lockedControls.push(this.spnAngle);
this.spnAngle.on('change', _.bind(this.onAngleChange, this));
this.btnTextToColumn = new Common.UI.Button({
el: $('#cell-btn-text-to-column')
});
this.btnTextToColumn.on('click', _.bind(this.onTextToColumn, this));
this.lockedControls.push(this.btnTextToColumn);
},
createDelayedElements: function() {
@ -367,7 +392,9 @@ define([
tipDiagU: 'Set Diagonal Up Border',
tipDiagD: 'Set Diagonal Down Border',
textOrientation: 'Text Orientation',
textAngle: 'Angle'
textAngle: 'Angle',
textTextToColumn: 'Text to Columns',
textWizard: 'Text to Columns Wizard'
}, SSE.Views.CellSettings || {}));
});

View file

@ -1145,6 +1145,8 @@
"SSE.Views.CellSettings.tipOuter": "Set outer border only",
"SSE.Views.CellSettings.tipRight": "Set outer right border only",
"SSE.Views.CellSettings.tipTop": "Set outer top border only",
"SSE.Views.CellSettings.textTextToColumn": "Text to Columns",
"SSE.Views.CellSettings.textWizard": "Text to Columns Wizard",
"SSE.Views.ChartSettings.strLineWeight": "Line Weight",
"SSE.Views.ChartSettings.strSparkColor": "Color",
"SSE.Views.ChartSettings.strTemplate": "Template",