From 3d438cbfcdaa81175c577fbbd31e119bb6679624 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 25 Nov 2010 13:49:40 +0100 Subject: [PATCH] Add functions to mark posts and replies as known. --- src/main/resources/static/javascript/sone.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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. * -- 2.7.4