# HG changeset patch # User Atul Varma # Date 1240897788 25200 # Node ID c9ba9a45f1ddb8f1128a4e8fc0f4ecd4ff5bb4f7 # Parent 11c4fb8bec3cd5464cb4adfd61c29d664afdbb75 Group consecutive messages by the same author. diff -r 11c4fb8bec3c -r c9ba9a45f1dd openwebchat.css --- 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; } diff -r 11c4fb8bec3c -r c9ba9a45f1dd openwebchat.js --- 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();