Mercurial > cosocket
changeset 41:c9ba9a45f1dd
Group consecutive messages by the same author.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 27 Apr 2009 22:49:48 -0700 |
parents | 11c4fb8bec3c |
children | f560e6f01c22 |
files | openwebchat.css openwebchat.js |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/openwebchat.css Mon Apr 27 22:26:57 2009 -0700 +++ b/openwebchat.css Mon Apr 27 22:49:48 2009 -0700 @@ -38,9 +38,10 @@ } .message { - padding-bottom: 1em; + } .author { + padding-top: 1em; font-variant: small-caps; }
--- a/openwebchat.js Mon Apr 27 22:26:57 2009 -0700 +++ b/openwebchat.js Mon Apr 27 22:49:48 2009 -0700 @@ -60,8 +60,11 @@ $('.content', block).html(msg.content); var author = msg.author ? msg.author : 'Anonymous'; - $('.author', block).text(author); - + if (author != $('.author:last').text()) + $('.author', block).text(author); + else + $('.author', block).remove(); + block.hide(); $('#incoming-messages').append(block); block.slideDown();