[PE] Add settings for notes panel
This commit is contained in:
parent
f3e7deb846
commit
24110bdac2
|
@ -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 || {}))
|
||||
});
|
||||
|
|
|
@ -748,6 +748,10 @@ 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===false);
|
||||
Common.Utils.InternalSettings.set("pe-hidden-notes", value);
|
||||
me.api.asc_ShowNotes(!value);
|
||||
|
||||
function checkWarns() {
|
||||
if (!window['AscDesktopEditor']) {
|
||||
var tips = [];
|
||||
|
|
|
@ -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.Utils.InternalSettings.get("pe-hidden-notes"),
|
||||
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,12 @@ 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.Utils.InternalSettings.set("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 +495,12 @@ 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);
|
||||
Common.Utils.InternalSettings.set("pe-hidden-notes", !bIsShow);
|
||||
},
|
||||
|
||||
textFitPage: 'Fit to Page',
|
||||
textFitWidth: 'Fit to Width'
|
||||
}, PE.Controllers.Viewport));
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue