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

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 14 17:28:09 UTC 2020


 loleaflet/html/loleaflet.html.m4             |    3 +++
 loleaflet/src/control/Control.AlertDialog.js |    6 +-----
 loleaflet/src/control/Control.Infobar.js     |    6 +-----
 loleaflet/src/control/Control.Menubar.js     |    7 +------
 4 files changed, 6 insertions(+), 16 deletions(-)

New commits:
commit ceec4f0505ee5849fe5c4480cf1d70e0aef70849
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Fri Feb 14 17:08:56 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Feb 14 18:27:51 2020 +0100

    android: Actually override window.open to always send the HYPERLINK on mobile.
    
    To cover potential future developers adding window.open without knowing
    it might break mobile...
    
    Change-Id: Iadad985ac6fad9b9f068f224fd8fb21f073bead6
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88732
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 4addf8955..9cba7427a 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -40,6 +40,9 @@ dnl# and window.ThisIsTheGtkApp
 
 ifelse(MOBILEAPP,[true],
   [   window.ThisIsAMobileApp = true;
+   window.open = function (url, windowName, windowFeatures) {
+     window.postMobileMessage('HYPERLINK ' + url); /* don't call the 'normal' window.open on mobile at all */
+   }
    window.MobileAppName='MOBILEAPPNAME';],
   [   window.ThisIsAMobileApp = false;]
 )
diff --git a/loleaflet/src/control/Control.AlertDialog.js b/loleaflet/src/control/Control.AlertDialog.js
index 20404dcb5..c73d87d92 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -62,11 +62,7 @@ L.Control.AlertDialog = L.Control.extend({
 					type: 'button',
 					className: 'vex-dialog-button-primary',
 					click: function openClick () {
-						if (window.ThisIsAMobileApp) {
-							window.postMobileMessage('HYPERLINK ' + url);
-						} else {
-							window.open(url, '_blank');
-						}
+						window.open(url, '_blank');
 						vex.closeAll();
 					}
 				});
diff --git a/loleaflet/src/control/Control.Infobar.js b/loleaflet/src/control/Control.Infobar.js
index 48b92c8a1..b00d0cdb2 100644
--- a/loleaflet/src/control/Control.Infobar.js
+++ b/loleaflet/src/control/Control.Infobar.js
@@ -22,11 +22,7 @@ L.Control.Infobar = L.Control.extend({
 					return;
 
 				if (e.action.startsWith('http')) { // We have a link
-					if (window.ThisIsAMobileApp) {
-						window.postMobileMessage('HYPERLINK ' + e.action);
-					} else {
-						var win = window.open(e.action, '_blank');
-					}
+					var win = window.open(e.action, '_blank');
 					win.focus();
 				}
 			};
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 6ea82050f..1a5cdc19d 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1155,12 +1155,7 @@ L.Control.Menubar = L.Control.extend({
 		} else if (id === 'about') {
 			this._map.showLOAboutDialog();
 		} else if (id === 'report-an-issue') {
-			var bugLink = 'https://bugs.documentfoundation.org/enter_bug.cgi?product=LibreOffice%20Online';
-			if (window.ThisIsAMobileApp) {
-				window.postMobileMessage('HYPERLINK ' + bugLink);
-			} else {
-				window.open(bugLink, '_blank');
-			}
+			window.open('https://bugs.documentfoundation.org/enter_bug.cgi?product=LibreOffice%20Online', '_blank');
 		} else if (id === 'inserthyperlink') {
 			this._map.showHyperlinkDialog();
 		} else if (id === 'keyboard-shortcuts' || id === 'online-help') {


More information about the Libreoffice-commits mailing list