Node.js based forum software built for the modern web
closed #74
Julian Lam86ad794918e6
diff --git a/public/css/topic.less b/public/css/topic.lessindex a89e53c0bc..a92a5e221a 100644--- a/public/css/topic.less+++ b/public/css/topic.less@@ -57,12 +57,16 @@float: right;margin-right: 5px;- div {+ button {display: inline-block;padding-left: 15px;padding-right: 15px;+ border: none;border-left: 1px solid #f0f0f0;cursor: pointer;+ background: none;+ font-size: 12px;+ height: 20px;&:last-child {padding-right: 5px;diff --git a/public/src/forum/topic.js b/public/src/forum/topic.jsindex 7f74eadb87..063183ffe5 100644--- a/public/src/forum/topic.js+++ b/public/src/forum/topic.js@@ -221,10 +221,18 @@});});- $('.container').on('click', '.post_reply', function() {+ $('#content').on('click', '.post_reply', function() {+ var selectionText = '',+ selection = window.getSelection() || document.getSelection();++ if ($(selection.baseNode).parents('.post-content').length > 0) {+ var snippet = selection.toString();+ if (snippet.length > 0) selectionText = '> ' + snippet.replace(/\n/g, '\n> ');+ }+if (thread_state.locked !== '1') {require(['composer'], function(cmp) {- cmp.push(tid);+ cmp.push(tid, null, null, selectionText + '\n\n');});}});diff --git a/public/templates/topic.tpl b/public/templates/topic.tplindex 7ef124deca..177b95956c 100644--- a/public/templates/topic.tpl+++ b/public/templates/topic.tpl@@ -84,11 +84,11 @@<div class="post-signature">{posts.signature}</div><div class="profile-block"><span class="post-buttons">- <div id="ids_{posts.pid}_{posts.uid}" class="edit {posts.display_moderator_tools} hidden-phone" title="Edit"><i class="icon-pencil"></i></div>- <div id="ids_{posts.pid}_{posts.uid}" class="delete {posts.display_moderator_tools} hidden-phone" title="Delete"><i class="icon-trash"></i></div>- <div id="quote_{posts.pid}_{posts.uid}" class="quote hidden-phone" title="Quote"><i class="icon-quote-left"></i></div>- <div id="favs_{posts.pid}_{posts.uid}" class="favourite hidden-phone" title="Favourite"><span class="post_rep_{posts.pid}">{posts.post_rep} </span><i class="{posts.fav_star_class}"></i></div>- <div class="post_reply" title="Reply"><i class="icon-reply"></i></div>+ <button id="ids_{posts.pid}_{posts.uid}" class="edit {posts.display_moderator_tools} hidden-phone" title="Edit"><i class="icon-pencil"></i></button>+ <button id="ids_{posts.pid}_{posts.uid}" class="delete {posts.display_moderator_tools} hidden-phone" title="Delete"><i class="icon-trash"></i></button>+ <button id="quote_{posts.pid}_{posts.uid}" class="quote hidden-phone" title="Quote"><i class="icon-quote-left"></i></button>+ <button id="favs_{posts.pid}_{posts.uid}" class="favourite hidden-phone" title="Favourite"><span class="post_rep_{posts.pid}">{posts.post_rep} </span><i class="{posts.fav_star_class}"></i></button>+ <button class="post_reply" title="Reply"><i class="icon-reply"></i></button></span><img class="hidden-desktop" src="{posts.picture}?s=10&default=identicon" align="left" /> posted by <strong><a class="username-field" href="/users/{posts.userslug}">{posts.username}</a></strong> {posts.relativeTime} ago<span class="{posts.edited-class} hidden-phone">| last edited by <strong><a href="/users/{posts.editorslug}">{posts.editorname}</a></strong> {posts.relativeEditTime} ago</span>