2 function commentOpenUI(obj, id) {
3 $(document).unbind( "click.commentOpen", handler );
5 var handler = function() {
6 if(obj.value == '{{$comment}}') {
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();
17 $(document).bind( "click.commentOpen", handler );
20 function commentCloseUI(obj, id) {
21 $(document).unbind( "click.commentClose", handler );
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();
33 $(document).bind( "click.commentClose", handler );
39 <div class="comment-wwedit-wrapper threaded" id="comment-edit-wrapper-{{$id}}" style="display: block;">
41 <div class="comment-wwedit-wrapper" id="comment-edit-wrapper-{{$id}}" style="display: block;">
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}}" />
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>
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>
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>
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>
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>
74 <ul class="comment-edit-bb-{{$id}} nav nav-pills pull-right">
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>
81 <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl}}" onclick="insertFormatting('{{$comment}}','url',{{$id}});">
82 <i class="fa fa-link"></i>
86 <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo}}" onclick="insertFormatting('{{$comment}}','video',{{$id}});">
87 <i class="fa fa-video-camera"></i>
92 <a class="icon underline" style="cursor: pointer;" title="{{$eduline}}" onclick="insertFormatting('{{$comment}}','u',{{$id}});">
93 <i class="fa fa-underline"></i>
97 <a class="icon italic" style="cursor: pointer;" title="{{$editalic}}" onclick="insertFormatting('{{$comment}}','i',{{$id}});">
98 <i class="fa fa-italic"></i>
102 <a class="icon bold" style="cursor: pointer;" title="{{$edbold}}" onclick="insertFormatting('{{$comment}}','b',{{$id}});">
103 <i class="fa fa-bold"></i>
107 <a class="icon quote" style="cursor: pointer;" title="{{$edquote}}" onclick="insertFormatting('{{$comment}}','quote',{{$id}});">
108 <i class="fa fa-quote-left"></i>
112 <div id="comment-edit-preview-{{$id}}" class="comment-edit-preview" style="display:none;"></div>
115 <div class="comment-edit-end"></div>