diff --git a/file/js/TimWolla.WCF.Chat.js b/file/js/TimWolla.WCF.Chat.js index cbed6da..b509c00 100644 --- a/file/js/TimWolla.WCF.Chat.js +++ b/file/js/TimWolla.WCF.Chat.js @@ -13,9 +13,16 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {}; (function ($, document) { TimWolla.WCF.Chat = { init: function(roomID, messageID) { + this.bindEvents(); + }, + bindEvents: function() { $('.smiley').click(function(event) { alert($(event.target).attr('alt')); }); + + $(window).bind('beforeunload', function() { + return false; + }); } }; })(jQuery, document); \ No newline at end of file diff --git a/file/lib/data/chat/message/ChatMessage.class.php b/file/lib/data/chat/message/ChatMessage.class.php index b312815..f08fd7e 100644 --- a/file/lib/data/chat/message/ChatMessage.class.php +++ b/file/lib/data/chat/message/ChatMessage.class.php @@ -1,5 +1,6 @@ message; + return $this->getFormattedMessage; + } + + /** + * Returns the formatted message. + * + * @return string + */ + public function getFormattedMessage() { + $message = $this->message; + switch ($this->type) { + case self::TYPE_JOIN: + case self::TYPE_LEAVE: + case self::TYPE_BACK: + $message = WCF::getLanguage()->get('wcf.chat.message.'.$this->type); + } + return $message; } } diff --git a/file/lib/data/chat/room/ChatRoom.class.php b/file/lib/data/chat/room/ChatRoom.class.php index 594e8ae..0c8b62a 100644 --- a/file/lib/data/chat/room/ChatRoom.class.php +++ b/file/lib/data/chat/room/ChatRoom.class.php @@ -57,7 +57,7 @@ public static function clearCache() { * @see \wcf\data\chat\room\ChatRoom::getTitle(); */ public function __tostring() { - return $this->getTitle; + return $this->getTitle(); } /** diff --git a/language/de.xml b/language/de.xml index b84c994..107a946 100644 --- a/language/de.xml +++ b/language/de.xml @@ -7,4 +7,10 @@ Chat entwickelt von TimWolla]]> + + + + + + \ No newline at end of file diff --git a/template/chatCopyright.tpl b/template/chatCopyright.tpl index 04e9ea1..11239c5 100644 --- a/template/chatCopyright.tpl +++ b/template/chatCopyright.tpl @@ -1 +1 @@ -{if $templateName == 'chat'}{lang}wcf.chat.copyright{/lang}{/if} \ No newline at end of file +{if $templateName == 'chat'}{/if} \ No newline at end of file