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@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
parent
1f04f15532
commit
ceec4f0505
4 changed files with 6 additions and 16 deletions
|
@ -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;]
|
||||
)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Reference in a new issue