From 063a56bcb6db5a9a1c844c65578740a9fb7373db Mon Sep 17 00:00:00 2001 From: max-m Date: Sat, 26 Jan 2013 22:46:54 +0100 Subject: [PATCH] Various fixes (forgot to commit at different stages :P) --- ...og.coffee => be.bastelstu.Chat.Log.coffee} | 4 +- ...F.Chat.coffee => be.bastelstu.Chat.coffee} | 28 +++++---- file/lib/data/CHATDatabaseObject.class.php | 11 ++++ file/lib/data/message/Message.class.php | 2 +- file/lib/data/message/MessageList.class.php | 22 +++---- file/lib/data/room/Room.class.php | 2 +- file/lib/data/room/RoomAction.class.php | 2 +- file/lib/data/suspension/Suspension.class.php | 2 +- file/lib/form/ChatForm.class.php | 8 +-- file/lib/page/ChatMessagePage.class.php | 2 +- file/lib/page/ChatPage.class.php | 2 +- ...{ChatCore.class.php => CHATCore.class.php} | 0 .../cache/builder/RoomCacheBuilder.class.php | 2 +- .../command/AbstractCommand.class.php | 22 +++---- .../AbstractRestrictedCommand.class.php | 4 +- .../command/CommandHandler.class.php | 4 +- .../{chat => }/command/ICommand.class.php | 2 +- .../command/IRestrictedCommand.class.php | 2 +- .../command/NotFoundException.class.php | 2 +- .../command/UserNotFoundException.class.php | 2 +- .../command/commands/AwayCommand.class.php | 12 ++-- .../command/commands/BanCommand.class.php | 2 +- .../command/commands/ColorCommand.class.php | 14 ++--- .../command/commands/FreeCommand.class.php | 8 +-- .../command/commands/InfoCommand.class.php | 14 ++--- .../command/commands/MeCommand.class.php | 12 ++-- .../command/commands/MuteCommand.class.php | 22 +++---- .../command/commands/PlainCommand.class.php | 12 ++-- .../command/commands/RestoreCommand.class.php | 16 +++--- .../commands/TemproomCommand.class.php | 14 ++--- .../command/commands/WhereCommand.class.php | 10 ++-- .../command/commands/WhisperCommand.class.php | 18 +++--- file/style/be.bastelstu.wcf.chat.less | 10 ++-- template/chat.tpl | 57 +++++++++---------- template/chatNavigationInclude.tpl | 5 -- template/{chatCopyright.tpl => copyright.tpl} | 14 ++--- ...criptInclude.tpl => javascriptInclude.tpl} | 4 +- template/{chatLog.tpl => log.tpl} | 0 template/{chatMessage.tpl => message.tpl} | 0 template/navigationInclude.tpl | 5 ++ template/{chatSidebar.tpl => sidebar.tpl} | 6 +- 41 files changed, 193 insertions(+), 187 deletions(-) rename file/js/{be.bastelstu.WCF.Chat.Log.coffee => be.bastelstu.Chat.Log.coffee} (91%) rename file/js/{be.bastelstu.WCF.Chat.coffee => be.bastelstu.Chat.coffee} (94%) create mode 100644 file/lib/data/CHATDatabaseObject.class.php rename file/lib/system/{ChatCore.class.php => CHATCore.class.php} (100%) rename file/lib/system/{chat => }/command/AbstractCommand.class.php (68%) rename file/lib/system/{chat => }/command/AbstractRestrictedCommand.class.php (89%) rename file/lib/system/{chat => }/command/CommandHandler.class.php (92%) rename file/lib/system/{chat => }/command/ICommand.class.php (96%) rename file/lib/system/{chat => }/command/IRestrictedCommand.class.php (94%) rename file/lib/system/{chat => }/command/NotFoundException.class.php (91%) rename file/lib/system/{chat => }/command/UserNotFoundException.class.php (94%) rename file/lib/system/{chat => }/command/commands/AwayCommand.class.php (68%) rename file/lib/system/{chat => }/command/commands/BanCommand.class.php (96%) rename file/lib/system/{chat => }/command/commands/ColorCommand.class.php (80%) rename file/lib/system/{chat => }/command/commands/FreeCommand.class.php (71%) rename file/lib/system/{chat => }/command/commands/InfoCommand.class.php (83%) rename file/lib/system/{chat => }/command/commands/MeCommand.class.php (62%) rename file/lib/system/{chat => }/command/commands/MuteCommand.class.php (76%) rename file/lib/system/{chat => }/command/commands/PlainCommand.class.php (63%) rename file/lib/system/{chat => }/command/commands/RestoreCommand.class.php (62%) rename file/lib/system/{chat => }/command/commands/TemproomCommand.class.php (83%) rename file/lib/system/{chat => }/command/commands/WhereCommand.class.php (78%) rename file/lib/system/{chat => }/command/commands/WhisperCommand.class.php (62%) delete mode 100644 template/chatNavigationInclude.tpl rename template/{chatCopyright.tpl => copyright.tpl} (72%) rename template/{chatJavascriptInclude.tpl => javascriptInclude.tpl} (70%) rename template/{chatLog.tpl => log.tpl} (100%) rename template/{chatMessage.tpl => message.tpl} (100%) create mode 100644 template/navigationInclude.tpl rename template/{chatSidebar.tpl => sidebar.tpl} (54%) diff --git a/file/js/be.bastelstu.WCF.Chat.Log.coffee b/file/js/be.bastelstu.Chat.Log.coffee similarity index 91% rename from file/js/be.bastelstu.WCF.Chat.Log.coffee rename to file/js/be.bastelstu.Chat.Log.coffee index 13d77e6..b3bc858 100644 --- a/file/js/be.bastelstu.WCF.Chat.Log.coffee +++ b/file/js/be.bastelstu.Chat.Log.coffee @@ -8,7 +8,7 @@ ### (($, window) -> - be.bastelstu.WCF.Chat.Log = be.bastelstu.Chat.extend + be.bastelstu.Chat.Log = be.bastelstu.Chat.extend init: (@chat) -> handleMessages: (messages) -> # Insert the messages @@ -23,7 +23,7 @@ li.appendTo $ '#timsChatLog .timsChatMessageContainer > ul' - be.bastelstu.WCF.Chat.Log.loadOverlay = () -> + be.bastelstu.Chat.Log.loadOverlay = () -> if !$.wcfIsset 'timsChatLogDialog' container = $ '
' $('#content').append container diff --git a/file/js/be.bastelstu.WCF.Chat.coffee b/file/js/be.bastelstu.Chat.coffee similarity index 94% rename from file/js/be.bastelstu.WCF.Chat.coffee rename to file/js/be.bastelstu.Chat.coffee index b5c1023..17f8018 100644 --- a/file/js/be.bastelstu.WCF.Chat.coffee +++ b/file/js/be.bastelstu.Chat.coffee @@ -188,14 +188,14 @@ window.console ?= # Toggle Buttons $('.timsChatToggle').click (event) -> element = $ @ - icon = element.find 'img' + icon = element.find 'span.icon' if element.data('status') is 1 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' else 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' $('#timsChatInput').focus() @@ -235,7 +235,7 @@ window.console ?= type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> @loading = false - target.parent().removeClass 'ajaxLoad' + target.parent().removeClass 'loading' # Mark as active $('.activeMenuItem .timsChatRoom').parent().removeClass 'activeMenuItem' @@ -260,10 +260,10 @@ window.console ?= # inclusive the error-message :) window.location.reload true 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 - target.parent().addClass 'ajaxLoad' + target.parent().addClass 'loading' , @) ### # Frees the fish @@ -412,11 +412,11 @@ window.console ?= menu = $ '' #menu.addClass 'timsChatUserMenu' menu.addClass 'dropdownMenu' - menu.append $ '
  • ' + WCF.Language.get('chat.query') + '
  • ' - menu.append $ '
  • ' + WCF.Language.get('chat.kick') + '
  • ' - menu.append $ '
  • ' + WCF.Language.get('chat.ban') + '
  • ' + menu.append $ '
  • ' + WCF.Language.get('chat.general.query') + '
  • ' + menu.append $ '
  • ' + WCF.Language.get('chat.general.kick') + '
  • ' + menu.append $ '
  • ' + WCF.Language.get('chat.general.ban') + '
  • ' # TODO: SID and co - menu.append $ '
  • ' + WCF.Language.get('wcf.chat.profile') + '
  • ' + menu.append $ '
  • ' + WCF.Language.get('chat.general.profile') + '
  • ' @events.userMenu.fire user, menu li.append menu @@ -485,7 +485,7 @@ window.console ?= # Desktop Notifications if typeof window.webkitNotifications isnt 'undefined' 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' content = message.username + message.separator + (if message.separator is ' ' then '' else ' ') + message.message notification = window.webkitNotifications.createNotification icon, title, content @@ -500,14 +500,14 @@ window.console ?= ### refreshRoomList: () -> console.log 'Refreshing the roomlist' - $('#toggleRooms a').addClass 'ajaxLoad' + $('#toggleRooms .ajaxLoad').show() $.ajax $('#toggleRooms a').data('refreshUrl'), dataType: 'json' type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> $('#timsChatRoomList li').remove() - $('#toggleRooms a').removeClass 'ajaxLoad' + $('#toggleRooms .ajaxLoad').hide() $('#toggleRooms .badge').text data.length for room in data @@ -549,12 +549,10 @@ window.console ?= smilies: $('#timsChatSmilies').data 'status' type: 'POST', beforeSend: (jqXHR) -> - $('#timsChatInput').addClass 'ajaxLoad' success: $.proxy((data, textStatus, jqXHR) -> @getMessages() , @) complete: () -> - $('#timsChatInput').removeClass 'ajaxLoad' ### # Toggles between user- and room-list. # diff --git a/file/lib/data/CHATDatabaseObject.class.php b/file/lib/data/CHATDatabaseObject.class.php new file mode 100644 index 0000000..ea369fd --- /dev/null +++ b/file/lib/data/CHATDatabaseObject.class.php @@ -0,0 +1,11 @@ +sqlOrderBy = "chat_message.messageID DESC"; + $messageList->sqlOrderBy = "message.messageID DESC"; $messageList->sqlLimit = $number; $messageList->getConditionBuilder()->add(' (( - chat_message.receiver IS NULL - AND chat_message.roomID = ? + message.receiver IS NULL + AND message.roomID = ? ) - OR chat_message.receiver = ? - OR chat_message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID)); + OR message.receiver = ? + OR message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID)); $messageList->readObjects(); 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) { $messageList = new static(); - $messageList->sqlOrderBy = "chat_message.messageID ASC"; - $messageList->getConditionBuilder()->add('chat_message.messageID > ?', array($since)); + $messageList->sqlOrderBy = "message.messageID ASC"; + $messageList->getConditionBuilder()->add('message.messageID > ?', array($since)); $messageList->getConditionBuilder()->add(' (( - chat_message.receiver IS NULL - AND chat_message.roomID = ? + message.receiver IS NULL + AND message.roomID = ? ) - OR chat_message.receiver = ? - OR chat_message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID)); + OR message.receiver = ? + OR message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID)); $messageList->readObjects(); return $messageList->getObjects(); diff --git a/file/lib/data/room/Room.class.php b/file/lib/data/room/Room.class.php index 91ff38f..ed864c6 100644 --- a/file/lib/data/room/Room.class.php +++ b/file/lib/data/room/Room.class.php @@ -13,7 +13,7 @@ * @package be.bastelstu.chat * @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 */ diff --git a/file/lib/data/room/RoomAction.class.php b/file/lib/data/room/RoomAction.class.php index 764dddf..98b997e 100644 --- a/file/lib/data/room/RoomAction.class.php +++ b/file/lib/data/room/RoomAction.class.php @@ -101,7 +101,7 @@ public function validateUpdatePosition() { */ public function updatePosition() { $roomList = new RoomList(); - $roomList->sqlOrderBy = "chat_room.position"; + $roomList->sqlOrderBy = "room.position"; $roomList->readObjects(); $i = $this->parameters['data']['offset']; diff --git a/file/lib/data/suspension/Suspension.class.php b/file/lib/data/suspension/Suspension.class.php index 6f959d2..2f2d140 100644 --- a/file/lib/data/suspension/Suspension.class.php +++ b/file/lib/data/suspension/Suspension.class.php @@ -11,7 +11,7 @@ * @package be.bastelstu.chat * @subpackage data.suspension */ -class Suspension extends \wcf\data\DatabaseObject { +class Suspension extends \chat\data\CHATDatabaseObject { /** * @see \wcf\data\DatabaseObject::$databaseTableName */ diff --git a/file/lib/form/ChatForm.class.php b/file/lib/form/ChatForm.class.php index d5c8f87..634462b 100644 --- a/file/lib/form/ChatForm.class.php +++ b/file/lib/form/ChatForm.class.php @@ -14,7 +14,7 @@ * @package be.bastelstu.chat * @subpackage form */ -class ChatForm extends AbstractForm { +class ChatForm extends \wcf\form\AbstractForm { /** * Should HTML be enabled for this message. * @@ -143,7 +143,7 @@ public function save() { parent::save(); \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()) { try { $command = $commandHandler->loadCommand(); @@ -156,12 +156,12 @@ public function save() { $this->message = $command->getMessage(); $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'); $type = data\message\Message::TYPE_ERROR; $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())); $type = data\message\Message::TYPE_ERROR; $receiver = WCF::getUser()->userID; diff --git a/file/lib/page/ChatMessagePage.class.php b/file/lib/page/ChatMessagePage.class.php index f35c00c..98acf95 100644 --- a/file/lib/page/ChatMessagePage.class.php +++ b/file/lib/page/ChatMessagePage.class.php @@ -118,7 +118,7 @@ public function readMessages() { $sql = "SELECT MAX(messageID) FROM - wcf".WCF_N."_chat_message"; + chat".WCF_N."_message"; $stmt = WCF::getDB()->prepareStatement($sql); $stmt->execute(); diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index 3176695..1fdde3c 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -141,7 +141,7 @@ public function readData() { 'sender' => WCF::getUser()->userID, 'username' => WCF::getUser()->username, '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()))), 'color1' => $this->userData['color'][1], 'color2' => $this->userData['color'][2] diff --git a/file/lib/system/ChatCore.class.php b/file/lib/system/CHATCore.class.php similarity index 100% rename from file/lib/system/ChatCore.class.php rename to file/lib/system/CHATCore.class.php diff --git a/file/lib/system/cache/builder/RoomCacheBuilder.class.php b/file/lib/system/cache/builder/RoomCacheBuilder.class.php index ddb4f71..47f7f3d 100644 --- a/file/lib/system/cache/builder/RoomCacheBuilder.class.php +++ b/file/lib/system/cache/builder/RoomCacheBuilder.class.php @@ -17,7 +17,7 @@ class RoomCacheBuilder implements \wcf\system\cache\builder\ICacheBuilder { public function getData(array $cacheResource) { // get all chat rooms $roomList = new \chat\data\room\RoomList(); - $roomList->sqlOrderBy = "chat_room.position"; + $roomList->sqlOrderBy = "room.position"; $roomList->readObjects(); return $roomList->getObjects(); diff --git a/file/lib/system/chat/command/AbstractCommand.class.php b/file/lib/system/command/AbstractCommand.class.php similarity index 68% rename from file/lib/system/chat/command/AbstractCommand.class.php rename to file/lib/system/command/AbstractCommand.class.php index 37c9074..940fa25 100644 --- a/file/lib/system/chat/command/AbstractCommand.class.php +++ b/file/lib/system/command/AbstractCommand.class.php @@ -1,5 +1,5 @@ fireAction($this, 'checkPermission'); diff --git a/file/lib/system/chat/command/CommandHandler.class.php b/file/lib/system/command/CommandHandler.class.php similarity index 92% rename from file/lib/system/chat/command/CommandHandler.class.php rename to file/lib/system/command/CommandHandler.class.php index b7e2a78..baa92bc 100644 --- a/file/lib/system/chat/command/CommandHandler.class.php +++ b/file/lib/system/command/CommandHandler.class.php @@ -1,5 +1,5 @@ $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() { return \wcf\data\chat\message\ChatMessage::TYPE_AWAY; } /** - * @see \wcf\system\chat\command\ICommand::getMessage() + * @see \chat\system\command\ICommand::getMessage() */ public function getMessage() { return serialize(array('message' => $this->commandHandler->getParameters())); } /** - * @see \wcf\system\chat\command\ICommand::getReceiver() + * @see \chat\system\command\ICommand::getReceiver() */ public function getReceiver() { return \wcf\system\WCF::getUser()->userID; diff --git a/file/lib/system/chat/command/commands/BanCommand.class.php b/file/lib/system/command/commands/BanCommand.class.php similarity index 96% rename from file/lib/system/chat/command/commands/BanCommand.class.php rename to file/lib/system/command/commands/BanCommand.class.php index 37e2e12..ed204fc 100644 --- a/file/lib/system/chat/command/commands/BanCommand.class.php +++ b/file/lib/system/command/commands/BanCommand.class.php @@ -1,5 +1,5 @@ 0xFF0000, 'blue' => 0x0000FF, @@ -36,7 +36,7 @@ class ColorCommand extends \wcf\system\chat\command\AbstractCommand { '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); try { 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) { if (isset(self::$colors[$val])) $color[$key] = self::$colors[$val]; 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(); $val = $matches[1]; 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() { return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; } /** - * @see \wcf\system\chat\command\ICommand::getMessage() + * @see \chat\system\command\ICommand::getMessage() */ public function getMessage() { return 'color changed'; } /** - * @see \wcf\system\chat\command\ICommand::getReceiver() + * @see \chat\system\command\ICommand::getReceiver() */ public function getReceiver() { return \wcf\system\WCF::getUser()->userID; diff --git a/file/lib/system/chat/command/commands/FreeCommand.class.php b/file/lib/system/command/commands/FreeCommand.class.php similarity index 71% rename from file/lib/system/chat/command/commands/FreeCommand.class.php rename to file/lib/system/command/commands/FreeCommand.class.php index 884c65f..833473f 100644 --- a/file/lib/system/chat/command/commands/FreeCommand.class.php +++ b/file/lib/system/command/commands/FreeCommand.class.php @@ -1,5 +1,5 @@ commandHandler->getParameters()) != 'the fish') { - throw new \wcf\system\chat\command\NotFoundException(); + throw new \chat\system\command\NotFoundException(); } $this->didInit(); } /** - * @see \wcf\system\chat\command\ICommand::getMessage() + * @see \chat\system\command\ICommand::getMessage() */ public function getMessage() { return 'freed the fish. OH A NOEZ'; diff --git a/file/lib/system/chat/command/commands/InfoCommand.class.php b/file/lib/system/command/commands/InfoCommand.class.php similarity index 83% rename from file/lib/system/chat/command/commands/InfoCommand.class.php rename to file/lib/system/command/commands/InfoCommand.class.php index 872364a..c1e0066 100644 --- a/file/lib/system/chat/command/commands/InfoCommand.class.php +++ b/file/lib/system/command/commands/InfoCommand.class.php @@ -1,5 +1,5 @@ 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 $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() { return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; } /** - * @see \wcf\system\chat\command\ICommand::getMessage() + * @see \chat\system\command\ICommand::getMessage() */ public function getMessage() { $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() { return \wcf\system\WCF::getUser()->userID; diff --git a/file/lib/system/chat/command/commands/MeCommand.class.php b/file/lib/system/command/commands/MeCommand.class.php similarity index 62% rename from file/lib/system/chat/command/commands/MeCommand.class.php rename to file/lib/system/command/commands/MeCommand.class.php index 586181b..bfab7cb 100644 --- a/file/lib/system/chat/command/commands/MeCommand.class.php +++ b/file/lib/system/command/commands/MeCommand.class.php @@ -1,5 +1,5 @@ didInit(); } /** - * @see \wcf\system\chat\command\ICommand::getType() + * @see \chat\system\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_ME; } /** - * @see \wcf\system\chat\command\ICommand::getMessage() + * @see \chat\system\command\ICommand::getMessage() */ public function getMessage() { return $this->commandHandler->getParameters(); diff --git a/file/lib/system/chat/command/commands/MuteCommand.class.php b/file/lib/system/command/commands/MuteCommand.class.php similarity index 76% rename from file/lib/system/chat/command/commands/MuteCommand.class.php rename to file/lib/system/command/commands/MuteCommand.class.php index 3201961..65c301f 100644 --- a/file/lib/system/chat/command/commands/MuteCommand.class.php +++ b/file/lib/system/command/commands/MuteCommand.class.php @@ -1,5 +1,5 @@ getParameters(); @@ -31,11 +31,11 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand $this->time = ChatUtil::timeModifier(substr($parameters, $comma + 1)); } else { - throw new \wcf\system\chat\command\NotFoundException(); + throw new \chat\system\command\NotFoundException(); } $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); $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() { parent::checkPermission(); $this->room = \wcf\system\request\RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->request->room; $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() { 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() { 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() { if ($this->fail) return WCF::getLanguage()->get('wcf.chat.suspension.exists'); @@ -107,7 +107,7 @@ public function getMessage() { return serialize(array( 'link' => $this->link, '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))) )); } } diff --git a/file/lib/system/chat/command/commands/PlainCommand.class.php b/file/lib/system/command/commands/PlainCommand.class.php similarity index 63% rename from file/lib/system/chat/command/commands/PlainCommand.class.php rename to file/lib/system/command/commands/PlainCommand.class.php index 03974ff..bda4ed3 100644 --- a/file/lib/system/chat/command/commands/PlainCommand.class.php +++ b/file/lib/system/command/commands/PlainCommand.class.php @@ -1,5 +1,5 @@ commandHandler->getText(), 1); } /** - * @see \wcf\system\chat\command\ICommand::getReceiver() + * @see \chat\system\command\ICommand::getReceiver() */ public function getReceiver() { return null; diff --git a/file/lib/system/chat/command/commands/RestoreCommand.class.php b/file/lib/system/command/commands/RestoreCommand.class.php similarity index 62% rename from file/lib/system/chat/command/commands/RestoreCommand.class.php rename to file/lib/system/command/commands/RestoreCommand.class.php index 6598b77..b9a9246 100644 --- a/file/lib/system/chat/command/commands/RestoreCommand.class.php +++ b/file/lib/system/command/commands/RestoreCommand.class.php @@ -1,5 +1,5 @@ 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 = ''; @@ -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() { 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() { return \wcf\data\chat\message\ChatMessage::TYPE_MODERATE; } /** - * @see \wcf\system\chat\command\ICommand::getMessage() + * @see \chat\system\command\ICommand::getMessage() */ public function getMessage() { return serialize(array( '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))) )); } } diff --git a/file/lib/system/chat/command/commands/TemproomCommand.class.php b/file/lib/system/command/commands/TemproomCommand.class.php similarity index 83% rename from file/lib/system/chat/command/commands/TemproomCommand.class.php rename to file/lib/system/command/commands/TemproomCommand.class.php index 1047fa6..4b8e192 100644 --- a/file/lib/system/chat/command/commands/TemproomCommand.class.php +++ b/file/lib/system/command/commands/TemproomCommand.class.php @@ -1,5 +1,5 @@ roomName; } /** - * @see \wcf\system\chat\command\ICommand::getReceiver() + * @see \chat\system\command\ICommand::getReceiver() */ public function getReceiver() { return \wcf\system\WCF::getUser()->userID; diff --git a/file/lib/system/chat/command/commands/WhereCommand.class.php b/file/lib/system/command/commands/WhereCommand.class.php similarity index 78% rename from file/lib/system/chat/command/commands/WhereCommand.class.php rename to file/lib/system/command/commands/WhereCommand.class.php index 439cbd7..de3fc4a 100644 --- a/file/lib/system/chat/command/commands/WhereCommand.class.php +++ b/file/lib/system/command/commands/WhereCommand.class.php @@ -1,5 +1,5 @@ userID; diff --git a/file/lib/system/chat/command/commands/WhisperCommand.class.php b/file/lib/system/command/commands/WhisperCommand.class.php similarity index 62% rename from file/lib/system/chat/command/commands/WhisperCommand.class.php rename to file/lib/system/command/commands/WhisperCommand.class.php index 4d3ad8f..07120b3 100644 --- a/file/lib/system/chat/command/commands/WhisperCommand.class.php +++ b/file/lib/system/command/commands/WhisperCommand.class.php @@ -1,5 +1,5 @@ getParameters(); @@ -24,30 +24,30 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand $username = substr($parameters, 0, $comma); $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); - 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(); } /** - * @see \wcf\system\chat\command\ICommand::getType() + * @see \chat\system\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_WHISPER; } /** - * @see \wcf\system\chat\command\ICommand::getMessage() + * @see \chat\system\command\ICommand::getMessage() */ public function getMessage() { 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() { return $this->user->userID; diff --git a/file/style/be.bastelstu.wcf.chat.less b/file/style/be.bastelstu.wcf.chat.less index 3d608d1..00e7efe 100644 --- a/file/style/be.bastelstu.wcf.chat.less +++ b/file/style/be.bastelstu.wcf.chat.less @@ -290,11 +290,11 @@ } } - .ajaxLoad { - background-position: right center; - background-repeat: no-repeat; - background-size: auto 100%; - background-image: url("../icon/spinner.svg"); + #toggleRooms .ajaxLoad { + position: absolute; + right: 5px; + top: 3px; + display: none; } #timsChatCopyright { diff --git a/template/chat.tpl b/template/chat.tpl index 7c3303b..682e12e 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -1,7 +1,7 @@ {include file='documentHeader'} - {$room} - {lang}wcf.chat.title{/lang} - {PAGE_TITLE|language} + {$room} - {lang}chat.general.title{/lang} - {PAGE_TITLE|language} {include file='headInclude' sandbox=false} -{capture assign='sidebar'}{include application='chat' file='chatSidebar'}{/capture} -{capture assign='headerNavigation'}{include application='chat' file='chatNavigationInclude'}{/capture} +{capture assign='sidebar'}{include application='chat' file='sidebar'}{/capture} +{capture assign='headerNavigation'}{include application='chat' file='navigationInclude'}{/capture} {include file='header' sandbox=false sidebarOrientation='right'} -{include file='chatJavascriptInclude'} +{include file='javascriptInclude'} + {if CHAT_SOCKET_IO_PATH}{/if} - + {event name='javascript'} \ No newline at end of file diff --git a/template/chatLog.tpl b/template/log.tpl similarity index 100% rename from template/chatLog.tpl rename to template/log.tpl diff --git a/template/chatMessage.tpl b/template/message.tpl similarity index 100% rename from template/chatMessage.tpl rename to template/message.tpl diff --git a/template/navigationInclude.tpl b/template/navigationInclude.tpl new file mode 100644 index 0000000..52e1f28 --- /dev/null +++ b/template/navigationInclude.tpl @@ -0,0 +1,5 @@ +
  • + + {lang}chat.general.protocol{/lang} + +
  • diff --git a/template/chatSidebar.tpl b/template/sidebar.tpl similarity index 54% rename from template/chatSidebar.tpl rename to template/sidebar.tpl index 802bde4..8c798ff 100644 --- a/template/chatSidebar.tpl +++ b/template/sidebar.tpl @@ -1,8 +1,8 @@
    @@ -20,7 +20,7 @@ {/if} {/foreach} -
    +