diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index f45ea381f..48db66ac3 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -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', // , 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 03dc7b788..fc4bba1a6 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -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 || {})) }); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 58839bd12..0ff33b1cf 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -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 = []; diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 0be27d371..9cb0b0b2f 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -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)); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 9aa7e0c87..b1929f7c0 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -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",