Add functions to mark posts and replies as known.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 12:49:40 +0000 (13:49 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 12:49:40 +0000 (13:49 +0100)
src/main/resources/static/javascript/sone.js

index 936ca57..6cb227c 100644 (file)
@@ -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.
  *