[Libreoffice-commits] online.git: loleaflet/dist loleaflet/src

Marco Cecchetti marco.cecchetti at collabora.com
Thu Sep 7 20:08:14 UTC 2017


 loleaflet/dist/toolbar/toolbar.js        |    8 +++++++-
 loleaflet/src/control/Control.Menubar.js |    5 ++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 5112f33d097a3c30787aad861deaf6eb6f0d7280
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Thu Sep 7 20:44:44 2017 +0200

    Disable slideshow feature when DisableExport property is set.
    
    Change-Id: I424da9abf2bba737c2985c6dcbb2ab9dbee4770c
    Reviewed-on: https://gerrit.libreoffice.org/42081
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index d69fe1b3..6810034a 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -981,6 +981,9 @@ map.on('wopiprops', function(e) {
 	if (e.HideSaveOption) {
 		w2ui['toolbar-up'].hide('save');
 	}
+	if (e.HideExportOption) {
+		w2ui['presentation-toolbar'].hide('presentation', 'presentationbreak');
+	}
 	if (e.DisableCopy) {
 		$('input#formulaInput').bind('copy', function(evt) {
 			evt.preventDefault();
@@ -1060,7 +1063,10 @@ map.on('doclayerinit', function () {
 		break;
 	case 'presentation':
 		var presentationToolbar = w2ui['presentation-toolbar'];
-		presentationToolbar.show('presentation', 'presentationbreak', 'insertpage', 'duplicatepage', 'deletepage');
+		presentationToolbar.show('insertpage', 'duplicatepage', 'deletepage');
+		if (!map['wopi'].HideExportOption) {
+			presentationToolbar.show('presentation', 'presentationbreak');
+		}
 		toolbarUp.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending');
 		toolbarUpMore.remove('insertannotation', 'wraptextseparator', 'wraptext', 'togglemergecells', 'break-toggle', 'numberformatcurrency', 'numberformatpercent', 'numberformatdecimal', 'numberformatdate', 'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'sortascending', 'sortdescending');
 		statusbar.insert('left', [
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 17bc8a64..808b58fa 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -229,7 +229,7 @@ L.Control.Menubar = L.Control.extend({
 				{name: _('New slide'), id: 'insertpage', type: 'action'},
 				{name: _('Duplicate slide'), id: 'duplicatepage', type: 'action'},
 				{name: _('Delete slide'), id: 'deletepage', type: 'action'},
-				{type: 'separator'},
+				{type: 'separator', id: 'fullscreen-presentation-separator'},
 				{name: _('Fullscreen presentation'), id: 'fullscreen-presentation', type: 'action'}]
 			},
 			{name: _('Help'), id: 'help', type: 'menu', menu: [
@@ -738,6 +738,9 @@ L.Control.Menubar = L.Control.extend({
 			if (menu[i].id === 'save' && this._map['wopi'].HideSaveOption)
 				continue;
 
+			if (menu[i].id && menu[i].id.startsWith('fullscreen-presentation') && this._map['wopi'].HideExportOption)
+				continue;
+
 			// Keep track of all 'downloadas-' options and register them as
 			// export formats with docLayer which can then be publicly accessed unlike
 			// this Menubar control for which there doesn't seem to be any easy way


More information about the Libreoffice-commits mailing list