mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Rework CoffeeScript
This commit is contained in:
parent
37d8542eff
commit
abc6ba66f4
File diff suppressed because it is too large
Load Diff
@ -28,12 +28,10 @@ public static function getNewestMessages(\chat\data\room\Room $room, $number = C
|
||||
$messageList->sqlOrderBy = "message.messageID DESC";
|
||||
$messageList->sqlLimit = $number;
|
||||
$messageList->getConditionBuilder()->add('
|
||||
((
|
||||
(
|
||||
message.receiver IS NULL
|
||||
AND message.roomID = ?
|
||||
)
|
||||
OR message.receiver = ?
|
||||
OR message.sender = ?)', array($room->roomID, \wcf\system\WCF::getUser()->userID, \wcf\system\WCF::getUser()->userID));
|
||||
AND message.roomID = ?
|
||||
)', array($room->roomID));
|
||||
|
||||
$messageList->readObjects();
|
||||
return array_reverse($messageList->getObjects());
|
||||
|
@ -26,12 +26,12 @@
|
||||
{capture assign='messageTemplate'}{include application='chat' file='message'}{/capture}
|
||||
{capture assign='userTemplate'}{include application='chat' file='userListUser'}{/capture}
|
||||
|
||||
window.chat = new be.bastelstu.Chat(
|
||||
be.bastelstu.Chat.init(
|
||||
{
|
||||
reloadTime: {@CHAT_RELOADTIME},
|
||||
messageURL: '{link application="chat" controller="NewMessages"}{/link}'
|
||||
},
|
||||
new WCF.Template('{ldelim}$title} - {"chat.general.title"|language|encodeJS} - {PAGE_TITLE|language|encodeJS}'),
|
||||
new WCF.Template('{literal}{if $newMessageCount}({#$newMessageCount}) {/if}{$title} - {/literal}{"chat.general.title"|language|encodeJS} - {PAGE_TITLE|language|encodeJS}'),
|
||||
new WCF.Template('{@$messageTemplate|encodeJS}'),
|
||||
new WCF.Template('{@$userTemplate|encodeJS}')
|
||||
);
|
||||
@ -39,7 +39,7 @@
|
||||
{event name='afterInit'}
|
||||
|
||||
// show the last X messages
|
||||
window.chat.handleMessages([
|
||||
be.bastelstu.Chat.handleMessages([
|
||||
{implode from=$newestMessages item='message'}{@$message->jsonify()}{/implode}
|
||||
]);
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
<script type="text/javascript" src="{$__wcf->getPath('chat')}js/be.bastelstu.Chat.js?version={PACKAGE_VERSION|rawurlencode}"></script>
|
||||
<script type="text/javascript" src="{$__wcf->getPath('chat')}js/be.bastelstu.Chat.Log.js?version={PACKAGE_VERSION|rawurlencode}"></script>
|
||||
<!--script type="text/javascript" src="{$__wcf->getPath('chat')}js/be.bastelstu.Chat.Log.js?version={PACKAGE_VERSION|rawurlencode}"></script-->
|
||||
{event name='javascript'}
|
Loading…
Reference in New Issue
Block a user