qcomment enhancements

This commit is contained in:
friendica 2012-03-26 20:13:03 -07:00
parent 4c585f759f
commit 5275b5d049
3 changed files with 25 additions and 5 deletions

View file

@ -13,10 +13,12 @@
<div class="comment-edit-photo-end"></div> <div class="comment-edit-photo-end"></div>
<textarea id="comment-edit-text-$id" class="comment-edit-text-empty" name="body" onFocus="commentOpen(this,$id);" onBlur="commentClose(this,$id);" >$comment</textarea> <textarea id="comment-edit-text-$id" class="comment-edit-text-empty" name="body" onFocus="commentOpen(this,$id);" onBlur="commentClose(this,$id);" >$comment</textarea>
{{ if $qcomment }} {{ if $qcomment }}
{{ for $qcomment as $qc }} <select id="qcomment-select-$id" name="qcomment-$id" class="qcomment" onchange="qCommentInsert(this,$id);" >
<span class="fakelink qcomment" onclick="commentInsert(this,$id); return false;" >$qc</span> <option value=""></option>
&nbsp; {{ for $qcomment as $qc }}
<option value="$qc">$qc</option>
{{ endfor }} {{ endfor }}
</select>
{{ endif }} {{ endif }}
<div class="comment-edit-text-end"></div> <div class="comment-edit-text-end"></div>

View file

@ -65,6 +65,22 @@
$("#comment-edit-text-" + id).val(tmpStr + ins); $("#comment-edit-text-" + id).val(tmpStr + ins);
} }
function qCommentInsert(obj,id) {
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == '$comment') {
tmpStr = '';
$("#comment-edit-text-" + id).addClass("comment-edit-text-full");
$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
openMenu("comment-edit-submit-wrapper-" + id);
}
var ins = $(obj).val();
ins = ins.replace('&lt;','<');
ins = ins.replace('&gt;','>');
ins = ins.replace('&amp;','&');
ins = ins.replace('&quot;','"');
$("#comment-edit-text-" + id).val(tmpStr + ins);
}
function showHideComments(id) { function showHideComments(id) {
if( $('#collapsed-comments-' + id).is(':visible')) { if( $('#collapsed-comments-' + id).is(':visible')) {
$('#collapsed-comments-' + id).hide(); $('#collapsed-comments-' + id).hide();

View file

@ -2978,11 +2978,13 @@ div.jGrowl div.info {
.qcomment { .qcomment {
border: 1px solid #EEE; border: 1px solid #EEE;
padding: 3px; padding: 3px;
margin-top: 15px;
margin-left: 25px;
} }
.qcomment { .qcomment {
opacity: 0; opacity: 0.3;
filter:alpha(opacity=0); filter:alpha(opacity=30);
} }
.qcomment:hover { .qcomment:hover {
opacity: 1.0; opacity: 1.0;