diff options
author | Max Kostikov <max@kostikov.co> | 2019-09-30 16:54:35 +0200 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-09-30 16:54:35 +0200 |
commit | 97b161c5366387b86ee8ac245ef92624e52c5ea2 (patch) | |
tree | e2c1371f8d4fc88e298fa81388d9681e27c2a430 /view/js/main.js | |
parent | cf27b7440dace81d29358af38dd63ba2978eedb0 (diff) | |
parent | ba3a6ecb52b5a092ea5dbf56ddd8faccfc6c4335 (diff) | |
download | volse-hubzilla-97b161c5366387b86ee8ac245ef92624e52c5ea2.tar.gz volse-hubzilla-97b161c5366387b86ee8ac245ef92624e52c5ea2.tar.bz2 volse-hubzilla-97b161c5366387b86ee8ac245ef92624e52c5ea2.zip |
Merge branch 'dev' into 'dev'
Fix empty string quotation; remove trailing spaces
See merge request hubzilla/core!1742
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/view/js/main.js b/view/js/main.js index bc1c48cf1..2b4acdf61 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1140,15 +1140,17 @@ 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); - 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(); + 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); + var sel = 'wall-item-body-' + ident.toString(); + var quote = window.getSelection().toString().trim(); + form.find('textarea').val("@{" + owner + "}" + ((($(window.getSelection().anchorNode).closest("#" + sel).attr("id") != sel) || (quote.length === 0))? " " : "\n[quote]" + quote + "[/quote]\n")); + $('#comment-edit-text-' + parent.toString()).focus(); } function doscroll(parent, hidden) { |