aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-05-01 10:06:24 +0200
committerMario <mario@mariovavti.com>2019-05-01 10:06:24 +0200
commit256f8dd41b9e22f2b16bf5d912228f84952c748a (patch)
tree4c874b220281b25c293e2ebe8bc6ddde19fa0801 /view
parenta04689b7840f336fed92ec648754cca02dcd90f0 (diff)
parentc340416c9424c285de4701158714541f24d66e85 (diff)
downloadvolse-hubzilla-256f8dd41b9e22f2b16bf5d912228f84952c748a.tar.gz
volse-hubzilla-256f8dd41b9e22f2b16bf5d912228f84952c748a.tar.bz2
volse-hubzilla-256f8dd41b9e22f2b16bf5d912228f84952c748a.zip
Merge branch 'dev' into 'dev'
Add 'reply on comment' feature See merge request hubzilla/core!1614
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js14
-rwxr-xr-xview/tpl/conv_item.tpl5
2 files changed, 19 insertions, 0 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 1322c2112..325ad9a51 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -231,6 +231,10 @@ function handle_comment_form(e) {
$('#' + emptyCommentElm).removeAttr('tabindex');
$('#' + emptySubmitElm).removeAttr('tabindex');
form.find(':not(.comment-edit-text)').hide();
+ form.find(':input[name=parent]').val(emptyCommentElm.replace(/\D/g,''));
+ var btn = form.find(':button[type=submit]').html();
+ form.find(':button[type=submit]').html(btn.replace(/<[^>]*>/g, '').trim());
+ form.find(':button[type=submit]').prop('title', '');
}
});
@@ -1144,6 +1148,16 @@ function doprofilelike(ident, verb) {
$.get('like/' + ident + '?verb=' + verb, function() { window.location.href=window.location.href; });
}
+function doreply(parent, ident, owner, hint) {
+ var form = $('#comment-edit-form-' + parent.toString());
+ form.find('input[name=parent]').val(ident);
+ var i = form.find('button[type=submit]');
+ var btn = i.html().replace(/<[^>]*>/g, '').trim();
+ i.html('<i class="fa fa-reply" ></i> ' + btn);
+ i.prop('title', hint);
+ form.find('textarea').val("@{" + owner + "}\n");
+ $('#comment-edit-text-' + parent.toString()).focus();
+}
function dropItem(url, object) {
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 428529de2..5df706b20 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -102,6 +102,11 @@
<i class="fa fa-thumbs-o-down{{if $item.my_responses.dislike}} ivoted{{/if}}" ></i>
</button>
{{/if}}
+ {{if $item.reply_to}}
+ <button type="button" title="{{$item.reply_to.0}}" class="btn btn-outline-secondary btn-sm" onclick="doreply({{$item.parent}},{{$item.id}},'{{$item.author_id}}', '{{$item.reply_to.2}} {{$item.name}}'); return false;">
+ <i class="fa fa-reply" ></i>
+ </button>
+ {{/if}}
{{if $item.isevent}}
<div class="btn-group">
<button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" id="wall-item-attend-menu-{{$item.id}}" title="{{$item.attend_title}}">