aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-12 00:49:06 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-12 00:49:06 -0700
commitb0f8cd5fe684d5c03419838c2859a11ea6d6f8a0 (patch)
treec1314b58b02985955b8cbcabb541fe602f8123a4
parent4e40156607aede8d1ed9bd63b18bc6c83ea572d7 (diff)
downloadvolse-hubzilla-b0f8cd5fe684d5c03419838c2859a11ea6d6f8a0.tar.gz
volse-hubzilla-b0f8cd5fe684d5c03419838c2859a11ea6d6f8a0.tar.bz2
volse-hubzilla-b0f8cd5fe684d5c03419838c2859a11ea6d6f8a0.zip
facebook style comments
-rw-r--r--include/main.js8
-rw-r--r--mod/profile.php19
-rw-r--r--view/comment_item.tpl6
3 files changed, 21 insertions, 12 deletions
diff --git a/include/main.js b/include/main.js
index 4fb92c774..8d364ebce 100644
--- a/include/main.js
+++ b/include/main.js
@@ -7,6 +7,14 @@
document.getElementById(theID).style.display = "block"
}
}
+
function openMenu(theID) {
document.getElementById(theID).style.display = "block"
}
+
+ function closeMenu(theID) {
+ document.getElementById(theID).style.display = "none"
+ }
+
+
+
diff --git a/mod/profile.php b/mod/profile.php
index 832618c91..45bac146e 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -216,16 +216,17 @@ dbg(2);
$tpl = file_get_contents('view/wall_item.tpl');
if(count($r)) {
- foreach($r as $rr) {
+ for($x = 0; $x < count($r); $x ++) {
+ $rr = $r[$x];
+ $comment = '';
if(can_write_wall($a,$a->profile['profile_uid'])) {
- $comment = replace_macros($template,array(
- '$id' => $rr['item_id'],
- '$parent' => $rr['parent'],
- '$profile_uid' => $a->profile['profile_uid']
- ));
- }
- else {
- $comment = '';
+ if((($x + 1) < count($r)) && ($r[$x+1]['parent'] != $rr['parent'])) {
+ $comment = replace_macros($template,array(
+ '$id' => $rr['item_id'],
+ '$parent' => $rr['parent'],
+ '$profile_uid' => $a->profile['profile_uid']
+ ));
+ }
}
$o .= item_display($a,$rr,$tpl,$comment);
}
diff --git a/view/comment_item.tpl b/view/comment_item.tpl
index 3ca190ba5..f617bc1a0 100644
--- a/view/comment_item.tpl
+++ b/view/comment_item.tpl
@@ -1,14 +1,14 @@
<div class="comment-edit" id="comment-edit-$id" onclick="openClose('comment-edit-wrapper-$id');" >Comments</div>
-<div class="comment-edit-wrapper" id="comment-edit-wrapper-$id" style="display: none;">
+<div class="comment-edit-wrapper" id="comment-edit-wrapper-$id" style="display: block;">
<form class="comment-edit-form" id="comment-edit-form-$id" action="item" method="post" >
<input type="hidden" name="type" value="jot" />
<input type="hidden" name="profile_uid" value="$profile_uid" />
<input type="hidden" name="parent" value="$parent" />
- <textarea rows="3" cols="40" id="comment-edit-text-$id" name="body" ></textarea>
+ <textarea rows="2" cols="24" id="comment-edit-text-$id" name="body" onFocus="this.rows=5; this.cols=40; openMenu('comment-edit-submit-$id');" onBlur="this.rows=2; this.cols=24; closeMenu('comment-edit-submit-$id'); this.value='';"></textarea>
- <div id="comment-edit-submit-wrapper" >
+ <div class="comment-edit-submit-wrapper" id="comment-edit-submit-$id" style="display: none;" >
<input type="submit" id="comment-edit-submit" name="submit" value="Submit" />
</div>
<div id="comment-edit-end"></div>