Skip to content

Node.js based forum software built for the modern web

added auto mention if u click post reply

Baris Soner Usaklic1da56ce455c
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 3da108aab8..759b13d68f 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -263,12 +263,20 @@ define(function() {
if ($(selection.baseNode).parents('.post-content').length > 0) {
var snippet = selection.toString();
- if (snippet.length > 0) selectionText = '> ' + snippet.replace(/\n/g, '\n> ');
+ if (snippet.length > 0) {
+ selectionText = '> ' + snippet.replace(/\n/g, '\n> ');
+ }
+ }
+
+ var username = '',
+ post = $(this).parents('li[data-pid]');
+ if(post.length) {
+ username = '@' + post.attr('data-username') + ' ';
}
if (thread_state.locked !== '1') {
require(['composer'], function(cmp) {
- cmp.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' : '');
+ cmp.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username);
});
}
});