feat: add offline queue for kiosk form submissions

Intercepts form submit via fetch and stores failed submissions in
IndexedDB when offline. Replays queued entries on the online event and
on each page load. Shows an offline banner on the form page and a
sync-pending message on the thank-you page.

Service worker bumped to guestbook-v2 to pre-cache offline-queue.js
so the script is available when the kiosk has no network.
This commit is contained in:
2026-03-29 20:22:25 -06:00
parent 6577a733c6
commit b20e118def
4 changed files with 237 additions and 1 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
const CACHE_NAME = 'guestbook-v1';
const CACHE_NAME = 'guestbook-v2';
const STATIC_ASSETS = [
'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css',
'https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js',
'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js',
'https://fonts.googleapis.com/css2?family=Vollkorn:wght@700&family=Open+Sans&display=swap',
'/static/images/logo.png',
'/static/offline-queue.js',
];
self.addEventListener('install', event => {