mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-14 17:07:53 +00:00
display new mentions with a different background
This commit is contained in:
parent
324ec920a0
commit
759e06216d
@ -851,6 +851,10 @@ ol.toptrends-list {
|
|||||||
transition: background .1s linear;
|
transition: background .1s linear;
|
||||||
-moz-transition: background .1s linear;
|
-moz-transition: background .1s linear;
|
||||||
}
|
}
|
||||||
|
.post.new
|
||||||
|
{
|
||||||
|
background: #F7F8E0;
|
||||||
|
}
|
||||||
.post.open
|
.post.open
|
||||||
{
|
{
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
@ -56,6 +56,9 @@ function postToElem( post, kind, promoted ) {
|
|||||||
elem.addClass(kind);
|
elem.addClass(kind);
|
||||||
elem.attr('data-time', t);
|
elem.attr('data-time', t);
|
||||||
|
|
||||||
|
if( post["isNew"] )
|
||||||
|
elem.addClass('new');
|
||||||
|
|
||||||
var postData = elem.find(".post-data");
|
var postData = elem.find(".post-data");
|
||||||
postData.addClass(kind);
|
postData.addClass(kind);
|
||||||
postData.attr('data-userpost', postJson);
|
postData.attr('data-userpost', postJson);
|
||||||
|
@ -24,7 +24,8 @@ function processMention(user, mentionTime, data) {
|
|||||||
if( mentionTime + 3600 * 24 * 3 > _lastMentionTime ) {
|
if( mentionTime + 3600 * 24 * 3 > _lastMentionTime ) {
|
||||||
_newMentions++;
|
_newMentions++;
|
||||||
newMentionsUpdated = true;
|
newMentionsUpdated = true;
|
||||||
_lastMentionTime = mentionTime;
|
_lastMentionTime = Math.max(mentionTime,_lastMentionTime);
|
||||||
|
data["isNew"] = true;
|
||||||
}
|
}
|
||||||
_knownMentions[key] = {mentionTime:mentionTime, data:data};
|
_knownMentions[key] = {mentionTime:mentionTime, data:data};
|
||||||
purgeOldMentions();
|
purgeOldMentions();
|
||||||
@ -80,6 +81,11 @@ function requestMentionsCount() {
|
|||||||
|
|
||||||
function resetMentionsCount() {
|
function resetMentionsCount() {
|
||||||
_newMentions = 0;
|
_newMentions = 0;
|
||||||
|
for( var key in _knownMentions ) {
|
||||||
|
if( _knownMentions.hasOwnProperty(key) && _knownMentions[key].data ) {
|
||||||
|
delete _knownMentions[key].data["isNew"]
|
||||||
|
}
|
||||||
|
}
|
||||||
saveMentionsToStorage();
|
saveMentionsToStorage();
|
||||||
$.MAL.updateNewMentionsUI(_newMentions);
|
$.MAL.updateNewMentionsUI(_newMentions);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user