diff --git a/language/en/webpushnotifications_module_ucp.php b/language/en/webpushnotifications_module_ucp.php index 716c52d..abc9cd7 100644 --- a/language/en/webpushnotifications_module_ucp.php +++ b/language/en/webpushnotifications_module_ucp.php @@ -46,4 +46,5 @@ 'NOTIFY_WEBPUSH_UNSUBSCRIBE' => 'Unsubscribe', 'NOTIFY_WEBPUSH_SUBSCRIBED' => 'Subscribed', 'NOTIFY_WEBPUSH_DROPDOWN_TITLE' => 'Visit notifications settings to set your preferred push notifications.', + 'NOTIFY_WEBPUSH_DENIED' => 'You have denied notifications from this site. To subscribe, please allow notifications in your browser settings.', ]); diff --git a/language/ru/webpushnotifications_module_ucp.php b/language/ru/webpushnotifications_module_ucp.php index efbb6b5..61cf1d9 100644 --- a/language/ru/webpushnotifications_module_ucp.php +++ b/language/ru/webpushnotifications_module_ucp.php @@ -46,4 +46,6 @@ 'NOTIFY_WEBPUSH_UNSUBSCRIBE' => 'Отписаться', 'NOTIFY_WEBPUSH_SUBSCRIBED' => 'Включено', 'NOTIFY_WEBPUSH_DROPDOWN_TITLE' => 'Посетите настройки уведомлений, чтобы установить предпочтительные push-уведомления.', + 'NOTIFY_WEBPUSH_DENIED' => 'Вы запретили браузерные уведомления для даного сайта. Для того, чтобы подписаться, необходимо их разрешить в настройках браузера.', + ]); diff --git a/styles/all/template/event/notification_dropdown_footer_after.html b/styles/all/template/event/notification_dropdown_footer_after.html index d4d1889..8b76bf4 100644 --- a/styles/all/template/event/notification_dropdown_footer_after.html +++ b/styles/all/template/event/notification_dropdown_footer_after.html @@ -1,7 +1,11 @@ {% if NOTIFICATIONS_WEBPUSH_ENABLE and notification_types is not defined %} {% endif %} diff --git a/styles/all/template/webpush.js b/styles/all/template/webpush.js index c326fe1..94e542d 100644 --- a/styles/all/template/webpush.js +++ b/styles/all/template/webpush.js @@ -150,6 +150,7 @@ function PhpbbWebpush() { // Prevent the user from clicking the subscribe button multiple times. const result = await Notification.requestPermission(); if (result === 'denied') { + phpbb.alert(subscribeButton.getAttribute('data-l-err'), subscribeButton.getAttribute('data-l-msg')); return; } diff --git a/styles/prosilver/template/event/ucp_notifications_content_before.html b/styles/prosilver/template/event/ucp_notifications_content_before.html index 2f159d6..026fd6f 100644 --- a/styles/prosilver/template/event/ucp_notifications_content_before.html +++ b/styles/prosilver/template/event/ucp_notifications_content_before.html @@ -5,7 +5,7 @@

{{ lang('NOTIFY_WEBPUSH_ENABLE_EXPLAIN') }}
- +