mirror of
https://github.com/Daniongithub/ER-TPL.git
synced 2025-12-06 13:02:01 +00:00
Utilizzo iframe orari
This commit is contained in:
@@ -21,8 +21,8 @@ body {
|
||||
margin:8px;
|
||||
}
|
||||
|
||||
#iframe{
|
||||
width: 97%;
|
||||
iframe{
|
||||
width: 100%;
|
||||
height: 2000px;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,30 @@ table{
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#selettore-direzione {
|
||||
border-collapse: collapse;
|
||||
border-radius: 8px;
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
table#selettore-direzione th:hover {
|
||||
background-color: rgb(204, 132, 0);
|
||||
}
|
||||
|
||||
table#selettore-direzione th:active{
|
||||
background-color: rgb(255, 234, 196);
|
||||
}
|
||||
|
||||
table#selettore-direzione th {
|
||||
border-left: 1px solid #282828;
|
||||
border-right: 1px solid #282828;
|
||||
padding: .7vw;
|
||||
padding-top: .6vw;
|
||||
padding-bottom: .6vw;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th,td {
|
||||
border: none;
|
||||
padding: .7vw;
|
||||
@@ -39,10 +63,6 @@ th,td {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
td.uguale{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
hr{
|
||||
margin-top:19px;
|
||||
}
|
||||
@@ -85,17 +105,6 @@ nav.index{
|
||||
min-height: 46px;
|
||||
}
|
||||
|
||||
nav#corsie-nav ul{
|
||||
justify-content: center;
|
||||
}
|
||||
nav#corsie-nav ul li a{
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
nav#corsie-nav ul li{
|
||||
margin-left: 8px;
|
||||
margin-right: 7px;
|
||||
}
|
||||
nav ul li {
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
|
||||
@@ -15,14 +15,19 @@
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav id="iframe-orari-nav">
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/seta_menu/frequenze/index.html"><h1 style="font-size: 100%;font-weight: 500;">Selettore linea</h1></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<h2>Orari e mappa linea: <span id="linea-span"></span></h2>
|
||||
<iframe id="iframe" src="" frameborder="0" onload="javascript:adattaIframe();"></iframe>
|
||||
<h2>Linea: <span id="linea-span"></span></h2>
|
||||
<div id="message"></div>
|
||||
<table id="selettore-direzione">
|
||||
<th onclick="javascript:setAs()">Andata</th>
|
||||
<th onclick="javascript:setDi()">Ritorno</th>
|
||||
</table>
|
||||
<iframe id="iframe" src="" frameborder="0"></iframe>
|
||||
<script src="js/iframeorari.js"></script>
|
||||
<footer>
|
||||
<div>
|
||||
|
||||
@@ -2,15 +2,30 @@ const params = new URLSearchParams(window.location.search);
|
||||
const num = params.get('routenum');
|
||||
const lineaSpan = document.getElementById('linea-span');
|
||||
const iframe = document.getElementById('iframe');
|
||||
const linkContainer = document.getElementById('link-a-seta');
|
||||
const messageDiv = document.getElementById('message');
|
||||
|
||||
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";
|
||||
const asURL = "https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi/?b=mo&l=MO"+num+"&dd="+todayDate+"&v=As";
|
||||
const diURL = "https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi/?b=mo&l=MO"+num+"&dd="+todayDate+"&v=Di";
|
||||
|
||||
//Display numero linea
|
||||
lineaSpan.innerHTML=num;
|
||||
lineaSpan.textContent=num;
|
||||
|
||||
//Spawn iframe
|
||||
iframe.setAttribute("src",baseURL);
|
||||
iframe.setAttribute("src",asURL);
|
||||
if(num==undefined||num==""){
|
||||
iframe.setAttribute("src","");
|
||||
message.innerHTML=`
|
||||
<p>Non hai specificato nessuna linea nei parametri dell'url</p>
|
||||
`;
|
||||
}
|
||||
|
||||
function setAs(){
|
||||
iframe.setAttribute("src",asURL);
|
||||
}
|
||||
|
||||
function setDi(){
|
||||
iframe.setAttribute("src",diURL);
|
||||
}
|
||||
@@ -41,6 +41,6 @@ fetch(urlDesc)
|
||||
table.appendChild(tr);
|
||||
i++;
|
||||
});
|
||||
linkContainer.innerHTML=`<a href="${data[0].linkseta}" class="biancosott">Visualizza sul sito seta</a>`;
|
||||
linkContainer.innerHTML=`<a href="iframeorari.html?routenum=${data[0].linea}" class="biancosott">Visualizza tabella e mappa</a>`;
|
||||
})
|
||||
.catch(error => {descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";console.error(error);})
|
||||
Reference in New Issue
Block a user