From 9bbe8053c73c875dca7c838e708a8829a80dacf6 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Thu, 12 Feb 2009 07:07:11 +0000 Subject: Added a show comment form button. Add comment form is revealed when the button is clicked. Used jQuery UI Effect to .highlight() to bring attention to newly added comments. Also added a named anchor to our block library to allow direct linking/scrolling to those blocks on the page. --- modules/comment/helpers/comment_theme.php | 1 + modules/comment/js/comment.js | 5 +++-- modules/comment/views/comments.html.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php index 3861bae0..b7e64e38 100644 --- a/modules/comment/helpers/comment_theme.php +++ b/modules/comment/helpers/comment_theme.php @@ -27,6 +27,7 @@ class comment_theme_Core { $block = new Block; $block->css_id = "gComments"; $block->title = t("Comments"); + $block->anchor = t("comments"); $view = new View("comments.html"); $view->comments = ORM::factory("comment") diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js index b000a3a2..bb486bbd 100644 --- a/modules/comment/js/comment.js +++ b/modules/comment/js/comment.js @@ -13,9 +13,10 @@ function ajaxify_comment_form() { if (data.result == "success") { $.get(data.resource, function(data, textStatus) { $("#gComments .gBlockContent ul:first").append("
  • "+data+"
  • "); - $("#gComments .gBlockContent ul:first li:last").hide().slideDown(); + $("#gComments .gBlockContent ul:first li:last").effect("highlight", {color: "#cfc"}, 8000); + $("#gAddCommentForm").hide(2000); }); } } }); -}; +} diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index ec7530c4..b407930e 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -1,5 +1,4 @@ - + -- cgit v1.2.3