aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-14 04:43:19 -0800
committerFriendika <info@friendika.com>2011-02-14 04:43:19 -0800
commit39dd36176bb3c72702d6964394d9409be4d6cdcd (patch)
tree875ba5ec83fa1f56ee06f72dc7ae38c8ac6bb9df /include
parentee46a028d6e443d4cffcd24a99871d88089a93c9 (diff)
downloadvolse-hubzilla-39dd36176bb3c72702d6964394d9409be4d6cdcd.tar.gz
volse-hubzilla-39dd36176bb3c72702d6964394d9409be4d6cdcd.tar.bz2
volse-hubzilla-39dd36176bb3c72702d6964394d9409be4d6cdcd.zip
ajax comments
Diffstat (limited to 'include')
-rw-r--r--include/main.js32
1 files changed, 20 insertions, 12 deletions
diff --git a/include/main.js b/include/main.js
index afe968daf..abd097e54 100644
--- a/include/main.js
+++ b/include/main.js
@@ -29,6 +29,7 @@
$(document).ready(function() {
$.ajaxSetup({cache: false});
+
msie = $.browser.msie ;
NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key
@@ -211,15 +212,22 @@
}
function post_comment(id) {
- var typename = 'f-type-' + id;
- var puidname = 'f-profile-uid-' + id;
- var parname = 'f-parent-' + id;
- var textname = 'comment-edit-text-' + id;
- var type = $('input[id=typename]').val();
- var profile_uid = $('input[id=puidname]').val();
- var parent = $('input[id=parname]').val();
- var body = $('textarea[id=textname]').val();
-
- alert(body);
-
- } \ No newline at end of file
+ $.post(
+ "item",
+ $("#comment-edit-form-" + id).serialize(),
+ function(data) {
+ if(data.success) {
+ $("#comment-edit-wrapper-" + id).hide();
+ $("#comment-edit-text-" + id).val('');
+ var tarea = document.getElementById("comment-edit-text-" + id);
+ if(tarea)
+ commentClose(tarea,id);
+ if(timer) clearTimeout(timer);
+ timer = setTimeout(NavUpdate,10);
+ }
+ },
+ "json"
+ );
+ return false;
+ }
+