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

Adding chatMessage-Template

This commit is contained in:
Tim Düsterhus 2011-12-04 23:12:12 +01:00
parent ca2d596d31
commit 725a94aeb2
2 changed files with 10 additions and 1 deletions

View File

@ -207,7 +207,10 @@
{foreach from=$newestMessages item='message'} {foreach from=$newestMessages item='message'}
<li> <li>
{* TODO: Use an own time-function to display a short timestamp *} {* TODO: Use an own time-function to display a short timestamp *}
{@$message->time|time} {@$message->getFormattedUsername()} {@$message->getFormattedMessage()} {assign var='time' value=$message->time|time}
{assign var='username' value=$message->getFormattedUsername()|concat:': '}
{assign var='message' value=$message->getFormattedMessage()}
{include file='chatMessage'}
</li> </li>
{/foreach} {/foreach}
</ul> </ul>
@ -266,6 +269,11 @@
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
TimWolla.WCF.Chat.titleTemplate = new WCF.Template('{ldelim}$title} - {'wcf.chat.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}'); TimWolla.WCF.Chat.titleTemplate = new WCF.Template('{ldelim}$title} - {'wcf.chat.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}');
{capture assign='time'}{literal}{@$time}{/literal}{/capture}
{capture assign='username'}{literal}{@$username}{/literal}{/capture}
{capture assign='message'}{literal}{@$message}{/literal}{/capture}
{capture assign='chatMessageTemplate'}{include file='chatMessage'}{/capture}
TimWolla.WCF.Chat.messageTemplate = new WCF.Template('{$chatMessageTemplate|encodeJS}');
TimWolla.WCF.Chat.init({$room->roomID}, 1); TimWolla.WCF.Chat.init({$room->roomID}, 1);
//]]> //]]>
</script> </script>

1
template/chatMessage.tpl Normal file
View File

@ -0,0 +1 @@
{@$time} {@$username}{@$message}