]> git.mxchange.org Git - friendica.git/commitdiff
CommentBox is now hidden by default, this can be toggled with a fake link
authorDomovoy <domovoy@errlock.org>
Fri, 27 Jul 2012 20:47:18 +0000 (22:47 +0200)
committerDomovoy <domovoy@errlock.org>
Fri, 27 Jul 2012 20:47:18 +0000 (22:47 +0200)
include/conversation.php
view/comment_item.tpl
view/head.tpl
view/theme/duepuntozero/comment_item.tpl

index 2794d8ab3b060653289f7155d9460c031e09e419..2a085666d782d580638971c74d22839ceac34de3 100644 (file)
@@ -473,7 +473,6 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
                        }
                }
 
-               logger('item, page_writeable:'. ($page_writeable ? 'yes' : 'no') .', show comment box: '. ($show_comment_box ? 'yes' : 'no'), LOGGER_DEBUG);
                if($page_writeable) {
                        $buttons = array(
                                'like' => array( t("I like this \x28toggle\x29"), t("like")),
@@ -489,7 +488,6 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
                                        $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
                                        $qcomment = (($qc) ? explode("\n",$qc) : null);
                                }
-                               
                                $comment = replace_macros($cmnt_tpl,array(
                                        '$return_path' => '', 
                                        '$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
index a1d4e1043a3ba18e7cec9616d6ee5f8550cbf1c3..b2be6f94e3f15daea20319a947ce02f9ea65dd41 100644 (file)
@@ -1,5 +1,6 @@
                <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" onsubmit="post_comment($id); return false;">
+                       <span id="hide-commentbox-$id" class="hide-commentbox fakelink" onclick="showHideCommentBox($id);">$comment</span>
+                       <form class="comment-edit-form" style="display: none;" 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" />
index 8a75a4b8e0bf1ecb0900b8b1895f37c02f2a337d..e5495b329f159d24d1c60692844208651488a843 100644 (file)
                }
        }
 
+       function showHideCommentBox(id) {
+               if( $('#comment-edit-form-' + id).is(':visible')) {
+                       $('#comment-edit-form-' + id).hide();
+               }
+               else {
+                       $('#comment-edit-form-' + id).show();
+               }
+       }
+
 
 </script>
 
index ea24d95cc33e80e9060525582ca6e00989145747..63c05f335c989dc11077118fd16ad7cf4564e41e 100755 (executable)
@@ -1,5 +1,6 @@
                <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" onsubmit="post_comment($id); return false;">
+                       <span id="hide-commentbox-$id" class="hide-commentbox fakelink" onclick="showHideCommentBox($id);">$comment</span>
+                       <form class="comment-edit-form" style="display: none;" 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" />