1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Smiley-switch works now.

This commit is contained in:
max-m 2011-12-20 21:20:32 +01:00
parent a850f5235b
commit 602f824e85
5 changed files with 19 additions and 3 deletions

3
.gitignore vendored
View File

@ -48,3 +48,6 @@ nbactions.xml
# Ignore packages build directly in the workspace. They can however be added manually via git add, if wanted.
*.tar
*.tar.gz
# Javascript - CoffeeScript is used instead ;)
*.js

View File

@ -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'

View File

@ -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;

View File

@ -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]
)

View File

@ -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 @@
<img alt="" src="{icon}disabled1{/icon}" /> <span>{lang}wcf.chat.notify{/lang}</span>
</a>
</li>
<li>
<a id="chatSmilies" href="javascript:;" class="chatToggle balloonTooltip" title="{lang}wcf.global.button.enable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="1">
<img alt="" src="{icon}enabled1{/icon}" /> <span>{lang}wcf.chat.smilies{/lang}</span>
</a>
</li>
<li>
<a id="chatClear" href="javascript:;" class="balloonTooltip" title="Clear the chat">
<img alt="" src="{icon}delete1{/icon}" /> <span>{lang}wcf.chat.clear{/lang}</span>