1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Make config editable via template event

This commit is contained in:
Maximilian Mader 2013-06-24 18:25:30 +02:00
parent 14fcafc483
commit 61c835cd38

View File

@ -21,22 +21,24 @@
'chat.error.reload': '{lang}chat.error.reload{/lang}'
});
{event name='beforeInit'}
// Boot the chat
{if MODULE_SMILEY}WCF.TabMenu.init();{/if}
new WCF.Message.Smilies();
{capture assign='messageTemplate'}{include application='chat' file='message'}{/capture}
{capture assign='userTemplate'}{include application='chat' file='userListUser'}{/capture}
be.bastelstu.Chat.init(
{$roomID},
{
var config = {
reloadTime: {@CHAT_RELOADTIME},
messageURL: '{link application="chat" controller="NewMessages"}{/link}',
installedCommands: [ {implode from=$commands item='command'}'{$command|encodeJS}'{/implode} ],
messageTypes: { {implode from=$messageTypes key='name' item='messageType'}'{$name|substr:5|encodeJS}': '{$messageType|encodeJS}'{/implode} }
},
};
{event name='beforeInit'}
be.bastelstu.Chat.init(
{$roomID},
config,
new WCF.Template('{literal}{if $newMessageCount}({#$newMessageCount}) {/if}{$title} - {/literal}{"chat.general.title"|language|encodeJS} - {PAGE_TITLE|language|encodeJS}'),
new WCF.Template('{@$messageTemplate|encodeJS}'),
new WCF.Template('{@$userTemplate|encodeJS}')