<defaultvalue>1</defaultvalue>
<options>module_wcf_ad</options>
</option>
+ <option name="enable_polling">
+ <categoryname>general.page</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ <enableoptions>enable_desktop_notifications</enableoptions>
+ </option>
+ <option name="enable_desktop_notifications">
+ <categoryname>general.page</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ </option>
<option name="head_code">
<categoryname>general.page</categoryname>
<optiontype>textarea</optiontype>
{if $__sessionKeepAlive|isset}
new WCF.System.KeepAlive({@$__sessionKeepAlive});
- {if $__wcf->user->userID}
+ {if ENABLE_POLLING && $__wcf->user->userID}
require(['WoltLabSuite/Core/Notification/Handler'], function(NotificationHandler) {
NotificationHandler.setup({
+ enableNotifications: {if ENABLE_DESKTOP_NOTIFICATIONS}true{else}false{/if},
icon: '{@$__wcf->getPath()}images/apple-touch-icon.png',
sessionKeepAlive: {@$__sessionKeepAlive}
});
define('AVATAR_DEFAULT_TYPE', 'initials');
define('ARTICLE_ENABLE_VISIT_TRACKING', 1);
define('ENABLE_AD_ROTATION', 1);
+define('ENABLE_POLLING', 1);
+define('ENABLE_DESKTOP_NOTIFICATIONS', 1);
*/
setup: function (options) {
options = Core.extend({
+ enableNotifications: false,
icon: '',
sessionKeepAlive: 0
}, options);
this._onVisibilityChange();
- window.Notification.requestPermission().then(function (result) {
- if (result === 'granted') {
- _allowNotification = true;
- }
- });
+ if (options.enableNotifications) {
+ window.Notification.requestPermission().then(function (result) {
+ if (result === 'granted') {
+ _allowNotification = true;
+ }
+ });
+ }
},
/**