mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-17 02:59:22 -04:00
23 lines
655 B
JavaScript
23 lines
655 B
JavaScript
$("document").ready(function() {
|
|
ajaxify_comment_form();
|
|
});
|
|
|
|
function ajaxify_comment_form() {
|
|
$("#gComments form").ajaxForm({
|
|
dataType: "json",
|
|
success: function(data) {
|
|
if (data.form) {
|
|
$("#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);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|