From 3c3678b509ca5b2be7b8802c349a5ee99e6dc33c Mon Sep 17 00:00:00 2001 From: Leocraft1 Date: Sun, 2 Nov 2025 18:52:20 +0100 Subject: [PATCH] Notizie seta!!! --- admin/setalinkgen/linkgen.html | 1 + index.html | 3 +- .../menu/documentistorici/atcmlalinea.html | 2 +- seta_modena/menu/documentistorici/index.html | 2 +- .../menu/documentistorici/radiati.html | 2 +- .../speciali/busottolalinea.html | 2 +- .../menu/documentistorici/streetview.html | 2 +- seta_modena/menu/index.html | 52 +++-------------- seta_modena/menu/js/notizia.js | 29 ++++++++++ seta_modena/menu/js/notizie.js | 57 +++++++++++++++++++ seta_modena/menu/notizia.html | 25 ++++++++ seta_modena/menu/radiati/estate25.html | 2 +- seta_modena/menu/suburbano.html | 1 - sitemap.xml | 18 +++--- style.css | 53 +++++++++++++++++ 15 files changed, 189 insertions(+), 62 deletions(-) create mode 100644 seta_modena/menu/js/notizia.js create mode 100644 seta_modena/menu/js/notizie.js create mode 100644 seta_modena/menu/notizia.html diff --git a/admin/setalinkgen/linkgen.html b/admin/setalinkgen/linkgen.html index 886f1e2..b226c3d 100644 --- a/admin/setalinkgen/linkgen.html +++ b/admin/setalinkgen/linkgen.html @@ -65,4 +65,5 @@ + \ No newline at end of file diff --git a/index.html b/index.html index 563802c..2fb2cf2 100644 --- a/index.html +++ b/index.html @@ -79,5 +79,4 @@ - - + \ No newline at end of file diff --git a/seta_modena/menu/documentistorici/atcmlalinea.html b/seta_modena/menu/documentistorici/atcmlalinea.html index 4d3e209..ac2e145 100644 --- a/seta_modena/menu/documentistorici/atcmlalinea.html +++ b/seta_modena/menu/documentistorici/atcmlalinea.html @@ -16,7 +16,7 @@ diff --git a/seta_modena/menu/documentistorici/index.html b/seta_modena/menu/documentistorici/index.html index 93af712..dec41df 100644 --- a/seta_modena/menu/documentistorici/index.html +++ b/seta_modena/menu/documentistorici/index.html @@ -28,7 +28,7 @@ Orari Gare di assunzione
- Veicoli radiati + Veicoli radiati \ No newline at end of file diff --git a/seta_modena/menu/documentistorici/radiati.html b/seta_modena/menu/documentistorici/radiati.html index 364265b..e8604ed 100644 --- a/seta_modena/menu/documentistorici/radiati.html +++ b/seta_modena/menu/documentistorici/radiati.html @@ -21,7 +21,7 @@

Indice veicoli radiati per anno

- Estate 2025 + Estate 2025
\ No newline at end of file diff --git a/seta_modena/menu/documentistorici/speciali/busottolalinea.html b/seta_modena/menu/documentistorici/speciali/busottolalinea.html index 6469e67..f4976af 100644 --- a/seta_modena/menu/documentistorici/speciali/busottolalinea.html +++ b/seta_modena/menu/documentistorici/speciali/busottolalinea.html @@ -16,7 +16,7 @@ diff --git a/seta_modena/menu/documentistorici/streetview.html b/seta_modena/menu/documentistorici/streetview.html index 3b9c1bd..2e29d8b 100644 --- a/seta_modena/menu/documentistorici/streetview.html +++ b/seta_modena/menu/documentistorici/streetview.html @@ -16,7 +16,7 @@ diff --git a/seta_modena/menu/index.html b/seta_modena/menu/index.html index 58302fa..77eb8c5 100644 --- a/seta_modena/menu/index.html +++ b/seta_modena/menu/index.html @@ -27,54 +27,17 @@
- Urbano - Suburbano - Extraurbano - Filobus + Urbano + Suburbano + Extraurbano + Filobus Minibus Veicoli di servizio

News SETA Modena:

-
- - - - - - -
+

Servizi SETA Modena:

@@ -87,11 +50,12 @@

Documenti storici:

