[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/dist loleaflet/src

Marco Cecchetti marco.cecchetti at collabora.com
Thu Sep 7 20:07:04 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 dcdaa19458166ff1989935bc5aebb3dd401875f1
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 fbb9322a..b48487b8 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -941,6 +941,9 @@ map.on('wopiprops', function(e) {
 		w2ui['toolbar-up'].hide('save');
 		w2ui['toolbar-up'].hide('savebreak');
 	}
+	if (e.HideExportOption) {
+		w2ui['presentation-toolbar'].hide('presentation', 'presentationbreak');
+	}
 	if (e.DisableCopy) {
 		$('input#formulaInput').bind('copy', function(evt) {
 			evt.preventDefault();
@@ -1020,7 +1023,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 fdd63bcd..70616749 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -222,7 +222,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: [
@@ -719,6 +719,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