Change usage of asc_DownloadAs
This commit is contained in:
parent
5ccd06857e
commit
4abaffcf88
|
@ -65,7 +65,7 @@
|
||||||
iframePrint.contentWindow.blur();
|
iframePrint.contentWindow.blur();
|
||||||
window.focus();
|
window.focus();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
|
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ define([
|
||||||
Common.Gateway.requestRestore(record.get('revision'));
|
Common.Gateway.requestRestore(record.get('revision'));
|
||||||
else {
|
else {
|
||||||
this.isFromSelectRevision = record.get('revision');
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,7 +458,7 @@ DE.ApplicationController = new(function(){
|
||||||
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
||||||
return;
|
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
|
// Helpers
|
||||||
|
|
|
@ -302,13 +302,13 @@ 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(format);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_DownloadAs(format);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
|
@ -326,14 +326,14 @@ 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(format, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.isFromFileDownloadAs = ext;
|
this.isFromFileDownloadAs = ext;
|
||||||
this.api.asc_DownloadAs(format, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -463,7 +463,7 @@ define([
|
||||||
|
|
||||||
if ( !_format || _supported.indexOf(_format) < 0 )
|
if ( !_format || _supported.indexOf(_format) < 0 )
|
||||||
_format = Asc.c_oAscFileType.DOCX;
|
_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();
|
me.iframePrint.contentWindow.blur();
|
||||||
window.focus();
|
window.focus();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
|
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,7 @@ define([
|
||||||
if ( !_format || _supported.indexOf(_format) < 0 )
|
if ( !_format || _supported.indexOf(_format) < 0 )
|
||||||
_format = Asc.c_oAscFileType.PDF;
|
_format = Asc.c_oAscFileType.PDF;
|
||||||
|
|
||||||
_main.api.asc_DownloadAs(_format);
|
_main.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format));
|
||||||
},
|
},
|
||||||
'go:editor': function() {
|
'go:editor': function() {
|
||||||
Common.Gateway.requestEditRights();
|
Common.Gateway.requestEditRights();
|
||||||
|
|
|
@ -322,7 +322,7 @@ define([
|
||||||
if (type && typeof type[1] === 'string') {
|
if (type && typeof type[1] === 'string') {
|
||||||
this.api.asc_DownloadOrigin(true)
|
this.api.asc_DownloadOrigin(true)
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_DownloadAs(Asc.c_oAscFileType.DOCX, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -567,13 +567,13 @@ define([
|
||||||
me.warnDownloadAs,
|
me.warnDownloadAs,
|
||||||
me.notcriticalErrorTitle,
|
me.notcriticalErrorTitle,
|
||||||
function () {
|
function () {
|
||||||
me.api.asc_DownloadAs(format);
|
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
_.defer(function () {
|
_.defer(function () {
|
||||||
me.api.asc_DownloadAs(format);
|
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -558,7 +558,7 @@ PE.ApplicationController = new(function(){
|
||||||
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
||||||
return;
|
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
|
// Helpers
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
|
@ -247,13 +247,13 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
clickSaveAsFormat: function(menu, format) {
|
clickSaveAsFormat: function(menu, format) {
|
||||||
this.api.asc_DownloadAs(format);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
clickSaveCopyAsFormat: function(menu, format, ext) {
|
clickSaveCopyAsFormat: function(menu, format, ext) {
|
||||||
this.isFromFileDownloadAs = ext;
|
this.isFromFileDownloadAs = ext;
|
||||||
this.api.asc_DownloadAs(format, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -419,7 +419,7 @@ define([
|
||||||
|
|
||||||
if ( !_format || _supported.indexOf(_format) < 0 )
|
if ( !_format || _supported.indexOf(_format) < 0 )
|
||||||
_format = Asc.c_oAscFileType.PPTX;
|
_format = Asc.c_oAscFileType.PPTX;
|
||||||
this.api.asc_DownloadAs(_format, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format, true));
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessMouse: function(data) {
|
onProcessMouse: function(data) {
|
||||||
|
@ -1784,7 +1784,7 @@ define([
|
||||||
me.iframePrint.contentWindow.blur();
|
me.iframePrint.contentWindow.blur();
|
||||||
window.focus();
|
window.focus();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
me.api.asc_DownloadAs(Asc.c_oAscFileType.PDF);
|
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ define([
|
||||||
if ( !_format || _supported.indexOf(_format) < 0 )
|
if ( !_format || _supported.indexOf(_format) < 0 )
|
||||||
_format = Asc.c_oAscFileType.PDF;
|
_format = Asc.c_oAscFileType.PDF;
|
||||||
|
|
||||||
_main.api.asc_DownloadAs(_format);
|
_main.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format));
|
||||||
},
|
},
|
||||||
'go:editor': function() {
|
'go:editor': function() {
|
||||||
Common.Gateway.requestEditRights();
|
Common.Gateway.requestEditRights();
|
||||||
|
|
|
@ -311,7 +311,7 @@ define([
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._state.isFromGatewayDownloadAs = true;
|
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) {
|
goBack: function(current) {
|
||||||
|
|
|
@ -381,7 +381,7 @@ define([
|
||||||
|
|
||||||
if (format) {
|
if (format) {
|
||||||
_.defer(function () {
|
_.defer(function () {
|
||||||
me.api.asc_DownloadAs(format);
|
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -464,7 +464,7 @@ SSE.ApplicationController = new(function(){
|
||||||
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
api.asc_DownloadAs(Asc.c_oAscFileType.XLSX, true);
|
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onApiMouseMove(array) {
|
function onApiMouseMove(array) {
|
||||||
|
|
|
@ -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(format);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
|
@ -273,7 +273,7 @@ define([
|
||||||
menu.hide();
|
menu.hide();
|
||||||
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format);
|
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format);
|
||||||
} else {
|
} else {
|
||||||
this.api.asc_DownloadAs(format);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -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(format, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
}, this)
|
}, this)
|
||||||
|
@ -298,7 +298,7 @@ define([
|
||||||
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format, true);
|
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format, true);
|
||||||
} else {
|
} else {
|
||||||
this.isFromFileDownloadAs = ext;
|
this.isFromFileDownloadAs = ext;
|
||||||
this.api.asc_DownloadAs(format, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true));
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -434,7 +434,7 @@ define([
|
||||||
if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
|
if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
|
||||||
Common.NotificationCenter.trigger('download:settings', this, _format, true);
|
Common.NotificationCenter.trigger('download:settings', this, _format, true);
|
||||||
else
|
else
|
||||||
this.api.asc_DownloadAs(_format, true);
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format, true));
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessMouse: function(data) {
|
onProcessMouse: function(data) {
|
||||||
|
@ -2021,7 +2021,9 @@ define([
|
||||||
me.iframePrint.contentWindow.blur();
|
me.iframePrint.contentWindow.blur();
|
||||||
window.focus();
|
window.focus();
|
||||||
} catch (e) {
|
} 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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,8 +268,11 @@ define([
|
||||||
|
|
||||||
if ( this.printSettingsDlg.type=='print' )
|
if ( this.printSettingsDlg.type=='print' )
|
||||||
this.api.asc_Print(this.adjPrintParams, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera);
|
this.api.asc_Print(this.adjPrintParams, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera);
|
||||||
else
|
else {
|
||||||
this.api.asc_DownloadAs(this.downloadFormat, this.asUrl, this.adjPrintParams);
|
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((this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs');
|
||||||
Common.component.Analytics.trackEvent('ToolBar', (this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs');
|
Common.component.Analytics.trackEvent('ToolBar', (this.printSettingsDlg.type=='print') ? 'Print' : 'DownloadAs');
|
||||||
Common.NotificationCenter.trigger('edit:complete', view);
|
Common.NotificationCenter.trigger('edit:complete', view);
|
||||||
|
|
|
@ -113,7 +113,7 @@ define([
|
||||||
if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
|
if (_format == Asc.c_oAscFileType.PDF || _format == Asc.c_oAscFileType.PDFA)
|
||||||
Common.NotificationCenter.trigger('download:settings', this.toolbar, _format);
|
Common.NotificationCenter.trigger('download:settings', this.toolbar, _format);
|
||||||
else
|
else
|
||||||
_main.api.asc_DownloadAs(_format);
|
_main.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format));
|
||||||
},
|
},
|
||||||
'go:editor': function() {
|
'go:editor': function() {
|
||||||
Common.Gateway.requestEditRights();
|
Common.Gateway.requestEditRights();
|
||||||
|
|
|
@ -319,7 +319,7 @@ define([
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._state.isFromGatewayDownloadAs = true;
|
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) {
|
goBack: function(current) {
|
||||||
|
|
|
@ -676,11 +676,11 @@ define([
|
||||||
me.warnDownloadAs,
|
me.warnDownloadAs,
|
||||||
me.notcriticalErrorTitle,
|
me.notcriticalErrorTitle,
|
||||||
function () {
|
function () {
|
||||||
me.api.asc_DownloadAs(format);
|
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
me.api.asc_DownloadAs(format);
|
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||||
}
|
}
|
||||||
|
|
||||||
me.hideModal();
|
me.hideModal();
|
||||||
|
|
Loading…
Reference in a new issue