Commit e4d7b7d9 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Fix Bug 33224.

parent 87326e30
...@@ -76,7 +76,10 @@ define([ ...@@ -76,7 +76,10 @@ define([
'<div id="id-codepages-combo" class="input-group-nr" style="margin-bottom:15px;"></div>', '<div id="id-codepages-combo" class="input-group-nr" style="margin-bottom:15px;"></div>',
'<% if (type == Asc.c_oAscAdvancedOptionsID.CSV) { %>', '<% if (type == Asc.c_oAscAdvancedOptionsID.CSV) { %>',
'<label class="header">' + t.txtDelimiter + '</label>', '<label class="header">' + t.txtDelimiter + '</label>',
'<div id="id-delimiters-combo" class="input-group-nr" style="max-width: 110px;"></div>', '<div>',
'<div id="id-delimiters-combo" class="input-group-nr" style="max-width: 110px;display: inline-block; vertical-align: middle;"></div>',
'<div id="id-delimiter-other" class="input-row" style="display: inline-block; vertical-align: middle;margin-left: 10px;"></div>',
'</div>',
'<% } %>', '<% } %>',
'<% } %>', '<% } %>',
'</div>', '</div>',
...@@ -135,9 +138,12 @@ define([ ...@@ -135,9 +138,12 @@ define([
onBtnClick: function (event) { onBtnClick: function (event) {
if (this.handler) { if (this.handler) {
if (this.cmbEncoding) if (this.cmbEncoding) {
this.handler.call(this, this.cmbEncoding.getValue(), this.cmbDelimiter ? this.cmbDelimiter.getValue() : null); var delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null,
else delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null;
(delimiter == -1) && (delimiter = null);
this.handler.call(this, this.cmbEncoding.getValue(), delimiter, delimiterChar);
} else
this.handler.call(this, this.inputPwd.getValue()); this.handler.call(this, this.inputPwd.getValue());
} }
...@@ -337,14 +343,29 @@ define([ ...@@ -337,14 +343,29 @@ define([
{value: 2, displayValue: ';'}, {value: 2, displayValue: ';'},
{value: 3, displayValue: ':'}, {value: 3, displayValue: ':'},
{value: 1, displayValue: this.txtTab}, {value: 1, displayValue: this.txtTab},
{value: 5, displayValue: this.txtSpace}], {value: 5, displayValue: this.txtSpace},
{value: -1, displayValue: this.txtOther}],
editable: false editable: false
}); });
this.cmbDelimiter.setValue( (this.settings && this.settings.asc_getDelimiter()) ? this.settings.asc_getDelimiter() : 4); this.cmbDelimiter.setValue( (this.settings && this.settings.asc_getDelimiter()) ? this.settings.asc_getDelimiter() : 4);
this.cmbDelimiter.on('selected', _.bind(this.onCmbDelimiterSelect, this));
this.inputDelimiter = new Common.UI.InputField({
el : $('#id-delimiter-other'),
style : 'width: 30px;',
maxLength: 1,
value: (this.settings && this.settings.asc_getDelimiterChar()) ? this.settings.asc_getDelimiterChar() : ''
});
this.inputDelimiter.setVisible(false);
} }
} }
}, },
onCmbDelimiterSelect: function(combo, record){
this.inputDelimiter.setVisible(record.value == -1);
},
okButtonText : "OK", okButtonText : "OK",
cancelButtonText : "Cancel", cancelButtonText : "Cancel",
txtDelimiter : "Delimiter", txtDelimiter : "Delimiter",
...@@ -353,7 +374,8 @@ define([ ...@@ -353,7 +374,8 @@ define([
txtTab : "Tab", txtTab : "Tab",
txtTitle : "Choose %1 options", txtTitle : "Choose %1 options",
txtPassword : "Password", txtPassword : "Password",
txtTitleProtected : "Protected File" txtTitleProtected : "Protected File",
txtOther: 'Other'
}, Common.Views.OpenDialog || {})); }, Common.Views.OpenDialog || {}));
}); });
\ No newline at end of file
...@@ -1413,10 +1413,10 @@ define([ ...@@ -1413,10 +1413,10 @@ define([
type: type, type: type,
codepages: advOptions.asc_getOptions().asc_getCodePages(), codepages: advOptions.asc_getOptions().asc_getCodePages(),
settings: advOptions.asc_getOptions().asc_getRecommendedSettings(), settings: advOptions.asc_getOptions().asc_getRecommendedSettings(),
handler: function (encoding, delimiter) { handler: function (encoding, delimiter, delimiterChar) {
me.isShowOpenDialog = false; me.isShowOpenDialog = false;
if (me && me.api) { if (me && me.api) {
me.api.asc_setAdvancedOptions(type, new Asc.asc_CCSVAdvancedOptions(encoding, delimiter)); me.api.asc_setAdvancedOptions(type, new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar));
me.loadMask && me.loadMask.show(); me.loadMask && me.loadMask.show();
} }
} }
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
"Common.Views.OpenDialog.txtTab": "Tab", "Common.Views.OpenDialog.txtTab": "Tab",
"Common.Views.OpenDialog.txtTitle": "Choose %1 options", "Common.Views.OpenDialog.txtTitle": "Choose %1 options",
"Common.Views.OpenDialog.txtTitleProtected": "Protected File", "Common.Views.OpenDialog.txtTitleProtected": "Protected File",
"Common.Views.OpenDialog.txtOther": "Other",
"Common.Views.PluginDlg.textLoading": "Loading", "Common.Views.PluginDlg.textLoading": "Loading",
"Common.Views.Plugins.strPlugins": "Plugins", "Common.Views.Plugins.strPlugins": "Plugins",
"Common.Views.Plugins.textLoading": "Loading", "Common.Views.Plugins.textLoading": "Loading",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment