diff --git a/seta_menu/cercaorario/js/cercafermata.js b/seta_menu/cercaorario/js/cercafermata.js
index b2c45b3..b0704e7 100644
--- a/seta_menu/cercaorario/js/cercafermata.js
+++ b/seta_menu/cercaorario/js/cercafermata.js
@@ -19,24 +19,30 @@ fetch(url)
.catch(error => console.error('Errore nel caricamento dei dati:', error));
searchBar.addEventListener('input', () => {
- const searchTerm = searchBar.value.toLowerCase();
const warning=document.getElementById('warning-mo');
- warning.innerHTML='';
- const filtered = allresults
- .filter(item => item.fermata.toLowerCase().includes(searchTerm))
- .sort((a, b) => {
- const aStartsWith = a.fermata.toLowerCase().startsWith(searchTerm);
- const bStartsWith = b.fermata.toLowerCase().startsWith(searchTerm);
- if (aStartsWith && !bStartsWith) return -1;
- if (!aStartsWith && bStartsWith) return 1;
- return 0;
- });
- renderresults(filtered);
if (searchBar.value == '') {
- resultsContainer.innerHTML='';
- warning.innerHTML = `
-
Come leggere il codice fermata.
+ resultsContainer.innerHTML=`
+
Fermate rapide:
+
Autostazione
+
Stazione FS
+
Largo Garibaldi
`;
+ warning.innerHTML = `
+
Come leggere il codice fermata.
+ `;
+ }else{
+ const searchTerm = searchBar.value.toLowerCase();
+ warning.innerHTML='';
+ const filtered = allresults
+ .filter(item => item.fermata.toLowerCase().includes(searchTerm))
+ .sort((a, b) => {
+ const aStartsWith = a.fermata.toLowerCase().startsWith(searchTerm);
+ const bStartsWith = b.fermata.toLowerCase().startsWith(searchTerm);
+ if (aStartsWith && !bStartsWith) return -1;
+ if (!aStartsWith && bStartsWith) return 1;
+ return 0;
+ });
+ renderresults(filtered);
}
});
@@ -65,9 +71,14 @@ stopCodeBar.addEventListener('input', () => {
searchResultsContainer.appendChild(div);
if (stopCodeBar.value == '') {
- resultsContainer.innerHTML='';
+ resultsContainer.innerHTML=`
+
Fermate rapide:
+
Autostazione
+
Stazione FS
+
Largo Garibaldi
+ `;
warning.innerHTML = `
-
Come leggere il codice fermata.
+
Come leggere il codice fermata.
`;
return;
}