diff options
| author | 2026-01-30 02:19:35 +0545 | |
|---|---|---|
| committer | 2026-01-29 21:34:35 +0100 | |
| commit | b59a2101b460200e4276a05f9b8cb4ae7a2e9b62 (patch) | |
| tree | ef2fec4a132bce5c11b35f7285ecf17ef64b09f8 /app/views | |
| parent | edc750fe444b6af65eccee879a048cf3e0cdd215 (diff) | |
Add option to enable notifications (#8458)
Closes https://github.com/FreshRSS/FreshRSS/issues/7330
- Default behavior is same
- Added FreshRSS_Context::userConf()->html5_disable_notif so that, it determines weather user wants notification. (will not show any even it has permission) (i want default false so disable, so old configs get proper default values)
- Added button such that checking it makes it request permission too
<img width="707" height="119" alt="image" src="https://github.com/user-attachments/assets/a0fdbc4d-9f15-4644-8753-f0e6c979677f" />
- test notification actually happening (how can i trigger it, do i have to wait it), this code fixes permissions.
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/display.phtml | 10 | ||||
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 6f8e3e1b4..64dcf1b84 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -232,6 +232,16 @@ </div> <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="html5_enable_notif"> + <input type="checkbox" name="html5_enable_notif" id="html5_enable_notif" value="1"<?= + FreshRSS_Context::userConf()->html5_enable_notif ? ' checked="checked"' : '' ?> /> + <?= _t('conf.notification.html5_enable_notif') ?> + </label> + </div> + </div> + + <div class="form-group"> <label class="group-name" for="html5_notif_timeout"><?= _t('conf.display.notif_html5.timeout') ?></label> <div class="group-controls"> <input type="number" min="0" max="60" id="html5_notif_timeout" name="html5_notif_timeout" value="<?= diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 73e047e11..f2203f56e 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -24,6 +24,7 @@ echo json_encode([ 'does_lazyload' => !!FreshRSS_Context::userConf()->lazyload , 'sides_close_article' => !!FreshRSS_Context::userConf()->sides_close_article, 'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(), + 'html5_enable_notif' => FreshRSS_Context::userConf()->html5_enable_notif, 'html5_notif_timeout' => FreshRSS_Context::userConf()->html5_notif_timeout, 'closeNotification' => [ 'good' => FreshRSS_Context::userConf()->good_notification_timeout * 1000, |
