Change usage of asc_DownloadAs

This commit is contained in:
Julia Radzhabova 2019-07-24 11:36:13 +03:00
parent 5ccd06857e
commit 4abaffcf88
21 changed files with 39 additions and 34 deletions

View file

@ -65,7 +65,7 @@
iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF));
}
};

View file

@ -113,7 +113,7 @@ define([
Common.Gateway.requestRestore(record.get('revision'));
else {
this.isFromSelectRevision = record.get('revision');
this.api.asc_DownloadAs(Asc.c_oAscFileType.DOCX, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true));
}
return;
}

View file

@ -458,7 +458,7 @@ DE.ApplicationController = new(function(){
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
return;
}
if (api) api.asc_DownloadAs(Asc.c_oAscFileType.DOCX, true);
if (api) api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true));
}
// Helpers

View file

@ -302,13 +302,13 @@ define([
buttons: ['ok', 'cancel'],
callback: _.bind(function(btn){
if (btn == 'ok') {
this.api.asc_DownloadAs(format);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
menu.hide();
}
}, this)
});
} else {
this.api.asc_DownloadAs(format);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
menu.hide();
}
} else
@ -326,14 +326,14 @@ define([
callback: _.bind(function(btn){
if (btn == 'ok') {
this.isFromFileDownloadAs = ext;
this.api.asc_DownloadAs(format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
menu.hide();
}
}, this)
});
} else {
this.isFromFileDownloadAs = ext;
this.api.asc_DownloadAs(format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
menu.hide();
}
} else {

View file

@ -463,7 +463,7 @@ define([
if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.DOCX;
this.api.asc_DownloadAs(_format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format, true));
}
},
@ -2096,7 +2096,7 @@ define([
me.iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF));
}
};
}

View file

@ -152,7 +152,7 @@ define([
if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.PDF;
_main.api.asc_DownloadAs(_format);
_main.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format));
},
'go:editor': function() {
Common.Gateway.requestEditRights();

View file

@ -322,7 +322,7 @@ define([
if (type && typeof type[1] === 'string') {
this.api.asc_DownloadOrigin(true)
} else {
this.api.asc_DownloadAs(Asc.c_oAscFileType.DOCX, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true));
}
},

View file

@ -567,13 +567,13 @@ define([
me.warnDownloadAs,
me.notcriticalErrorTitle,
function () {
me.api.asc_DownloadAs(format);
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}
);
});
} else {
_.defer(function () {
me.api.asc_DownloadAs(format);
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
});
}

View file

@ -558,7 +558,7 @@ PE.ApplicationController = new(function(){
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
return;
}
if (api) api.asc_DownloadAs(Asc.c_oAscFileType.PPTX, true);
if (api) api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PPTX, true));
}
// Helpers
// -------------------------

View file

@ -247,13 +247,13 @@ define([
},
clickSaveAsFormat: function(menu, format) {
this.api.asc_DownloadAs(format);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
menu.hide();
},
clickSaveCopyAsFormat: function(menu, format, ext) {
this.isFromFileDownloadAs = ext;
this.api.asc_DownloadAs(format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
menu.hide();
},

View file

@ -419,7 +419,7 @@ define([
if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.PPTX;
this.api.asc_DownloadAs(_format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format, true));
},
onProcessMouse: function(data) {
@ -1784,7 +1784,7 @@ define([
me.iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF));
}
};
}

View file

@ -161,7 +161,7 @@ define([
if ( !_format || _supported.indexOf(_format) < 0 )
_format = Asc.c_oAscFileType.PDF;
_main.api.asc_DownloadAs(_format);
_main.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format));
},
'go:editor': function() {
Common.Gateway.requestEditRights();

View file

@ -311,7 +311,7 @@ define([
return;
}
this._state.isFromGatewayDownloadAs = true;
this.api.asc_DownloadAs(Asc.c_oAscFileType.PPTX, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PPTX, true));
},
goBack: function(current) {

View file

@ -381,7 +381,7 @@ define([
if (format) {
_.defer(function () {
me.api.asc_DownloadAs(format);
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
});
}

View file

@ -464,7 +464,7 @@ SSE.ApplicationController = new(function(){
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
return;
}
api.asc_DownloadAs(Asc.c_oAscFileType.XLSX, true);
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true));
}
function onApiMouseMove(array) {

View file

@ -264,7 +264,7 @@ define([
buttons: ['ok', 'cancel'],
callback: _.bind(function(btn){
if (btn == 'ok') {
this.api.asc_DownloadAs(format);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
menu.hide();
}
}, this)
@ -273,7 +273,7 @@ define([
menu.hide();
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format);
} else {
this.api.asc_DownloadAs(format);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
menu.hide();
}
},
@ -287,7 +287,7 @@ define([
callback: _.bind(function(btn){
if (btn == 'ok') {
this.isFromFileDownloadAs = ext;
this.api.asc_DownloadAs(format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
menu.hide();
}
}, this)
@ -298,7 +298,7 @@ define([
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format, true);
} else {
this.isFromFileDownloadAs = ext;
this.api.asc_DownloadAs(format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
menu.hide();
}
},

View file

@ -434,7 +434,7 @@ define([
if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
Common.NotificationCenter.trigger('download:settings', this, _format, true);
else
this.api.asc_DownloadAs(_format, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format, true));
},
onProcessMouse: function(data) {
@ -2021,7 +2021,9 @@ define([
me.iframePrint.contentWindow.blur();
window.focus();
} catch (e) {
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF, false, me.getApplication().getController('Print').getPrintParams());
var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF);
opts.asc_setAdjustPrint(me.getApplication().getController('Print').getPrintParams());
me.api.asc_DownloadAs(opts);
}
};
}

View file

@ -268,8 +268,11 @@ define([
if ( this.printSettingsDlg.type=='print' )
this.api.asc_Print(this.adjPrintParams, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera);
else
this.api.asc_DownloadAs(this.downloadFormat, this.asUrl, this.adjPrintParams);
else {
var opts = new Asc.asc_CDownloadOptions(this.downloadFormat, this.asUrl);
opts.asc_setAdjustPrint(this.adjPrintParams);
this.api.asc_DownloadAs(opts);
}
Common.component.Analytics.trackEvent((this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs');
Common.component.Analytics.trackEvent('ToolBar', (this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs');
Common.NotificationCenter.trigger('edit:complete', view);

View file

@ -113,7 +113,7 @@ define([
if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
Common.NotificationCenter.trigger('download:settings', this.toolbar, _format);
else
_main.api.asc_DownloadAs(_format);
_main.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format));
},
'go:editor': function() {
Common.Gateway.requestEditRights();

View file

@ -319,7 +319,7 @@ define([
return;
}
this._state.isFromGatewayDownloadAs = true;
this.api.asc_DownloadAs(Asc.c_oAscFileType.XLSX, true);
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true));
},
goBack: function(current) {

View file

@ -676,11 +676,11 @@ define([
me.warnDownloadAs,
me.notcriticalErrorTitle,
function () {
me.api.asc_DownloadAs(format);
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}
);
} else {
me.api.asc_DownloadAs(format);
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
}
me.hideModal();