From f52b50ae676ec6d1ad3a42d647c37d2c634858fd Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 15 Feb 2022 22:36:49 +0300 Subject: [PATCH 1/4] [DE] Use default settings for pdf download --- .../main/app/controller/LeftMenu.js | 30 +++++++------------ .../main/app/controller/Main.js | 10 ++++++- apps/documenteditor/main/locale/en.json | 1 + 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 59c2df39d..08cc58f48 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -374,22 +374,16 @@ define([ } else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA) this._saveAsFormat(menu, format, ext); else { - (new Common.Views.OptionsDialog({ - width: 300, - title: this.titleConvertOptions, - label: this.textGroup, - items: [ - {caption: this.textChar, value: Asc.c_oAscTextAssociation.BlockChar, checked: true}, - {caption: this.textLine, value: Asc.c_oAscTextAssociation.BlockLine, checked: false}, - {caption: this.textParagraph, value: Asc.c_oAscTextAssociation.PlainLine, checked: false} - ], - handler: function (dlg, result) { - if (result=='ok') { - me._saveAsFormat(menu, format, ext, new AscCommon.asc_CTextParams(dlg.getSettings())); + Common.UI.warning({ + title: this.notcriticalErrorTitle, + msg: this.warnDownloadAsPdf, + buttons: ['ok', 'cancel'], + callback: _.bind(function(btn){ + if (btn == 'ok') { + me._saveAsFormat(menu, format, ext, new AscCommon.asc_CTextParams(Asc.c_oAscTextAssociation.PlainLine)); } - Common.NotificationCenter.trigger('edit:complete', me.toolbar); - } - })).show(); + }, this) + }); } } else this._saveAsFormat(menu, format, ext); @@ -930,11 +924,7 @@ define([ warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?', txtUntitled: 'Untitled', txtCompatible: 'The document will be saved to the new format. It will allow to use all the editor features, but might affect the document layout.
Use the \'Compatibility\' option of the advanced settings if you want to make the files compatible with older MS Word versions.', - titleConvertOptions: 'Grouping options', - textGroup: 'Group by', - textChar: 'Char', - textLine: 'Line', - textParagraph: 'Paragraph' + warnDownloadAsPdf: 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?' }, DE.Controllers.LeftMenu || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index ebd4a4137..d137d0c24 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -552,6 +552,7 @@ define([ this._state.isFromGatewayDownloadAs = true; var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null, _defaultFormat = null, + textParams, _supported = [ Asc.c_oAscFileType.TXT, Asc.c_oAscFileType.RTF, @@ -575,6 +576,7 @@ define([ else if (/^djvu$/.test(this.document.fileType)) { _supported = [Asc.c_oAscFileType.PDF]; } + textParams = new AscCommon.asc_CTextParams(Asc.c_oAscTextAssociation.PlainLine); } else { _supported = _supported.concat([Asc.c_oAscFileType.PDF, Asc.c_oAscFileType.PDFA]); _defaultFormat = Asc.c_oAscFileType.DOCX; @@ -584,7 +586,13 @@ define([ } if ( !_format || _supported.indexOf(_format) < 0 ) _format = _defaultFormat; - _format ? this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(_format, true)) : this.api.asc_DownloadOrigin(true); + if (_format) { + var options = new Asc.asc_CDownloadOptions(_format, true); + textParams && options.asc_setTextParams(textParams); + this.api.asc_DownloadAs(options); + } else { + this.api.asc_DownloadOrigin(true); + } }, onProcessMouse: function(data) { diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index bf17005a1..7e3be3041 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -513,6 +513,7 @@ "DE.Controllers.LeftMenu.txtUntitled": "Untitled", "DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?", "DE.Controllers.LeftMenu.warnDownloadAsRTF": "If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?", + "DE.Controllers.LeftMenu.warnDownloadAsPdf": "If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?", "DE.Controllers.Main.applyChangesTextText": "Loading the changes...", "DE.Controllers.Main.applyChangesTitleText": "Loading the Changes", "DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.", From dbb5613fe4dbaac122c44c0faab1567b8eceb87a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 15 Feb 2022 22:46:54 +0300 Subject: [PATCH 2/4] Fix Bug 55064 --- apps/documenteditor/main/app/controller/LeftMenu.js | 1 - apps/documenteditor/main/app/controller/Toolbar.js | 1 - apps/presentationeditor/main/app/controller/Toolbar.js | 1 - apps/spreadsheeteditor/main/app/controller/Toolbar.js | 1 - 4 files changed, 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 08cc58f48..bcb9e0e02 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -314,7 +314,6 @@ define([ options.asc_setTextParams(textParams); if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) { Common.UI.warning({ - closable: false, title: this.notcriticalErrorTitle, msg: (format == Asc.c_oAscFileType.TXT) ? this.warnDownloadAs : this.warnDownloadAsRTF, buttons: ['ok', 'cancel'], diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 170f30824..a66896dd9 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1289,7 +1289,6 @@ define([ !Common.Utils.ModalWindow.isVisible() && Common.UI.warning({ width: 500, - closable: false, msg: this.confirmAddFontName, buttons: ['yes', 'no'], primary: 'yes', diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index a36e7b6ed..4d863cbf0 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1272,7 +1272,6 @@ define([ !Common.Utils.ModalWindow.isVisible() && Common.UI.warning({ width: 500, - closable: false, msg: this.confirmAddFontName, buttons: ['yes', 'no'], primary: 'yes', diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index b85de925e..834cfd680 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -1573,7 +1573,6 @@ define([ !Common.Utils.ModalWindow.isVisible() && Common.UI.warning({ width: 500, - closable: false, msg: this.confirmAddFontName, buttons: ['yes', 'no'], primary: 'yes', From 0da0ae7e675e4a2e47dbb09353fbce08cb87a3de Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 16 Feb 2022 11:30:36 +0300 Subject: [PATCH 3/4] [DE] Update translation --- apps/documenteditor/main/app/controller/LeftMenu.js | 3 ++- apps/documenteditor/main/locale/en.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index bcb9e0e02..51390c5b8 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -374,6 +374,7 @@ define([ this._saveAsFormat(menu, format, ext); else { Common.UI.warning({ + width: 600, title: this.notcriticalErrorTitle, msg: this.warnDownloadAsPdf, buttons: ['ok', 'cancel'], @@ -923,7 +924,7 @@ define([ warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?', txtUntitled: 'Untitled', txtCompatible: 'The document will be saved to the new format. It will allow to use all the editor features, but might affect the document layout.
Use the \'Compatibility\' option of the advanced settings if you want to make the files compatible with older MS Word versions.', - warnDownloadAsPdf: 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?' + warnDownloadAsPdf: 'Your PDF will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original PDF, especially if the original file contained lots of graphics.' }, DE.Controllers.LeftMenu || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 7e3be3041..a9ce29848 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -513,7 +513,7 @@ "DE.Controllers.LeftMenu.txtUntitled": "Untitled", "DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?", "DE.Controllers.LeftMenu.warnDownloadAsRTF": "If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?", - "DE.Controllers.LeftMenu.warnDownloadAsPdf": "If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?", + "DE.Controllers.LeftMenu.warnDownloadAsPdf": "Your PDF will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original PDF, especially if the original file contained lots of graphics.", "DE.Controllers.Main.applyChangesTextText": "Loading the changes...", "DE.Controllers.Main.applyChangesTitleText": "Loading the Changes", "DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.", From 316e12098fbefb8436330b64f66786b25351ed55 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 16 Feb 2022 12:30:41 +0300 Subject: [PATCH 4/4] [DE] Update translation --- apps/documenteditor/main/app/controller/LeftMenu.js | 4 ++-- apps/documenteditor/main/locale/en.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 51390c5b8..700c1babe 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -376,7 +376,7 @@ define([ Common.UI.warning({ width: 600, title: this.notcriticalErrorTitle, - msg: this.warnDownloadAsPdf, + msg: Common.Utils.String.format(this.warnDownloadAsPdf, fileType.toUpperCase()), buttons: ['ok', 'cancel'], callback: _.bind(function(btn){ if (btn == 'ok') { @@ -924,7 +924,7 @@ define([ warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?', txtUntitled: 'Untitled', txtCompatible: 'The document will be saved to the new format. It will allow to use all the editor features, but might affect the document layout.
Use the \'Compatibility\' option of the advanced settings if you want to make the files compatible with older MS Word versions.', - warnDownloadAsPdf: 'Your PDF will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original PDF, especially if the original file contained lots of graphics.' + warnDownloadAsPdf: 'Your {0} will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original {0}, especially if the original file contained lots of graphics.' }, DE.Controllers.LeftMenu || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index a9ce29848..29c15f1eb 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -513,7 +513,7 @@ "DE.Controllers.LeftMenu.txtUntitled": "Untitled", "DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?", "DE.Controllers.LeftMenu.warnDownloadAsRTF": "If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?", - "DE.Controllers.LeftMenu.warnDownloadAsPdf": "Your PDF will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original PDF, especially if the original file contained lots of graphics.", + "DE.Controllers.LeftMenu.warnDownloadAsPdf": "Your {0} will be converted to an editable format. This may take a while. The resulting document will be optimized to allow you to edit the text, so it might not look exactly like the original {0}, especially if the original file contained lots of graphics.", "DE.Controllers.Main.applyChangesTextText": "Loading the changes...", "DE.Controllers.Main.applyChangesTitleText": "Loading the Changes", "DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",