mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-07 03:59:12 -04:00
GET /controller -> controller::_index() POST /controller -> controller::_create() GET /controller/id -> controller::_show() PUT /controller/id -> controller::_update() DELETE /controller/id -> controller::_delete() GET /form/edit/controller/resource_id -> controller::_form() GET /form/add/controller/data -> controller::_form()
20 lines
587 B
JavaScript
20 lines
587 B
JavaScript
$("document").ready(function() {
|
|
ajaxify_comment_form();
|
|
});
|
|
|
|
function ajaxify_comment_form() {
|
|
$("#gCommentForm").ajaxForm({
|
|
complete: function(xhr, statusText) {
|
|
$("#gCommentForm").replaceWith(xhr.responseText);
|
|
if (xhr.status == 201) {
|
|
$.get(xhr.getResponseHeader("Location"), function(data, textStatus) {
|
|
$("#gComment div.gBlockContent ul:first").append(data);
|
|
$("#gComment div.gBlockContent ul:first li:last").hide().slideDown();
|
|
});
|
|
$("#gCommentForm").clearForm();
|
|
}
|
|
ajaxify_comment_form();
|
|
}
|
|
});
|
|
}
|