Files
gallery3/themes/default/js/comment.js
Jozef Selesi 3ebb751cda First iteration of REST controller refactoring. RESTful controllers that refer to collections should now have plural names and there should be only one controller per resource. Updated existing classes that implement REST_Controller. The routing now works like this:
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()
2008-11-18 08:28:32 +00:00

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();
}
});
}