mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Merge branch 'master' of github.com:wbbaddons/Tims-Chat
This commit is contained in:
commit
e537788732
@ -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);
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace wcf\data\chat\message;
|
||||
use \wcf\system\WCF;
|
||||
|
||||
/**
|
||||
* Represents a chat message.
|
||||
@ -40,6 +41,22 @@ class ChatMessage extends \wcf\data\DatabaseObject {
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
return $this->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;
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public static function clearCache() {
|
||||
* @see \wcf\data\chat\room\ChatRoom::getTitle();
|
||||
*/
|
||||
public function __tostring() {
|
||||
return $this->getTitle;
|
||||
return $this->getTitle();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,4 +7,10 @@
|
||||
<item name="wcf.chat.title"><![CDATA[Chat]]></item>
|
||||
<item name="wcf.chat.copyright"><![CDATA[<a href="http://timwolla.wbbaddons.de">Chat entwickelt von TimWolla</a>]]></item>
|
||||
</category>
|
||||
<category name="wcf.chat.message">
|
||||
<!-- 1 = TYPE_JOIN -->
|
||||
<item name="wcf.chat.message.1"><![CDATA[hat den Chat betreten.]]></item>
|
||||
<!-- 2 = TYPE_LEAVE -->
|
||||
<item name="wcf.chat.message.2"><![CDATA[hat den Chat verlassen.]]></item>
|
||||
</category>
|
||||
</language>
|
@ -1 +1 @@
|
||||
{if $templateName == 'chat'}{lang}wcf.chat.copyright{/lang}{/if}
|
||||
{if $templateName == 'chat'}<address class="copyright">{lang}wcf.chat.copyright{/lang}</address>{/if}
|
Loading…
Reference in New Issue
Block a user