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

Alert smiley-code on click.

Will be replaced with inserting into input lateron.
This commit is contained in:
Tim Düsterhus 2011-11-27 13:13:59 +01:00
parent 3314249c44
commit c28b0a3067
2 changed files with 13 additions and 8 deletions

View File

@ -11,10 +11,11 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
(function ($, document) {
TimWolla.WCF.Chat = function(roomID, messageID) { this.init(roomID, messageID); };
TimWolla.WCF.Chat.prototype = {
TimWolla.WCF.Chat = {
init: function(roomID, messageID) {
history.replaceState({}, '', 'index.php/Chat/'+roomID);
$('.smiley').click(function(event) {
alert($(event.target).attr('alt'));
});
}
};
})(jQuery, document);

View File

@ -4,11 +4,6 @@
<title>{lang}wcf.chat.title{/lang} - {PAGE_TITLE|language}</title>
{include file='headInclude' sandbox=false}
<script type="text/javascript">
//<![CDATA[
new TimWolla.WCF.Chat({$roomID},1);
//]]>
</script>
</head>
<body id="tpl{$templateName|ucfirst}">
@ -21,6 +16,15 @@
</hgroup>
</header>
{foreach from=$smilies item='smiley'}
<img src="{$smiley->getURL()}" alt="{$smiley->smileyCode}" class="smiley" /><br />
{/foreach}
<script type="text/javascript">
//<![CDATA[
TimWolla.WCF.Chat.init({$room->roomID}, 1);
//]]>
</script>
{include file='footer' sandbox=false}
</body>