From 43f0b7c9feffceff7aabed2d24c1131e24fb8262 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 17 Feb 2011 11:25:53 +0100 Subject: [PATCH] Add function to return the post for an ID. --- src/main/resources/static/javascript/sone.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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"); } -- 2.7.4