diff --git a/.gitignore b/.gitignore index d9b96dd..ef666fc 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,7 @@ nbactions.xml # Community Framework # Ignore packages build directly in the workspace. They can however be added manually via git add, if wanted. *.tar -*.tar.gz \ No newline at end of file +*.tar.gz + +# Javascript - CoffeeScript is used instead ;) +*.js \ No newline at end of file diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index da96675..a0d029f 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -178,7 +178,8 @@ TimWolla.WCF ?= {} $.ajax $('#chatForm').attr('action'), data: - text: $('#chatInput').val() + text: $('#chatInput').val(), + smilies: $('#chatSmilies').data('status') type: 'POST', beforeSend: (jqXHR) -> $('#chatInput').addClass 'ajaxLoad' diff --git a/file/lib/data/chat/message/ChatMessage.class.php b/file/lib/data/chat/message/ChatMessage.class.php index c4b3899..53abe99 100755 --- a/file/lib/data/chat/message/ChatMessage.class.php +++ b/file/lib/data/chat/message/ChatMessage.class.php @@ -59,7 +59,7 @@ public function getFormattedMessage() { break; case self::TYPE_NORMAL: if (!$this->enableHTML) { - $message = \wcf\system\bbcode\SimpleMessageParser::getInstance()->parse($message, $this->enableSmilies); + $message = \wcf\system\bbcode\SimpleMessageParser::getInstance()->parse($message, true, $this->enableSmilies); } } return $message; diff --git a/file/lib/form/ChatForm.class.php b/file/lib/form/ChatForm.class.php index 0158cba..b8b1785 100644 --- a/file/lib/form/ChatForm.class.php +++ b/file/lib/form/ChatForm.class.php @@ -19,6 +19,7 @@ */ class ChatForm extends AbstractForm { public $message = ''; + public $enableSmilies = 1; public $userData = array(); public $useTemplate = false; @@ -37,6 +38,7 @@ public function readFormParameters() { parent::readFormParameters(); if (isset($_REQUEST['text'])) $this->message = StringUtil::trim($_REQUEST['text']); + if (isset($_REQUEST['smilies'])) $this->enableSmilies = intval($_REQUEST['smilies']); } /** @@ -96,6 +98,7 @@ public function save() { 'time' => TIME_NOW, 'type' => chat\message\ChatMessage::TYPE_NORMAL, 'message' => $this->message, + 'enableSmilies' => $this->enableSmilies, 'color1' => $this->userData['color'][1], 'color2' => $this->userData['color'][2] ) diff --git a/template/chat.tpl b/template/chat.tpl index f4465fb..4fd53e0 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -130,6 +130,10 @@ background-image: url({icon size='S'}toLeft1{/icon}); } + .chatMessageContainer { + padding-left: 7px !important; + } + .ajaxLoad { background-position: right center; background-repeat: no-repeat; @@ -301,6 +305,11 @@ {lang}wcf.chat.notify{/lang} +