Repository navigation
Expand file tree
/
Copy pathdataSourceInfo.html
More file actions
63 lines (49 loc) · 1.76 KB
/
Copy pathdataSourceInfo.html
File metadata and controls
63 lines (49 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<h3 align="center" style="color: auto">Data Source Info</h3>
<p align="center">Here you can directly access the sources for the shown data</p>
<div id="srcbtncontainer">
<button lnk="https://www.kvg-kiel.de//internetservice/services/passageInfo/stopPassages/stop?mode=departure&stop=" add="activeStop">Current Stop Live Departure Data</button>
<button add="activeStop" lnk="https://www.kvg-kiel.de/internetservice/services/stopInfo/stop?stop=">Current Stop Data</button>
</div>
<div id="activeStopData">
<p>Name: <span id="activeStopName"></span></p>
<p>StopNr: <span id="activeStopNr"></span></p>
<p>ID: <span id="activeStopID"></span></p>
</div>
<style>
#srcbtncontainer{
display: flex;
justify-content: space-between;
}
#srcbtncontainer button{
border: none;
background: rgba(128, 128, 128, 0.3);
width: 40%;
cursor: pointer;
}
</style>
<script>
document.addEventListener('click', function(e){
//console.log(e);
var notcon = document.getElementById('notificationContainer');
//console.log(notcon.contains(e.target));
if(!notcon.contains(e.target) && notcon.innerHTML != ''){
notcon.style.display = 'none';
notcon.innerHTML = '';
}
if(document.getElementById('srcbtncontainer').contains(e.target)){
if(e.target.nodeName == 'BUTTON'){
var lnk = e.target.getAttribute('lnk');
switch(e.target.getAttribute('add')){
case 'activeStop':
lnk += activeStop;
default:
null;
}
window.open(lnk);
}
}
});
document.querySelector('#activeStopName').innerHTML = stops.filter((a) => a.stopNr == activeStop)[0].passengerName;
document.querySelector('#activeStopNr').innerHTML = activeStop;
document.querySelector('#activeStopID').innerHTML = stops.filter((a) => a.stopNr = activeStop)[0].id;
</script>