Convert trust controls to javascript functions.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 3 Jan 2011 06:27:24 +0000 (07:27 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 3 Jan 2011 12:39:06 +0000 (13:39 +0100)
src/main/resources/static/javascript/sone.js

index 58fbf95..09c0bb0 100644 (file)
@@ -569,6 +569,20 @@ function ajaxifyPost(postElement) {
                return false;
        });
 
+       /* convert trust control buttons to javascript functions. */
+       $(postElement).find(".post-trust").submit(function() {
+               trustSone(getPostAuthor(this));
+               return false;
+       });
+       $(postElement).find(".post-distrust").submit(function() {
+               distrustSone(getPostAuthor(this));
+               return false;
+       });
+       $(postElement).find(".post-untrust").submit(function() {
+               untrustSone(getPostAuthor(this));
+               return false;
+       });
+
        /* add “comment” link. */
        addCommentLink(getPostId(postElement), postElement, $(postElement).find(".post-status-line .time"));