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

Adding security closure in Template as well

This commit is contained in:
Tim Düsterhus 2012-01-16 17:11:22 +01:00
parent 0c3fc4e474
commit 4561157272

View File

@ -185,36 +185,38 @@
<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}'); (function ($, window) {
{capture assign='chatMessageTemplate'}{include file='chatMessage'}{/capture} TimWolla.WCF.Chat.titleTemplate = new WCF.Template('{ldelim}$title} - {'wcf.chat.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}');
TimWolla.WCF.Chat.messageTemplate = new WCF.Template('{@$chatMessageTemplate|encodeJS}'); {capture assign='chatMessageTemplate'}{include file='chatMessage'}{/capture}
TimWolla.WCF.Chat.config = { TimWolla.WCF.Chat.messageTemplate = new WCF.Template('{@$chatMessageTemplate|encodeJS}');
reloadTime: {CHAT_RELOADTIME}, TimWolla.WCF.Chat.config = {
animations: {CHAT_ANIMATIONS}, reloadTime: {CHAT_RELOADTIME},
maxTextLength: {CHAT_LENGTH} animations: {CHAT_ANIMATIONS},
} maxTextLength: {CHAT_LENGTH}
WCF.Language.add('wcf.chat.query', '{lang}wcf.chat.query{/lang}'); }
WCF.Language.add('wcf.chat.kick', '{lang}wcf.chat.kick{/lang}'); WCF.Language.add('wcf.chat.query', '{lang}wcf.chat.query{/lang}');
WCF.Language.add('wcf.chat.ban', '{lang}wcf.chat.ban{/lang}'); WCF.Language.add('wcf.chat.kick', '{lang}wcf.chat.kick{/lang}');
WCF.Language.add('wcf.chat.profile', '{lang}wcf.chat.profile{/lang}'); WCF.Language.add('wcf.chat.ban', '{lang}wcf.chat.ban{/lang}');
{event name='shouldInit'} WCF.Language.add('wcf.chat.profile', '{lang}wcf.chat.profile{/lang}');
TimWolla.WCF.Chat.init(); {event name='shouldInit'}
{event name='didInit'} TimWolla.WCF.Chat.init();
TimWolla.WCF.Chat.handleMessages([ {event name='didInit'}
{implode from=$newestMessages item='message'} TimWolla.WCF.Chat.handleMessages([
{@$message->jsonify()} {implode from=$newestMessages item='message'}
{/implode} {@$message->jsonify()}
]); {/implode}
$('#chatInput').enable().jCounter().focus(); ]);
$('#chatControls .copyright').click(function (event) { $('#chatInput').enable().jCounter().focus();
event.preventDefault(); $('#chatControls .copyright').click(function (event) {
if ($.wcfIsset('chatCopyrightDialog')) return WCF.showDialog('chatCopyrightDialog', true, { title: 'Tims Chat{if CHAT_SHOW_VERSION} {$chatVersion}{/if}' }); event.preventDefault();
var container = $('<div id="chatCopyrightDialog"></div>'); if ($.wcfIsset('chatCopyrightDialog')) return WCF.showDialog('chatCopyrightDialog', true, { title: 'Tims Chat{if CHAT_SHOW_VERSION} {$chatVersion}{/if}' });
container.load('{link controller='Chat' action='Copyright'}{/link}', function() { var container = $('<div id="chatCopyrightDialog"></div>');
$('body').append(container); container.load('{link controller='Chat' action='Copyright'}{/link}', function() {
WCF.showDialog('chatCopyrightDialog', true, { title: 'Tims Chat{if CHAT_SHOW_VERSION} {$chatVersion}{/if}' }); $('body').append(container);
WCF.showDialog('chatCopyrightDialog', true, { title: 'Tims Chat{if CHAT_SHOW_VERSION} {$chatVersion}{/if}' });
});
}); });
}); })(jQuery, this)
//]]> //]]>
</script> </script>