- Documenti e Foto - Siti web con Wayback Machine + Documenti e Foto + Siti web con Wayback Machine
+ diff --git a/seta_modena/menu/js/notizia.js b/seta_modena/menu/js/notizia.js new file mode 100644 index 0000000..8611a8a --- /dev/null +++ b/seta_modena/menu/js/notizia.js @@ -0,0 +1,29 @@ +const params = new URLSearchParams(window.location.search); +const link = params.get('link'); +const notiziaContainer = document.getElementById('notizia-container'); + +//URL +const newsURL = "https://setaapi.serverissimo.freeddns.org/news?link="+link; + +notiziaContainer.innerHTML="

Caricamento notizia...

"; +fetch(newsURL) + .then(response => { + if (!response.ok){ + notiziaContainer.innerHTML="

Impossibile raggiungere l'API.

"; + throw new Error("Errore nel caricamento dei dati."); + } + return response.json(); + }).then(element =>{ + notiziaContainer.innerHTML=""; + var div = document.createElement('div'); + var h1 = document.createElement('h1'); + var p = document.createElement('p'); + var p2 = document.createElement('p'); + p.innerHTML=element.date; + h1.innerHTML=element.title; + div.appendChild(p); + div.appendChild(h1); + p2.innerHTML=element.content; + div.appendChild(p2); + notiziaContainer.appendChild(div); + }) \ No newline at end of file diff --git a/seta_modena/menu/js/notizie.js b/seta_modena/menu/js/notizie.js new file mode 100644 index 0000000..bc50bae --- /dev/null +++ b/seta_modena/menu/js/notizie.js @@ -0,0 +1,57 @@ +const newsContainer = document.getElementById('news-container'); + +//URL +const newsURL = "https://setaapi.serverissimo.freeddns.org/allnews"; + +newsContainer.innerHTML="

Caricamento notizie...

"; +fetch(newsURL) + .then(response => { + if (!response.ok){ + newsContainer.innerHTML="

Impossibile raggiungere l'API.

"; + throw new Error("Errore nel caricamento dei dati."); + } + return response.json(); + }).then(data =>{ + newsContainer.innerHTML=""; + data.news.forEach(element => { + var div = document.createElement('div'); + div.setAttribute("class","news-card"); + var a = document.createElement('a'); + var h3 = document.createElement('h3'); + var p = document.createElement('p'); + var span = document.createElement('span'); + if(element.type=="Importante"){ + span.setAttribute("class","red"); + } + if(element.type=="Informazione"){ + span.setAttribute("class","yellow"); + } + if(element.type=="Novità"){ + span.setAttribute("class","green"); + } + if(element.type=="Orari"){ + span.setAttribute("class","yellow"); + } + if(element.type=="Autobus Treno"){ + span.setAttribute("class","blu"); + } + if(element.type=="Lavori in corso"){ + span.setAttribute("class","red"); + } + if(element.type=="Biglietti"){ + span.setAttribute("class","blu"); + } + //P creation + span.innerHTML=element.type; + p.innerHTML=element.date+" - "; + p.appendChild(span); + h3.innerHTML=element.title; + //Link creation + const link = "/seta_modena/menu/notizia.html?link="+element.link; + a.setAttribute("href",link); + a.appendChild(p); + a.appendChild(h3); + div.appendChild(a); + newsContainer.appendChild(div); + }); + }) \ No newline at end of file diff --git a/seta_modena/menu/notizia.html b/seta_modena/menu/notizia.html new file mode 100644 index 0000000..8ea1722 --- /dev/null +++ b/seta_modena/menu/notizia.html @@ -0,0 +1,25 @@ + + + + + + ER-TPL - SETA Suburbano + + + + + + + +
+ +
+
+ + + \ No newline at end of file diff --git a/seta_modena/menu/radiati/estate25.html b/seta_modena/menu/radiati/estate25.html index 9051ce2..22e2b82 100644 --- a/seta_modena/menu/radiati/estate25.html +++ b/seta_modena/menu/radiati/estate25.html @@ -16,7 +16,7 @@ diff --git a/seta_modena/menu/suburbano.html b/seta_modena/menu/suburbano.html index 45ecafb..e9923c3 100644 --- a/seta_modena/menu/suburbano.html +++ b/seta_modena/menu/suburbano.html @@ -13,7 +13,6 @@