* @protected
*/
_getNextDelay: function() {
+ // TODO: DEBUG ONLY
+ return 1;
+
if (_inactiveSince === 0) return 5;
// milliseconds -> minutes
//noinspection JSUnresolvedVariable
if (typeof pollData.notification === 'object' && typeof pollData.notification.message === 'string') {
//noinspection JSUnresolvedVariable
- new window.Notification(pollData.notification.title, {
+ var notification = new window.Notification(pollData.notification.title, {
body: pollData.notification.message,
icon: _icon
- })
+ });
+ notification.onclick = function () {
+ window.focus();
+ notification.close();
+
+ //noinspection JSUnresolvedVariable
+ window.location = pollData.notification.link;
+ };
}
},
use wcf\system\email\UserMailbox;
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
+use wcf\system\request\LinkHandler;
use wcf\system\user\notification\event\IUserNotificationEvent;
use wcf\system\user\notification\object\type\IUserNotificationObjectType;
use wcf\system\user\notification\object\IUserNotificationObject;
return [
'title' => strip_tags($event->getTitle()),
- 'message' => strip_tags($event->getMessage())
+ 'message' => strip_tags($event->getMessage()),
+ 'link' => LinkHandler::getInstance()->getLink('NotificationConfirm', ['id' => $event->getNotification()->notificationID])
];
}
}