',
@@ -143,6 +144,7 @@ define([
this.handler = _options.handler;
this.type = _options.type;
this.preview = _options.preview;
+ this.previewData = _options.previewData;
this.warning = _options.warning || false;
this.closable = _options.closable;
this.codepages = _options.codepages;
@@ -168,7 +170,7 @@ define([
this.previewScrolled = this.$window.find('#id-preview');
this.previewInner = this.previewScrolled.find('div:first-child');
- if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) {
+ if (this.type == Common.Utils.importTextType.DRM) {
this.inputPwd = new Common.UI.InputField({
el: $('#id-password-txt'),
type: 'text',
@@ -187,8 +189,9 @@ define([
});
} else {
this.initCodePages();
- if (this.preview)
- this.updatePreview();
+ if (this.preview) {
+ (this.previewData) ? this.previewCallback(this.previewData) : this.updatePreview();
+ }
}
this.onPrimary = function() {
me._handleInput('ok');
@@ -200,7 +203,7 @@ define([
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
- if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) {
+ if (this.type == Common.Utils.importTextType.DRM) {
var me = this;
setTimeout(function(){
me.inputPwd.cmpEl.find('input').focus();
@@ -220,15 +223,15 @@ define([
_handleInput: function(state) {
if (this.handler) {
- if (this.cmbEncoding) {
- var encoding = (!this.cmbEncoding.isDisabled()) ? this.cmbEncoding.getValue() :
- ((this.settings && this.settings.asc_getCodePage()) ? this.settings.asc_getCodePage() : 0),
+ if (this.type == Common.Utils.importTextType.DRM) {
+ this.handler.call(this, state, this.inputPwd.getValue());
+ } else {
+ var encoding = (this.cmbEncoding && !this.cmbEncoding.isDisabled()) ? this.cmbEncoding.getValue() :
+ ((this.settings && this.settings.asc_getCodePage()) ? this.settings.asc_getCodePage() : 0),
delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null,
delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null;
(delimiter == -1) && (delimiter = null);
this.handler.call(this, state, encoding, delimiter, delimiterChar);
- } else {
- this.handler.call(this, state, this.inputPwd.getValue());
}
}
@@ -253,37 +256,37 @@ define([
}
length = encodedata.length;
- for (i = 0; i < length; ++i) {
- listItems.push({
- value: encodedata[i][0],
- displayValue: Common.Utils.String.htmlEncode(encodedata[i][1]),
- lcid: encodedata[i][2] || ''
- });
- }
+ if (length) {
+ for (i = 0; i < length; ++i) {
+ listItems.push({
+ value: encodedata[i][0],
+ displayValue: Common.Utils.String.htmlEncode(encodedata[i][1]),
+ lcid: encodedata[i][2] || ''
+ });
+ }
- var itemsTemplate =
- _.template([
- '<% _.each(items, function(item) { %>',
- '
',
+ var itemsTemplate =
+ _.template([
+ '<% _.each(items, function(item) { %>',
+ '',
'<%= item.displayValue %>
',
'',
- '',
- '<% }); %>'
- ].join(''));
+ '',
+ '<% }); %>'
+ ].join(''));
- this.cmbEncoding = new Common.UI.ComboBox({
- el: $('#id-codepages-combo', this.$window),
- style: 'width: 100%;',
- menuStyle: 'min-width: 100%; max-height: 200px;',
- cls: 'input-group-nr',
- menuCls: 'scrollable-menu',
- data: listItems,
- editable: false,
- disabled: true,
- itemsTemplate: itemsTemplate
- });
+ this.cmbEncoding = new Common.UI.ComboBox({
+ el: $('#id-codepages-combo', this.$window),
+ style: 'width: 100%;',
+ menuStyle: 'min-width: 100%; max-height: 200px;',
+ cls: 'input-group-nr',
+ menuCls: 'scrollable-menu',
+ data: listItems,
+ editable: false,
+ disabled: true,
+ itemsTemplate: itemsTemplate
+ });
- if (length) {
this.cmbEncoding.setDisabled(false);
this.cmbEncoding.setValue((this.settings && this.settings.asc_getCodePage()) ? this.settings.asc_getCodePage() : encodedata[0][0]);
if (this.preview)
@@ -295,7 +298,7 @@ define([
ul.find('li div').width(width);
}
- if (this.type == Asc.c_oAscAdvancedOptionsID.CSV) {
+ if (this.type == Common.Utils.importTextType.CSV || this.type == Common.Utils.importTextType.Paste || this.type == Common.Utils.importTextType.Columns) {
this.cmbDelimiter = new Common.UI.ComboBox({
el: $('#id-delimiters-combo', this.$window),
style: 'width: 100px;',
@@ -328,16 +331,23 @@ define([
},
updatePreview: function() {
- var encoding = (!this.cmbEncoding.isDisabled()) ? this.cmbEncoding.getValue() :
+ var encoding = (this.cmbEncoding && !this.cmbEncoding.isDisabled()) ? this.cmbEncoding.getValue() :
((this.settings && this.settings.asc_getCodePage()) ? this.settings.asc_getCodePage() : 0);
+ var delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null,
+ delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null;
+ (delimiter == -1) && (delimiter = null);
- if (this.type == Asc.c_oAscAdvancedOptionsID.CSV) {
- var delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null,
- delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null;
- (delimiter == -1) && (delimiter = null);
- this.api.asc_decodeBuffer(this.preview, new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar), _.bind(this.previewCallback, this));
- } else {
- this.api.asc_decodeBuffer(this.preview, new Asc.asc_CTXTAdvancedOptions(encoding), _.bind(this.previewCallback, this));
+ switch (this.type) {
+ case Common.Utils.importTextType.CSV:
+ this.api.asc_decodeBuffer(this.preview, new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar), _.bind(this.previewCallback, this));
+ break;
+ case Common.Utils.importTextType.TXT:
+ this.api.asc_decodeBuffer(this.preview, new Asc.asc_CTXTAdvancedOptions(encoding), _.bind(this.previewCallback, this));
+ break;
+ case Common.Utils.importTextType.Paste:
+ case Common.Utils.importTextType.Columns:
+ this.api.asc_TextImport(new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar), _.bind(this.previewCallback, this), this.type == Common.Utils.importTextType.Paste);
+ break;
}
},
@@ -379,7 +389,7 @@ define([
delete this.scrollerX;
}
- if (this.type == Asc.c_oAscAdvancedOptionsID.CSV) {
+ if (this.type == Common.Utils.importTextType.CSV || this.type == Common.Utils.importTextType.Paste || this.type == Common.Utils.importTextType.Columns) {
var maxlength = 0;
for (var i=0; i
maxlength)
@@ -387,7 +397,7 @@ define([
}
var tpl = '';
for (var i=0; i';
+ tpl += '';
for (var j=0; j' + Common.Utils.String.htmlEncode(data[i][j]) + '';
}
@@ -400,7 +410,7 @@ define([
} else {
var tpl = '';
for (var i=0; i| ' + Common.Utils.String.htmlEncode(data[i]) + ' | ';
+ tpl += '| ' + Common.Utils.String.htmlEncode(data[i]) + ' |
';
}
tpl += '
';
}
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 39596f971..3db9478a3 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -1947,8 +1947,9 @@ define([
me = this;
if (type == Asc.c_oAscAdvancedOptionsID.TXT) {
me._state.openDlg = new Common.Views.OpenDialog({
- mode: mode,
- type: type,
+ title: Common.Views.OpenDialog.prototype.txtTitle.replace('%1', 'TXT'),
+ closable: (mode==2), // if save settings
+ type: Common.Utils.importTextType.TXT,
preview: advOptions.asc_getOptions().asc_getData(),
codepages: advOptions.asc_getOptions().asc_getCodePages(),
settings: advOptions.asc_getOptions().asc_getRecommendedSettings(),
@@ -1966,8 +1967,9 @@ define([
});
} else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
me._state.openDlg = new Common.Views.OpenDialog({
+ title: Common.Views.OpenDialog.prototype.txtTitleProtected,
closeFile: me.appOptions.canRequestClose,
- type: type,
+ type: Common.Utils.importTextType.DRM,
warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline),
validatePwd: !!me._state.isDRM,
handler: function (result, value) {
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js
index cf4591000..bdbf3b02d 100644
--- a/apps/presentationeditor/main/app/controller/Main.js
+++ b/apps/presentationeditor/main/app/controller/Main.js
@@ -1788,8 +1788,9 @@ define([
me = this;
if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
me._state.openDlg = new Common.Views.OpenDialog({
+ title: Common.Views.OpenDialog.prototype.txtTitleProtected,
closeFile: me.appOptions.canRequestClose,
- type: type,
+ type: Common.Utils.importTextType.DRM,
warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline),
validatePwd: !!me._state.isDRM,
handler: function (result, value) {
diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
index 28cecea7d..601d66f10 100644
--- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
+++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
@@ -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',
@@ -2135,23 +2136,25 @@ define([
// Prepare menu container
if (pasteContainer.length < 1) {
me._arrSpecialPaste = [];
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = me.txtPaste;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormula] = me.txtPasteFormulas;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaNumberFormat] = me.txtPasteFormulaNumFormat;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaAllFormatting] = me.txtPasteKeepSourceFormat;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaWithoutBorders] = me.txtPasteBorders;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaColumnWidth] = me.txtPasteColWidths;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.mergeConditionalFormating] = me.txtPasteMerge;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyValues] = me.txtPasteValues;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueNumberFormat] = me.txtPasteValNumFormat;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueAllFormating] = me.txtPasteValFormat;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormating] = me.txtPasteFormat;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.transpose] = me.txtPasteTranspose;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.link] = me.txtPasteLink;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = me.txtPastePicture;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.linkedPicture] = me.txtPasteLinkPicture;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = me.txtPasteSourceFormat;
- me._arrSpecialPaste[Asc.c_oSpecialPasteProps.destinationFormatting] = me.txtPasteDestFormat;
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = [me.txtPaste, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormula] = [me.txtPasteFormulas, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaNumberFormat] = [me.txtPasteFormulaNumFormat, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaAllFormatting] = [me.txtPasteKeepSourceFormat, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaWithoutBorders] = [me.txtPasteBorders, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.formulaColumnWidth] = [me.txtPasteColWidths, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.mergeConditionalFormating] = [me.txtPasteMerge, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.transpose] = [me.txtPasteTranspose, 0];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyValues] = [me.txtPasteValues, 1];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueNumberFormat] = [me.txtPasteValNumFormat, 1];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.valueAllFormating] = [me.txtPasteValFormat, 1];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.pasteOnlyFormating] = [me.txtPasteFormat, 2];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.link] = [me.txtPasteLink, 2];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = [me.txtPastePicture, 2];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.linkedPicture] = [me.txtPasteLinkPicture, 2];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = [me.txtPasteSourceFormat, 2];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.destinationFormatting] = [me.txtPasteDestFormat, 2];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.keepTextOnly] = [me.txtKeepTextOnly, 2];
+ me._arrSpecialPaste[Asc.c_oSpecialPasteProps.useTextImport] = [me.txtUseTextImport, 3];
pasteContainer = $('');
documentHolderView.cmpEl.append(pasteContainer);
@@ -2170,28 +2173,78 @@ define([
menu.removeItem(menu.items[i]);
i--;
}
+ var groups = [];
+ for (var i = 0; i < 3; i++) {
+ groups[i] = [];
+ }
- var group_prev = -1;
+ var importText;
_.each(pasteItems, function(menuItem, index) {
- var group = (menuItem<7) ? 0 : (menuItem>9 ? 2 : 1);
- if (group_prev !== group && group_prev>=0)
- menu.addItem(new Common.UI.MenuItem({ caption: '--' }));
- group_prev = group;
+ if (menuItem == Asc.c_oSpecialPasteProps.useTextImport) {
+ importText = new Common.UI.MenuItem({
+ caption: me._arrSpecialPaste[menuItem][0],
+ value: menuItem,
+ checkable: true,
+ toggleGroup : 'specialPasteGroup'
+ }).on('click', function(item, e) {
+ (new Common.Views.OpenDialog({
+ title: me.txtImportWizard,
+ closable: true,
+ type: Common.Utils.importTextType.Paste,
+ preview: true,
+ api: me.api,
+ handler: function (result, encoding, delimiter, delimiterChar) {
+ if (result == 'ok') {
+ if (me && me.api) {
+ var props = new Asc.SpecialPasteProps();
+ props.asc_setProps(Asc.c_oSpecialPasteProps.useTextImport);
+ props.asc_setAdvancedOptions(new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar));
+ me.api.asc_SpecialPaste(props);
+ }
+ me._state.lastSpecPasteChecked = item;
+ } else {
+ item.setChecked(false, true);
+ me._state.lastSpecPasteChecked && me._state.lastSpecPasteChecked.setChecked(true, true);
+ }
+ }
+ })).show();
+ setTimeout(function(){menu.hide();}, 100);
+ });
+ } else {
+ var mnu = new Common.UI.MenuItem({
+ caption: me._arrSpecialPaste[menuItem][0],
+ value: menuItem,
+ checkable: true,
+ toggleGroup : 'specialPasteGroup'
+ }).on('click', function(item, e) {
+ me._state.lastSpecPasteChecked = item;
- var mnu = new Common.UI.MenuItem({
- caption: me._arrSpecialPaste[menuItem],
- value: menuItem,
- checkable: true,
- toggleGroup : 'specialPasteGroup'
- }).on('click', function(item, e) {
- var props = new Asc.SpecialPasteProps();
- props.asc_setProps(item.value);
- me.api.asc_SpecialPaste(props);
- setTimeout(function(){menu.hide();}, 100);
- });
- menu.addItem(mnu);
+ var props = new Asc.SpecialPasteProps();
+ props.asc_setProps(item.value);
+ me.api.asc_SpecialPaste(props);
+ setTimeout(function(){menu.hide();}, 100);
+ });
+ groups[me._arrSpecialPaste[menuItem][1]].push(mnu);
+ }
});
+ var newgroup = false;
+ for (var i = 0; i < 3; i++) {
+ if (newgroup && groups[i].length>0) {
+ menu.addItem(new Common.UI.MenuItem({ caption: '--' }));
+ newgroup = false;
+ }
+ _.each(groups[i], function(menuItem, index) {
+ menu.addItem(menuItem);
+ newgroup = true;
+ });
+ }
(menu.items.length>0) && menu.items[0].setChecked(true, true);
+ me._state.lastSpecPasteChecked = (menu.items.length>0) ? menu.items[0] : null;
+
+ if (importText) {
+ menu.addItem(new Common.UI.MenuItem({ caption: '--' }));
+ menu.addItem(importText);
+ }
}
if ( coord[0].asc_getX()<0 || coord[0].asc_getY()<0) {
@@ -3180,6 +3233,8 @@ define([
txtPasteLinkPicture: 'Linked Picture',
txtPasteSourceFormat: 'Source formatting',
txtPasteDestFormat: 'Destination formatting',
+ txtKeepTextOnly: 'Keep text only',
+ txtUseTextImport: 'Use text import wizard',
txtUndoExpansion: 'Undo table autoexpansion',
txtRedoExpansion: 'Redo table autoexpansion',
txtAnd: 'and',
@@ -3206,7 +3261,8 @@ define([
txtEqualsToFontColor: 'Equals to font color',
txtAll: '(All)',
txtBlanks: '(Blanks)',
- txtColumn: 'Column'
+ txtColumn: 'Column',
+ txtImportWizard: 'Text Import Wizard'
}, SSE.Controllers.DocumentHolder || {}));
});
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index e60c7c1da..0cec53f8c 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -1365,6 +1365,10 @@ define([
config.msg = this.errorEmailClient;
break;
+ case Asc.c_oAscError.ID.NoDataToParse:
+ config.msg = this.errorNoDataToParse;
+ break;
+
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
break;
@@ -1605,8 +1609,9 @@ define([
me = this;
if (type == Asc.c_oAscAdvancedOptionsID.CSV) {
me._state.openDlg = new Common.Views.OpenDialog({
- mode: mode,
- type: type,
+ title: Common.Views.OpenDialog.prototype.txtTitle.replace('%1', 'CSV'),
+ closable: (mode==2), // if save settings
+ type: Common.Utils.importTextType.CSV,
preview: advOptions.asc_getOptions().asc_getData(),
codepages: advOptions.asc_getOptions().asc_getCodePages(),
settings: advOptions.asc_getOptions().asc_getRecommendedSettings(),
@@ -1624,8 +1629,9 @@ define([
});
} else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
me._state.openDlg = new Common.Views.OpenDialog({
+ title: Common.Views.OpenDialog.prototype.txtTitleProtected,
closeFile: me.appOptions.canRequestClose,
- type: type,
+ type: Common.Utils.importTextType.DRM,
warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline),
validatePwd: !!me._state.isDRM,
handler: function (result, value) {
@@ -2493,7 +2499,8 @@ define([
errorEmailClient: 'No email client could be found',
txtPrintArea: 'Print_Area',
txtTable: 'Table',
- textCustomLoader: 'Please note that according to the terms of the license you are not entitled to change the loader.
Please contact our Sales Department to get a quote.'
+ textCustomLoader: 'Please note that according to the terms of the license you are not entitled to change the loader.
Please contact our Sales Department to get a quote.',
+ errorNoDataToParse: 'No data was selected to parse.'
}
})(), SSE.Controllers.Main || {}))
});
diff --git a/apps/spreadsheeteditor/main/app/template/CellSettings.template b/apps/spreadsheeteditor/main/app/template/CellSettings.template
index f02f4417d..59be2c71d 100644
--- a/apps/spreadsheeteditor/main/app/template/CellSettings.template
+++ b/apps/spreadsheeteditor/main/app/template/CellSettings.template
@@ -60,5 +60,15 @@
+
+ |
+
+ |
+
+
+ |
+
+ |
+
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/app/view/CellSettings.js b/apps/spreadsheeteditor/main/app/view/CellSettings.js
index 776d80a9b..735fce90a 100644
--- a/apps/spreadsheeteditor/main/app/view/CellSettings.js
+++ b/apps/spreadsheeteditor/main/app/view/CellSettings.js
@@ -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';
@@ -70,11 +71,13 @@ define([
this._state = {
BackColor: undefined,
DisabledControls: true,
- CellAngle: undefined
+ CellAngle: undefined,
+ CSVOptions: new Asc.asc_CCSVAdvancedOptions(0, 4, '')
};
this.lockedControls = [];
this._locked = true;
this.isEditCell = false;
+ this.isMultiSelect = false;
this.BorderType = 1;
this.render();
@@ -138,6 +141,32 @@ define([
this.api && this.api.asc_setCellAngle(field.getNumberValue());
},
+ onTextToColumn: function() {
+ this.api.asc_TextImport(this._state.CSVOptions, _.bind(this.onTextToColumnCallback, this), false);
+ },
+
+ onTextToColumnCallback: function(data) {
+ if (!data || !data.length) return;
+
+ var me = this;
+ (new Common.Views.OpenDialog({
+ title: me.textWizard,
+ closable: true,
+ type: Common.Utils.importTextType.Columns,
+ preview: true,
+ previewData: data,
+ settings: this._state.CSVOptions,
+ 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({
@@ -149,6 +178,7 @@ define([
this.api = o;
if (o) {
this.api.asc_registerCallback('asc_onEditCell', this.onApiEditCell.bind(this));
+ this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onApiSelectionChanged, this));
}
return this;
},
@@ -236,6 +266,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() {
@@ -333,6 +369,10 @@ define([
this.disableControls(this._locked);
},
+ onApiSelectionChanged: function(info) {
+ this.isMultiSelect = info.asc_getFlags().asc_getMultiselect() || info.asc_getSelectedColsCount()>1;
+ },
+
setLocked: function (locked) {
this._locked = locked;
},
@@ -347,6 +387,7 @@ define([
item.setDisabled(disable);
});
}
+ this.btnTextToColumn.setDisabled(disable || this.isMultiSelect);
},
textBorders: 'Border\'s Style',
@@ -367,7 +408,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 || {}));
});
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 31a656c10..ffca26d1e 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -371,6 +371,9 @@
"SSE.Controllers.DocumentHolder.txtUndoExpansion": "Undo table autoexpansion",
"SSE.Controllers.DocumentHolder.txtUseTextImport": "Use text import wizard",
"SSE.Controllers.DocumentHolder.txtWidth": "Width",
+ "SSE.Controllers.DocumentHolder.txtKeepTextOnly": "Keep text only",
+ "SSE.Controllers.DocumentHolder.txtUseTextImport": "Use text import wizard",
+ "SSE.Controllers.DocumentHolder.txtImportWizard": "Text Import Wizard",
"SSE.Controllers.LeftMenu.newDocumentTitle": "Unnamed spreadsheet",
"SSE.Controllers.LeftMenu.textByColumns": "By columns",
"SSE.Controllers.LeftMenu.textByRows": "By rows",
@@ -726,6 +729,7 @@
"SSE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.",
"SSE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
+ "SSE.Controllers.Main.errorNoDataToParse": "No data was selected to parse.",
"SSE.Controllers.Print.strAllSheets": "All Sheets",
"SSE.Controllers.Print.textWarning": "Warning",
"SSE.Controllers.Print.txtCustom": "Custom",
@@ -1148,6 +1152,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",