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

Made message marking functional

This commit is contained in:
Tim Düsterhus 2013-04-26 23:00:48 +02:00
parent 72d6c48236
commit d9842fcb8d
7 changed files with 61 additions and 29 deletions

View File

@ -270,6 +270,19 @@ Toggle fullscreen mode.
$('html').addClass 'fullscreen' $('html').addClass 'fullscreen'
else else
$('html').removeClass 'fullscreen' $('html').removeClass 'fullscreen'
Toggle checkboxes
$('#timsChatMark').click (event) ->
$('.timsChatMessageContainer').toggleClass 'markEnabled'
$(document).on 'click', '.timsChatMessage :checkbox', (event) ->
if $(this).is ':checked'
$(this).parents('.timsChatMessage').addClass('jsMarked')
else
$(this).parents('.timsChatMessage').removeClass('jsMarked')
Scroll down when autoscroll is being activated. Scroll down when autoscroll is being activated.
@ -517,8 +530,7 @@ Build HTML of new user and append it.
li.attr 'title', user.awayStatus li.attr 'title', user.awayStatus
li.data 'username', user.username li.data 'username', user.username
li.append @userTemplate.fetch li.append @userTemplate.fetch user
user: user
menu = $ '<ul></ul>' menu = $ '<ul></ul>'
menu.addClass 'dropdownMenu' menu.addClass 'dropdownMenu'

View File

@ -1,7 +1,5 @@
<?php <?php
namespace chat\page; namespace chat\page;
use \wcf\system\exception\IllegalLinkException;
use \wcf\system\WCF;
/** /**
* Shows information about Tims chat. * Shows information about Tims chat.
@ -39,9 +37,9 @@ class CopyrightPage extends \wcf\page\AbstractPage {
public function assignVariables() { public function assignVariables() {
parent::assignVariables(); parent::assignVariables();
$images = explode("\n\n", file_get_contents(__FILE__, null, null, __COMPILER_HALT_OFFSET__+2)); $images = explode("\n\n", file_get_contents(__FILE__, null, null, __COMPILER_HALT_OFFSET__ + 2));
WCF::getTPL()->assign(array( \wcf\system\WCF::getTPL()->assign(array(
'background' => str_replace("\n", '', $images[array_rand($images)]) 'background' => str_replace("\n", '', $images[array_rand($images)])
)); ));
} }

View File

@ -29,26 +29,60 @@
height: 200px; height: 200px;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
display: none;
&.active {
display: block;
}
&.markEnabled {
ul {
.timsChatMessage {
&.jsMarked {
background-color: @wcfSelectedBackgroundColor;
color: @wcfSelectedColor;
}
> {
.markContainer {
visibility: visible;
}
}
}
}
}
ul { ul {
display: table; display: table;
width: 100%; width: 100%;
.timsChatMessage { .timsChatMessage {
min-height: 16px;
display: table-row; display: table-row;
.transition(opacity, .2s); .transition(opacity, .2s);
.username { &.unloaded {
font-weight: bold; opacity: .5;
}
&::before {
.icon;
.icon16;
}
&:nth-child(even) {
background-color: @wcfContainerAccentBackgroundColor;
} }
> { > {
time, .usernameContainer, .text { .markContainer, time, .usernameContainer, .text {
display: table-cell; display: table-cell;
vertical-align: top; vertical-align: top;
} }
.markContainer {
visibility: hidden;
}
time { time {
&::before { &::before {
content: "["; content: "[";
@ -63,25 +97,13 @@
min-width: 100px; min-width: 100px;
padding: 0px 5px; padding: 0px 5px;
white-space: nowrap; white-space: nowrap;
font-weight: bold;
} }
.text { .text {
width: 100%; width: 100%;
} }
} }
&.unloaded {
opacity: .5;
}
&::before {
.icon;
.icon16;
}
&:nth-child(even) {
background-color: @wcfContainerAccentBackgroundColor;
}
} }
} }
} }

View File

@ -32,7 +32,7 @@
messageURL: '{link application="chat" controller="NewMessages"}{/link}', messageURL: '{link application="chat" controller="NewMessages"}{/link}',
socketIOPath: '{@CHAT_SOCKET_IO_PATH|encodeJS}' socketIOPath: '{@CHAT_SOCKET_IO_PATH|encodeJS}'
}, },
new WCF.Template('{ldelim}$title} - {'chat.general.title'|language|encodeJS} - {PAGE_TITLE|language|encodeJS}'), new WCF.Template('{ldelim}$title} - {"chat.general.title"|language|encodeJS} - {PAGE_TITLE|language|encodeJS}'),
new WCF.Template('{@$messageTemplate|encodeJS}'), new WCF.Template('{@$messageTemplate|encodeJS}'),
new WCF.Template('{@$userTemplate|encodeJS}') new WCF.Template('{@$userTemplate|encodeJS}')
); );
@ -97,7 +97,7 @@
<div> <div>
<p id="timsChatTopic" class="container{if $room->topic|language === ''} empty{/if}">{$room->topic|language}</p> <p id="timsChatTopic" class="container{if $room->topic|language === ''} empty{/if}">{$room->topic|language}</p>
<div id="timsChatMessageContainer" class="timsChatMessageContainer marginTop container"> <div id="timsChatMessageContainer" class="timsChatMessageContainer marginTop container active">
<p class="error noJsOnly" style="display: none;">{lang}chat.general.noJs{/lang}</p> <p class="error noJsOnly" style="display: none;">{lang}chat.general.noJs{/lang}</p>
<ul> <ul>
</ul> </ul>

View File

@ -1 +1 @@
{literal}<time>{@$formattedTime}</time> <span class="usernameContainer"><span class="username">{@$formattedUsername}</span><span class="separator">{$separator}</span></span> <span class="text">{@$formattedMessage}</span>{/literal} {literal}<time>{@$formattedTime}</time> <span class="usernameContainer"><span class="username">{@$formattedUsername}</span><span class="separator">{$separator}</span></span> <span class="text">{@$formattedMessage}</span> <span class="markContainer"><input type="checkbox" value="{@$messageID}" /></span>{/literal}

View File

@ -2,7 +2,7 @@
<nav class="timsChatSidebarTabs"> <nav class="timsChatSidebarTabs">
<ul> <ul>
<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="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='RoomList'}{/link}">{lang}chat.general.rooms{/lang} <span class="badge">{#$rooms|count}</span><span class="ajaxLoad icon icon32 icon-spinner"></span></a></li> <li id="toggleRooms"><a title="{lang}chat.general.rooms{/lang}">{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>

View File

@ -1 +1 @@
{literal}<a class="dropdownToggle userLink" data-user-id="{$user.userID.toString()}">{@$user.avatar['24']} {$user.username}</a>{/literal} {literal}<a class="dropdownToggle userLink" data-user-id="{$userID.toString()}">{@$avatar['24']} {$username}</a>{/literal}