-
Notifications
You must be signed in to change notification settings - Fork 3
/
templateListener.xml
36 lines (34 loc) · 1.43 KB
/
templateListener.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/templateListener.xsd">
<import>
<templatelistener name="requirePaths">
<environment>user</environment>
<templatename>headIncludeJavaScript</templatename>
<eventname>requirePaths</eventname>
<templatecode><![CDATA[{if NODEPUSH_HOST}'socket.io-client': '{@NODEPUSH_HOST|encodeJS}/socket.io/socket.io',{/if}]]></templatecode>
</templatelistener>
<templatelistener name="requireConfig">
<environment>user</environment>
<templatename>headIncludeJavaScript</templatename>
<eventname>requireConfig</eventname>
<templatecode><![CDATA[{if NODEPUSH_HOST}
;(requirejs.config({ map: { '*': { 'Bastelstu.be/_Push': 'Bastelstu.be/NodePush' } } }));
{/if}]]></templatecode>
</templatelistener>
<templatelistener name="javascriptInclude">
<environment>user</environment>
<templatename>headIncludeJavaScript</templatename>
<!-- Don't use javascriptInit, as it runs after the DOM is loaded -->
<eventname>javascriptInclude</eventname>
<templatecode><![CDATA[
{if NODEPUSH_HOST}
<script data-relocate="true">
require([ 'Bastelstu.be/NodePush' ], function (nodePush) {
nodePush.init('{@NODEPUSH_HOST|encodeJS}', '{$nodePushSignedUserID|encodeJS}')
})
</script>
{/if}
]]></templatecode>
</templatelistener>
</import>
</data>