]> git.mxchange.org Git - friendica.git/blob - templates/comment_item.tpl
hovercard: some polishing
[friendica.git] / templates / comment_item.tpl
1 <script>
2         function commentOpenUI(obj, id) {
3                 $(document).unbind( "click.commentOpen", handler );
4
5                 var handler = function() {
6                         if(obj.value == '{{$comment}}') {
7                                 obj.value = '';
8                                 $("#comment-edit-text-" + id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty");
9                                 // Choose an arbitrary tab index that's greater than what we're using in jot (3 of them)
10                                 // The submit button gets tabindex + 1
11                                 $("#comment-edit-text-" + id).attr('tabindex','9');
12                                 $("#comment-edit-submit-" + id).attr('tabindex','10');
13                                 $("#comment-edit-submit-wrapper-" + id).show();
14                         }
15                 };
16
17                 $(document).bind( "click.commentOpen", handler );
18 }
19
20         function commentCloseUI(obj, id) {
21                 $(document).unbind( "click.commentClose", handler );
22
23                 var handler = function() {
24                         if(obj.value === '') {
25                         obj.value = '{{$comment}}';
26                                 $("#comment-edit-text-" + id).removeClass("comment-edit-text-full").addClass("comment-edit-text-empty");
27                                 $("#comment-edit-text-" + id).removeAttr('tabindex');
28                                 $("#comment-edit-submit-" + id).removeAttr('tabindex');
29                                 $("#comment-edit-submit-wrapper-" + id).hide();
30                         }
31                 };
32
33                 $(document).bind( "click.commentClose", handler );
34         }
35
36 </script>
37
38 {{if $threaded}}
39 <div class="comment-wwedit-wrapper threaded" id="comment-edit-wrapper-{{$id}}" style="display: block;">
40 {{else}}
41 <div class="comment-wwedit-wrapper" id="comment-edit-wrapper-{{$id}}" style="display: block;">
42 {{/if}}
43         <form class="comment-edit-form" style="display: block;" id="comment-edit-form-{{$id}}" action="item" method="post" onsubmit="post_comment({{$id}}); return false;">
44                 <input type="hidden" name="type" value="{{$type}}" />
45                 <input type="hidden" name="profile_uid" value="{{$profile_uid}}" />
46                 <input type="hidden" name="parent" value="{{$parent}}" />
47                 {{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
48                 <input type="hidden" name="jsreload" value="{{$jsreload}}" />
49                 <input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
50                 <input type="hidden" name="post_id_random" value="{{$rand_num}}" />
51
52                 <!--<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}" >
53                         <a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
54                 </div>
55                 <div class="comment-edit-photo-end"></div>-->
56                 <div class="bb form-group">
57                         <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty form-control" name="body" onFocus="commentOpenUI(this,{{$id}});" onBlur="commentCloseUI(this,{{$id}});">{{$comment}}</textarea>
58                 </div>
59                 {{if $qcomment}}
60                         <select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});" >
61                         <option value=""></option>
62                 {{foreach $qcomment as $qc}}
63                         <option value="{{$qc}}">{{$qc}}</option>
64                 {{/foreach}}
65                         </select>
66                 {{/if}}
67
68                 <div class="comment-edit-text-end"></div>
69                 <div class="comment-edit-submit-wrapper" id="comment-edit-submit-wrapper-{{$id}}" style="display: none;">
70                         <button class="btn btn-primary btn-sm" type="submit" onclick="post_comment({{$id}}); return false;" id="comment-edit-submit-{{$id}}" name="submit"><i class="fa fa-envelope"></i> {{$submit}}</button>
71                         {{if $preview}}
72                                 <button class="btn btn-defaul btn-sm" type="button" onclick="preview_comment({{$id}});" id="comment-edit-preview-link-{{$id}}"><i class="fa fa-eye"></i> {{$preview}}</button>
73                         {{/if}}
74                         <ul class="comment-edit-bb-{{$id}} nav nav-pills pull-right">
75                                 <li>
76                                         <a style="cursor: pointer;" title="{{$edimg}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="{{$id}}">
77                                                 <i class="fa fa-picture-o"></i>
78                                         </a>
79                                 </li>
80                                 <li>
81                                         <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl}}" onclick="insertFormatting('{{$comment}}','url',{{$id}});">
82                                                 <i class="fa fa-link"></i>
83                                         </a>
84                                 </li>
85                                 <li>
86                                         <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo}}" onclick="insertFormatting('{{$comment}}','video',{{$id}});">
87                                                 <i class="fa fa-video-camera"></i>
88                                         </a>
89                                 </li>
90
91                                 <li>
92                                         <a class="icon underline" style="cursor: pointer;" title="{{$eduline}}" onclick="insertFormatting('{{$comment}}','u',{{$id}});">
93                                                 <i class="fa fa-underline"></i>
94                                         </a>
95                                 </li>
96                                 <li>
97                                         <a class="icon italic" style="cursor: pointer;" title="{{$editalic}}" onclick="insertFormatting('{{$comment}}','i',{{$id}});">
98                                                 <i class="fa fa-italic"></i>
99                                         </a>
100                                 </li>
101                                 <li>
102                                         <a class="icon bold" style="cursor: pointer;"  title="{{$edbold}}" onclick="insertFormatting('{{$comment}}','b',{{$id}});">
103                                                 <i class="fa fa-bold"></i>
104                                         </a>
105                                 </li>
106                                 <li>
107                                         <a class="icon quote" style="cursor: pointer;" title="{{$edquote}}" onclick="insertFormatting('{{$comment}}','quote',{{$id}});">
108                                                 <i class="fa fa-quote-left"></i>
109                                         </a>
110                                 </li>
111                         </ul>
112                         <div id="comment-edit-preview-{{$id}}" class="comment-edit-preview" style="display:none;"></div>
113                 </div>
114
115                 <div class="comment-edit-end"></div>
116         </form>
117
118 </div>