[PE] Add settings for notes panel
This commit is contained in:
parent
f3e7deb846
commit
24110bdac2
|
@ -783,7 +783,8 @@ define([
|
||||||
tipViewSettings: 'View Settings',
|
tipViewSettings: 'View Settings',
|
||||||
textRemoveFavorite: 'Remove from Favorites',
|
textRemoveFavorite: 'Remove from Favorites',
|
||||||
textDarkTheme: 'Dark theme',
|
textDarkTheme: 'Dark theme',
|
||||||
textAddFavorite: 'Mark as favorite'
|
textAddFavorite: 'Mark as favorite',
|
||||||
|
textHideNotes: 'Hide Notes'
|
||||||
}
|
}
|
||||||
}(), Common.Views.Header || {}))
|
}(), Common.Views.Header || {}))
|
||||||
});
|
});
|
||||||
|
|
|
@ -748,6 +748,10 @@ define([
|
||||||
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
|
Common.Utils.InternalSettings.set("pe-settings-spellcheck", value);
|
||||||
me.api.asc_setSpellCheck(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() {
|
function checkWarns() {
|
||||||
if (!window['AscDesktopEditor']) {
|
if (!window['AscDesktopEditor']) {
|
||||||
var tips = [];
|
var tips = [];
|
||||||
|
|
|
@ -120,6 +120,7 @@ define([
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this));
|
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_onCoAuthoringDisconnect',this.onApiCoAuthoringDisconnect.bind(this));
|
||||||
|
this.api.asc_registerCallback('asc_onNotesShow', this.onNotesShow.bind(this));
|
||||||
Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this));
|
Common.NotificationCenter.on('api:disconnect', this.onApiCoAuthoringDisconnect.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -255,6 +256,13 @@ define([
|
||||||
if (!config.isEdit)
|
if (!config.isEdit)
|
||||||
mnuitemHideRulers.hide();
|
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({
|
me.header.mnuitemFitPage = new Common.UI.MenuItem({
|
||||||
caption: me.textFitPage,
|
caption: me.textFitPage,
|
||||||
checkable: true,
|
checkable: true,
|
||||||
|
@ -292,6 +300,7 @@ define([
|
||||||
me.header.mnuitemCompactToolbar,
|
me.header.mnuitemCompactToolbar,
|
||||||
mnuitemHideStatusBar,
|
mnuitemHideStatusBar,
|
||||||
mnuitemHideRulers,
|
mnuitemHideRulers,
|
||||||
|
me.header.mnuitemHideNotes,
|
||||||
{caption:'--'},
|
{caption:'--'},
|
||||||
me.header.mnuitemFitPage,
|
me.header.mnuitemFitPage,
|
||||||
me.header.mnuitemFitWidth,
|
me.header.mnuitemFitWidth,
|
||||||
|
@ -452,6 +461,12 @@ define([
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'rulers');
|
Common.NotificationCenter.trigger('layout:changed', 'rulers');
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.header);
|
Common.NotificationCenter.trigger('edit:complete', me.header);
|
||||||
break;
|
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':
|
case 'zoom:page':
|
||||||
item.isChecked() ? me.api.zoomFitToPage() : me.api.zoomCustomMode();
|
item.isChecked() ? me.api.zoomFitToPage() : me.api.zoomCustomMode();
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.header);
|
Common.NotificationCenter.trigger('edit:complete', me.header);
|
||||||
|
@ -480,6 +495,12 @@ define([
|
||||||
this.header && this.header.lockHeaderBtns( 'rename-user', disable);
|
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',
|
textFitPage: 'Fit to Page',
|
||||||
textFitWidth: 'Fit to Width'
|
textFitWidth: 'Fit to Width'
|
||||||
}, PE.Controllers.Viewport));
|
}, PE.Controllers.Viewport));
|
||||||
|
|
|
@ -169,6 +169,7 @@
|
||||||
"Common.Views.Header.tipViewUsers": "View users and manage document access rights",
|
"Common.Views.Header.tipViewUsers": "View users and manage document access rights",
|
||||||
"Common.Views.Header.txtAccessRights": "Change access rights",
|
"Common.Views.Header.txtAccessRights": "Change access rights",
|
||||||
"Common.Views.Header.txtRename": "Rename",
|
"Common.Views.Header.txtRename": "Rename",
|
||||||
|
"Common.Views.Header.textHideNotes": "Hide Notes",
|
||||||
"Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:",
|
"Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:",
|
||||||
"Common.Views.ImageFromUrlDialog.txtEmpty": "This field is required",
|
"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",
|
"Common.Views.ImageFromUrlDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
|
||||||
|
|
Loading…
Reference in a new issue