Skip to content

Commit d01ac3e

Browse files
committed
Re-name Decline to Deny
1 parent c17dba0 commit d01ac3e

File tree

7 files changed

+30
-24
lines changed

7 files changed

+30
-24
lines changed

language/en/webpushnotifications_module_acp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
'WEBPUSH_DROPDOWN_SUBSCRIBE' => 'Show web push settings in the notification dropdown',
5252
'WEBPUSH_DROPDOWN_SUBSCRIBE_EXPLAIN'=> 'Show or hide the “Enable Web Push” toggle switch in the notification dropdown. This allows users to easily enable or disable push notifications from any page of the forum.',
5353
'WEBPUSH_POPUP_PROMPT' => 'Show popup prompt for unsubscribed members',
54-
'WEBPUSH_POPUP_PROMPT_EXPLAIN' => 'Display a popup message asking registered members if they want to receive push notifications. The popup will only appear to members who are not currently subscribed and have not previously declined.',
54+
'WEBPUSH_POPUP_PROMPT_EXPLAIN' => 'Display a popup message asking registered members if they want to receive push notifications. The popup will only appear to members who are not currently subscribed and have not previously denied.',
5555
'WEBPUSH_INSECURE_SERVER_ERROR' => 'This board is not using a secure SSL/HTTPS protocol, which is required for enabling web push notifications. Alternatively, the server environment might be misconfigured. Ensure that the <em>HTTPS</em> and <em>HEADER_CLIENT_PROTO</em> server environment variables are correctly configured.',
5656
]);

language/en/webpushnotifications_module_ucp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
'NOTIFY_WEBPUSH_POPUP_TITLE' => 'Allow browser notifications?',
5353
'NOTIFY_WEBPUSH_POPUP_MESSAGE' => 'We would like to send you browser notifications for replies, private messages, and relevant forum activity. Optional — you can manage these settings at any time.',
5454
'NOTIFY_WEBPUSH_POPUP_ALLOW' => 'Allow',
55-
'NOTIFY_WEBPUSH_POPUP_DECLINE' => 'Decline',
55+
'NOTIFY_WEBPUSH_POPUP_DENY' => 'Deny',
5656
]);

language/ru/webpushnotifications_module_ucp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
'NOTIFY_WEBPUSH_POPUP_TITLE' => 'Включить браузерные уведомления?',
5353
'NOTIFY_WEBPUSH_POPUP_MESSAGE' => 'Браузерные уведомления позволяют быстро получать информацию о новых ответах, личных сообщениях и других активностях на данной конференции. Функцию можно отключить или включить в любое время в настройках уведомлений в Личном разделе.',
5454
'NOTIFY_WEBPUSH_POPUP_ALLOW' => 'Включить',
55-
'NOTIFY_WEBPUSH_POPUP_DECLINE' => 'Отклонить',
55+
'NOTIFY_WEBPUSH_POPUP_DENY' => 'Отклонить',
5656
]);

styles/all/template/webpush.js

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ function PhpbbWebpush() {
126126
return;
127127
}
128128

129-
// Check if user declined on this browser
130-
if (getDeclined() === 'true') {
129+
// Check if user denied prompt on this browser
130+
if (promptDenied.get() === 'true') {
131131
return;
132132
}
133133

@@ -157,7 +157,7 @@ function PhpbbWebpush() {
157157
}, 1000);
158158

159159
const allowBtn = document.getElementById('wpn_popup_allow');
160-
const declineBtn = document.getElementById('wpn_popup_decline');
160+
const denyBtn = document.getElementById('wpn_popup_deny');
161161
const overlay = document.getElementById('wpn_popup_prompt');
162162

163163
if (allowBtn) {
@@ -168,19 +168,19 @@ function PhpbbWebpush() {
168168
});
169169
}
170170

