diff --git a/sw.js b/sw.js index f05f9d2..ee57a69 100755 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -const VERSION = 'v22' +const VERSION = 'v23' const API_ORIGIN = 'https://scraper.infotren.dcdev.ro/' const API_TRAINS = `${API_ORIGIN}v3/trains` const API_STATIONS = `${API_ORIGIN}v3/stations` diff --git a/view-station.js b/view-station.js index 68ffbad..153780a 100644 --- a/view-station.js +++ b/view-station.js @@ -209,6 +209,12 @@ window.addEventListener('load', function (e) { }) }) + if (navigator.canShare && navigator.canShare({ url: '' })) { + document.getElementById('title').addEventListener('click', function () { + navigator.share({ url: '' }); + }) + } + refresh() setInterval(function () { diff --git a/view-train.js b/view-train.js index 3e2c79d..bcc7b4a 100755 --- a/view-train.js +++ b/view-train.js @@ -518,6 +518,12 @@ window.addEventListener('load', function (e) { }) }) + if (navigator.canShare && navigator.canShare({ url: '' })) { + document.getElementById('title').addEventListener('click', function () { + navigator.share({ url: '' }); + }) + } + var content = document.getElementsByClassName('content')[0] content.focus() content.addEventListener('keydown', function (e) {