From 50827a6691829e50b592819ab22168f751e5c23e Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 30 Oct 2015 04:28:23 +0500 Subject: [PATCH] individual new messages counters in DM modals for each peer/group --- css/style.css | 7 +++++++ following.html | 1 + home.html | 1 + js/twister_directmsg.js | 5 +++++ theme_calm/css/style.css | 7 +++++++ theme_nin/css/style.css | 7 +++++++ theme_nin/sass/style.sass | 5 +++++ 7 files changed, 33 insertions(+) diff --git a/css/style.css b/css/style.css index 57a74d3..94144a4 100644 --- a/css/style.css +++ b/css/style.css @@ -1534,6 +1534,13 @@ ol.toptrends-list { color: rgba( 0, 0, 0, .4 ); } +.direct-messages-list .post .messages-qtd { + display: none; + top: 8px; + left: 16px; + line-height: 8px; +} + .direct-messages-thread { padding: 10px; } diff --git a/following.html b/following.html index 998eace..603ef13 100644 --- a/following.html +++ b/following.html @@ -373,6 +373,7 @@

+
0
diff --git a/home.html b/home.html index 46d0eea..3ecaf28 100644 --- a/home.html +++ b/home.html @@ -465,6 +465,7 @@

+
0
diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index 18fbb92..d07e77f 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -28,6 +28,11 @@ function processDMsnippet(dmUsers, dmThreadList, forGroup) { // convert snipped to html and add it to date-sorted list var dmItem = dmDataToSnippetItem(dmUsers[u][0], u); + console.log(u + ': ' + _newDMsPerUser[u]); + if (_newDMsPerUser[u] > 0) { + dmItem.addClass('new') + .find('.messages-qtd').text(_newDMsPerUser[u]).show(); + } var timeDmItem = parseInt(dmItem.attr('data-time')); var existingItems = dmThreadList.children(); for (var j = 0; j < existingItems.length; j++) { diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index 9ed5f30..bad4484 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -1919,6 +1919,13 @@ textarea.splited-post { color: rgba( 0, 0, 0, .4 ); } +.direct-messages-list .post .messages-qtd { + display: none; + top: 8px; + left: 16px; + line-height: 8px; +} + .direct-messages-thread { padding: 10px; } diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 8f97f6b..98b2b1d 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -2905,6 +2905,13 @@ ol.toptrends-list a:hover { display: none; } +.direct-messages-list .post .messages-qtd { + display: none; + top: -2px; + right: -2px; + font-size: 0.7em; +} + /* line 782, ../sass/style.sass */ .direct-messages-list .post:hover:after { display: block; diff --git a/theme_nin/sass/style.sass b/theme_nin/sass/style.sass index 5c97f8c..3ea82ed 100755 --- a/theme_nin/sass/style.sass +++ b/theme_nin/sass/style.sass @@ -847,6 +847,11 @@ ol.toptrends-list margin: -6px 0 0 0 color: rgba(0, 0, 0, 0.4) display: none + .messages-qtd + display: none + top: -2px + right: -2px + font-size: 0.7em .direct-messages-list .post:hover:after