]> git.mxchange.org Git - friendica.git/commitdiff
more test ajax comments
authorFriendika <info@friendika.com>
Sat, 12 Feb 2011 11:42:57 +0000 (03:42 -0800)
committerFriendika <info@friendika.com>
Sat, 12 Feb 2011 11:42:57 +0000 (03:42 -0800)
include/main.js
view/comment_item.tpl

index 63b34bd21aa0bd9acc889541ad974595708d51bf..afe968daf433594a824b338451141ca3b05f3fea 100644 (file)
                $('#panel').hide();
        }
 
+       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
index 2f1a8393fece8e4ff752f92b4e9fbc5cc3632f1e..068cf073187bc6650a32b4cb8456d8586c1cbf46 100644 (file)
@@ -1,5 +1,5 @@
                <div class="comment-$wwedit-wrapper" id="comment-edit-wrapper-$id" style="display: block;">
-                       <form class="comment-edit-form" id="comment-edit-form-$id" action="item" method="post" >
+                       <form class="comment-edit-form" id="comment-edit-form-$id" method="post" onsubmit="post_comment($id); return false;">
                                <input id="f-type-$id" type="hidden" name="type" value="$type" />
                                <input id="f-profile-uid-$id" type="hidden" name="profile_uid" value="$profile_uid" />
                                <input id="f-parent-$id" type="hidden" name="parent" value="$parent" />
@@ -13,7 +13,7 @@
 
                                <div class="comment-edit-text-end"></div>
                                <div class="comment-edit-submit-wrapper" id="comment-edit-submit-wrapper-$id" style="display: none;" >
-                                       <input type="submit" id="comment-edit-submit-$id" class="comment-edit-submit" name="submit" value="Submit" />
+                                       <input type="submit" onclick="post_comment($id); return false;" id="comment-edit-submit-$id" class="comment-edit-submit" name="submit" value="Submit" />
                                </div>
 
                                <div class="comment-edit-end"></div>