[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'],
|
buttons: ['ok', 'cancel'],
|
||||||
callback: _.bind(function(btn){
|
callback: _.bind(function(btn){
|
||||||
if (btn == 'ok') {
|
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();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
|
@ -326,7 +326,7 @@ define([
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX);
|
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);
|
this.api.asc_DownloadAs(opts);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -348,7 +348,7 @@ define([
|
||||||
callback: _.bind(function(btn){
|
callback: _.bind(function(btn){
|
||||||
if (btn == 'ok') {
|
if (btn == 'ok') {
|
||||||
this.isFromFileDownloadAs = ext;
|
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();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
|
@ -374,7 +374,7 @@ define([
|
||||||
} else {
|
} else {
|
||||||
this.isFromFileDownloadAs = ext;
|
this.isFromFileDownloadAs = ext;
|
||||||
var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true);
|
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);
|
this.api.asc_DownloadAs(opts);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -195,6 +195,7 @@ define([
|
||||||
|
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
|
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
|
||||||
|
Common.NotificationCenter.on('download:advanced', _.bind(this.onAdvancedOptions, this));
|
||||||
|
|
||||||
this.isShowOpenDialog = false;
|
this.isShowOpenDialog = false;
|
||||||
|
|
||||||
|
@ -1948,7 +1949,7 @@ define([
|
||||||
this.getApplication().getController('Toolbar').getView().updateMetricUnit();
|
this.getApplication().getController('Toolbar').getView().updateMetricUnit();
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdvancedOptions: function(advOptions, mode) {
|
onAdvancedOptions: function(advOptions, mode, formatOptions) {
|
||||||
if (this._state.openDlg) return;
|
if (this._state.openDlg) return;
|
||||||
|
|
||||||
var type = advOptions.asc_getOptionId(),
|
var type = advOptions.asc_getOptionId(),
|
||||||
|
@ -1966,6 +1967,10 @@ define([
|
||||||
me.isShowOpenDialog = false;
|
me.isShowOpenDialog = false;
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
if (me && me.api) {
|
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.api.asc_setAdvancedOptions(type, new Asc.asc_CTXTAdvancedOptions(encoding));
|
||||||
me.loadMask && me.loadMask.show();
|
me.loadMask && me.loadMask.show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ define([
|
||||||
buttons: ['ok', 'cancel'],
|
buttons: ['ok', 'cancel'],
|
||||||
callback: _.bind(function(btn){
|
callback: _.bind(function(btn){
|
||||||
if (btn == 'ok') {
|
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();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
|
@ -287,7 +287,7 @@ define([
|
||||||
callback: _.bind(function(btn){
|
callback: _.bind(function(btn){
|
||||||
if (btn == 'ok') {
|
if (btn == 'ok') {
|
||||||
this.isFromFileDownloadAs = ext;
|
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();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
|
|
|
@ -168,6 +168,7 @@ define([
|
||||||
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
|
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
|
||||||
Common.NotificationCenter.on('namedrange:locked', _.bind(this.onNamedRangeLocked, this));
|
Common.NotificationCenter.on('namedrange:locked', _.bind(this.onNamedRangeLocked, this));
|
||||||
Common.NotificationCenter.on('download:cancel', _.bind(this.onDownloadCancel, this));
|
Common.NotificationCenter.on('download:cancel', _.bind(this.onDownloadCancel, this));
|
||||||
|
Common.NotificationCenter.on('download:advanced', _.bind(this.onAdvancedOptions, this));
|
||||||
|
|
||||||
this.stackLongActions = new Common.IrregularStack({
|
this.stackLongActions = new Common.IrregularStack({
|
||||||
strongCompare : this._compareActionStrong,
|
strongCompare : this._compareActionStrong,
|
||||||
|
@ -1602,7 +1603,7 @@ define([
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdvancedOptions: function(advOptions, mode) {
|
onAdvancedOptions: function(advOptions, mode, formatOptions) {
|
||||||
if (this._state.openDlg) return;
|
if (this._state.openDlg) return;
|
||||||
|
|
||||||
var type = advOptions.asc_getOptionId(),
|
var type = advOptions.asc_getOptionId(),
|
||||||
|
@ -1620,6 +1621,10 @@ define([
|
||||||
me.isShowOpenDialog = false;
|
me.isShowOpenDialog = false;
|
||||||
if (result == 'ok') {
|
if (result == 'ok') {
|
||||||
if (me && me.api) {
|
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.api.asc_setAdvancedOptions(type, new Asc.asc_CCSVAdvancedOptions(encoding, delimiter, delimiterChar));
|
||||||
me.loadMask && me.loadMask.show();
|
me.loadMask && me.loadMask.show();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue