[DE][PE] Add settings for copy, cut, paste

This commit is contained in:
Julia Radzhabova 2020-06-04 11:51:14 +03:00
parent 3ceab39e48
commit 469c76d0a1
10 changed files with 56 additions and 4 deletions

View file

@ -490,6 +490,10 @@ define([
value = Common.localStorage.getBool("de-settings-spellcheck", true);
Common.Utils.InternalSettings.set("de-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
value = parseInt(Common.localStorage.getItem("de-settings-paste-button"));
Common.Utils.InternalSettings.set("de-settings-paste-button", value);
this.api.asc_setVisiblePasteButton(!!value);
}
this.api.put_ShowSnapLines(Common.Utils.InternalSettings.get("de-settings-showsnaplines"));

View file

@ -1048,6 +1048,11 @@ define([
me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave);
}
value = Common.localStorage.getItem("de-settings-paste-button");
if (value===null) value = '1';
Common.Utils.InternalSettings.set("de-settings-paste-button", parseInt(value));
me.api.asc_setVisiblePasteButton(!!parseInt(value));
if (me.needToUpdateVersion)
Common.NotificationCenter.trigger('api:disconnect');
var timer_sl = setInterval(function(){

View file

@ -234,6 +234,10 @@ define([
'<td class="left"><label><%= scope.strUnit %></label></td>',
'<td class="right"><span id="fms-cmb-unit" /></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.strPaste %></label></td>',
'<td class="right"><div id="fms-chb-paste-settings"/></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="macros">',
'<td class="left"><label><%= scope.strMacrosSettings %></label></td>',
'<td class="right">',
@ -409,6 +413,11 @@ define([
});
this.lblMacrosDesc = $markup.findById('#fms-lbl-macros');
this.chPaste = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-paste-settings'),
labelText: this.strPasteButton
});
this.btnApply = new Common.UI.Button({
el: $markup.findById('#fms-btn-apply')
});
@ -502,6 +511,8 @@ define([
item = this.cmbMacros.store.findWhere({value: Common.Utils.InternalSettings.get("de-macros-mode")});
this.cmbMacros.setValue(item ? item.get('value') : 0);
this.lblMacrosDesc.text(item ? item.get('descValue') : this.txtWarnMacrosDesc);
this.chPaste.setValue(Common.Utils.InternalSettings.get("de-settings-paste-button"));
},
applySettings: function() {
@ -532,6 +543,8 @@ define([
Common.localStorage.setItem("de-macros-mode", this.cmbMacros.getValue());
Common.Utils.InternalSettings.set("de-macros-mode", Common.localStorage.getItem("de-macros-mode"));
Common.localStorage.setItem("de-settings-paste-button", this.chPaste.isChecked() ? 1 : 0);
Common.localStorage.save();
if (this.menu) {
@ -613,7 +626,9 @@ define([
txtStopMacros: 'Disable All',
txtWarnMacrosDesc: 'Disable all macros with notification',
txtRunMacrosDesc: 'Enable all macros without notification',
txtStopMacrosDesc: 'Disable all macros without notification'
txtStopMacrosDesc: 'Disable all macros without notification',
strPaste: 'Cut, copy and paste',
strPasteButton: 'Show Paste Options button when content is pasted'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -1578,6 +1578,8 @@
"DE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with notification",
"DE.Views.FileMenuPanels.Settings.txtRunMacrosDesc": "Enable all macros without notification",
"DE.Views.FileMenuPanels.Settings.txtStopMacrosDesc": "Disable all macros without notification",
"DE.Views.FileMenuPanels.Settings.strPaste": "Cut, copy and paste",
"DE.Views.FileMenuPanels.Settings.strPasteButton": "Show Paste Options button when content is pasted",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left",
"DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page",

View file

@ -326,6 +326,10 @@ define([
value = Common.localStorage.getBool("pe-settings-spellcheck", true);
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
this.api.asc_setSpellCheck(value);
value = parseInt(Common.localStorage.getItem("pe-settings-paste-button"));
Common.Utils.InternalSettings.set("pe-settings-paste-button", value);
this.api.asc_setVisiblePasteButton(!!value);
}
this.api.put_ShowSnapLines(Common.Utils.InternalSettings.get("pe-settings-showsnaplines"));

View file

@ -774,6 +774,11 @@ define([
me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave);
}
value = Common.localStorage.getItem("pe-settings-paste-button");
if (value===null) value = '1';
Common.Utils.InternalSettings.set("pe-settings-paste-button", parseInt(value));
me.api.asc_setVisiblePasteButton(!!parseInt(value));
if (me.needToUpdateVersion)
Common.NotificationCenter.trigger('api:disconnect');
var timer_sl = setInterval(function(){

View file

@ -208,6 +208,10 @@ define([
'<td class="left"><label><%= scope.strUnit %></label></td>',
'<td class="right"><span id="fms-cmb-unit" /></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="edit">',
'<td class="left"><label><%= scope.strPaste %></label></td>',
'<td class="right"><div id="fms-chb-paste-settings"/></td>',
'</tr>','<tr class="divider edit"></tr>',
'<tr class="macros">',
'<td class="left"><label><%= scope.strMacrosSettings %></label></td>',
'<td class="right">',
@ -352,6 +356,11 @@ define([
});
this.lblMacrosDesc = $markup.findById('#fms-lbl-macros');
this.chPaste = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-paste-settings'),
labelText: this.strPasteButton
});
this.btnApply = new Common.UI.Button({
el: $markup.findById('#fms-btn-apply')
});
@ -435,6 +444,8 @@ define([
item = this.cmbMacros.store.findWhere({value: Common.Utils.InternalSettings.get("pe-macros-mode")});
this.cmbMacros.setValue(item ? item.get('value') : 0);
this.lblMacrosDesc.text(item ? item.get('descValue') : this.txtWarnMacrosDesc);
this.chPaste.setValue(Common.Utils.InternalSettings.get("pe-settings-paste-button"));
},
applySettings: function() {
@ -459,6 +470,8 @@ define([
Common.localStorage.setItem("pe-macros-mode", this.cmbMacros.getValue());
Common.Utils.InternalSettings.set("pe-macros-mode", Common.localStorage.getItem("pe-macros-mode"));
Common.localStorage.setItem("pe-settings-paste-button", this.chPaste.isChecked() ? 1 : 0);
Common.localStorage.save();
if (this.menu) {
@ -520,7 +533,9 @@ define([
txtStopMacros: 'Disable All',
txtWarnMacrosDesc: 'Disable all macros with notification',
txtRunMacrosDesc: 'Enable all macros without notification',
txtStopMacrosDesc: 'Disable all macros without notification'
txtStopMacrosDesc: 'Disable all macros without notification',
strPaste: 'Cut, copy and paste',
strPasteButton: 'Show Paste Options button when content is pasted'
}, PE.Views.FileMenuPanels.Settings || {}));
PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -1268,6 +1268,8 @@
"PE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with notification",
"PE.Views.FileMenuPanels.Settings.txtRunMacrosDesc": "Enable all macros without notification",
"PE.Views.FileMenuPanels.Settings.txtStopMacrosDesc": "Disable all macros without notification",
"PE.Views.FileMenuPanels.Settings.strPaste": "Cut, copy and paste",
"PE.Views.FileMenuPanels.Settings.strPasteButton": "Show Paste Options button when content is pasted",
"PE.Views.HeaderFooterDialog.applyAllText": "Apply to all",
"PE.Views.HeaderFooterDialog.applyText": "Apply",
"PE.Views.HeaderFooterDialog.diffLanguage": "You cant use a date format in a different language than the slide master.<br>To change the master, click 'Apply to all' instead of 'Apply'",

View file

@ -1201,7 +1201,7 @@ define([
txtRunMacrosDesc: 'Enable all macros without notification',
txtStopMacrosDesc: 'Disable all macros without notification',
strPaste: 'Cut, copy and paste',
strPasteButton: 'Show Paste Option button when content is pasted'
strPasteButton: 'Show Paste Options button when content is pasted'
}, SSE.Views.FileMenuPanels.MainSettingsGeneral || {}));
SSE.Views.FileMenuPanels.MainSpellCheckSettings = Common.UI.BaseView.extend(_.extend({

View file

@ -1700,7 +1700,7 @@
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRunMacrosDesc": "Enable all macros without notification",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtStopMacrosDesc": "Disable all macros without notification",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strPaste": "Cut, copy and paste",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strPasteButton": "Show Paste Option button when content is pasted",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.strPasteButton": "Show Paste Options button when content is pasted",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.okButtonText": "Apply",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strDictionaryLanguage": "Dictionary language",
"SSE.Views.FileMenuPanels.MainSpellCheckSettings.strIgnoreWordsInUPPERCASE": "Ignore words in UPPERCASE",