ajax comments

This commit is contained in:
Friendika 2011-02-14 04:43:19 -08:00
parent ee46a028d6
commit 39dd36176b

View file

@ -29,6 +29,7 @@
$(document).ready(function() { $(document).ready(function() {
$.ajaxSetup({cache: false}); $.ajaxSetup({cache: false});
msie = $.browser.msie ; msie = $.browser.msie ;
NavUpdate(); NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key // Allow folks to stop the ajax page updates with the pause/break key
@ -211,15 +212,22 @@
} }
function post_comment(id) { function post_comment(id) {
var typename = 'f-type-' + id; $.post(
var puidname = 'f-profile-uid-' + id; "item",
var parname = 'f-parent-' + id; $("#comment-edit-form-" + id).serialize(),
var textname = 'comment-edit-text-' + id; function(data) {
var type = $('input[id=typename]').val(); if(data.success) {
var profile_uid = $('input[id=puidname]').val(); $("#comment-edit-wrapper-" + id).hide();
var parent = $('input[id=parname]').val(); $("#comment-edit-text-" + id).val('');
var body = $('textarea[id=textname]').val(); var tarea = document.getElementById("comment-edit-text-" + id);
if(tarea)
alert(body); commentClose(tarea,id);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,10);
}
},
"json"
);
return false;
} }