diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 3395df3da..921b52e72 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -307,6 +307,28 @@ define([ } }, this) }); + } else if (format == Asc.c_oAscFileType.DOCX) { + if (!Common.Utils.InternalSettings.get("de-settings-compatible") && !Common.localStorage.getBool("de-hide-save-compatible") /* && this.api.checkCompatibility()*/) { + Common.UI.warning({ + closable: false, + width: 600, + title: this.notcriticalErrorTitle, + msg: this.txtCompatible, + buttons: ['ok', 'cancel'], + dontshow: true, + callback: _.bind(function(btn, dontshow){ + if (dontshow) Common.localStorage.setItem("de-hide-save-compatible", 1); + if (btn == 'ok') { + this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); + menu.hide(); + } + }, this) + }); + } else { + var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX); + // opts.asc_setCompatible(!!Common.Utils.InternalSettings.get("de-settings-compatible")); + this.api.asc_DownloadAs(opts); + } } else { this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); menu.hide(); @@ -331,6 +353,30 @@ define([ } }, this) }); + } else if (format == Asc.c_oAscFileType.DOCX) { + if (!Common.Utils.InternalSettings.get("de-settings-compatible") && !Common.localStorage.getBool("de-hide-save-compatible") /* && this.api.checkCompatibility()*/) { + Common.UI.warning({ + closable: false, + width: 600, + title: this.notcriticalErrorTitle, + msg: this.txtCompatible, + buttons: ['ok', 'cancel'], + dontshow: true, + callback: _.bind(function(btn, dontshow){ + if (dontshow) Common.localStorage.setItem("de-hide-save-compatible", 1); + if (btn == 'ok') { + this.isFromFileDownloadAs = ext; + this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true)); + menu.hide(); + } + }, this) + }); + } else { + this.isFromFileDownloadAs = ext; + var opts = new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.DOCX, true); + // opts.asc_setCompatible(!!Common.Utils.InternalSettings.get("de-settings-compatible")); + this.api.asc_DownloadAs(opts); + } } else { this.isFromFileDownloadAs = ext; this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true)); @@ -822,6 +868,8 @@ define([ leavePageText: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.', warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?', warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?', - txtUntitled: 'Untitled' + 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.' + }, 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 156643c26..ba5ab5465 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -890,6 +890,9 @@ define([ Common.Utils.InternalSettings.set("de-settings-spellcheck", value); me.api.asc_setSpellCheck(value); + value = Common.localStorage.getBool("de-settings-compatible", false); + Common.Utils.InternalSettings.set("de-settings-compatible", value); + Common.Utils.InternalSettings.set("de-settings-showsnaplines", me.api.get_ShowSnapLines()); function checkWarns() { @@ -2002,7 +2005,7 @@ define([ }, onTryUndoInFastCollaborative: function() { - if (!window.localStorage.getBool("de-hide-try-undoredo")) + if (!Common.localStorage.getBool("de-hide-try-undoredo")) Common.UI.info({ width: 500, msg: this.textTryUndoRedo, @@ -2012,7 +2015,7 @@ define([ customButtonText: this.textStrict, dontshow: true, callback: _.bind(function(btn, dontshow){ - if (dontshow) window.localStorage.setItem("de-hide-try-undoredo", 1); + if (dontshow) Common.localStorage.setItem("de-hide-try-undoredo", 1); if (btn == 'custom') { Common.localStorage.setItem("de-settings-coauthmode", 0); Common.Utils.InternalSettings.set("de-settings-coauthmode", false); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index a32be4c16..fbb208dd0 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -198,6 +198,10 @@ define([ '', '', '','', + '', + '', + '', + '','', '', '', '', @@ -270,6 +274,11 @@ define([ labelText: this.strSpellCheckMode }); + this.chCompatible = new Common.UI.CheckBox({ + el: $('#fms-chb-compatible'), + labelText: this.textOldVersions + }); + this.chAutosave = new Common.UI.CheckBox({ el: $('#fms-chb-autosave'), labelText: this.strAutosave @@ -448,6 +457,7 @@ define([ this.chSpell.setValue(Common.Utils.InternalSettings.get("de-settings-spellcheck")); this.chAlignGuides.setValue(Common.Utils.InternalSettings.get("de-settings-showsnaplines")); + this.chCompatible.setValue(Common.Utils.InternalSettings.get("de-settings-compatible")); }, applySettings: function() { @@ -469,6 +479,8 @@ define([ if (this.mode.canForcesave) Common.localStorage.setItem("de-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-spellcheck", this.chSpell.isChecked() ? 1 : 0); + Common.localStorage.setItem("de-settings-compatible", this.chCompatible.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("de-settings-compatible", this.chCompatible.isChecked() ? 1 : 0); Common.Utils.InternalSettings.set("de-settings-showsnaplines", this.chAlignGuides.isChecked()); Common.localStorage.save(); @@ -531,7 +543,9 @@ define([ txtFitWidth: 'Fit to Width', textForceSave: 'Save to Server', strForcesave: 'Always save to server (otherwise save to server on document close)', - strResolvedComment: 'Turn on display of the resolved comments' + strResolvedComment: 'Turn on display of the resolved comments', + textCompatible: 'Compatibility', + textOldVersions: 'Make the files compatible with older MS Word versions' }, DE.Views.FileMenuPanels.Settings || {})); DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 830450879..0f9300050 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -330,6 +330,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.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.", "DE.Controllers.Main.applyChangesTextText": "Loading the changes...", "DE.Controllers.Main.applyChangesTitleText": "Loading the Changes", "DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.", @@ -1423,6 +1424,8 @@ "DE.Views.FileMenuPanels.Settings.txtPt": "Point", "DE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking", "DE.Views.FileMenuPanels.Settings.txtWin": "as Windows", + "DE.Views.FileMenuPanels.Settings.textCompatible": "Compatibility", + "DE.Views.FileMenuPanels.Settings.textOldVersions": "Make the files compatible with older MS Word versions", "DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center", "DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left", "DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page",