Implement browser notification system for calendar event alarms
- Add comprehensive alarm scheduling and notification system - Support for VAlarm data structures from calendar events - Browser notification API integration with permission handling - localStorage persistence for alarms across sessions - Background service worker for alarm checking when app inactive - Real-time alarm detection with 30-second intervals - Debug logging for troubleshooting notification issues - Automatic permission requests when events with alarms are created - Support for Display action alarms with Duration and DateTime triggers - Clean alarm management (create, update, remove, expire) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<link data-trunk rel="css" href="styles.css">
|
||||
<link data-trunk rel="css" href="print-preview.css">
|
||||
<link data-trunk rel="copy-file" href="styles/google.css">
|
||||
<link data-trunk rel="copy-file" href="service-worker.js">
|
||||
<link data-trunk rel="icon" href="favicon.ico">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
</head>
|
||||
@@ -17,6 +18,19 @@
|
||||
window.addEventListener('TrunkApplicationStarted', () => {
|
||||
console.log("Trunk application started successfully!");
|
||||
});
|
||||
|
||||
// Register service worker for alarm background processing
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/service-worker.js')
|
||||
.then((registration) => {
|
||||
console.log('SW registered: ', registration);
|
||||
})
|
||||
.catch((registrationError) => {
|
||||
console.log('SW registration failed: ', registrationError);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user