Added format parameter to downloadAs api method.
This commit is contained in:
parent
304e08e23c
commit
5da46ba82c
|
@ -511,9 +511,10 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var _downloadAs = function() {
|
var _downloadAs = function(data) {
|
||||||
_sendCommand({
|
_sendCommand({
|
||||||
command: 'downloadAs'
|
command: 'downloadAs',
|
||||||
|
data: data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -80,8 +80,8 @@ if (Common === undefined) {
|
||||||
$me.trigger('processmailmerge', data);
|
$me.trigger('processmailmerge', data);
|
||||||
},
|
},
|
||||||
|
|
||||||
'downloadAs': function() {
|
'downloadAs': function(data) {
|
||||||
$me.trigger('downloadas');
|
$me.trigger('downloadas', data);
|
||||||
},
|
},
|
||||||
|
|
||||||
'processMouse': function(data) {
|
'processMouse': function(data) {
|
||||||
|
|
|
@ -364,10 +364,25 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadAs: function() {
|
onDownloadAs: function(format) {
|
||||||
this._state.isFromGatewayDownloadAs = true;
|
this._state.isFromGatewayDownloadAs = true;
|
||||||
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
|
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
|
||||||
(type && typeof type[1] === 'string') ? this.api.asc_DownloadOrigin(true) : this.api.asc_DownloadAs(Asc.c_oAscFileType.DOCX, true);
|
if (type && typeof type[1] === 'string')
|
||||||
|
this.api.asc_DownloadOrigin(true);
|
||||||
|
else {
|
||||||
|
var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
|
||||||
|
_supported = [
|
||||||
|
Asc.c_oAscFileType.TXT,
|
||||||
|
Asc.c_oAscFileType.ODT,
|
||||||
|
Asc.c_oAscFileType.DOCX,
|
||||||
|
Asc.c_oAscFileType.HTML,
|
||||||
|
Asc.c_oAscFileType.PDF
|
||||||
|
];
|
||||||
|
|
||||||
|
if ( !_format || _supported.indexOf(_format) < 0 )
|
||||||
|
_format = Asc.c_oAscFileType.DOCX;
|
||||||
|
this.api.asc_DownloadAs(_format, true);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessMouse: function(data) {
|
onProcessMouse: function(data) {
|
||||||
|
|
|
@ -356,8 +356,17 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadAs: function() {
|
onDownloadAs: function(format) {
|
||||||
this.api.asc_DownloadAs(Asc.c_oAscFileType.PPTX, true);
|
var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
|
||||||
|
_supported = [
|
||||||
|
Asc.c_oAscFileType.PPTX,
|
||||||
|
Asc.c_oAscFileType.ODP,
|
||||||
|
Asc.c_oAscFileType.PDF
|
||||||
|
];
|
||||||
|
|
||||||
|
if ( !_format || _supported.indexOf(_format) < 0 )
|
||||||
|
_format = Asc.c_oAscFileType.PPTX;
|
||||||
|
this.api.asc_DownloadAs(_format, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessMouse: function(data) {
|
onProcessMouse: function(data) {
|
||||||
|
|
|
@ -393,8 +393,18 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadAs: function() {
|
onDownloadAs: function(format) {
|
||||||
this.api.asc_DownloadAs(Asc.c_oAscFileType.XLSX, true);
|
var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
|
||||||
|
_supported = [
|
||||||
|
Asc.c_oAscFileType.XLSX,
|
||||||
|
Asc.c_oAscFileType.ODS,
|
||||||
|
Asc.c_oAscFileType.CSV,
|
||||||
|
Asc.c_oAscFileType.PDF
|
||||||
|
];
|
||||||
|
|
||||||
|
if ( !_format || _supported.indexOf(_format) < 0 )
|
||||||
|
_format = Asc.c_oAscFileType.XLSX;
|
||||||
|
this.api.asc_DownloadAs(_format, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessMouse: function(data) {
|
onProcessMouse: function(data) {
|
||||||
|
|
Loading…
Reference in a new issue