summaryrefslogtreecommitdiff
path: root/modules/comment/js/comment.js
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
committerAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
commit0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch)
tree6877946232f1b01b1c8709054c689f6658cef34f /modules/comment/js/comment.js
parent218493c50be9362d4abed6900a816308fee5d978 (diff)
parent9379308f91a476f790fb8d444536719535c584e4 (diff)
Merge commit 'upstream/master'
Conflicts: modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/comment/js/comment.js')
-rw-r--r--modules/comment/js/comment.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js
index bff83770..96370fb1 100644
--- a/modules/comment/js/comment.js
+++ b/modules/comment/js/comment.js
@@ -1,31 +1,43 @@
$("document").ready(function() {
- $("#gAddCommentButton").click(function(event) {
+ $("#g-admin-comment-button").click(function(event) {
event.preventDefault();
- if (!$("#gAddCommentForm").length) {
+ if (!$("#g-comment-form").length) {
$.get($(this).attr("href"),
{},
function(data) {
- $("#gCommentDetail").append(data);
+ $("#g-comment-detail").append(data);
ajaxify_comment_form();
});
}
});
+ $("#g-no-comments").click(function(event) {
+ event.preventDefault();
+ if (!$("#g-comment-form").length) {
+ $.get($(this).attr("href"),
+ {},
+ function(data) {
+ $("#g-comment-detail").append(data);
+ ajaxify_comment_form();
+ });
+ $("#g-no-comments-yet").remove();
+ }
+ });
});
function ajaxify_comment_form() {
- $("#gComments form").ajaxForm({
+ $("#g-comments form").ajaxForm({
dataType: "json",
success: function(data) {
if (data.form) {
- $("#gComments form").replaceWith(data.form);
+ $("#g-comments form").replaceWith(data.form);
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").effect("highlight", {color: "#cfc"}, 8000);
- $("#gAddCommentForm").hide(2000).remove();
- $("#gNoCommentsYet").hide(2000);
+ $("#g-comments .g-block-content ul:first").append("<li>"+data+"</li>");
+ $("#g-comments .g-block-content ul:first li:last").effect("highlight", {color: "#cfc"}, 8000);
+ $("#g-comment-form").hide(2000).remove();
+ $("#g-no-comments-yet").hide(2000);
});
}
}