From: David ‘Bombe’ Roden Date: Thu, 17 Feb 2011 10:26:10 +0000 (+0100) Subject: Ajaxify bookmark buttons. X-Git-Tag: 0.4.4^2~7^2~1 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=8dea6187151fc392e6274cbca27157f0effafd35 Ajaxify bookmark buttons. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index c5296ca..e99d654 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -692,6 +692,16 @@ function ajaxifyPost(postElement) { return false; }); + /* convert bookmark/unbookmark buttons to javascript functions. */ + $(postElement).find(".bookmark").submit(function() { + bookmarkPost(getPostId(this)); + return false; + }); + $(postElement).find(".unbookmark").submit(function() { + unbookmarkPost(getPostId(this)); + return false; + }); + /* add “comment” link. */ addCommentLink(getPostId(postElement), postElement, $(postElement).find(".post-status-line .time"));