171-
if (declineBtn) {
172-
declineBtn.addEventListener('click', (event) => {
171+
if (denyBtn) {
172+
denyBtn.addEventListener('click', (event) => {
173173
event.stopPropagation();
174174
popup.style.display = 'none';
175-
setDeclined();
175+
promptDenied.set();
176176
});
177177
}
178178

179179
if (overlay) {
180180
overlay.addEventListener('click', (event) => {
181181
if (event.target === overlay) {
182182
popup.style.display = 'none';
183-
setDeclined();
183+
promptDenied.set();
184184
}
185185
});
186186
}
@@ -328,7 +328,7 @@ function PhpbbWebpush() {
328328
if ('form_tokens' in response) {
329329
updateFormTokens(response.form_tokens);
330330
}
331-
resetDeclined();
331+
promptDenied.remove();
332332
const popup = document.getElementById('wpn_popup_prompt');
333333
if (popup) {
334334
popup.style.display = 'none';
@@ -379,15 +379,21 @@ function PhpbbWebpush() {
379379
return outputArray;
380380
}
381381

382-
function setDeclined() {
383-
localStorage.setItem('wpn_popup_declined', 'true');
384-
}
385-
function getDeclined() {
386-
return localStorage.getItem('wpn_popup_declined');
387-
}
388-
function resetDeclined() {
389-
localStorage.removeItem('wpn_popup_declined');
390-
}
382+
const promptDenied = {
383+
key: 'wpn_popup_denied',
384+
385+
set() {
386+
localStorage.setItem(this.key, 'true');
387+
},
388+
389+
get() {
390+
return localStorage.getItem(this.key);
391+
},
392+
393+
remove() {
394+
localStorage.removeItem(this.key);
395+
}
396+
};
391397
}
392398

393399
function domReady(callBack) {

styles/all/template/webpush_popup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h3 class="wpn-popup-title">{{ lang('NOTIFY_WEBPUSH_POPUP_TITLE') }}</h3>
66
<p class="wpn-popup-message">{{ lang('NOTIFY_WEBPUSH_POPUP_MESSAGE') }}</p>
77
<div class="wpn-popup-buttons">
88
<button id="wpn_popup_allow" class="wpn-popup-btn wpn-popup-btn-allow">{{ lang('NOTIFY_WEBPUSH_POPUP_ALLOW') }}</button>
9-
<button id="wpn_popup_decline" class="wpn-popup-btn wpn-popup-btn-decline">{{ lang('NOTIFY_WEBPUSH_POPUP_DECLINE') }}</button>
9+
<button id="wpn_popup_deny" class="wpn-popup-btn wpn-popup-btn-deny">{{ lang('NOTIFY_WEBPUSH_POPUP_DENY') }}</button>
1010
</div>
1111
</div>
1212
</div>

styles/all/theme/phpbb_wpn.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@
130130
background: #0052a3;
131131
}
132132

133-
.wpn-popup-btn-decline {
133+
.wpn-popup-btn-deny {
134134
background: #f0f0f0;
135135
color: #666666;
136136
}
137137

138-
.wpn-popup-btn-decline:hover {
138+
.wpn-popup-btn-deny:hover {
139139
background: #e0e0e0;
140140
}
141141

tests/functional/functional_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function test_popup_prompt()
159159
$this->assertContainsLang('NOTIFY_WEBPUSH_POPUP_TITLE', $crawler->filter('.wpn-popup-title')->text());
160160
$this->assertContainsLang('NOTIFY_WEBPUSH_POPUP_MESSAGE', $crawler->filter('.wpn-popup-message')->text());
161161
$this->assertContainsLang('NOTIFY_WEBPUSH_POPUP_ALLOW', $crawler->filter('#wpn_popup_allow')->text());
162-
$this->assertContainsLang('NOTIFY_WEBPUSH_POPUP_DECLINE', $crawler->filter('#wpn_popup_decline')->text());
162+
$this->assertContainsLang('NOTIFY_WEBPUSH_POPUP_DENY', $crawler->filter('#wpn_popup_deny')->text());
163163
}
164164

165165
protected function set_acp_option($option, $value)

0 commit comments

Comments
 (0)