[DE] Set option for saving docx in mode compatible with old versions

This commit is contained in:
Julia Radzhabova 2019-07-24 12:27:14 +03:00
parent 4abaffcf88
commit b0d6c172b9
4 changed files with 72 additions and 4 deletions

View file

@ -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.<br> 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.<br>Are you sure you want to continue?',
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>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.<br>Use the \'Compatibility\' option of the advanced settings if you want to make the files compatible with older MS Word versions.'
}, DE.Controllers.LeftMenu || {}));
});

View file

@ -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);

View file

@ -198,6 +198,10 @@ define([
'<td class="left"><label><%= scope.textAlignGuides %></label></td>',
'<td class="right"><span id="fms-chb-align-guides" /></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.textCompatible %></label></td>',
'<td class="right"><span id="fms-chb-compatible" /></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="autosave">',
'<td class="left"><label id="fms-lbl-autosave"><%= scope.textAutoSave %></label></td>',
'<td class="right"><span id="fms-chb-autosave" /></td>',
@ -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({

View file

@ -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.<br>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.<br>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.<br>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",