diff --git a/templates/main.js b/templates/main.js index 9437c5ca..242ba3a3 100644 --- a/templates/main.js +++ b/templates/main.js @@ -214,6 +214,15 @@ function citeReply(id, with_link) { textarea.value += '>>' + id + '\n'; } if (typeof $ != 'undefined') { + var select = document.getSelection().toString(); + if (select) { + var body = $('#reply_' + id + ', #op_' + id).find('div.body'); // TODO: support for OPs + var index = body.text().indexOf(select.replace('\n', '')); // for some reason this only works like this + if (index > -1) { + textarea.value += '>' + select + '\n'; + } + } + $(window).trigger('cite', [id, with_link]); $(textarea).change(); } diff --git a/templates/post_thread.html b/templates/post_thread.html index aa0f1f78..08b4c4c1 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -5,7 +5,7 @@ {% if not index %}{% endif %} {% include 'post/fileinfo.html' %} -
1%}style='clear:both'{%endif%}>

+

1%}style='clear:both'{%endif%}>