[DE][SSE] Change downloading as TXT/ RTF and CSV
This commit is contained in:
parent
39bfe54860
commit
c0862be9b9
|
@ -302,7 +302,7 @@ define([
|
|||
buttons: ['ok', 'cancel'],
|
||||
callback: _.bind(function(btn){
|
||||
if (btn == 'ok') {
|
||||
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
Common.NotificationCenter.trigger('download:advanced', this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format));
|
||||
menu.hide();
|
||||
}
|
||||
}, this)
|
||||
|
@ -326,7 +326,7 @@ define([
|
|||
});
|
||||
} else {
|
||||
var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX);
|
||||
// opts.asc_setCompatible(!!Common.Utils.InternalSettings.get("de-settings-compatible"));
|
||||
opts.asc_setCompatible(!!Common.Utils.InternalSettings.get("de-settings-compatible"));
|
||||
this.api.asc_DownloadAs(opts);
|
||||
}
|
||||
} else {
|
||||
|
@ -348,7 +348,7 @@ define([
|
|||
callback: _.bind(function(btn){
|
||||
if (btn == 'ok') {
|
||||
this.isFromFileDownloadAs = ext;
|
||||
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
|
||||
Common.NotificationCenter.trigger('download:advanced', this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format, true));
|
||||
menu.hide();
|
||||
}
|
||||
}, this)
|
||||
|
@ -374,7 +374,7 @@ define([
|
|||
} else {
|
||||
this.isFromFileDownloadAs = ext;
|
||||
var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true);
|
||||
// opts.asc_setCompatible(!!Common.Utils.InternalSettings.get("de-settings-compatible"));
|
||||
opts.asc_setCompatible(!!Common.Utils.InternalSettings.get("de-settings-compatible"));
|
||||
this.api.asc_DownloadAs(opts);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -195,6 +195,7 @@ define([
|
|||
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
|
||||
Common.NotificationCenter.on('download:advanced', _.bind(this.onAdvancedOptions, this));
|
||||
|
||||
this.isShowOpenDialog = false;
|
||||
|
||||
|
@ -1948,7 +1949,7 @@ define([
|
|||
this.getApplication().getController('Toolbar').getView().updateMetricUnit();
|
||||
},
|
||||
|
||||
onAdvancedOptions: function(advOptions, mode) {
|
||||
onAdvancedOptions: function(advOptions, mode, formatOptions) {
|
||||
if (this._state.openDlg) return;
|
||||
|
||||
var type = advOptions.asc_getOptionId(),
|
||||
|
@ -1966,6 +1967,10 @@ define([
|
|||
me.isShowOpenDialog = false;
|
||||
if (result == 'ok') {
|
||||
if (me && me.api) {
|
||||
if (mode==2) {
|
||||
formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CTXTAdvancedOptions(encoding));
|
||||
me.api.asc_DownloadAs(formatOptions);
|
||||
} else
|
||||
me.api.asc_setAdvancedOptions(type, new Asc.asc_CTXTAdvancedOptions(encoding));
|
||||
me.loadMask && me.loadMask.show();
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ define([
|
|||
buttons: ['ok', 'cancel'],
|
||||
callback: _.bind(function(btn){
|
||||
if (btn == 'ok') {
|
||||
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
Common.NotificationCenter.trigger('download:advanced', this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format));
|
||||
menu.hide();
|
||||
}
|
||||
}, this)
|
||||
|
@ -287,7 +287,7 @@ define([
|
|||
callback: _.bind(function(btn){
|
||||
if (btn == 'ok') {
|
||||
this.isFromFileDownloadAs = ext;
|
||||
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
|
||||
Common.NotificationCenter.trigger('download:advanced', this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format, true));
|
||||
menu.hide();
|
||||
}
|
||||
}, this)
|
||||
|
|
|
@ -168,6 +168,7 @@ define([
|
|||
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
|
||||
Common.NotificationCenter.on('namedrange:locked', _.bind(this.onNamedRangeLocked, this));
|
||||
Common.NotificationCenter.on('download:cancel', _.bind(this.onDownloadCancel, this));
|
||||
Common.NotificationCenter.on('download:advanced', _.bind(this.onAdvancedOptions, this));
|
||||
|
||||
this.stackLongActions = new Common.IrregularStack({
|
||||
strongCompare : this._compareActionStrong,
|
||||
|
@ -1602,7 +1603,7 @@ define([
|
|||
return false;
|
||||
},
|
||||
|
||||
onAdvancedOptions: function(advOptions, mode) {
|
||||
onAdvancedOptions: function(advOptions, mode, formatOptions) {
|
||||
if (this._state.openDlg) return;
|
||||
|
||||
var type = advOptions.asc_getOptionId(),
|
||||
|
@ -1620,6 +1621,10 @@ define([
|
|||
me.isShowOpenDialog = false;
|
||||
if (result == 'ok') {
|
||||
if (me && me.api) {
|
||||
if (mode==2) {
|
||||
formatOptions && formatOptions.asc_setAdvancedOptions(new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar));
|
||||
me.api.asc_DownloadAs(formatOptions);
|
||||
} else
|
||||
me.api.asc_setAdvancedOptions(type, new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar));
|
||||
me.loadMask && me.loadMask.show();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue