2008-11-16 07:14:12 +00:00
|
|
|
$("document").ready(function() {
|
|
|
|
|
ajaxify_comment_form();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function ajaxify_comment_form() {
|
2008-11-23 20:17:02 +00:00
|
|
|
$("#gComments form").ajaxForm({
|
2008-11-16 07:14:12 +00:00
|
|
|
complete: function(xhr, statusText) {
|
2008-11-23 20:17:02 +00:00
|
|
|
$("#gComments form").replaceWith(xhr.responseText);
|
2008-11-16 07:14:12 +00:00
|
|
|
if (xhr.status == 201) {
|
|
|
|
|
$.get(xhr.getResponseHeader("Location"), function(data, textStatus) {
|
2008-11-24 07:12:45 +00:00
|
|
|
$("#gComments .gBlockContent ul:first").append("<li>"+data+"</li>");
|
|
|
|
|
$("#gComments .gBlockContent ul:first li:last").hide().slideDown();
|
2008-11-18 08:28:32 +00:00
|
|
|
});
|
2008-11-23 20:17:02 +00:00
|
|
|
$("#gComments form").clearForm();
|
2008-11-16 07:14:12 +00:00
|
|
|
}
|
2008-11-16 07:27:36 +00:00
|
|
|
ajaxify_comment_form();
|
2008-11-16 07:14:12 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|