From d9842fcb8d72f5b82070f7b1618fb55f050f7366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 26 Apr 2013 23:00:48 +0200 Subject: [PATCH] Made message marking functional --- file/js/be.bastelstu.Chat.litcoffee | 16 +++++++- file/lib/page/CopyrightPage.class.php | 6 +-- file/style/be.bastelstu.wcf.chat.less | 58 ++++++++++++++++++--------- template/chat.tpl | 4 +- template/message.tpl | 2 +- template/sidebar.tpl | 2 +- template/userListUser.tpl | 2 +- 7 files changed, 61 insertions(+), 29 deletions(-) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 56727c0..bfc0e98 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -270,6 +270,19 @@ Toggle fullscreen mode. $('html').addClass 'fullscreen' else $('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. @@ -517,8 +530,7 @@ Build HTML of new user and append it. li.attr 'title', user.awayStatus li.data 'username', user.username - li.append @userTemplate.fetch - user: user + li.append @userTemplate.fetch user menu = $ '' menu.addClass 'dropdownMenu' diff --git a/file/lib/page/CopyrightPage.class.php b/file/lib/page/CopyrightPage.class.php index 55fcaad..6741e5f 100644 --- a/file/lib/page/CopyrightPage.class.php +++ b/file/lib/page/CopyrightPage.class.php @@ -1,7 +1,5 @@ assign(array( + \wcf\system\WCF::getTPL()->assign(array( 'background' => str_replace("\n", '', $images[array_rand($images)]) )); } diff --git a/file/style/be.bastelstu.wcf.chat.less b/file/style/be.bastelstu.wcf.chat.less index 1891d04..3f3c462 100644 --- a/file/style/be.bastelstu.wcf.chat.less +++ b/file/style/be.bastelstu.wcf.chat.less @@ -29,26 +29,60 @@ height: 200px; overflow-y: scroll; overflow-x: hidden; + display: none; + + &.active { + display: block; + } + + &.markEnabled { + ul { + .timsChatMessage { + &.jsMarked { + background-color: @wcfSelectedBackgroundColor; + color: @wcfSelectedColor; + } + + > { + .markContainer { + visibility: visible; + } + } + } + } + } ul { display: table; width: 100%; - + .timsChatMessage { - min-height: 16px; display: table-row; .transition(opacity, .2s); - .username { - font-weight: bold; + &.unloaded { + opacity: .5; + } + + &::before { + .icon; + .icon16; + } + + &:nth-child(even) { + background-color: @wcfContainerAccentBackgroundColor; } > { - time, .usernameContainer, .text { + .markContainer, time, .usernameContainer, .text { display: table-cell; vertical-align: top; } + .markContainer { + visibility: hidden; + } + time { &::before { content: "["; @@ -63,25 +97,13 @@ min-width: 100px; padding: 0px 5px; white-space: nowrap; + font-weight: bold; } .text { width: 100%; } } - - &.unloaded { - opacity: .5; - } - - &::before { - .icon; - .icon16; - } - - &:nth-child(even) { - background-color: @wcfContainerAccentBackgroundColor; - } } } } diff --git a/template/chat.tpl b/template/chat.tpl index 6d91a58..22083ed 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -32,7 +32,7 @@ messageURL: '{link application="chat" controller="NewMessages"}{/link}', 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('{@$userTemplate|encodeJS}') ); @@ -97,7 +97,7 @@

{$room->topic|language}

-
+
diff --git a/template/message.tpl b/template/message.tpl index 635ccfa..1f43e46 100644 --- a/template/message.tpl +++ b/template/message.tpl @@ -1 +1 @@ -{literal} {@$formattedUsername}{$separator} {@$formattedMessage}{/literal} \ No newline at end of file +{literal} {@$formattedUsername}{$separator} {@$formattedMessage} {/literal} \ No newline at end of file diff --git a/template/sidebar.tpl b/template/sidebar.tpl index 44dfbdb..dc15c8e 100644 --- a/template/sidebar.tpl +++ b/template/sidebar.tpl @@ -2,7 +2,7 @@ diff --git a/template/userListUser.tpl b/template/userListUser.tpl index f8c1015..a885e22 100644 --- a/template/userListUser.tpl +++ b/template/userListUser.tpl @@ -1 +1 @@ -{literal}{@$user.avatar['24']} {$user.username}{/literal} \ No newline at end of file +{literal}{@$avatar['24']} {$username}{/literal} \ No newline at end of file