From: David ‘Bombe’ Roden Date: Wed, 8 Jun 2011 13:36:26 +0000 (+0200) Subject: Mark new local posts and replies as new after five seconds. X-Git-Tag: 0.6.5^2~10^2~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6ac8adfa83dfc3335758f97a3aa10e8836024685;p=Sone.git Mark new local posts and replies as new after five seconds. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 375fc53..35db2d6 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1237,6 +1237,11 @@ function loadNewPost(postId, soneId, recipientId, time) { newPost = $(data.post.html).addClass("hidden"); if ($(".post-author-local", newPost).text() == "true") { newPost.removeClass("new"); + (function(newPost) { + setTimeout(function() { + markPostAsKnown(newPost, false); + }, 5000); + })(newPost); } if (firstOlderPost != null) { newPost.insertBefore(firstOlderPost); @@ -1273,6 +1278,11 @@ function loadNewReply(replyId, soneId, postId, postSoneId) { newReply = $(data.reply.html).addClass("hidden"); if ($(".reply-author-local", newPost).text() == "true") { newPost.removeClass("new"); + (function(newReply) { + setTimeout(function() { + markReplyAsKnown(newReply, false); + }, 5000); + })(newReply); } if (firstNewerReply != null) { newReply.insertBefore(firstNewerReply);