diff options
author | Friendika <info@friendika.com> | 2011-02-14 04:46:49 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-02-14 04:46:49 -0800 |
commit | b87ddbd58aa2739521282f44a463be53c6397231 (patch) | |
tree | ea47d4ca6df492beaf1ffdc6fdfb4159513e9893 | |
parent | f37caa0999b4d9a7a1ef92b7996d3bec00150b2b (diff) | |
parent | df209907536a3c5e093b8ae95070ca9941c6c797 (diff) | |
download | volse-hubzilla-b87ddbd58aa2739521282f44a463be53c6397231.tar.gz volse-hubzilla-b87ddbd58aa2739521282f44a463be53c6397231.tar.bz2 volse-hubzilla-b87ddbd58aa2739521282f44a463be53c6397231.zip |
Merge branch 'ajaxcomms'
Conflicts:
view/comment_item.tpl
-rw-r--r-- | include/main.js | 21 | ||||
-rw-r--r-- | mod/item.php | 7 | ||||
-rw-r--r-- | mod/network.php | 2 | ||||
-rw-r--r-- | mod/profile.php | 2 | ||||
-rw-r--r-- | view/comment_item.tpl | 5 |
5 files changed, 32 insertions, 5 deletions
diff --git a/include/main.js b/include/main.js index 63b34bd21..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 @@ -210,3 +211,23 @@ $('#panel').hide(); } + function post_comment(id) { + $.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; + } + diff --git a/mod/item.php b/mod/item.php index a83373f59..2cc2b9eb2 100644 --- a/mod/item.php +++ b/mod/item.php @@ -490,7 +490,12 @@ function item_post(&$a) { } } - goaway($a->get_baseurl() . "/" . $_POST['return'] ); + if((x($_POST,'return')) && strlen($_POST['return'])) + goaway($a->get_baseurl() . "/" . $_POST['return'] ); + + $json = array('success' => 1); + echo json_encode($json); + killme(); // NOTREACHED } diff --git a/mod/network.php b/mod/network.php index f11db45a8..f09b302e9 100644 --- a/mod/network.php +++ b/mod/network.php @@ -340,7 +340,7 @@ function network_content(&$a, $update = 0) { if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => $_SESSION['return_url'], + '$return_path' => '', // $_SESSION['return_url'], '$type' => 'net-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], diff --git a/mod/profile.php b/mod/profile.php index 8ec29d382..57abc479d 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -293,7 +293,7 @@ function profile_content(&$a, $update = 0) { } if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => $_SESSION['return_url'], + '$return_path' => '', // $_SESSION['return_url'], '$type' => 'wall-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], diff --git a/view/comment_item.tpl b/view/comment_item.tpl index 1b1f3a49e..885d735ed 100644 --- a/view/comment_item.tpl +++ b/view/comment_item.tpl @@ -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" action="item" method="post" onsubmit="post_comment($id); return false;"> <input type="hidden" name="type" value="$type" /> <input type="hidden" name="profile_uid" value="$profile_uid" /> <input type="hidden" name="parent" value="$parent" /> @@ -13,9 +13,10 @@ <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> </form> + </div> |