mirror of
https://github.com/Daniongithub/ER-TPL.git
synced 2025-12-06 15:02:03 +00:00
Compare commits
2 Commits
91a0be6b54
...
1eb159f632
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1eb159f632 | ||
|
|
dba381fa8e |
@@ -22,7 +22,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#iframe{
|
#iframe{
|
||||||
width: 100%;
|
width: 97%;
|
||||||
}
|
}
|
||||||
|
|
||||||
table{
|
table{
|
||||||
@@ -170,9 +170,6 @@ img{
|
|||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
h2{
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
h2.noreduction{
|
h2.noreduction{
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,13 +21,13 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<h2>Orari oggi linea: <span id="linea-span"></span></h2>
|
<h2>Orari e mappa linea: <span id="linea-span"></span></h2>
|
||||||
<iframe id="iframe" src="https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi" frameborder="0" height="500" width="500"></iframe>
|
<iframe id="iframe" src="" frameborder="0" onload="javascript:adattaIframe();"></iframe>
|
||||||
|
<script src="js/iframeorari.js"></script>
|
||||||
<footer>
|
<footer>
|
||||||
<div>
|
<div>
|
||||||
<p>Copyright (C) 2025 ER-TPL Team - <a href="https://ertpl.pages.dev" target="_blank">ertpl.pages.dev</a> - code by Il Dani & SetaModenaFanpage <a href="https://github.com/Leocraft1/SetaAPI" target="_blank">Codice Sorgente</a> - I loghi SETA Spa sono marchi registrati e sono inseriti in questo sito solo a scopo di illustrazione.</p>
|
<p>Copyright (C) 2025 ER-TPL Team - <a href="https://ertpl.pages.dev" target="_blank">ertpl.pages.dev</a> - code by Il Dani & SetaModenaFanpage <a href="https://github.com/Leocraft1/SetaAPI" target="_blank">Codice Sorgente</a> - I loghi SETA Spa sono marchi registrati e sono inseriti in questo sito solo a scopo di illustrazione.</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="js/iframeorari.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,46 +1,25 @@
|
|||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const num = params.get('routenum');
|
const num = params.get('routenum');
|
||||||
const lineaSpan = document.getElementById('linea-span');
|
const lineaSpan = document.getElementById('linea-span');
|
||||||
const iframeContainer = document.getElementById('iframe-container');
|
const iframe = document.getElementById('iframe');
|
||||||
const linkContainer = document.getElementById('link-a-seta');
|
const linkContainer = document.getElementById('link-a-seta');
|
||||||
|
|
||||||
var setaURL = "https://setaapi.serverissimo.freeddns.org/frequencydescription/"+num;
|
const date = new Date();
|
||||||
|
const todayDate=date.getDate()+"/"+(date.getMonth()+1)+"/"+date.getFullYear();
|
||||||
|
|
||||||
|
const baseURL = "https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi/?b=mo&l=MO"+num+"&dd="+todayDate+"&v=As";
|
||||||
|
|
||||||
//Display numero linea
|
//Display numero linea
|
||||||
lineaSpan.innerHTML=num;
|
lineaSpan.innerHTML=num;
|
||||||
|
|
||||||
//Contenuto del testo
|
//Spawn iframe
|
||||||
fetch(urlDesc)
|
iframe.setAttribute("src",baseURL);
|
||||||
.then(response => {
|
setTimeout(function(){}, 2000);
|
||||||
if (!response.ok) throw new Error("Impossibile raggiungere il server.");
|
|
||||||
return response.json();
|
//Adatta altezza iframe da codice injectato
|
||||||
})
|
window.addEventListener("message", (event) => {
|
||||||
.then(data =>{
|
if (event.origin !== "https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi") return; // sicurezza
|
||||||
descContainer.innerHTML=`
|
if (event.data?.type === "resize") {
|
||||||
<table id="desc-table">
|
frame.style.height = event.data.height + "px";
|
||||||
<th>Destinazione</th>
|
}
|
||||||
<th>Tempo di percorrenza</th>
|
});
|
||||||
<th>Frequenza</th>
|
|
||||||
</table>`;
|
|
||||||
const table = document.getElementById('desc-table');
|
|
||||||
if(data[0].linea==undefined){
|
|
||||||
descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";
|
|
||||||
}
|
|
||||||
var i=0;
|
|
||||||
data[0].destinazioni.forEach(element => {
|
|
||||||
var tr = document.createElement('tr');
|
|
||||||
var td = document.createElement('td');
|
|
||||||
td.innerHTML=data[0].destinazioni[i];
|
|
||||||
tr.appendChild(td);
|
|
||||||
var td = document.createElement('td');
|
|
||||||
td.innerHTML=data[0].percorrenza[i];
|
|
||||||
tr.appendChild(td);
|
|
||||||
var td = document.createElement('td');
|
|
||||||
td.innerHTML=data[0].frequenze[i];
|
|
||||||
tr.appendChild(td);
|
|
||||||
table.appendChild(tr);
|
|
||||||
i++;
|
|
||||||
});
|
|
||||||
linkContainer.innerHTML=`<a href="${data[0].linkseta}" class="biancosott">Visualizza sul sito seta</a>`;
|
|
||||||
})
|
|
||||||
.catch(error => {descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";console.error(error);})
|
|
||||||
Reference in New Issue
Block a user