mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 02:29:58 +08:00
Fix Bug 77079
This commit is contained in:
@ -355,9 +355,27 @@ define([
|
||||
});
|
||||
},
|
||||
|
||||
showLostDataWarningOds: function(callback) {
|
||||
Common.UI.warning({
|
||||
title: this.textWarning,
|
||||
msg: this.warnDownloadOds,
|
||||
buttons: ['ok', 'cancel'],
|
||||
maxwidth: 600,
|
||||
callback: _.bind(function (btn) {
|
||||
if (btn == 'ok') {
|
||||
callback.call();
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
},
|
||||
|
||||
clickSaveAsFormat: function(menu, format) {
|
||||
var me = this,
|
||||
callback = function () {
|
||||
me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
menu.hide();
|
||||
};
|
||||
if (format == Asc.c_oAscFileType.CSV) {
|
||||
var me = this;
|
||||
this.showLostDataWarning(function () {
|
||||
Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format));
|
||||
menu.hide();
|
||||
@ -365,15 +383,24 @@ define([
|
||||
} else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA) {
|
||||
menu.hide();
|
||||
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format);
|
||||
} else if (format == Asc.c_oAscFileType.ODS) {
|
||||
this.showLostDataWarningOds(callback);
|
||||
} else {
|
||||
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
menu.hide();
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
clickSaveCopyAsFormat: function(menu, format, ext, wopiPath) {
|
||||
var me = this,
|
||||
callback = function() {
|
||||
me.isFromFileDownloadAs = ext;
|
||||
var options = new Asc.asc_CDownloadOptions(format, true);
|
||||
options.asc_setIsSaveAs(true);
|
||||
wopiPath && options.asc_setWopiSaveAsPath(wopiPath);
|
||||
me.api.asc_DownloadAs(options);
|
||||
menu.hide();
|
||||
};
|
||||
if (format == Asc.c_oAscFileType.CSV) {
|
||||
var me = this;
|
||||
me.showLostDataWarning(function () {
|
||||
me.isFromFileDownloadAs = ext;
|
||||
var options = new Asc.asc_CDownloadOptions(format, true);
|
||||
@ -386,13 +413,10 @@ define([
|
||||
this.isFromFileDownloadAs = ext;
|
||||
menu.hide();
|
||||
Common.NotificationCenter.trigger('download:settings', this.leftMenu, format, true, wopiPath);
|
||||
} else if (format == Asc.c_oAscFileType.ODS) {
|
||||
this.showLostDataWarningOds(callback);
|
||||
} else {
|
||||
this.isFromFileDownloadAs = ext;
|
||||
var options = new Asc.asc_CDownloadOptions(format, true);
|
||||
options.asc_setIsSaveAs(true);
|
||||
wopiPath && options.asc_setWopiSaveAsPath(wopiPath);
|
||||
this.api.asc_DownloadAs(options);
|
||||
menu.hide();
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -1483,6 +1483,7 @@
|
||||
"SSE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
|
||||
"SSE.Controllers.LeftMenu.warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.<br>To save only the active sheet to CSV, press OK.<br>To save the whole spreadsheet and all features, click Cancel and select another format.",
|
||||
"SSE.Controllers.LeftMenu.warnDownloadCsvSheets": "The CSV format does not support saving a multi-sheet file.<br>To keep the selected format and save only the current sheet, press Save.<br>To save the current spreadsheet, click Cancel and save it in a different format.",
|
||||
"SSE.Controllers.LeftMenu.warnDownloadOds": "Saving this file may result in the loss of some formulas, cell formatting, or embedded objects due to limited format support.<br>Are you sure you want to continue?",
|
||||
"SSE.Controllers.Main.confirmAddCellWatches": "This action will add {0} cell watches.<br>Do you want to continue?",
|
||||
"SSE.Controllers.Main.confirmAddCellWatchesMax": "This action will add only {0} cell watches by memory save reason.<br>Do you want to continue?",
|
||||
"SSE.Controllers.Main.confirmMaxChangesSize": "The size of actions exceeds the limitation set for your server.<br>Press \"Undo\" to cancel your last action or press \"Continue\" to keep action locally (you need to download the file or copy its content to make sure nothing is lost).",
|
||||
|
||||
@ -890,7 +890,8 @@
|
||||
"txtZh": "Chinese (Simplified)",
|
||||
"txtZhtw": "Chinese (Traditional)",
|
||||
"warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
|
||||
"warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.<br>To save only the active sheet to CSV, press OK.<br>To save the whole spreadsheet and all features, click Cancel and select another format."
|
||||
"warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.<br>To save only the active sheet to CSV, press OK.<br>To save the whole spreadsheet and all features, click Cancel and select another format.",
|
||||
"warnDownloadOds": "Saving this file may result in the loss of some formulas, cell formatting, or embedded objects due to limited format support.<br>Are you sure you want to continue?"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -44,6 +44,22 @@ class DownloadController extends Component {
|
||||
}
|
||||
]
|
||||
}).open();
|
||||
} else if (format == Asc.c_oAscFileType.ODS) {
|
||||
f7.dialog.create({
|
||||
title: _t.notcriticalErrorTitle,
|
||||
text: _t.warnDownloadOds,
|
||||
buttons: [
|
||||
{
|
||||
text: _t.textCancel
|
||||
},
|
||||
{
|
||||
text: _t.textOk,
|
||||
onClick: () => {
|
||||
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
}
|
||||
}
|
||||
]
|
||||
}).open();
|
||||
} else {
|
||||
api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user