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:
parent
0241bb50c9
commit
063a56bcb6
@ -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 = $ '<fieldset id="timsChatLogDialog"></fieldset>'
|
||||
$('#content').append container
|
@ -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 = $ '<ul></ul>'
|
||||
#menu.addClass 'timsChatUserMenu'
|
||||
menu.addClass 'dropdownMenu'
|
||||
menu.append $ '<li><a>' + WCF.Language.get('chat.query') + '</a></li>'
|
||||
menu.append $ '<li><a>' + WCF.Language.get('chat.kick') + '</a></li>'
|
||||
menu.append $ '<li><a>' + WCF.Language.get('chat.ban') + '</a></li>'
|
||||
menu.append $ '<li><a>' + WCF.Language.get('chat.general.query') + '</a></li>'
|
||||
menu.append $ '<li><a>' + WCF.Language.get('chat.general.kick') + '</a></li>'
|
||||
menu.append $ '<li><a>' + WCF.Language.get('chat.general.ban') + '</a></li>'
|
||||
# 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
|
||||
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.
|
||||
#
|
11
file/lib/data/CHATDatabaseObject.class.php
Normal file
11
file/lib/data/CHATDatabaseObject.class.php
Normal 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;
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage data.message
|
||||
*/
|
||||
class Message extends \wcf\data\DatabaseObject {
|
||||
class Message extends \chat\data\CHATDatabaseObject {
|
||||
/**
|
||||
* @see \wcf\data\DatabaseObject::$databaseTableName
|
||||
*/
|
||||
|
@ -25,15 +25,15 @@ class MessageList extends \wcf\data\DatabaseObjectList {
|
||||
*/
|
||||
public static function getNewestMessages(\chat\data\room\Room $room, $number = CHAT_LASTMESSAGES) {
|
||||
$messageList = new static();
|
||||
$messageList->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();
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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'];
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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]
|
||||
|
@ -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();
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command;
|
||||
namespace chat\system\command;
|
||||
use \wcf\system\event\EventHandler;
|
||||
|
||||
/**
|
||||
@ -15,7 +15,7 @@ abstract class AbstractCommand implements ICommand {
|
||||
/**
|
||||
* Instance of the CommandHandler
|
||||
*
|
||||
* @var \wcf\system\chat\command\CommandHandler
|
||||
* @var \chat\system\command\CommandHandler
|
||||
*/
|
||||
public $commandHandler = null;
|
||||
|
||||
@ -23,8 +23,8 @@ abstract class AbstractCommand implements ICommand {
|
||||
* Should HTML be enabled?
|
||||
*
|
||||
* @var integer
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_OFF
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_ON
|
||||
* @see \chat\system\command\ICommand::SETTING_OFF
|
||||
* @see \chat\system\command\ICommand::SETTING_ON
|
||||
*/
|
||||
public $enableHTML = ICommand::SETTING_OFF;
|
||||
|
||||
@ -32,9 +32,9 @@ abstract class AbstractCommand implements ICommand {
|
||||
* Should BBCodes be enabled?
|
||||
*
|
||||
* @var integer
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_OFF
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_ON
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_USER
|
||||
* @see \chat\system\command\ICommand::SETTING_OFF
|
||||
* @see \chat\system\command\ICommand::SETTING_ON
|
||||
* @see \chat\system\command\ICommand::SETTING_USER
|
||||
*/
|
||||
public $enableBBCodes = ICommand::SETTING_OFF;
|
||||
|
||||
@ -42,9 +42,9 @@ abstract class AbstractCommand implements ICommand {
|
||||
* Should smilies be enabled?
|
||||
*
|
||||
* @var integer
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_OFF
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_ON
|
||||
* @see \wcf\system\chat\command\ICommand::SETTING_USER
|
||||
* @see \chat\system\command\ICommand::SETTING_OFF
|
||||
* @see \chat\system\command\ICommand::SETTING_ON
|
||||
* @see \chat\system\command\ICommand::SETTING_USER
|
||||
*/
|
||||
public $enableSmilies = ICommand::SETTING_OFF;
|
||||
|
||||
@ -64,7 +64,7 @@ public function didInit() {
|
||||
/**
|
||||
* Default-Receiver: Everyone
|
||||
*
|
||||
* @see \wcf\system\chat\command\ICommand::getReceiver()
|
||||
* @see \chat\system\command\ICommand::getReceiver()
|
||||
*/
|
||||
public function getReceiver() {
|
||||
return null;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command;
|
||||
namespace chat\system\command;
|
||||
use \wcf\system\event\EventHandler;
|
||||
|
||||
/**
|
||||
@ -21,7 +21,7 @@ public function __construct(CommandHandler $commandHandler) {
|
||||
/**
|
||||
* Fires checkPermission event.
|
||||
*
|
||||
* @see \wcf\system\chat\command\IRestrictedCommand
|
||||
* @see \chat\system\command\IRestrictedCommand
|
||||
*/
|
||||
public function checkPermission() {
|
||||
EventHandler::getInstance()->fireAction($this, 'checkPermission');
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command;
|
||||
namespace chat\system\command;
|
||||
use \wcf\util\StringUtil;
|
||||
|
||||
/**
|
||||
@ -73,7 +73,7 @@ public function loadCommand() {
|
||||
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)) {
|
||||
throw new NotFoundException();
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command;
|
||||
namespace chat\system\command;
|
||||
|
||||
/**
|
||||
* Interface for chat-commands.
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command;
|
||||
namespace chat\system\command;
|
||||
|
||||
/**
|
||||
* Interface for Restricted commands.
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command;
|
||||
namespace chat\system\command;
|
||||
|
||||
/**
|
||||
* Thrown when a command is not found.
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command;
|
||||
namespace chat\system\command;
|
||||
|
||||
/**
|
||||
* Thrown when a user is not found.
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\util\StringUtil;
|
||||
|
||||
/**
|
||||
@ -11,8 +11,8 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class AwayCommand extends \wcf\system\chat\command\AbstractCommand {
|
||||
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) {
|
||||
class AwayCommand extends \chat\system\command\AbstractCommand {
|
||||
public function __construct(\chat\system\command\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
\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() {
|
||||
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;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\data\chat\suspension;
|
||||
use \wcf\data\user\User;
|
||||
use \wcf\system\WCF;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\util\StringUtil;
|
||||
|
||||
/**
|
||||
@ -11,7 +11,7 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class ColorCommand extends \wcf\system\chat\command\AbstractCommand {
|
||||
class ColorCommand extends \chat\system\command\AbstractCommand {
|
||||
public static $colors = array(
|
||||
'red' => 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;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
|
||||
/**
|
||||
* Informs everyone that the fish was freed. OH A NOEZ.
|
||||
@ -11,18 +11,18 @@
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class FreeCommand extends MeCommand {
|
||||
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) {
|
||||
public function __construct(\chat\system\command\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\system\chat\command\ICommand::getMessage()
|
||||
* @see \chat\system\command\ICommand::getMessage()
|
||||
*/
|
||||
public function getMessage() {
|
||||
return 'freed the fish. OH A NOEZ';
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\data\user\User;
|
||||
use \wcf\system\WCF;
|
||||
use \wcf\util\ChatUtil;
|
||||
@ -14,17 +14,17 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @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 $enableHTML = self::SETTING_ON;
|
||||
public $lines = array();
|
||||
public $user = null;
|
||||
|
||||
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) {
|
||||
public function __construct(\chat\system\command\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
$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
|
||||
$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;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\util\StringUtil;
|
||||
|
||||
/**
|
||||
@ -11,24 +11,24 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class MeCommand extends \wcf\system\chat\command\AbstractCommand {
|
||||
public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER;
|
||||
class MeCommand extends \chat\system\command\AbstractCommand {
|
||||
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);
|
||||
|
||||
$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_ME;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\system\chat\command\ICommand::getMessage()
|
||||
* @see \chat\system\command\ICommand::getMessage()
|
||||
*/
|
||||
public function getMessage() {
|
||||
return $this->commandHandler->getParameters();
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\data\chat\suspension;
|
||||
use \wcf\data\user\User;
|
||||
use \wcf\system\WCF;
|
||||
@ -14,7 +14,7 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class MuteCommand extends \wcf\system\chat\command\AbstractRestrictedCommand {
|
||||
class MuteCommand extends \chat\system\command\AbstractRestrictedCommand {
|
||||
public $user = null;
|
||||
public $time = 0;
|
||||
public $suspensionAction = null;
|
||||
@ -22,7 +22,7 @@ class MuteCommand extends \wcf\system\chat\command\AbstractRestrictedCommand {
|
||||
public $fail = false;
|
||||
public $room = null;
|
||||
|
||||
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) {
|
||||
public function __construct(\chat\system\command\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
$parameters = $commandHandler->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)))
|
||||
));
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
|
||||
/**
|
||||
* Sends a message that starts with a slash.
|
||||
@ -10,25 +10,25 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class PlainCommand extends \wcf\system\chat\command\AbstractCommand {
|
||||
public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER;
|
||||
class PlainCommand extends \chat\system\command\AbstractCommand {
|
||||
public $enableSmilies = \chat\system\command\ICommand::SMILEY_USER;
|
||||
|
||||
/**
|
||||
* @see \wcf\system\chat\command\ICommand::getType()
|
||||
* @see \chat\system\command\ICommand::getType()
|
||||
*/
|
||||
public function getType() {
|
||||
return \wcf\data\chat\message\ChatMessage::TYPE_NORMAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\system\chat\command\ICommand::getMessage()
|
||||
* @see \chat\system\command\ICommand::getMessage()
|
||||
*/
|
||||
public function getMessage() {
|
||||
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() {
|
||||
return null;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\data\user\User;
|
||||
use \wcf\system\WCF;
|
||||
use \wcf\util\ChatUtil;
|
||||
@ -13,16 +13,16 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class RestoreCommand extends \wcf\system\chat\command\AbstractRestrictedCommand {
|
||||
class RestoreCommand extends \chat\system\command\AbstractRestrictedCommand {
|
||||
public $enableHTML = 1;
|
||||
public $user = null;
|
||||
public $link = '';
|
||||
|
||||
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) {
|
||||
public function __construct(\chat\system\command\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
$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.'" />';
|
||||
|
||||
@ -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)))
|
||||
));
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\system\WCF;
|
||||
use \wcf\util\StringUtil;
|
||||
|
||||
@ -12,10 +12,10 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class TemproomCommand extends \wcf\system\chat\command\AbstractRestrictedCommand {
|
||||
class TemproomCommand extends \chat\system\command\AbstractRestrictedCommand {
|
||||
public $roomName = '';
|
||||
|
||||
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) {
|
||||
public function __construct(\chat\system\command\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
// 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() {
|
||||
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() {
|
||||
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 $this->roomName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\system\chat\command\ICommand::getReceiver()
|
||||
* @see \chat\system\command\ICommand::getReceiver()
|
||||
*/
|
||||
public function getReceiver() {
|
||||
return \wcf\system\WCF::getUser()->userID;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
|
||||
/**
|
||||
* Shows the users that are online
|
||||
@ -10,19 +10,19 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @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 $enableBBCodes = self::SETTING_ON;
|
||||
|
||||
/**
|
||||
* @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() {
|
||||
$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() {
|
||||
return \wcf\system\WCF::getUser()->userID;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace wcf\system\chat\command\commands;
|
||||
namespace chat\system\command\commands;
|
||||
use \wcf\data\user\User;
|
||||
|
||||
/**
|
||||
@ -11,11 +11,11 @@
|
||||
* @package be.bastelstu.chat
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class WhisperCommand extends \wcf\system\chat\command\AbstractCommand {
|
||||
public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_USER;
|
||||
class WhisperCommand extends \chat\system\command\AbstractCommand {
|
||||
public $enableSmilies = \chat\system\command\ICommand::SMILEY_USER;
|
||||
public $user = null, $message = '';
|
||||
|
||||
public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) {
|
||||
public function __construct(\chat\system\command\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
$parameters = $commandHandler->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;
|
@ -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 {
|
||||
|
@ -1,7 +1,7 @@
|
||||
{include file='documentHeader'}
|
||||
|
||||
<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}
|
||||
<style type="text/css">
|
||||
@ -18,26 +18,26 @@
|
||||
}
|
||||
|
||||
.timsChatMessage{$type|concat:'JOIN'|constant} {
|
||||
background-image: url({icon}circleArrowRight{/icon});
|
||||
{*background-image: url({icon}circleArrowRight{/icon});*}
|
||||
}
|
||||
|
||||
.timsChatMessage{$type|concat:'LEAVE'|constant} {
|
||||
background-image: url({icon}circleArrowLeft{/icon});
|
||||
{*background-image: url({icon}circleArrowLeft{/icon});*}
|
||||
}
|
||||
|
||||
.timsChatMessage{$type|concat:'INFORMATION'|constant} {
|
||||
background-image: url({icon}systemInfo{/icon});
|
||||
{*background-image: url({icon}systemInfo{/icon});*}
|
||||
}
|
||||
|
||||
.timsChatMessage{$type|concat:'ERROR'|constant} {
|
||||
background-image: url({icon}systemError{/icon});
|
||||
{*background-image: url({icon}systemError{/icon});*}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body id="tpl{$templateName|ucfirst}">
|
||||
{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'}
|
||||
|
||||
<div id="timsChatRoomContent">
|
||||
@ -45,13 +45,13 @@
|
||||
<fieldset>
|
||||
<div id="timsChatMessageContainer" class="timsChatMessageContainer container box shadow1">
|
||||
<ul>
|
||||
<li class="error">{lang}wcf.chat.noJs{/lang}</li>
|
||||
<li class="error">{lang}chat.general.noJs{/lang}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<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>
|
||||
|
||||
<div id="timsChatControls" class="marginTop">
|
||||
@ -87,40 +87,40 @@
|
||||
<ul class="smallButtons">
|
||||
<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">
|
||||
<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>
|
||||
</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">
|
||||
<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>
|
||||
</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">
|
||||
<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>
|
||||
</li>
|
||||
<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}">
|
||||
<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>
|
||||
</li>
|
||||
<li>
|
||||
<a id="timsChatClear" class="jsTooltip button" title="{lang}wcf.chat.clear.description{/lang}">
|
||||
<img alt="" src="{icon}delete{/icon}" /> <span>{lang}wcf.chat.clear{/lang}</span>
|
||||
<a id="timsChatClear" class="jsTooltip button" title="{lang}chat.general.clear.description{/lang}">
|
||||
<span class="icon icon16 icon-remove"></span><span>{lang}chat.general.clear{/lang}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="timsChatMark" class="jsTooltip button" title="{lang}wcf.chat.mark.description{/lang}">
|
||||
<img alt="" src="{icon}check{/icon}" /> <span>{lang}wcf.chat.mark{/lang}</span>
|
||||
<a id="timsChatMark" class="jsTooltip button" title="{lang}chat.general.mark.description{/lang}">
|
||||
<span class="icon icon16 icon-check"></span><span>{lang}chat.general.mark{/lang}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{include file='chatCopyright'}
|
||||
{include file='copyright'}
|
||||
</div>
|
||||
{include file='chatJavascriptInclude'}
|
||||
{include file='javascriptInclude'}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var chat;
|
||||
@ -129,28 +129,25 @@
|
||||
$('.timsChatMessageContainer .error').remove();
|
||||
|
||||
WCF.Language.addObject({
|
||||
'wcf.chat.query': '{lang}wcf.chat.query{/lang}',
|
||||
'wcf.chat.kick': '{lang}wcf.chat.kick{/lang}',
|
||||
'wcf.chat.ban': '{lang}wcf.chat.ban{/lang}',
|
||||
'wcf.chat.profile': '{lang}wcf.chat.profile{/lang}',
|
||||
'wcf.chat.notify.title': '{lang}wcf.chat.notify.title{/lang}'
|
||||
});
|
||||
WCF.Icon.addObject({
|
||||
'be.bastelstu.wcf.chat.chat': '{icon}chat{/icon}'
|
||||
'chat.general.query': '{lang}chat.general.query{/lang}',
|
||||
'chat.general.kick': '{lang}chat.general.kick{/lang}',
|
||||
'chat.general.ban': '{lang}chat.general.ban{/lang}',
|
||||
'chat.general.profile': '{lang}chat.general.profile{/lang}',
|
||||
'chat.general.notify.title': '{lang}chat.general.notify.title{/lang}'
|
||||
});
|
||||
{event name='shouldInit'}
|
||||
// Boot the chat
|
||||
WCF.TabMenu.init();
|
||||
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},
|
||||
unloadURL: '{link controller="Chat" action="Leave"}{/link}',
|
||||
messageURL: '{link controller="Chat" action="Message"}{/link}',
|
||||
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'}
|
||||
|
||||
// show the last X messages
|
||||
|
@ -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>
|
@ -1,7 +1,7 @@
|
||||
{if $templateName == 'chat'}<address id="timsChatCopyright" class="copyright">{lang}wcf.chat.copyright{/lang}</address>
|
||||
{elseif $templateName == 'chatCopyright'}
|
||||
{if $templateName == 'chat'}<address id="timsChatCopyright" class="copyright">{lang}chat.general.copyright{/lang}</address>
|
||||
{elseif $templateName == 'copyright'}
|
||||
<dl>
|
||||
<dt>{lang}wcf.chat.copyright.leader{/lang}</dt>
|
||||
<dt>{lang}chat.general.copyright.leader{/lang}</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
|
||||
@ -9,7 +9,7 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{lang}wcf.chat.copyright.developer{/lang}</dt>
|
||||
<dt>{lang}chat.general.copyright.developer{/lang}</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li><a href="http://tims.bastelstu.be/">Tim Düsterhus</a></li>
|
||||
@ -18,7 +18,7 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{lang}wcf.chat.copyright.graphics{/lang}</dt>
|
||||
<dt>{lang}chat.general.copyright.graphics{/lang}</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li><a href="http://www.cls-design.com/">Tom</a></li>
|
||||
@ -26,7 +26,7 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{lang}wcf.chat.copyright.translation{/lang}</dt>
|
||||
<dt>{lang}chat.general.copyright.translation{/lang}</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>Riccardo Vianello (it)</li>
|
||||
@ -34,7 +34,7 @@
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{lang}wcf.chat.copyright.thanks{/lang}</dt>
|
||||
<dt>{lang}chat.general.copyright.thanks{/lang}</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li><a href="http://www.wbbaddons.de/user/2020-noone/">-noone-</a></li>
|
@ -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>
|
||||
{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'}
|
5
template/navigationInclude.tpl
Normal file
5
template/navigationInclude.tpl
Normal 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>
|
@ -1,8 +1,8 @@
|
||||
<div id="sidebarContent" class="sidebarContent">
|
||||
<nav class="timsChatSidebarTabs">
|
||||
<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="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="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}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>
|
||||
</nav>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
<div><button type="button">{lang}wcf.chat.forceRefresh{/lang}</button></div>
|
||||
<div><button type="button">{lang}chat.general.forceRefresh{/lang}</button></div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user