Ajaxify trust controls in replies.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 3 Jan 2011 19:12:49 +0000 (20:12 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 3 Jan 2011 19:12:49 +0000 (20:12 +0100)
src/main/resources/static/javascript/sone.js

index d67cbc4..ef34c66 100644 (file)
@@ -640,6 +640,20 @@ function ajaxifyReply(replyElement) {
        })(replyElement);
        addCommentLink(getPostId(replyElement), replyElement, $(replyElement).find(".reply-status-line .time"));
 
+       /* convert trust control buttons to javascript functions. */
+       $(replyElement).find(".reply-trust").submit(function() {
+               trustSone(getReplyAuthor(this));
+               return false;
+       });
+       $(replyElement).find(".reply-distrust").submit(function() {
+               distrustSone(getReplyAuthor(this));
+               return false;
+       });
+       $(replyElement).find(".reply-untrust").submit(function() {
+               untrustSone(getReplyAuthor(this));
+               return false;
+       });
+
        /* mark post and all replies as known on click. */
        $(replyElement).click(function() {
                markPostAsKnown(getPostElement(this));