From 6ac8adfa83dfc3335758f97a3aa10e8836024685 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 8 Jun 2011 15:36:26 +0200 Subject: [PATCH] Mark new local posts and replies as new after five seconds. --- src/main/resources/static/javascript/sone.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- 2.7.4