vers. 3.0.0 - nuova interfaccia app per mobile e desktop
Nuova UI disegnata sul tema RPIGroup Radio Theme dei siti del gruppo: guscio unico responsive (sidebar e player in basso da 900px, topbar e tab bar su telefono), player della radio persistente nel dock con now playing, HLS/MP3, volume e Media Session; pagine radio, tv, podcast (copertine e programma dal feed), player e pagine di testo rifatte; icone SVG inline al posto di Bootstrap, jQuery e Material Icons; font Bricolage Grotesque e Plus Jakarta Sans in locale; service worker v5, manifest con orientamento libero, icone PWA 192 e 384 rigenerate. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
0ee93d3b75
commit
24391c49ac
58 files changed
+5226
-16550
No files matched your search
@@ -1,23 +1,28 @@
|
||||
const CACHE_NAME = 'rpigroupplay-v4';
|
||||
const CACHE_NAME = 'rpigroupplay-v5';
|
||||
const ASSETS = [
|
||||
'./',
|
||||
'./index.php',
|
||||
'./manifest.json',
|
||||
'./css/style.css',
|
||||
'./css/bootstrap.css',
|
||||
'./css/animation.css',
|
||||
'./css/fonts/plus-jakarta-sans-latin-wght-normal.woff2',
|
||||
'./css/fonts/bricolage-grotesque-latin-wght-normal.woff2',
|
||||
'./js/app.js',
|
||||
'./js/bootstrap.js',
|
||||
'./js/pwa-install.js',
|
||||
'./img/RpiGroupPlayWHITE.png',
|
||||
'./img/logoapp.png'
|
||||
'./img/logoapp.png',
|
||||
'./img/icons/icon-192x192.png',
|
||||
'./img/icons/icon-512x512.png'
|
||||
];
|
||||
|
||||
// File statici dell'app: la versione nella query (?v=...) serve solo a svuotare la cache del browser,
|
||||
// per il service worker è lo stesso file
|
||||
const STATIC_RE = /\.(css|js|png|jpe?g|svg|webp|ico|json|woff2?|ttf)$/i;
|
||||
|
||||
// Install Event
|
||||
self.addEventListener('install', (e) => {
|
||||
e.waitUntil(
|
||||
caches.open(CACHE_NAME)
|
||||
.then((cache) => {
|
||||
console.log('[Service Worker] Caching static shell');
|
||||
return cache.addAll(ASSETS).catch(err => {
|
||||
console.warn('[Service Worker] Asset caching warning:', err);
|
||||
});
|
||||
@@ -33,7 +38,6 @@ self.addEventListener('activate', (e) => {
|
||||
return Promise.all(
|
||||
keys.map((key) => {
|
||||
if (key !== CACHE_NAME) {
|
||||
console.log('[Service Worker] Removing old cache', key);
|
||||
return caches.delete(key);
|
||||
}
|
||||
})
|
||||
@@ -51,7 +55,7 @@ self.addEventListener('fetch', (e) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Bypass streaming content, APIs, and external domains (like radio/tv streams)
|
||||
// Bypass streaming content, APIs, and external domains (like radio/tv streams, fonts, hls.js)
|
||||
if (
|
||||
url.includes('stream') ||
|
||||
url.includes('.mp3') ||
|
||||
@@ -60,6 +64,7 @@ self.addEventListener('fetch', (e) => {
|
||||
url.includes('.ts') ||
|
||||
url.includes('icecast') ||
|
||||
url.includes('shoutcast') ||
|
||||
url.includes('nowplaying') ||
|
||||
url.includes('radiocitta105') ||
|
||||
url.includes('radiodiffusionelibera') ||
|
||||
!url.startsWith(self.location.origin)
|
||||
@@ -67,8 +72,11 @@ self.addEventListener('fetch', (e) => {
|
||||
return; // Let the browser handle standard streaming/external fetch requests directly
|
||||
}
|
||||
|
||||
const isStatic = STATIC_RE.test(new URL(url).pathname);
|
||||
const matchOptions = isStatic ? { ignoreSearch: true } : undefined;
|
||||
|
||||
e.respondWith(
|
||||
caches.match(e.request).then((cachedResponse) => {
|
||||
caches.match(e.request, matchOptions).then((cachedResponse) => {
|
||||
if (cachedResponse) {
|
||||
// Return cached resource immediately and fetch fresh copy in background (Stale-While-Revalidate)
|
||||
fetch(e.request).then((networkResponse) => {
|
||||
|
||||
Reference in new issue
Block a user