From cded6e79a3ada43a4d55ddfd8dba14fe8f29e45a Mon Sep 17 00:00:00 2001 From: max-m Date: Mon, 26 Dec 2011 22:16:37 +0100 Subject: [PATCH 01/51] Added title notifications --- file/js/TimWolla.WCF.Chat.coffee | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 47858e9..b9c9a38 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -13,7 +13,9 @@ TimWolla.WCF ?= {} (($) -> TimWolla.WCF.Chat = titleTemplate: null + title: document.title messageTemplate: null + newMessageCount: null init: () -> @bindEvents() @refreshRoomList() @@ -25,6 +27,19 @@ TimWolla.WCF ?= {} # Binds all the events needed for Tims Chat. ### bindEvents: () -> + @isActive = true + $(window).focus $.proxy () -> + document.title = @title + @newMessageCount = 0 + clearTimeout @timeout + @isActive = true + , this + + $(window).blur $.proxy () -> + @title = document.title + @isActive = false + , this + $('.smiley').click $.proxy (event) -> @insertText ' ' + $(event.target).attr('alt') + ' ' , this @@ -137,6 +152,15 @@ TimWolla.WCF ?= {} dataType: 'json' type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> + if (!@isActive) + @newMessageCount += data.length + if (@newMessageCount > 0) + @timeout = setTimeout $.proxy(() -> + document.title = @newMessageCount + WCF.Language.get('wcf.chat.newMessages') + setTimeout $.proxy(() -> + document.title = @title + , this), 3000 + , this), 1000 @handleMessages(data) , this) ### From cfae043ba4a2f25af1e01a6c2eef33c296cc7b69 Mon Sep 17 00:00:00 2001 From: max-m Date: Mon, 26 Dec 2011 22:46:29 +0100 Subject: [PATCH 02/51] Now the fish won't swim out of the window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ________ / Blubb \ \___ __/ v ><((((°> --- file/js/TimWolla.WCF.Chat.coffee | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index b9c9a38..0c39354 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -135,15 +135,20 @@ TimWolla.WCF ?= {} fish.appendTo $ 'body' new WCF.PeriodicalExecuter(() -> left = (Math.random() * 100 - 50) + top = (Math.random() * 100 - 50) + fish = $('#fish') - $('#fish').text('><((((°>') if (left > 0) - $('#fish').text('<°))))><') if (left < 0) + left *= -1 if((fish.position().left + left) < (0 + fish.width()) or (fish.position().left + left) > ($(document).width() - fish.width())) + top *= -1 if((fish.position().top + top) < (0 + fish.height()) or (fish.position().top + top) > ($(document).height() - fish.height())) - $('#fish').animate - top: '+=' + (Math.random() * 100 - 50) + fish.text('><((((°>') if (left > 0) + fish.text('<°))))><') if (left < 0) + + fish.animate + top: '+=' + top left: '+=' + left , 1000 - , 3e3); + , 1.5e3); ### # Loads new messages. ### From f98abf5298541c666669dd56c2acc4b335a0c7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2011 12:25:20 +0100 Subject: [PATCH 03/51] First ideas for design when JS is disabled --- template/chat.tpl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/template/chat.tpl b/template/chat.tpl index 2859cee..11f563c 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -121,11 +121,13 @@
topic|language === ''} style="display: none;"{/if}>{$room->topic|language}
-
    +
      + +
    - +
    @@ -188,7 +190,7 @@ {@$message->jsonify()} {/implode} ]); - + $('#chatInput').enable(); $('#chatInput').jCounter(); //]]> From 3b5fa3d95a3bfd80949abf0609695a344ab61921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2011 14:45:25 +0100 Subject: [PATCH 04/51] Take care of notify status --- file/js/TimWolla.WCF.Chat.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 8618ae0..a69e7e9 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -157,7 +157,7 @@ TimWolla.WCF ?= {} dataType: 'json' type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> - if (!@isActive) + if (!@isActive && $('#chatNotify').data('status') is 1) @newMessageCount += data.messages.length if (@newMessageCount > 0) @timeout = setTimeout $.proxy(() -> From ff56eac2761f2a4bcbbff042b790122902fcced2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2011 16:43:44 +0100 Subject: [PATCH 05/51] Elements are unbound automatically --- file/js/TimWolla.WCF.Chat.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index a69e7e9..6614931 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -215,7 +215,6 @@ TimWolla.WCF ?= {} dataType: 'json' type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> - $('.chatRoom').unbind 'click' $('#chatRoomList li').remove() $('#toggleRooms a').removeClass 'ajaxLoad' for room in data From fc561804f935538b5a64d5a7706f1ca268a7a9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2011 17:07:12 +0100 Subject: [PATCH 06/51] Adding basic message-event --- file/js/TimWolla.WCF.Chat.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 6614931..7e90398 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -16,6 +16,7 @@ TimWolla.WCF ?= {} title: document.title messageTemplate: null newMessageCount: null + events: { newMessage: $.Callbacks() } init: () -> @bindEvents() @refreshRoomList() @@ -175,6 +176,8 @@ TimWolla.WCF ?= {} ### handleMessages: (messages) -> for message in messages + @events.newMessage.fire message + output = @messageTemplate.fetch message li = $ '
  • ' li.addClass 'chatMessage chatMessage'+message.type From d7183001f39947ca77716d24056c3a43844cf425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2011 17:10:39 +0100 Subject: [PATCH 07/51] Adding shouldInit and didInit event --- template/chat.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/template/chat.tpl b/template/chat.tpl index 2859cee..6436d19 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -182,7 +182,9 @@ animations: {CHAT_ANIMATIONS}, maxTextLength: {CHAT_LENGTH} } + {event name='shouldInit'} TimWolla.WCF.Chat.init(); + {event name='didInit'} TimWolla.WCF.Chat.handleMessages([ {implode from=$newestMessages item='message'} {@$message->jsonify()} From 16df20c7143f3ccaaae06bcaf3999cc352c0b84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 27 Dec 2011 16:43:44 +0100 Subject: [PATCH 08/51] Elements are unbound automatically --- file/js/TimWolla.WCF.Chat.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index a69e7e9..6614931 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -215,7 +215,6 @@ TimWolla.WCF ?= {} dataType: 'json' type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> - $('.chatRoom').unbind 'click' $('#chatRoomList li').remove() $('#toggleRooms a').removeClass 'ajaxLoad' for room in data From b6a1577d0f0de67469411f884ab74d429ba28905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 31 Dec 2011 14:45:27 +0100 Subject: [PATCH 09/51] Removing travis-config --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 41d1881..0000000 --- a/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: php -php: - - 5.3 -script: php build.php \ No newline at end of file From a942396b7c2ea57fcd22385007b3a56144ffa249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 3 Jan 2012 13:10:46 +0100 Subject: [PATCH 10/51] Use current() --- file/lib/system/menu/page/ChatPageMenuItemProvider.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php index 533f707..29e201f 100644 --- a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php +++ b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php @@ -29,7 +29,7 @@ public function isVisible() { do { $cache->seek($i++); - $this->room = $cache->search($cache->key()); + $this->room = $cache->current(); } while (!$this->room->canEnter()); From bae9cabc1e766df8618e0c843570c549a64a2dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 6 Jan 2012 15:53:23 +0100 Subject: [PATCH 11/51] Making build.php executable --- build.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build.php diff --git a/build.php b/build.php old mode 100644 new mode 100755 From 91456cafe144ff14fafd4768da87bdd8aefdb3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 6 Jan 2012 16:15:40 +0100 Subject: [PATCH 12/51] Improving build.php --- build.php | 73 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/build.php b/build.php index 5439cc6..df37cf9 100755 --- a/build.php +++ b/build.php @@ -1,16 +1,61 @@ #!/usr/bin/env php Date: Fri, 6 Jan 2012 16:28:42 +0100 Subject: [PATCH 13/51] Adding PHPDoc for build.php --- build.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.php b/build.php index df37cf9..0069fed 100755 --- a/build.php +++ b/build.php @@ -1,5 +1,13 @@ #!/usr/bin/env php + * @package timwolla.wcf.chat + */ echo << Date: Fri, 6 Jan 2012 16:32:12 +0100 Subject: [PATCH 14/51] Break on exit-code != 0 --- build.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build.php b/build.php index 0069fed..d8bbded 100755 --- a/build.php +++ b/build.php @@ -26,7 +26,8 @@ EOT; foreach (glob('file/js/*.coffee') as $coffeeFile) { echo $coffeeFile."\n"; - passthru('coffee -cb '.escapeshellarg($coffeeFile)); + passthru('coffee -cb '.escapeshellarg($coffeeFile), $code); + if ($code != 0) exit($code); } echo << Date: Fri, 6 Jan 2012 17:53:14 +0100 Subject: [PATCH 15/51] Adding README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..77a9dc5 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +Tims Chat 3.0 +============= + +Tims Chat is a chat-plugin for WoltLab Community Framework. From 0f0acf2a582d176fbc1a0dc0588418b6f0bd1340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 6 Jan 2012 18:01:17 +0100 Subject: [PATCH 16/51] Completed README.md --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 77a9dc5..555681d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,33 @@ Tims Chat 3.0 ============= -Tims Chat is a chat-plugin for WoltLab Community Framework. +Tims Chat is a chat-plugin for WoltLab Community Framework. + + +Version notes +------------- + +The currently available source code represents an early alpha-version of Tims Chat, even though it may be installable, we cannot guarantee a working installation at any time. You MUST NOT install and/or use Tims Chat 3.0 in a production environment. + +Contribution +------------ + +Developers are always welcome to fork Tims Chat and provide features or bug fixes using pull requests. If you make changes or add classes it is mandatory to follow the requirements below: + +* Testing is key, you MUST try out your changes before submitting pull requests +* You MUST save your files with Unix-style line endings (\n) +* You MUST NOT include the closing tag of a PHP block at the end of file, provide an empty newline instead +* You MUST use tabs for indentation + * Tab size of 8 is required + * Empty lines MUST be indented equal to previous line +* All comments within source code MUST be written in English language +* Use a sensible number of commits. In most cases one commit should be enough. + * Split huge changes into several logical groups + * Rebase small changes that consist of several commits into one commit + +Follow the above conventions if you want your pull requests accepted. + +License +------- + +For licensing information refer to the LICENSE file in this folder. \ No newline at end of file From e01fa4f0c53e8727a286021aec024cdd1cc11fa5 Mon Sep 17 00:00:00 2001 From: max-m Date: Sat, 7 Jan 2012 00:27:45 +0100 Subject: [PATCH 17/51] Fixed PIP names in package.xml --- package.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.xml b/package.xml index 0ee7745..6a8f69f 100644 --- a/package.xml +++ b/package.xml @@ -28,9 +28,9 @@ install.sql objectType.xml option.xml - pagemenu.xml + pagemenu.xml eventListener.xml - templatelistener.xml + templatelistener.xml acloptions.xml @@ -40,9 +40,9 @@ template.tar objectType.xml option.xml - pagemenu.xml + pagemenu.xml eventListener.xml - templatelistener.xml + templatelistener.xml acloptions.xml \ No newline at end of file From 8405a4f31b0e5b3cd6a9d0f1ed9560ca6bc3c1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 7 Jan 2012 16:31:20 +0100 Subject: [PATCH 18/51] Ignore scss-files when taring the files.tar --- build.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.php b/build.php index d8bbded..f10da56 100755 --- a/build.php +++ b/build.php @@ -47,7 +47,7 @@ EOT; chdir('file'); - passthru('tar cvf ../file.tar * --exclude=*.coffee', $code); + passthru('tar cvf ../file.tar * --exclude=*.coffee --exclude=*.scss', $code); if ($code != 0) exit($code); echo << Date: Sat, 7 Jan 2012 16:45:14 +0100 Subject: [PATCH 19/51] Adding Badges for Sidebar-Tabs --- file/js/TimWolla.WCF.Chat.coffee | 2 ++ template/chat.tpl | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 7e90398..9c16513 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -220,6 +220,8 @@ TimWolla.WCF ?= {} success: $.proxy((data, textStatus, jqXHR) -> $('#chatRoomList li').remove() $('#toggleRooms a').removeClass 'ajaxLoad' + $('#toggleRooms .badge').text(data.length); + for room in data li = $ '
  • ' li.addClass 'activeMenuItem' if room.active diff --git a/template/chat.tpl b/template/chat.tpl index 6436d19..7877cf3 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -79,8 +79,8 @@
    From b17498d8e5e4fe174f47251f3f36b49593110114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 7 Jan 2012 16:50:17 +0100 Subject: [PATCH 20/51] Change background-color of "active-badge" to blue --- file/style/timwolla.wcf.chat.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/file/style/timwolla.wcf.chat.scss b/file/style/timwolla.wcf.chat.scss index a760cb1..45cb5f8 100644 --- a/file/style/timwolla.wcf.chat.scss +++ b/file/style/timwolla.wcf.chat.scss @@ -196,6 +196,18 @@ .chatSidebarTabs { margin-right: -1px; } } + + &.active .badge { + font-size: 65% !important; + color: #fff; + background-color: #369; + + -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 1); + -moz-box-shadow: 0 0 1px rgba(255, 255, 255, 1); + -ms-box-shadow: 0 0 1px rgba(255, 255, 255, 1); + -o-box-shadow: 0 0 1px rgba(255, 255, 255, 1); + box-shadow: 0 0 1px rgba(255, 255, 255, 1); + } } } } From 75adb8e3ab2d856f73080d633f000b114e603663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 7 Jan 2012 17:20:21 +0100 Subject: [PATCH 21/51] Hide overflow-x so one cannot nuke our chat-stream --- file/style/timwolla.wcf.chat.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/file/style/timwolla.wcf.chat.scss b/file/style/timwolla.wcf.chat.scss index 45cb5f8..f97fcbb 100644 --- a/file/style/timwolla.wcf.chat.scss +++ b/file/style/timwolla.wcf.chat.scss @@ -51,6 +51,7 @@ #topic, #smileyList, #chatOptions { .chatMessageContainer { height: 200px; overflow-y: scroll; + overflow-x: hidden; padding-left: 7px !important; } From 4aba3376edc2153c14225e07e38c887e9800c4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 7 Jan 2012 17:47:38 +0100 Subject: [PATCH 22/51] Cleanup Style - Add comment - Remove unneeded declarations - Fix conflict with search --- file/style/timwolla.wcf.chat.scss | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/file/style/timwolla.wcf.chat.scss b/file/style/timwolla.wcf.chat.scss index f97fcbb..d6e457d 100644 --- a/file/style/timwolla.wcf.chat.scss +++ b/file/style/timwolla.wcf.chat.scss @@ -1,20 +1,18 @@ -#chatBox { - padding: 0; - - div { - text-align: center; - } -} +/** + * Chat-Styles + * + * @author Tim Düsterhus, Maximilian Mader + * @copyright 2010-2011 Tim Düsterhus + * @license Creative Commons Attribution-NonCommercial-ShareAlike + * @package timwolla.wcf.chat + */ -#chatBox aside, #chatRoomContent { +#chatRoomContent { text-align: left; } .sidebar { margin-bottom: -20px !important; -} - -aside { overflow: auto; padding: 0; @@ -32,18 +30,8 @@ aside { } } } - - & aside { - padding-right: 1px; - } - - & aside { - padding-left: 1px; - } } - - #topic, #smileyList, #chatOptions { padding: 5px; } From 4d4ad8def7f8de99c53a1fc2efee3107479c2568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 9 Jan 2012 17:50:39 +0100 Subject: [PATCH 23/51] Change sidebarDirection to sidebarOrientation to comply with the changes in WCF --- template/chat.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/chat.tpl b/template/chat.tpl index 7877cf3..0201365 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -116,7 +116,7 @@
    {/capture} -{include file='header' sandbox=false sidebarDirection='right'} +{include file='header' sandbox=false sidebarOrientation='right'}
    topic|language === ''} style="display: none;"{/if}>{$room->topic|language}
    From 59ec2ac3f09ddfeab009259dda518f32cb52216b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 9 Jan 2012 17:53:10 +0100 Subject: [PATCH 24/51] sidebarMenu -> sidebarContent to comply with changes to WCF --- template/chat.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/chat.tpl b/template/chat.tpl index 0201365..47eccb5 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -76,7 +76,7 @@ {capture assign='sidebar'} -
    +