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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 3 14:00:45 UTC 2019


 loleaflet/src/map/handler/Map.SlideShow.js |   42 +++++++++++++++++------------
 1 file changed, 26 insertions(+), 16 deletions(-)

New commits:
commit ca4fc297545d07ab9ab306925a431194d6be499f
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Mon Sep 23 09:49:12 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Dec 3 15:00:27 2019 +0100

    loleaflet: android: call a javascript interface, slideshow method
    
    NextCloud Android Application is detected with the JavaScript Interface
    "RichDocumentsMobileInterface" and the slideShow() is called when the
    full screen slideshow is applied
    
    Change-Id: I2559a1cdf452e77147892eddcde21ca472ef632e
    Reviewed-on: https://gerrit.libreoffice.org/84118
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.SlideShow.js b/loleaflet/src/map/handler/Map.SlideShow.js
index 05a1669c9..4f268df24 100644
--- a/loleaflet/src/map/handler/Map.SlideShow.js
+++ b/loleaflet/src/map/handler/Map.SlideShow.js
@@ -28,28 +28,34 @@ L.Map.SlideShow = L.Handler.extend({
 			window.postMobileMessage('SLIDESHOW');
 			return;
 		}
-		this._slideShow = L.DomUtil.create('iframe', 'leaflet-slideshow', this._map._container);
-		if (this._slideShow.requestFullscreen) {
-			this._slideShow.requestFullscreen();
-		}
-		else if (this._slideShow.msRequestFullscreen) {
-			this._slideShow.msRequestFullscreen();
-		}
-		else if (this._slideShow.mozRequestFullScreen) {
-			this._slideShow.mozRequestFullScreen();
-		}
-		else if (this._slideShow.webkitRequestFullscreen) {
-			this._slideShow.webkitRequestFullscreen();
-		}
 
-		L.DomEvent.on(document, 'fullscreenchange webkitfullscreenchange mozfullscreenchange msfullscreenchange',
+		if (!window.RichDocumentsMobileInterface) {
+			this._slideShow = L.DomUtil.create('iframe', 'leaflet-slideshow', this._map._container);
+			if (this._slideShow.requestFullscreen) {
+				this._slideShow.requestFullscreen();
+			}
+			else if (this._slideShow.msRequestFullscreen) {
+				this._slideShow.msRequestFullscreen();
+			}
+			else if (this._slideShow.mozRequestFullScreen) {
+				this._slideShow.mozRequestFullScreen();
+			}
+			else if (this._slideShow.webkitRequestFullscreen) {
+				this._slideShow.webkitRequestFullscreen();
+			}
+
+			L.DomEvent.on(document, 'fullscreenchange webkitfullscreenchange mozfullscreenchange msfullscreenchange',
 				this._onFullScreenChange, this);
+		}
 
 		this.fullscreen = true;
 		this._map.downloadAs('slideshow.svg', 'svg', null, 'slideshow');
 	},
 
 	_onFullScreenChange: function () {
+		if (window.RichDocumentsMobileInterface) {
+			return;
+		}
 
 		this.fullscreen = document.fullscreen ||
 			document.webkitIsFullScreen ||
@@ -61,8 +67,12 @@ L.Map.SlideShow = L.Handler.extend({
 	},
 
 	_onSlideDownloadReady: function (e) {
-		this._slideShow.src = e.url;
-		this._slideShow.contentWindow.focus();
+		if (window.RichDocumentsMobileInterface) {
+			window.RichDocumentsMobileInterface.slideShow(e.url);
+		} else {
+			this._slideShow.src = e.url;
+			this._slideShow.contentWindow.focus();
+		}
 	}
 });
 


More information about the Libreoffice-commits mailing list