Browse Source

Add share on clicking title

master
Kenneth Bruen 2 years ago
parent
commit
a653e92e03
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 2
      sw.js
  2. 6
      view-station.js
  3. 6
      view-train.js

2
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`

6
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 () {

6
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) {

Loading…
Cancel
Save