summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorChad Kieffer <chad@2tbsp.com>2009-02-12 07:07:11 +0000
committerChad Kieffer <chad@2tbsp.com>2009-02-12 07:07:11 +0000
commit9bbe8053c73c875dca7c838e708a8829a80dacf6 (patch)
tree8a383b53272123858b46d4100454f086d7e667bb /modules
parentd4875583690dbf8b532427755d76aca33d4c63ae (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/helpers/comment_theme.php1
-rw-r--r--modules/comment/js/comment.js5
-rw-r--r--modules/comment/views/comments.html.php2
3 files changed, 5 insertions, 3 deletions
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("<li>"+data+"</li>");
- $("#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 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
-<a name="comments"></a>
<ul id="gComments">
<? foreach ($comments as $comment): ?>
<li id="gComment-<?= $comment->id ?>">
@@ -21,3 +20,4 @@
</li>
<? endforeach ?>
</ul>
+<a name="add_comment_form"></a>