Merge pull request #843 from ONLYOFFICE/feature/pe-hide-notes

Feature/pe hide notes
This commit is contained in:
Julia Radzhabova 2021-04-27 10:31:57 +03:00 committed by GitHub
commit 77a6da1e2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 1 deletions

View file

@ -162,6 +162,7 @@
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
trackChanges: undefined // true/false - open editor with track changes mode on/off,
hideRulers: false // hide or show rulers on first loading (presentation or document editor)
hideNotes: false // hide or show notes panel on first loading (presentation editor)
},
coEditing: {
mode: 'fast', // <coauthoring mode>, 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true

View file

@ -783,7 +783,8 @@ define([
tipViewSettings: 'View Settings',
textRemoveFavorite: 'Remove from Favorites',
textDarkTheme: 'Dark theme',
textAddFavorite: 'Mark as favorite'
textAddFavorite: 'Mark as favorite',
textHideNotes: 'Hide Notes'
}
}(), Common.Views.Header || {}))
});

View file

@ -748,6 +748,9 @@ define([
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
me.api.asc_setSpellCheck(value);
value = Common.localStorage.getBool('pe-hidden-notes', this.appOptions.customization && this.appOptions.customization.hideNotes===true);
me.api.asc_ShowNotes(!value);
function checkWarns() {
if (!window['AscDesktopEditor']) {
var tips = [];

View file

@ -120,6 +120,7 @@ define([
this.api = api;
this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',this.onApiCoAuthoringDisconnect.bind(this));
this.api.asc_registerCallback('asc_onNotesShow', this.onNotesShow.bind(this));
Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this));
},
@ -255,6 +256,13 @@ define([
if (!config.isEdit)
mnuitemHideRulers.hide();
me.header.mnuitemHideNotes = new Common.UI.MenuItem({
caption: me.header.textHideNotes,
checked: Common.localStorage.getBool('pe-hidden-notes', config.customization && config.customization.hideNotes===true),
checkable: true,
value: 'notes'
});
me.header.mnuitemFitPage = new Common.UI.MenuItem({
caption: me.textFitPage,
checkable: true,
@ -292,6 +300,7 @@ define([
me.header.mnuitemCompactToolbar,
mnuitemHideStatusBar,
mnuitemHideRulers,
me.header.mnuitemHideNotes,
{caption:'--'},
me.header.mnuitemFitPage,
me.header.mnuitemFitWidth,
@ -452,6 +461,11 @@ define([
Common.NotificationCenter.trigger('layout:changed', 'rulers');
Common.NotificationCenter.trigger('edit:complete', me.header);
break;
case 'notes':
me.api.asc_ShowNotes(!item.isChecked());
Common.localStorage.setBool('pe-hidden-notes', item.isChecked());
Common.NotificationCenter.trigger('edit:complete', me.header);
break;
case 'zoom:page':
item.isChecked() ? me.api.zoomFitToPage() : me.api.zoomCustomMode();
Common.NotificationCenter.trigger('edit:complete', me.header);
@ -480,6 +494,11 @@ define([
this.header && this.header.lockHeaderBtns( 'rename-user', disable);
},
onNotesShow: function(bIsShow) {
this.header && this.header.mnuitemHideNotes.setChecked(!bIsShow, true);
Common.localStorage.setBool('pe-hidden-notes', !bIsShow);
},
textFitPage: 'Fit to Page',
textFitWidth: 'Fit to Width'
}, PE.Controllers.Viewport));

View file

@ -169,6 +169,7 @@
"Common.Views.Header.tipViewUsers": "View users and manage document access rights",
"Common.Views.Header.txtAccessRights": "Change access rights",
"Common.Views.Header.txtRename": "Rename",
"Common.Views.Header.textHideNotes": "Hide Notes",
"Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:",
"Common.Views.ImageFromUrlDialog.txtEmpty": "This field is required",
"Common.Views.ImageFromUrlDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",