Files
gallery3/modules/comment/js/comment.js
T

24 lines
691 B
JavaScript
Raw Normal View History

2008-11-16 07:14:12 +00:00
$("document").ready(function() {
ajaxify_comment_form();
});
function ajaxify_comment_form() {
$("#gComments form").ajaxForm({
2008-12-25 01:34:17 +00:00
dataType: "json",
success: function(data) {
if (data.form) {
2008-12-31 03:29:25 +00:00
$("#gComments 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);
$("#gNoCommentsYet").hide(2000);
});
2008-11-16 07:14:12 +00:00
}
}
});
}