From fd30be7644cc35d5396bcaf7bb376fd26e476ba5 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 9 Sep 2019 12:35:47 +0200 Subject: Add selected text quote on comment reply --- view/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index 2eea7543d..bc1c48cf1 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1146,8 +1146,8 @@ function doreply(parent, ident, owner, hint) { var i = form.find('button[type=submit]'); var btn = i.html().replace(/<[^>]*>/g, '').trim(); i.html(' ' + btn); - i.prop('title', hint); - form.find('textarea').val("@{" + owner + "} "); + var sel = 'wall-item-body-' + ident.toString(); + form.find('textarea').val("@{" + owner + "}" + (($(window.getSelection().anchorNode).closest("#" + sel).attr("id") != sel) ? " " : "\n[quote]" + window.getSelection().toString() + "[/quote]\n")); $('#comment-edit-text-' + parent.toString()).focus(); } -- cgit v1.2.3