From: David ‘Bombe’ Roden Date: Thu, 17 Feb 2011 10:25:53 +0000 (+0100) Subject: Add function to return the post for an ID. X-Git-Tag: 0.4.4^2~7^2~3 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=43f0b7c9feffceff7aabed2d24c1131e24fb8262 Add function to return the post for an ID. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 6c396f8..60861b5 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -297,6 +297,17 @@ function getSoneId(element) { return getSoneElement(element).find(".id").text(); } +/** + * Returns the element of the post with the given ID. + * + * @param postId + * The ID of the post + * @returns The element of the post + */ +function getPost(postId) { + return $("#sone .post#" + postId); +} + function getPostElement(element) { return $(element).closest(".post"); }