##// END OF EJS Templates
Insert line break before post reflink when replying to a post after entering some text into the form
neko259 -
r1696:d1918b48 default
parent child Browse files
Show More
@@ -77,7 +77,12 b' function addQuickReply(postId) {'
77
77
78 // If this is not OP, add reflink to the post. If there already is
78 // If this is not OP, add reflink to the post. If there already is
79 // the same reflink, don't add it again.
79 // the same reflink, don't add it again.
80 if (!post.is(':first-child') && textAreaJq.val().indexOf(postLinkRaw) < 0) {
80 var postText = textAreaJq.val();
81 if (!post.is(':first-child') && postText.indexOf(postLinkRaw) < 0) {
82 // Insert line break if none is present.
83 if (postText.length > 0 && !postText.endsWith('\n') && !postText.endsWith('\r')) {
84 textToAdd += '\n';
85 }
81 textToAdd += postLinkRaw + '\n';
86 textToAdd += postLinkRaw + '\n';
82 }
87 }
83
88
@@ -160,4 +165,4 b' function showQuoteButton() {'
160 $("#quote-button").click(function() {
165 $("#quote-button").click(function() {
161 addQuickQuote();
166 addQuickQuote();
162 })
167 })
163 }); No newline at end of file
168 });
General Comments 0
You need to be logged in to leave comments. Login now