X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=c02e240d8f2a637d9addd7c79a3b44623dae40ed;hb=eb8d6cb360fd57eeccc692f631f6b9b7d8f41729;hp=e07c51ef775c99d0cf9e46edbb8e83463f561fd3;hpb=39788815bb8b499128d895304b5aee707dfc3b9a;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index e07c51e..c02e240 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -497,6 +497,11 @@ function ajaxifyPost(postElement) { }); }); + /* mark everything as known on click. */ + $(postElement).click(function() { + markPostAsKnown(this); + }); + /* hide reply input field. */ $(postElement).find(".create-reply").addClass("hidden"); } @@ -526,6 +531,11 @@ function ajaxifyReply(replyElement) { }); })(replyElement); addCommentLink(getPostId(replyElement), replyElement, $(replyElement).find(".reply-status-line .time")); + + /* mark post and all replies as known on click. */ + $(replyElement).click(function() { + markPostAsKnown(getPostElement(replyElement)); + }); } /** @@ -608,7 +618,9 @@ function loadNewPost(postId) { return false; } }); - newPost = $(data.post.html).addClass("hidden"); + newPost = $(data.post.html).addClass("hidden").click(function() { + markPostAsKnown(this); + }); if (firstOlderPost != null) { newPost.insertBefore(firstOlderPost); } else { @@ -637,7 +649,9 @@ function loadNewReply(replyId) { return false; } }); - newReply = $(data.reply.html).addClass("hidden"); + newReply = $(data.reply.html).addClass("hidden").click(function() { + markPostAsKnown(getPostElement(this)); + }); if (firstNewerReply != null) { newReply.insertBefore(firstNewerReply); } else {