X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=ba78d2c30e35c3b667e5638af4491b49d3c7e55a;hb=630d39c1db18db07186e6c38d93cd3ea79d316d0;hp=472df5a82e836f18a5c360b83bcf45cbd399386d;hpb=42beabd1ccb9ce725041a4efcaff95513c9f89b1;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 472df5a..ba78d2c 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)); + }); } /** @@ -690,9 +700,11 @@ function resetActivity() { } function setActivity() { - title = document.title; - if (title.indexOf('(') != 0) { - document.title = "(!) " + title; + if (!focus) { + title = document.title; + if (title.indexOf('(') != 0) { + document.title = "(!) " + title; + } } }