From 3d9845f4a45f963161e31fe18d69ed31e38af003 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 12 Feb 2011 03:14:59 -0800 Subject: [PATCH 1/7] preliminary ajax comment setups --- mod/item.php | 4 +++- mod/network.php | 2 +- mod/profile.php | 2 +- view/comment_item.tpl | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/item.php b/mod/item.php index a83373f59a..0d9a674f23 100644 --- a/mod/item.php +++ b/mod/item.php @@ -490,7 +490,9 @@ function item_post(&$a) { } } - goaway($a->get_baseurl() . "/" . $_POST['return'] ); + if((x($_POST,'return')) && strlen($_POST['return'])) + goaway($a->get_baseurl() . "/" . $_POST['return'] ); + killme(); // NOTREACHED } diff --git a/mod/network.php b/mod/network.php index f11db45a8b..f09b302e9b 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 8ec29d3827..57abc479d7 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 6f63e39b7a..2f1a8393fe 100644 --- a/view/comment_item.tpl +++ b/view/comment_item.tpl @@ -18,4 +18,5 @@
+ From ee46a028d6e443d4cffcd24a99871d88089a93c9 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 12 Feb 2011 03:42:57 -0800 Subject: [PATCH 2/7] more test ajax comments --- include/main.js | 13 +++++++++++++ view/comment_item.tpl | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/main.js b/include/main.js index 63b34bd21a..afe968daf4 100644 --- a/include/main.js +++ b/include/main.js @@ -210,3 +210,16 @@ $('#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 diff --git a/view/comment_item.tpl b/view/comment_item.tpl index 2f1a8393fe..068cf07318 100644 --- a/view/comment_item.tpl +++ b/view/comment_item.tpl @@ -1,5 +1,5 @@
-
+ @@ -13,7 +13,7 @@
From e32cda65422265ad93458e7028e088dcf8c4504b Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 13 Feb 2011 13:35:08 -0800 Subject: [PATCH 3/7] app not defined --- include/acl_selectors.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 953243a437..94f51a9ff5 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -44,6 +44,8 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) { function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false) { + $a = get_app(); + $o = ''; // When used for private messages, we limit correspondence to mutual friends and the selector From ce8c6dfaf700ab09587a7a9eab5985941bd939b8 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 13 Feb 2011 17:24:42 -0800 Subject: [PATCH 4/7] just in time for valentines day - heart smiley <3 --- boot.php | 3 ++- images/smiley-heart.gif | Bin 0 -> 592 bytes 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 images/smiley-heart.gif diff --git a/boot.php b/boot.php index 2cbc48cde5..6a1d3a04b4 100644 --- a/boot.php +++ b/boot.php @@ -1978,8 +1978,9 @@ function smilies($s) { $a = get_app(); return str_replace( - array( ':-)', ';-)', ':-(', ':(', ':-P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O'), + array( '<3', ':-)', ';-)', ':-(', ':(', ':-P', ':-"', ':-x', ':-X', ':-D', '8-|', '8-O'), array( + '<3', ':-)', ';-)', ':-(', diff --git a/images/smiley-heart.gif b/images/smiley-heart.gif new file mode 100644 index 0000000000000000000000000000000000000000..21c0c6530847f73e43881e6c631c580517d42e8a GIT binary patch literal 592 zcmZ?wbhEHb6k-r!IOf2>#>6DTz@WguAjZXO#lq^r#Kb8g9L>Ox!@wXZAyv-6*v!B% zlYuFZPhc?v!$tT2m?($YHG*24gBNFd7E#@frv)yKy%B*Zs3I4(N6proX=s3fzhs;sH0ed5GPQ>XMzpEhCE ztf}+n&0Mr_+KS~1HmqN_W%JHWn>Ov+yKV2@o%{CgK79Dt@(K!~JTglaWck#aOvGj7w#qG+-zF=|YU!XTwR79yZ3-NQ4jSTz zj_i`?B%dEvU{`8$&}EX@vh_aO zwnz95Gwl=UFan$0o=`eV?NI{sPph9L#^U?hd4AubR C7DkHz literal 0 HcmV?d00001 From f37caa0999b4d9a7a1ef92b7996d3bec00150b2b Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 14 Feb 2011 02:59:22 -0800 Subject: [PATCH 5/7] try this again --- view/comment_item.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/view/comment_item.tpl b/view/comment_item.tpl index 6f63e39b7a..1b1f3a49e9 100644 --- a/view/comment_item.tpl +++ b/view/comment_item.tpl @@ -1,9 +1,9 @@
- - - - + + + +
$mytitle From 39dd36176bb3c72702d6964394d9409be4d6cdcd Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 14 Feb 2011 04:43:19 -0800 Subject: [PATCH 6/7] ajax comments --- include/main.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/include/main.js b/include/main.js index afe968daf4..abd097e54a 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(); + $.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; + } - alert(body); - - } \ No newline at end of file From df209907536a3c5e093b8ae95070ca9941c6c797 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 14 Feb 2011 04:43:49 -0800 Subject: [PATCH 7/7] ajax comments --- mod/item.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/item.php b/mod/item.php index 0d9a674f23..2cc2b9eb2c 100644 --- a/mod/item.php +++ b/mod/item.php @@ -492,6 +492,9 @@ function item_post(&$a) { if((x($_POST,'return')) && strlen($_POST['return'])) goaway($a->get_baseurl() . "/" . $_POST['return'] ); + + $json = array('success' => 1); + echo json_encode($json); killme(); // NOTREACHED }