loleaflet/debug/document/loleaflet.html | 1 + loleaflet/main.js | 3 +++ loleaflet/src/control/Control.Menubar.js | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-)
New commits: commit 5d22b274f8cf8169e78489f770fecbd545174163 Author: Henry Castro <[email protected]> Date: Wed May 24 10:28:14 2017 -0400 loleaflet: add parameter to disable 'About' menu Change-Id: I07fa655b8318f78d7e479a3dc34830ebe5f81a2e diff --git a/loleaflet/debug/document/loleaflet.html b/loleaflet/debug/document/loleaflet.html index 33364cea..f5462f84 100644 --- a/loleaflet/debug/document/loleaflet.html +++ b/loleaflet/debug/document/loleaflet.html @@ -106,6 +106,7 @@ var permission = getParameterByName('permission') || 'edit'; var timestamp = getParameterByName('timestamp'); var closebutton = getParameterByName('closebutton'); + var disableAbout = getParameterByName('disableabout'); if (wopiSrc === '' && filePath === '') { vex.dialog.alert(wrongwopisrc); } diff --git a/loleaflet/main.js b/loleaflet/main.js index 48200cd9..2fb44b3d 100644 --- a/loleaflet/main.js +++ b/loleaflet/main.js @@ -75,6 +75,8 @@ var closebutton = getParameterByName('closebutton'); var revHistoryEnabled = getParameterByName('revisionhistory'); // Should the document go inactive or not var alwaysActive = getParameterByName('alwaysactive'); +// Disable the about dialog +var disableAbout = getParameterByName('disableabout'); // Loleaflet Debug mode var debugMode = getParameterByName('debug'); if (wopiSrc === '' && filePath === '') { @@ -88,6 +90,7 @@ if (host === '') { // TODO: Get rid of these globals global.closebutton = closebutton; global.revHistoryEnabled = revHistoryEnabled; +global.disableAbout = disableAbout; global.title = title; global.errorMessages = errorMessages; var docURL, docParams; diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 8206ab5c..33d2e1e1 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -2,7 +2,7 @@ * Control.Menubar */ -/* global $ _ map title vex revHistoryEnabled closebutton */ +/* global $ _ map title vex revHistoryEnabled closebutton disableAbout*/ L.Control.Menubar = L.Control.extend({ // TODO: Some mechanism to stop the need to copy duplicate menus (eg. Help) options: { @@ -541,6 +541,10 @@ L.Control.Menubar = L.Control.extend({ _createMenu: function(menu) { var itemList = []; for (var i in menu) { + if (menu[i].id === 'help' && disableAbout) { + menu[i].menu.pop(); + } + if (map._permission === 'readonly' && menu[i].type === 'menu') { var found = false; for (var j in this.options.allowedReadonlyMenus) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
