Mark new local posts and replies as new after five seconds.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 8 Jun 2011 13:36:26 +0000 (15:36 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 8 Jun 2011 13:36:26 +0000 (15:36 +0200)
src/main/resources/static/javascript/sone.js

index 375fc53..35db2d6 100644 (file)
@@ -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);