From: David ‘Bombe’ Roden Date: Thu, 25 Nov 2010 12:49:40 +0000 (+0100) Subject: Add functions to mark posts and replies as known. X-Git-Tag: 0.3.1-RC1~11 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3d438cbfcdaa81175c577fbbd31e119bb6679624;p=Sone.git Add functions to mark posts and replies as known. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 936ca57..6cb227c 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -649,6 +649,24 @@ function loadNewReply(replyId) { }); } +function markPostAsKnown(postElements) { + $(postElements).each(function() { + postElement = this; + $.getJSON("ajax/markPostAsKnown.ajax", {"formPassword": getFormPassword(), "post": getPostId(postElement)}, function() { + $(postElement).removeClass("new"); + }); + }); +} + +function markReplyAsKnown(replyElements) { + $(replyElements).each(function() { + replyElement = this; + $.getJSON("ajax/markReplyAsKnown.ajax", {"formPassword": getFormPassword(), "reply": getReplyId(replyElement)}, function() { + $(replyElement).removeClass("new"); + }); + }); +} + /** * Creates a new notification. *