|
6 | 6 | <templatename>headInclude</templatename> |
7 | 7 | <eventname>javascriptInit</eventname> |
8 | 8 | <templatecode><![CDATA[{if $__wcf->user->userID} |
9 | | -(function() { |
10 | | - var notification = new WCF.System.Notification('{lang}wcf.user.notification.new{/lang}', 'info'); |
11 | | - |
12 | | - be.bastelstu.wcf.push.onMessage('be.bastelstu.max.wcf.user.newNotification', function() { |
13 | | - // You have mail! |
14 | | - notification.show(null, 5e3); |
| 9 | +(function($, window) { |
| 10 | + $(function() { |
| 11 | + var notification = new WCF.System.Notification('{lang}wcf.user.notification.new{/lang}', 'info'); |
15 | 12 | |
16 | | - // Load WCF notifications and fire the corresponding callback |
17 | | - // See WCF.System.KeepAlive <https://github.com/WoltLab/WCF/blob/3a80c04c92fab9dcc84d520717ed72fd1ef0a4ff/wcfsetup/install/files/js/WCF.js#L8219> |
18 | | - if (typeof WCF.System.PushNotification !== 'undefined') { |
19 | | - new WCF.Action.Proxy({ |
20 | | - autoSend: true, |
21 | | - data: { |
22 | | - actionName: 'keepAlive', |
23 | | - className: 'wcf\\data\\session\\SessionAction' |
24 | | - }, |
25 | | - failure: function() { }, |
26 | | - showLoadingOverlay: false, |
27 | | - success: function(data) { |
28 | | - WCF.System.PushNotification.executeCallbacks(data); |
29 | | - }, |
30 | | - suppressErrors: true |
31 | | - }); |
32 | | - } |
| 13 | + be.bastelstu.wcf.push.onMessage('be.bastelstu.max.wcf.user.newNotification', function() { |
| 14 | + // You have mail! |
| 15 | + notification.show(null, 5e3); |
| 16 | + |
| 17 | + // Load WCF notifications and fire the corresponding callback |
| 18 | + // See WCF.System.KeepAlive <https://github.com/WoltLab/WCF/blob/3a80c04c92fab9dcc84d520717ed72fd1ef0a4ff/wcfsetup/install/files/js/WCF.js#L8219> |
| 19 | + if (typeof WCF.System.PushNotification !== 'undefined') { |
| 20 | + new WCF.Action.Proxy({ |
| 21 | + autoSend: true, |
| 22 | + data: { |
| 23 | + actionName: 'keepAlive', |
| 24 | + className: 'wcf\\data\\session\\SessionAction' |
| 25 | + }, |
| 26 | + failure: function() { }, |
| 27 | + showLoadingOverlay: false, |
| 28 | + success: function(data) { |
| 29 | + WCF.System.PushNotification.executeCallbacks(data); |
| 30 | + }, |
| 31 | + suppressErrors: true |
| 32 | + }); |
| 33 | + } |
| 34 | + }); |
33 | 35 | }); |
34 | | -})();{/if}]]></templatecode> |
| 36 | +})(jQuery, window);{/if}]]></templatecode> |
35 | 37 | </templatelistener> |
36 | 38 | </import> |
37 | 39 | </data> |
0 commit comments