This commit is contained in:
nnduc
2026-10-24 14:03:52 +07:00
commit 4fe046de58
4790 changed files with 311146 additions and 0 deletions
@@ -0,0 +1,8 @@
[notificationconfig]
title = Notifications
push_subscriptions = Push notifications
push_subscriptions_text = Movim will send push notifications to the following registered devices
push_enabled = Push notifications enabled for this device
push_disabled = Push notifications disabled for this device
unknown_browser = Unknown browser
unknown_platform = Unknown platform
@@ -0,0 +1,18 @@
MovimWebsocket.attach(function() {
if (Notification.permission !== 'granted') {
NotificationConfig_ajaxHttpRequest();
}
navigator.serviceWorker.getRegistration(SW_URI).then((registration) => {
if (!registration) {
NotificationConfig_ajaxHttpPushGetConfig();
return;
}
registration.pushManager.getSubscription().then((pushSubscription) => {
NotificationConfig_ajaxHttpPushGetConfig(pushSubscription ? pushSubscription.endpoint : null);
}, () => {
NotificationConfig_ajaxHttpPushGetConfig();
});
});
});