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

Various fixes (forgot to commit at different stages :P)

This commit is contained in:
max-m 2013-01-26 22:46:54 +01:00
parent 0241bb50c9
commit 063a56bcb6
41 changed files with 193 additions and 187 deletions

View File

@ -8,7 +8,7 @@
### ###
(($, window) -> (($, window) ->
be.bastelstu.WCF.Chat.Log = be.bastelstu.Chat.extend be.bastelstu.Chat.Log = be.bastelstu.Chat.extend
init: (@chat) -> init: (@chat) ->
handleMessages: (messages) -> handleMessages: (messages) ->
# Insert the messages # Insert the messages
@ -23,7 +23,7 @@
li.appendTo $ '#timsChatLog .timsChatMessageContainer > ul' li.appendTo $ '#timsChatLog .timsChatMessageContainer > ul'
be.bastelstu.WCF.Chat.Log.loadOverlay = () -> be.bastelstu.Chat.Log.loadOverlay = () ->
if !$.wcfIsset 'timsChatLogDialog' if !$.wcfIsset 'timsChatLogDialog'
container = $ '<fieldset id="timsChatLogDialog"></fieldset>' container = $ '<fieldset id="timsChatLogDialog"></fieldset>'
$('#content').append container $('#content').append container

View File

@ -188,14 +188,14 @@ window.console ?=
# Toggle Buttons # Toggle Buttons
$('.timsChatToggle').click (event) -> $('.timsChatToggle').click (event) ->
element = $ @ element = $ @
icon = element.find 'img' icon = element.find 'span.icon'
if element.data('status') is 1 if element.data('status') is 1
element.data 'status', 0 element.data 'status', 0
icon.attr 'src', icon.attr('src').replace /enabled(.*).svg$/, 'disabled$1.svg' icon.removeClass('icon-circle-blank').addClass('icon-off')
element.attr 'title', element.data 'enableMessage' element.attr 'title', element.data 'enableMessage'
else else
element.data 'status', 1 element.data 'status', 1
icon.attr 'src', icon.attr('src').replace /disabled(.*).svg$/, 'enabled$1.svg' icon.removeClass('icon-off').addClass('icon-circle-blank')
element.attr 'title', element.data 'disableMessage' element.attr 'title', element.data 'disableMessage'
$('#timsChatInput').focus() $('#timsChatInput').focus()
@ -235,7 +235,7 @@ window.console ?=
type: 'POST' type: 'POST'
success: $.proxy((data, textStatus, jqXHR) -> success: $.proxy((data, textStatus, jqXHR) ->
@loading = false @loading = false
target.parent().removeClass 'ajaxLoad' target.parent().removeClass 'loading'
# Mark as active # Mark as active
$('.activeMenuItem .timsChatRoom').parent().removeClass 'activeMenuItem' $('.activeMenuItem .timsChatRoom').parent().removeClass 'activeMenuItem'
@ -260,10 +260,10 @@ window.console ?=
# inclusive the error-message :) # inclusive the error-message :)
window.location.reload true window.location.reload true
beforeSend: $.proxy(() -> beforeSend: $.proxy(() ->
return false if target.parent().hasClass('ajaxLoad') or target.parent().hasClass 'activeMenuItem' return false if target.parent().hasClass('loading') or target.parent().hasClass 'activeMenuItem'
@loading = true @loading = true
target.parent().addClass 'ajaxLoad' target.parent().addClass 'loading'
, @) , @)
### ###
# Frees the fish # Frees the fish
@ -412,11 +412,11 @@ window.console ?=
menu = $ '<ul></ul>' menu = $ '<ul></ul>'
#menu.addClass 'timsChatUserMenu' #menu.addClass 'timsChatUserMenu'
menu.addClass 'dropdownMenu' menu.addClass 'dropdownMenu'
menu.append $ '<li><a>' + WCF.Language.get('chat.query') + '</a></li>' menu.append $ '<li><a>' + WCF.Language.get('chat.general.query') + '</a></li>'
menu.append $ '<li><a>' + WCF.Language.get('chat.kick') + '</a></li>' menu.append $ '<li><a>' + WCF.Language.get('chat.general.kick') + '</a></li>'
menu.append $ '<li><a>' + WCF.Language.get('chat.ban') + '</a></li>' menu.append $ '<li><a>' + WCF.Language.get('chat.general.ban') + '</a></li>'
# TODO: SID and co # TODO: SID and co
menu.append $ '<li><a href="index.php/User/' + user.userID + '-' + encodeURI(user.username) + '/">' + WCF.Language.get('wcf.chat.profile') + '</a></li>' menu.append $ '<li><a href="index.php/User/' + user.userID + '-' + encodeURI(user.username) + '/">' + WCF.Language.get('chat.general.profile') + '</a></li>'
@events.userMenu.fire user, menu @events.userMenu.fire user, menu
li.append menu li.append menu
@ -485,7 +485,7 @@ window.console ?=
# Desktop Notifications # Desktop Notifications
if typeof window.webkitNotifications isnt 'undefined' if typeof window.webkitNotifications isnt 'undefined'
if window.webkitNotifications.checkPermission() is 0 if window.webkitNotifications.checkPermission() is 0
title = WCF.Language.get 'chat.notify.title' title = WCF.Language.get 'chat.general.notify.title'
icon = WCF.Icon.get 'be.bastelstu.chat.chat' icon = WCF.Icon.get 'be.bastelstu.chat.chat'
content = message.username + message.separator + (if message.separator is ' ' then '' else ' ') + message.message content = message.username + message.separator + (if message.separator is ' ' then '' else ' ') + message.message
notification = window.webkitNotifications.createNotification icon, title, content notification = window.webkitNotifications.createNotification icon, title, content
@ -500,14 +500,14 @@ window.console ?=
### ###
refreshRoomList: () -> refreshRoomList: () ->
console.log 'Refreshing the roomlist' console.log 'Refreshing the roomlist'
$('#toggleRooms a').addClass 'ajaxLoad' $('#toggleRooms .ajaxLoad').show()
$.ajax $('#toggleRooms a').data('refreshUrl'), $.ajax $('#toggleRooms a').data('refreshUrl'),
dataType: 'json' dataType: 'json'
type: 'POST' type: 'POST'
success: $.proxy((data, textStatus, jqXHR) -> success: $.proxy((data, textStatus, jqXHR) ->
$('#timsChatRoomList li').remove() $('#timsChatRoomList li').remove()
$('#toggleRooms a').removeClass 'ajaxLoad' $('#toggleRooms .ajaxLoad').hide()
$('#toggleRooms .badge').text data.length $('#toggleRooms .badge').text data.length
for room in data for room in data
@ -549,12 +549,10 @@ window.console ?=
smilies: $('#timsChatSmilies').data 'status' smilies: $('#timsChatSmilies').data 'status'
type: 'POST', type: 'POST',
beforeSend: (jqXHR) -> beforeSend: (jqXHR) ->
$('#timsChatInput').addClass 'ajaxLoad'
success: $.proxy((data, textStatus, jqXHR) -> success: $.proxy((data, textStatus, jqXHR) ->
@getMessages() @getMessages()
, @) , @)
complete: () -> complete: () ->
$('#timsChatInput').removeClass 'ajaxLoad'
### ###
# Toggles between user- and room-list. # Toggles between user- and room-list.
# #

View File

@ -0,0 +1,11 @@
<?php
namespace chat\data;
abstract class CHATDatabaseObject extends \wcf\data\DatabaseObject {
/**
* @see \wcf\data\DatabaseObject::getDatabaseTableName()
*/
public static function getDatabaseTableName() {
return 'chat'.WCF_N.'_'.static::$databaseTableName;
}
}

View File

@ -13,7 +13,7 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage data.message * @subpackage data.message
*/ */
class Message extends \wcf\data\DatabaseObject { class Message extends \chat\data\CHATDatabaseObject {
/** /**
* @see \wcf\data\DatabaseObject::$databaseTableName * @see \wcf\data\DatabaseObject::$databaseTableName
*/ */

View File

@ -25,15 +25,15 @@ class MessageList extends \wcf\data\DatabaseObjectList {
*/ */
public static function getNewestMessages(\chat\data\room\Room $room, $number = CHAT_LASTMESSAGES) { public static function getNewestMessages(\chat\data\room\Room $room, $number = CHAT_LASTMESSAGES) {
$messageList = new static(); $messageList = new static();
$messageList->sqlOrderBy = "chat_message.messageID DESC"; $messageList->sqlOrderBy = "message.messageID DESC";
$messageList->sqlLimit = $number; $messageList->sqlLimit = $number;
$messageList->getConditionBuilder()->add(' $messageList->getConditionBuilder()->add('
(( ((
chat_message.receiver IS NULL message.receiver IS NULL
AND chat_message.roomID = ? AND message.roomID = ?
) )
OR chat_message.receiver = ? OR message.receiver = ?
OR chat_message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID)); OR message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID));
$messageList->readObjects(); $messageList->readObjects();
return array_reverse($messageList->getObjects()); return array_reverse($messageList->getObjects());
@ -48,15 +48,15 @@ public static function getNewestMessages(\chat\data\room\Room $room, $number = C
*/ */
public static function getMessagesSince(\chat\data\room\Room $room, $since) { public static function getMessagesSince(\chat\data\room\Room $room, $since) {
$messageList = new static(); $messageList = new static();
$messageList->sqlOrderBy = "chat_message.messageID ASC"; $messageList->sqlOrderBy = "message.messageID ASC";
$messageList->getConditionBuilder()->add('chat_message.messageID > ?', array($since)); $messageList->getConditionBuilder()->add('message.messageID > ?', array($since));
$messageList->getConditionBuilder()->add(' $messageList->getConditionBuilder()->add('
(( ((
chat_message.receiver IS NULL message.receiver IS NULL
AND chat_message.roomID = ? AND message.roomID = ?
) )
OR chat_message.receiver = ? OR message.receiver = ?
OR chat_message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID)); OR message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID));
$messageList->readObjects(); $messageList->readObjects();
return $messageList->getObjects(); return $messageList->getObjects();

View File

@ -13,7 +13,7 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage data.room * @subpackage data.room
*/ */
class Room extends \wcf\data\DatabaseObject implements \wcf\system\request\IRouteController { class Room extends \chat\data\CHATDatabaseObject implements \wcf\system\request\IRouteController {
/** /**
* @see \wcf\data\DatabaseObject::$databaseTableName * @see \wcf\data\DatabaseObject::$databaseTableName
*/ */

View File

@ -101,7 +101,7 @@ public function validateUpdatePosition() {
*/ */
public function updatePosition() { public function updatePosition() {
$roomList = new RoomList(); $roomList = new RoomList();
$roomList->sqlOrderBy = "chat_room.position"; $roomList->sqlOrderBy = "room.position";
$roomList->readObjects(); $roomList->readObjects();
$i = $this->parameters['data']['offset']; $i = $this->parameters['data']['offset'];

View File

@ -11,7 +11,7 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage data.suspension * @subpackage data.suspension
*/ */
class Suspension extends \wcf\data\DatabaseObject { class Suspension extends \chat\data\CHATDatabaseObject {
/** /**
* @see \wcf\data\DatabaseObject::$databaseTableName * @see \wcf\data\DatabaseObject::$databaseTableName
*/ */

View File

@ -14,7 +14,7 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage form * @subpackage form
*/ */
class ChatForm extends AbstractForm { class ChatForm extends \wcf\form\AbstractForm {
/** /**
* Should HTML be enabled for this message. * Should HTML be enabled for this message.
* *
@ -143,7 +143,7 @@ public function save() {
parent::save(); parent::save();
\chat\util\ChatUtil::writeUserData(array('away' => null)); \chat\util\ChatUtil::writeUserData(array('away' => null));
$commandHandler = new \wcf\system\chat\command\CommandHandler($this->message); $commandHandler = new \chat\system\command\CommandHandler($this->message);
if ($commandHandler->isCommand()) { if ($commandHandler->isCommand()) {
try { try {
$command = $commandHandler->loadCommand(); $command = $commandHandler->loadCommand();
@ -156,12 +156,12 @@ public function save() {
$this->message = $command->getMessage(); $this->message = $command->getMessage();
$receiver = $command->getReceiver(); $receiver = $command->getReceiver();
} }
catch (\wcf\system\chat\command\NotFoundException $e) { catch (\chat\system\command\NotFoundException $e) {
$this->message = WCF::getLanguage()->get('wcf.chat.error.notFound'); $this->message = WCF::getLanguage()->get('wcf.chat.error.notFound');
$type = data\message\Message::TYPE_ERROR; $type = data\message\Message::TYPE_ERROR;
$receiver = WCF::getUser()->userID; $receiver = WCF::getUser()->userID;
} }
catch (\wcf\system\chat\command\UserNotFoundException $e) { catch (\chat\system\command\UserNotFoundException $e) {
$this->message = WCF::getLanguage()->getDynamicVariable('wcf.chat.error.userNotFound', array('username' => $e->getUsername())); $this->message = WCF::getLanguage()->getDynamicVariable('wcf.chat.error.userNotFound', array('username' => $e->getUsername()));
$type = data\message\Message::TYPE_ERROR; $type = data\message\Message::TYPE_ERROR;
$receiver = WCF::getUser()->userID; $receiver = WCF::getUser()->userID;

View File

@ -118,7 +118,7 @@ public function readMessages() {
$sql = "SELECT $sql = "SELECT
MAX(messageID) MAX(messageID)
FROM FROM
wcf".WCF_N."_chat_message"; chat".WCF_N."_message";
$stmt = WCF::getDB()->prepareStatement($sql); $stmt = WCF::getDB()->prepareStatement($sql);
$stmt->execute(); $stmt->execute();

View File

@ -141,7 +141,7 @@ public function readData() {
'sender' => WCF::getUser()->userID, 'sender' => WCF::getUser()->userID,
'username' => WCF::getUser()->username, 'username' => WCF::getUser()->username,
'time' => TIME_NOW, 'time' => TIME_NOW,
'type' => chat\message\ChatMessage::TYPE_JOIN, 'type' => \chat\data\message\Message::TYPE_JOIN,
'message' => serialize(array('ipAddress' => \wcf\util\UserUtil::convertIPv6To4(\wcf\util\UserUtil::getIpAddress()))), 'message' => serialize(array('ipAddress' => \wcf\util\UserUtil::convertIPv6To4(\wcf\util\UserUtil::getIpAddress()))),
'color1' => $this->userData['color'][1], 'color1' => $this->userData['color'][1],
'color2' => $this->userData['color'][2] 'color2' => $this->userData['color'][2]

View File

@ -17,7 +17,7 @@ class RoomCacheBuilder implements \wcf\system\cache\builder\ICacheBuilder {
public function getData(array $cacheResource) { public function getData(array $cacheResource) {
// get all chat rooms // get all chat rooms
$roomList = new \chat\data\room\RoomList(); $roomList = new \chat\data\room\RoomList();
$roomList->sqlOrderBy = "chat_room.position"; $roomList->sqlOrderBy = "room.position";
$roomList->readObjects(); $roomList->readObjects();
return $roomList->getObjects(); return $roomList->getObjects();

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command; namespace chat\system\command;
use \wcf\system\event\EventHandler; use \wcf\system\event\EventHandler;
/** /**
@ -15,7 +15,7 @@ abstract class AbstractCommand implements ICommand {
/** /**
* Instance of the CommandHandler * Instance of the CommandHandler
* *
* @var \wcf\system\chat\command\CommandHandler * @var \chat\system\command\CommandHandler
*/ */
public $commandHandler = null; public $commandHandler = null;
@ -23,8 +23,8 @@ abstract class AbstractCommand implements ICommand {
* Should HTML be enabled? * Should HTML be enabled?
* *
* @var integer * @var integer
* @see \wcf\system\chat\command\ICommand::SETTING_OFF * @see \chat\system\command\ICommand::SETTING_OFF
* @see \wcf\system\chat\command\ICommand::SETTING_ON * @see \chat\system\command\ICommand::SETTING_ON
*/ */
public $enableHTML = ICommand::SETTING_OFF; public $enableHTML = ICommand::SETTING_OFF;
@ -32,9 +32,9 @@ abstract class AbstractCommand implements ICommand {
* Should BBCodes be enabled? * Should BBCodes be enabled?
* *
* @var integer * @var integer
* @see \wcf\system\chat\command\ICommand::SETTING_OFF * @see \chat\system\command\ICommand::SETTING_OFF
* @see \wcf\system\chat\command\ICommand::SETTING_ON * @see \chat\system\command\ICommand::SETTING_ON
* @see \wcf\system\chat\command\ICommand::SETTING_USER * @see \chat\system\command\ICommand::SETTING_USER
*/ */
public $enableBBCodes = ICommand::SETTING_OFF; public $enableBBCodes = ICommand::SETTING_OFF;
@ -42,9 +42,9 @@ abstract class AbstractCommand implements ICommand {
* Should smilies be enabled? * Should smilies be enabled?
* *
* @var integer * @var integer
* @see \wcf\system\chat\command\ICommand::SETTING_OFF * @see \chat\system\command\ICommand::SETTING_OFF
* @see \wcf\system\chat\command\ICommand::SETTING_ON * @see \chat\system\command\ICommand::SETTING_ON
* @see \wcf\system\chat\command\ICommand::SETTING_USER * @see \chat\system\command\ICommand::SETTING_USER
*/ */
public $enableSmilies = ICommand::SETTING_OFF; public $enableSmilies = ICommand::SETTING_OFF;
@ -64,7 +64,7 @@ public function didInit() {
/** /**
* Default-Receiver: Everyone * Default-Receiver: Everyone
* *
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return null; return null;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command; namespace chat\system\command;
use \wcf\system\event\EventHandler; use \wcf\system\event\EventHandler;
/** /**
@ -21,7 +21,7 @@ public function __construct(CommandHandler $commandHandler) {
/** /**
* Fires checkPermission event. * Fires checkPermission event.
* *
* @see \wcf\system\chat\command\IRestrictedCommand * @see \chat\system\command\IRestrictedCommand
*/ */
public function checkPermission() { public function checkPermission() {
EventHandler::getInstance()->fireAction($this, 'checkPermission'); EventHandler::getInstance()->fireAction($this, 'checkPermission');

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command; namespace chat\system\command;
use \wcf\util\StringUtil; use \wcf\util\StringUtil;
/** /**
@ -73,7 +73,7 @@ public function loadCommand() {
return new commands\PlainCommand($this); return new commands\PlainCommand($this);
} }
$class = '\wcf\system\chat\command\commands\\'.ucfirst(strtolower($parts[0])).'Command'; $class = '\chat\system\command\commands\\'.ucfirst(strtolower($parts[0])).'Command';
if (!class_exists($class)) { if (!class_exists($class)) {
throw new NotFoundException(); throw new NotFoundException();
} }

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command; namespace chat\system\command;
/** /**
* Interface for chat-commands. * Interface for chat-commands.

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command; namespace chat\system\command;
/** /**
* Interface for Restricted commands. * Interface for Restricted commands.

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command; namespace chat\system\command;
/** /**
* Thrown when a command is not found. * Thrown when a command is not found.

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command; namespace chat\system\command;
/** /**
* Thrown when a user is not found. * Thrown when a user is not found.

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\util\StringUtil; use \wcf\util\StringUtil;
/** /**
@ -11,8 +11,8 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class AwayCommand extends \wcf\system\chat\command\AbstractCommand { class AwayCommand extends \chat\system\command\AbstractCommand {
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
\chat\util\ChatUtil::writeUserData(array('away' => $commandHandler->getParameters())); \chat\util\ChatUtil::writeUserData(array('away' => $commandHandler->getParameters()));
@ -20,21 +20,21 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_AWAY; return \wcf\data\chat\message\ChatMessage::TYPE_AWAY;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return serialize(array('message' => $this->commandHandler->getParameters())); return serialize(array('message' => $this->commandHandler->getParameters()));
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return \wcf\system\WCF::getUser()->userID; return \wcf\system\WCF::getUser()->userID;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\data\chat\suspension; use \wcf\data\chat\suspension;
use \wcf\data\user\User; use \wcf\data\user\User;
use \wcf\system\WCF; use \wcf\system\WCF;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\util\StringUtil; use \wcf\util\StringUtil;
/** /**
@ -11,7 +11,7 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class ColorCommand extends \wcf\system\chat\command\AbstractCommand { class ColorCommand extends \chat\system\command\AbstractCommand {
public static $colors = array( public static $colors = array(
'red' => 0xFF0000, 'red' => 0xFF0000,
'blue' => 0x0000FF, 'blue' => 0x0000FF,
@ -36,7 +36,7 @@ class ColorCommand extends \wcf\system\chat\command\AbstractCommand {
'oxford' => 0xF02D // looks like green 'oxford' => 0xF02D // looks like green
); );
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
try { try {
list($color[1], $color[2]) = explode(' ', $commandHandler->getParameters()); list($color[1], $color[2]) = explode(' ', $commandHandler->getParameters());
@ -49,7 +49,7 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
foreach ($color as $key => $val) { foreach ($color as $key => $val) {
if (isset(self::$colors[$val])) $color[$key] = self::$colors[$val]; if (isset(self::$colors[$val])) $color[$key] = self::$colors[$val];
else { else {
if (!$regex->match($val)) throw new \wcf\system\chat\command\NotFoundException(); if (!$regex->match($val)) throw new \chat\system\command\NotFoundException();
$matches = $regex->getMatches(); $matches = $regex->getMatches();
$val = $matches[1]; $val = $matches[1];
if (strlen($val) == 3) $val = $val[0].$val[0].$val[1].$val[1].$val[2].$val[2]; if (strlen($val) == 3) $val = $val[0].$val[0].$val[1].$val[1].$val[2].$val[2];
@ -61,21 +61,21 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return 'color changed'; return 'color changed';
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return \wcf\system\WCF::getUser()->userID; return \wcf\system\WCF::getUser()->userID;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
/** /**
* Informs everyone that the fish was freed. OH A NOEZ. * Informs everyone that the fish was freed. OH A NOEZ.
@ -11,18 +11,18 @@
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class FreeCommand extends MeCommand { class FreeCommand extends MeCommand {
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
if (\wcf\util\StringUtil::toLowerCase($this->commandHandler->getParameters()) != 'the fish') { if (\wcf\util\StringUtil::toLowerCase($this->commandHandler->getParameters()) != 'the fish') {
throw new \wcf\system\chat\command\NotFoundException(); throw new \chat\system\command\NotFoundException();
} }
$this->didInit(); $this->didInit();
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return 'freed the fish. OH A NOEZ'; return 'freed the fish. OH A NOEZ';

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\data\user\User; use \wcf\data\user\User;
use \wcf\system\WCF; use \wcf\system\WCF;
use \wcf\util\ChatUtil; use \wcf\util\ChatUtil;
@ -14,17 +14,17 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class InfoCommand extends \wcf\system\chat\command\AbstractCommand { class InfoCommand extends \chat\system\command\AbstractCommand {
public $enableBBCodes = self::SETTING_ON; public $enableBBCodes = self::SETTING_ON;
public $enableHTML = self::SETTING_ON; public $enableHTML = self::SETTING_ON;
public $lines = array(); public $lines = array();
public $user = null; public $user = null;
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
$this->user = User::getUserByUsername(rtrim($commandHandler->getParameters(), ',')); $this->user = User::getUserByUsername(rtrim($commandHandler->getParameters(), ','));
if (!$this->user->userID) throw new \wcf\system\chat\command\UserNotFoundException(rtrim($commandHandler->getParameters(), ',')); if (!$this->user->userID) throw new \chat\system\command\UserNotFoundException(rtrim($commandHandler->getParameters(), ','));
// Username + link to profile // Username + link to profile
$color = ChatUtil::readUserData('color', $this->user); $color = ChatUtil::readUserData('color', $this->user);
@ -75,14 +75,14 @@ public function fetchSession() {
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
$lines = array(); $lines = array();
@ -93,7 +93,7 @@ public function getMessage() {
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return \wcf\system\WCF::getUser()->userID; return \wcf\system\WCF::getUser()->userID;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\util\StringUtil; use \wcf\util\StringUtil;
/** /**
@ -11,24 +11,24 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class MeCommand extends \wcf\system\chat\command\AbstractCommand { class MeCommand extends \chat\system\command\AbstractCommand {
public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER; public $enableSmilies = \chat\system\command\ICommand::SMILEY_USER;
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
$this->didInit(); $this->didInit();
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_ME; return \wcf\data\chat\message\ChatMessage::TYPE_ME;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return $this->commandHandler->getParameters(); return $this->commandHandler->getParameters();

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\data\chat\suspension; use \wcf\data\chat\suspension;
use \wcf\data\user\User; use \wcf\data\user\User;
use \wcf\system\WCF; use \wcf\system\WCF;
@ -14,7 +14,7 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class MuteCommand extends \wcf\system\chat\command\AbstractRestrictedCommand { class MuteCommand extends \chat\system\command\AbstractRestrictedCommand {
public $user = null; public $user = null;
public $time = 0; public $time = 0;
public $suspensionAction = null; public $suspensionAction = null;
@ -22,7 +22,7 @@ class MuteCommand extends \wcf\system\chat\command\AbstractRestrictedCommand {
public $fail = false; public $fail = false;
public $room = null; public $room = null;
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
$parameters = $commandHandler->getParameters(); $parameters = $commandHandler->getParameters();
@ -31,11 +31,11 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
$this->time = ChatUtil::timeModifier(substr($parameters, $comma + 1)); $this->time = ChatUtil::timeModifier(substr($parameters, $comma + 1));
} }
else { else {
throw new \wcf\system\chat\command\NotFoundException(); throw new \chat\system\command\NotFoundException();
} }
$this->user = User::getUserByUsername($username); $this->user = User::getUserByUsername($username);
if (!$this->user->userID) throw new \wcf\system\chat\command\UserNotFoundException($username); if (!$this->user->userID) throw new \chat\system\command\UserNotFoundException($username);
$color = ChatUtil::readUserData('color', $this->user); $color = ChatUtil::readUserData('color', $this->user);
$profile = \wcf\system\request\LinkHandler::getInstance()->getLink('User', array( $profile = \wcf\system\request\LinkHandler::getInstance()->getLink('User', array(
@ -71,18 +71,18 @@ public function executeAction() {
} }
/** /**
* @see \wcf\system\chat\command\IRestrictedChatCommand::checkPermission() * @see \chat\system\command\IRestrictedChatCommand::checkPermission()
*/ */
public function checkPermission() { public function checkPermission() {
parent::checkPermission(); parent::checkPermission();
$this->room = \wcf\system\request\RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->request->room; $this->room = \wcf\system\request\RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->request->room;
$ph = new \wcf\system\chat\permission\ChatPermissionHandler(); $ph = new \wcf\system\chat\permission\ChatPermissionHandler();
if (!$ph->getPermission($this->room, 'mod.can'.str_replace(array('wcf\system\chat\command\commands\\', 'Command'), '', get_class($this)))) throw new \wcf\system\exception\PermissionDeniedException(); if (!$ph->getPermission($this->room, 'mod.can'.str_replace(array('chat\system\command\commands\\', 'Command'), '', get_class($this)))) throw new \wcf\system\exception\PermissionDeniedException();
} }
/** /**
* @see wcf\system\chat\command\ICommand::getReceiver() * @see chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
if ($this->fail) return WCF::getUser()->userID; if ($this->fail) return WCF::getUser()->userID;
@ -91,7 +91,7 @@ public function getReceiver() {
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
if ($this->fail) return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; if ($this->fail) return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION;
@ -99,7 +99,7 @@ public function getType() {
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
if ($this->fail) return WCF::getLanguage()->get('wcf.chat.suspension.exists'); if ($this->fail) return WCF::getLanguage()->get('wcf.chat.suspension.exists');
@ -107,7 +107,7 @@ public function getMessage() {
return serialize(array( return serialize(array(
'link' => $this->link, 'link' => $this->link,
'until' => TIME_NOW + $this->time, 'until' => TIME_NOW + $this->time,
'type' => str_replace(array('wcf\system\chat\command\commands\\', 'command'), '', strtolower(get_class($this))) 'type' => str_replace(array('chat\system\command\commands\\', 'command'), '', strtolower(get_class($this)))
)); ));
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
/** /**
* Sends a message that starts with a slash. * Sends a message that starts with a slash.
@ -10,25 +10,25 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class PlainCommand extends \wcf\system\chat\command\AbstractCommand { class PlainCommand extends \chat\system\command\AbstractCommand {
public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER; public $enableSmilies = \chat\system\command\ICommand::SMILEY_USER;
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_NORMAL; return \wcf\data\chat\message\ChatMessage::TYPE_NORMAL;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return \wcf\util\StringUtil::substring($this->commandHandler->getText(), 1); return \wcf\util\StringUtil::substring($this->commandHandler->getText(), 1);
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return null; return null;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\data\user\User; use \wcf\data\user\User;
use \wcf\system\WCF; use \wcf\system\WCF;
use \wcf\util\ChatUtil; use \wcf\util\ChatUtil;
@ -13,16 +13,16 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class RestoreCommand extends \wcf\system\chat\command\AbstractRestrictedCommand { class RestoreCommand extends \chat\system\command\AbstractRestrictedCommand {
public $enableHTML = 1; public $enableHTML = 1;
public $user = null; public $user = null;
public $link = ''; public $link = '';
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
$this->user = User::getUserByUsername(rtrim($commandHandler->getParameters(), ',')); $this->user = User::getUserByUsername(rtrim($commandHandler->getParameters(), ','));
if (!$this->user->userID) throw new \wcf\system\chat\command\UserNotFoundException(rtrim($commandHandler->getParameters(), ',')); if (!$this->user->userID) throw new \chat\system\command\UserNotFoundException(rtrim($commandHandler->getParameters(), ','));
$this->link = '<span class="userLink" data-user-id="'.$this->user->userID.'" />'; $this->link = '<span class="userLink" data-user-id="'.$this->user->userID.'" />';
@ -30,7 +30,7 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
} }
/** /**
* @see \wcf\system\chat\command\IRestrictedChatCommand::checkPermission() * @see \chat\system\command\IRestrictedChatCommand::checkPermission()
*/ */
public function checkPermission() { public function checkPermission() {
parent::checkPermission(); parent::checkPermission();
@ -39,19 +39,19 @@ public function checkPermission() {
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_MODERATE; return \wcf\data\chat\message\ChatMessage::TYPE_MODERATE;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return serialize(array( return serialize(array(
'link' => $this->link, 'link' => $this->link,
'type' => str_replace(array('wcf\system\chat\command\commands\\', 'command'), '', strtolower(get_class($this))) 'type' => str_replace(array('chat\system\command\commands\\', 'command'), '', strtolower(get_class($this)))
)); ));
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\system\WCF; use \wcf\system\WCF;
use \wcf\util\StringUtil; use \wcf\util\StringUtil;
@ -12,10 +12,10 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class TemproomCommand extends \wcf\system\chat\command\AbstractRestrictedCommand { class TemproomCommand extends \chat\system\command\AbstractRestrictedCommand {
public $roomName = ''; public $roomName = '';
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
// create room // create room
@ -55,7 +55,7 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
} }
/** /**
* @see \wcf\system\chat\command\IRestrictedCommand::checkPermission() * @see \chat\system\command\IRestrictedCommand::checkPermission()
*/ */
public function checkPermission() { public function checkPermission() {
parent::checkPermission(); parent::checkPermission();
@ -64,21 +64,21 @@ public function checkPermission() {
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return $this->roomName; return $this->roomName;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return \wcf\system\WCF::getUser()->userID; return \wcf\system\WCF::getUser()->userID;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
/** /**
* Shows the users that are online * Shows the users that are online
@ -10,19 +10,19 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class WhereCommand extends \wcf\system\chat\command\AbstractCommand { class WhereCommand extends \chat\system\command\AbstractCommand {
public $enableHTML = self::SETTING_ON; public $enableHTML = self::SETTING_ON;
public $enableBBCodes = self::SETTING_ON; public $enableBBCodes = self::SETTING_ON;
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
$rooms = \wcf\data\chat\room\ChatRoom::getCache(); $rooms = \wcf\data\chat\room\ChatRoom::getCache();
@ -40,7 +40,7 @@ public function getMessage() {
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return \wcf\system\WCF::getUser()->userID; return \wcf\system\WCF::getUser()->userID;

View File

@ -1,5 +1,5 @@
<?php <?php
namespace wcf\system\chat\command\commands; namespace chat\system\command\commands;
use \wcf\data\user\User; use \wcf\data\user\User;
/** /**
@ -11,11 +11,11 @@
* @package be.bastelstu.chat * @package be.bastelstu.chat
* @subpackage system.chat.command.commands * @subpackage system.chat.command.commands
*/ */
class WhisperCommand extends \wcf\system\chat\command\AbstractCommand { class WhisperCommand extends \chat\system\command\AbstractCommand {
public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER; public $enableSmilies = \chat\system\command\ICommand::SMILEY_USER;
public $user = null, $message = ''; public $user = null, $message = '';
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { public function __construct(\chat\system\command\CommandHandler $commandHandler) {
parent::__construct($commandHandler); parent::__construct($commandHandler);
$parameters = $commandHandler->getParameters(); $parameters = $commandHandler->getParameters();
@ -24,30 +24,30 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
$username = substr($parameters, 0, $comma); $username = substr($parameters, 0, $comma);
$this->message = substr($parameters, $comma + 1); $this->message = substr($parameters, $comma + 1);
} }
else throw new \wcf\system\chat\command\NotFoundException(); else throw new \chat\system\command\NotFoundException();
$this->user = User::getUserByUsername($username); $this->user = User::getUserByUsername($username);
if (!$this->user->userID) throw new \wcf\system\chat\command\UserNotFoundException($username); if (!$this->user->userID) throw new \chat\system\command\UserNotFoundException($username);
$this->didInit(); $this->didInit();
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getType() * @see \chat\system\command\ICommand::getType()
*/ */
public function getType() { public function getType() {
return \wcf\data\chat\message\ChatMessage::TYPE_WHISPER; return \wcf\data\chat\message\ChatMessage::TYPE_WHISPER;
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getMessage() * @see \chat\system\command\ICommand::getMessage()
*/ */
public function getMessage() { public function getMessage() {
return serialize(array('message' => $this->message, 'username' => $this->user->username)); return serialize(array('message' => $this->message, 'username' => $this->user->username));
} }
/** /**
* @see \wcf\system\chat\command\ICommand::getReceiver() * @see \chat\system\command\ICommand::getReceiver()
*/ */
public function getReceiver() { public function getReceiver() {
return $this->user->userID; return $this->user->userID;

View File

@ -290,11 +290,11 @@
} }
} }
.ajaxLoad { #toggleRooms .ajaxLoad {
background-position: right center; position: absolute;
background-repeat: no-repeat; right: 5px;
background-size: auto 100%; top: 3px;
background-image: url("../icon/spinner.svg"); display: none;
} }
#timsChatCopyright { #timsChatCopyright {

View File

@ -1,7 +1,7 @@
{include file='documentHeader'} {include file='documentHeader'}
<head> <head>
<title>{$room} - {lang}wcf.chat.title{/lang} - {PAGE_TITLE|language}</title> <title>{$room} - {lang}chat.general.title{/lang} - {PAGE_TITLE|language}</title>
{include file='headInclude' sandbox=false} {include file='headInclude' sandbox=false}
<style type="text/css"> <style type="text/css">
@ -18,26 +18,26 @@
} }
.timsChatMessage{$type|concat:'JOIN'|constant} { .timsChatMessage{$type|concat:'JOIN'|constant} {
background-image: url({icon}circleArrowRight{/icon}); {*background-image: url({icon}circleArrowRight{/icon});*}
} }
.timsChatMessage{$type|concat:'LEAVE'|constant} { .timsChatMessage{$type|concat:'LEAVE'|constant} {
background-image: url({icon}circleArrowLeft{/icon}); {*background-image: url({icon}circleArrowLeft{/icon});*}
} }
.timsChatMessage{$type|concat:'INFORMATION'|constant} { .timsChatMessage{$type|concat:'INFORMATION'|constant} {
background-image: url({icon}systemInfo{/icon}); {*background-image: url({icon}systemInfo{/icon});*}
} }
.timsChatMessage{$type|concat:'ERROR'|constant} { .timsChatMessage{$type|concat:'ERROR'|constant} {
background-image: url({icon}systemError{/icon}); {*background-image: url({icon}systemError{/icon});*}
} }
</style> </style>
</head> </head>
<body id="tpl{$templateName|ucfirst}"> <body id="tpl{$templateName|ucfirst}">
{capture assign='sidebar'}{include application='chat' file='chatSidebar'}{/capture} {capture assign='sidebar'}{include application='chat' file='sidebar'}{/capture}
{capture assign='headerNavigation'}{include application='chat' file='chatNavigationInclude'}{/capture} {capture assign='headerNavigation'}{include application='chat' file='navigationInclude'}{/capture}
{include file='header' sandbox=false sidebarOrientation='right'} {include file='header' sandbox=false sidebarOrientation='right'}
<div id="timsChatRoomContent"> <div id="timsChatRoomContent">
@ -45,13 +45,13 @@
<fieldset> <fieldset>
<div id="timsChatMessageContainer" class="timsChatMessageContainer container box shadow1"> <div id="timsChatMessageContainer" class="timsChatMessageContainer container box shadow1">
<ul> <ul>
<li class="error">{lang}wcf.chat.noJs{/lang}</li> <li class="error">{lang}chat.general.noJs{/lang}</li>
</ul> </ul>
</div> </div>
</fieldset> </fieldset>
<form id="timsChatForm" action="{link application='chat' controller='Chat' action='Send'}{/link}" method="post"> <form id="timsChatForm" action="{link application='chat' controller='Chat' action='Send'}{/link}" method="post">
<input id="timsChatInput" accesskey="w" type="text" class="inputText long" name="text" autocomplete="off" maxlength="{@CHAT_MAX_LENGTH}" disabled="disabled" required="required" placeholder="{lang}wcf.chat.submit.default{/lang}" /> <input id="timsChatInput" accesskey="w" type="text" class="inputText long" name="text" autocomplete="off" maxlength="{@CHAT_MAX_LENGTH}" disabled="disabled" required="required" placeholder="{lang}chat.general.submit.default{/lang}" />
</form> </form>
<div id="timsChatControls" class="marginTop"> <div id="timsChatControls" class="marginTop">
@ -87,40 +87,40 @@
<ul class="smallButtons"> <ul class="smallButtons">
<li> <li>
<a id="timsChatAutoscroll" accesskey="d" class="timsChatToggle jsTooltip button" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="1"> <a id="timsChatAutoscroll" accesskey="d" class="timsChatToggle jsTooltip button" title="{lang}wcf.global.button.disable{/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}enabled{/icon}" /> <span>{lang}wcf.chat.scroll{/lang}</span> <span class="icon icon16 icon-circle-blank"></span><span>{lang}chat.general.scroll{/lang}</span>
</a> </a>
</li> </li>
<li> <li>
<a id="timsChatFullscreen" accesskey="f" class="timsChatToggle jsTooltip button" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="0"> <a id="timsChatFullscreen" accesskey="f" class="timsChatToggle jsTooltip button" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="0">
<img alt="" src="{icon}disabled{/icon}" /> <span>{lang}wcf.chat.fullscreen{/lang}</span> <span class="icon icon16 icon-off"></span><span>{lang}chat.general.fullscreen{/lang}</span>
</a> </a>
</li> </li>
<li> <li>
<a id="timsChatNotify" accesskey="n" class="timsChatToggle jsTooltip button" 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="0"> <a id="timsChatNotify" accesskey="n" class="timsChatToggle jsTooltip button" 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="0">
<img alt="" src="{icon}disabled{/icon}" /> <span>{lang}wcf.chat.notify{/lang}</span> <span class="icon icon16 icon-off"></span><span>{lang}chat.general.notify{/lang}</span>
</a> </a>
</li> </li>
<li{if !MODULE_SMILEY} style="display: none;"{/if}> <li{if !MODULE_SMILEY} style="display: none;"{/if}>
<a id="timsChatSmilies" accesskey="e" class="timsChatToggle jsTooltip button" title="{lang}wcf.global.button.{if ENABLE_SMILIES_DEFAULT_VALUE}dis{else}en{/if}able{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="{@ENABLE_SMILIES_DEFAULT_VALUE}"> <a id="timsChatSmilies" accesskey="e" class="timsChatToggle jsTooltip button" title="{lang}wcf.global.button.{if ENABLE_SMILIES_DEFAULT_VALUE}dis{else}en{/if}able{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="{@ENABLE_SMILIES_DEFAULT_VALUE}">
<img alt="" src="{icon}{if ENABLE_SMILIES_DEFAULT_VALUE}en{else}dis{/if}abled{/icon}" /> <span>{lang}wcf.chat.smilies{/lang}</span> <span class="icon icon16 icon-{if ENABLE_SMILIES_DEFAULT_VALUE}circle-blank{else}off{/if}"></span><span>{lang}chat.general.smilies{/lang}</span>
</a> </a>
</li> </li>
<li> <li>
<a id="timsChatClear" class="jsTooltip button" title="{lang}wcf.chat.clear.description{/lang}"> <a id="timsChatClear" class="jsTooltip button" title="{lang}chat.general.clear.description{/lang}">
<img alt="" src="{icon}delete{/icon}" /> <span>{lang}wcf.chat.clear{/lang}</span> <span class="icon icon16 icon-remove"></span><span>{lang}chat.general.clear{/lang}</span>
</a> </a>
</li> </li>
<li> <li>
<a id="timsChatMark" class="jsTooltip button" title="{lang}wcf.chat.mark.description{/lang}"> <a id="timsChatMark" class="jsTooltip button" title="{lang}chat.general.mark.description{/lang}">
<img alt="" src="{icon}check{/icon}" /> <span>{lang}wcf.chat.mark{/lang}</span> <span class="icon icon16 icon-check"></span><span>{lang}chat.general.mark{/lang}</span>
</a> </a>
</li> </li>
</ul> </ul>
</nav> </nav>
</div> </div>
{include file='chatCopyright'} {include file='copyright'}
</div> </div>
{include file='chatJavascriptInclude'} {include file='javascriptInclude'}
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
var chat; var chat;
@ -129,28 +129,25 @@
$('.timsChatMessageContainer .error').remove(); $('.timsChatMessageContainer .error').remove();
WCF.Language.addObject({ WCF.Language.addObject({
'wcf.chat.query': '{lang}wcf.chat.query{/lang}', 'chat.general.query': '{lang}chat.general.query{/lang}',
'wcf.chat.kick': '{lang}wcf.chat.kick{/lang}', 'chat.general.kick': '{lang}chat.general.kick{/lang}',
'wcf.chat.ban': '{lang}wcf.chat.ban{/lang}', 'chat.general.ban': '{lang}chat.general.ban{/lang}',
'wcf.chat.profile': '{lang}wcf.chat.profile{/lang}', 'chat.general.profile': '{lang}chat.general.profile{/lang}',
'wcf.chat.notify.title': '{lang}wcf.chat.notify.title{/lang}' 'chat.general.notify.title': '{lang}chat.general.notify.title{/lang}'
});
WCF.Icon.addObject({
'be.bastelstu.wcf.chat.chat': '{icon}chat{/icon}'
}); });
{event name='shouldInit'} {event name='shouldInit'}
// Boot the chat // Boot the chat
WCF.TabMenu.init(); WCF.TabMenu.init();
new WCF.Message.Smilies();{* new WCF.Message.Smilies();{*
*}{capture assign='chatMessageTemplate'}{include application='chat' file='chatMessage'}{/capture} *}{capture assign='messageTemplate'}{include application='chat' file='message'}{/capture}
chat = new be.bastelstu.WCF.Chat({ chat = new be.bastelstu.Chat({
reloadTime: {@CHAT_RELOADTIME}, reloadTime: {@CHAT_RELOADTIME},
unloadURL: '{link controller="Chat" action="Leave"}{/link}', unloadURL: '{link controller="Chat" action="Leave"}{/link}',
messageURL: '{link controller="Chat" action="Message"}{/link}', messageURL: '{link controller="Chat" action="Message"}{/link}',
socketIOPath: '{@CHAT_SOCKET_IO_PATH|encodeJS}' socketIOPath: '{@CHAT_SOCKET_IO_PATH|encodeJS}'
}, (new WCF.Template('{ldelim}$title} - {'wcf.chat.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}')).compile(), (new WCF.Template('{@$chatMessageTemplate|encodeJS}')).compile()); }, (new WCF.Template('{ldelim}$title} - {'chat.general.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}')).compile(), (new WCF.Template('{@$messageTemplate|encodeJS}')).compile());
{event name='didInit'} {event name='didInit'}
// show the last X messages // show the last X messages

View File

@ -1,5 +0,0 @@
<li>
<a id="chatLogLink" title="{lang}wcf.chat.protocol{/lang}" class="jsTooltip">
<img src="{icon}eye{/icon}" alt="" /> <span>{lang}wcf.chat.protocol{/lang}</span>
</a>
</li>

View File

@ -1,7 +1,7 @@
{if $templateName == 'chat'}<address id="timsChatCopyright" class="copyright">{lang}wcf.chat.copyright{/lang}</address> {if $templateName == 'chat'}<address id="timsChatCopyright" class="copyright">{lang}chat.general.copyright{/lang}</address>
{elseif $templateName == 'chatCopyright'} {elseif $templateName == 'copyright'}
<dl> <dl>
<dt>{lang}wcf.chat.copyright.leader{/lang}</dt> <dt>{lang}chat.general.copyright.leader{/lang}</dt>
<dd> <dd>
<ul> <ul>
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li> <li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
@ -9,7 +9,7 @@
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt>{lang}wcf.chat.copyright.developer{/lang}</dt> <dt>{lang}chat.general.copyright.developer{/lang}</dt>
<dd> <dd>
<ul> <ul>
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li> <li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
@ -18,7 +18,7 @@
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt>{lang}wcf.chat.copyright.graphics{/lang}</dt> <dt>{lang}chat.general.copyright.graphics{/lang}</dt>
<dd> <dd>
<ul> <ul>
<li><a href="http://www.cls-design.com/">Tom</a></li> <li><a href="http://www.cls-design.com/">Tom</a></li>
@ -26,7 +26,7 @@
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt>{lang}wcf.chat.copyright.translation{/lang}</dt> <dt>{lang}chat.general.copyright.translation{/lang}</dt>
<dd> <dd>
<ul> <ul>
<li>Riccardo Vianello (it)</li> <li>Riccardo Vianello (it)</li>
@ -34,7 +34,7 @@
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt>{lang}wcf.chat.copyright.thanks{/lang}</dt> <dt>{lang}chat.general.copyright.thanks{/lang}</dt>
<dd> <dd>
<ul> <ul>
<li><a href="http://www.wbbaddons.de/user/2020-noone/">-noone-</a></li> <li><a href="http://www.wbbaddons.de/user/2020-noone/">-noone-</a></li>

View File

@ -1,5 +1,5 @@
<script type="text/javascript" src="{@$__wcf->getPath('chat')}js/be.bastelstu.WCF.Chat.js{if $chatVersion|isset}?version={$chatVersion|urlencode}{/if}"></script> <script type="text/javascript" src="{@$__wcf->getPath('chat')}js/be.bastelstu.Chat.js{if $chatVersion|isset}?version={$chatVersion|urlencode}{/if}"></script>
<script type="text/javascript" src="{@$__wcf->getPath('chat')}js/jCounter.jQuery.js"></script> <script type="text/javascript" src="{@$__wcf->getPath('chat')}js/jCounter.jQuery.js"></script>
{if CHAT_SOCKET_IO_PATH}<script type="text/javascript" src="{CHAT_SOCKET_IO_PATH}/socket.io/socket.io.js"></script>{/if} {if CHAT_SOCKET_IO_PATH}<script type="text/javascript" src="{CHAT_SOCKET_IO_PATH}/socket.io/socket.io.js"></script>{/if}
<script type="text/javascript" src="{@$__wcf->getPath('chat')}js/be.bastelstu.WCF.Chat.Log.js{if $chatVersion|isset}?version={$chatVersion|urlencode}{/if}"></script> <script type="text/javascript" src="{@$__wcf->getPath('chat')}js/be.bastelstu.Chat.Log.js{if $chatVersion|isset}?version={$chatVersion|urlencode}{/if}"></script>
{event name='javascript'} {event name='javascript'}

View File

@ -0,0 +1,5 @@
<li>
<a id="chatLogLink" title="{lang}chat.general.protocol{/lang}" class="jsTooltip">
<span class="icon icon16 icon-eye-open"></span><span>{lang}chat.general.protocol{/lang}</span>
</a>
</li>

View File

@ -1,8 +1,8 @@
<div id="sidebarContent" class="sidebarContent"> <div id="sidebarContent" class="sidebarContent">
<nav class="timsChatSidebarTabs"> <nav class="timsChatSidebarTabs">
<ul> <ul>
<li id="toggleUsers" class="active"><a title="{lang}wcf.chat.users{/lang}">{lang}wcf.chat.users{/lang} <span class="badge">0</span></a></li> <li id="toggleUsers" class="active"><a title="{lang}chat.general.users{/lang}">{lang}chat.general.users{/lang} <span class="badge">0</span></a></li>
<li id="toggleRooms"><a title="{lang}wcf.chat.rooms{/lang}" data-refresh-url="{link application='chat' controller="Chat" action="RefreshRoomList"}{/link}">{lang}wcf.chat.rooms{/lang} <span class="badge">{#$rooms|count}</span></a></li> <li id="toggleRooms"><a title="{lang}chat.general.rooms{/lang}" data-refresh-url="{link application='chat' controller="Chat" action="RefreshRoomList"}{/link}">{lang}chat.general.rooms{/lang} <span class="badge">{#$rooms|count}</span><span class="ajaxLoad icon icon32 icon-spinner"></span></a></li>
</ul> </ul>
</nav> </nav>
@ -20,7 +20,7 @@
{/if} {/if}
{/foreach} {/foreach}
</ul> </ul>
<div><button type="button">{lang}wcf.chat.forceRefresh{/lang}</button></div> <div><button type="button">{lang}chat.general.forceRefresh{/lang}</button></div>
</div> </div>
</nav> </nav>
</div> </div>