// Config
var baseURL = '';
var recordTemplate = new Template(
- '<div class="record">#{data}<div class="info">Posted #{date}. <a href="/\##{author}/#{record}">[permalink]</a></div></div>'
+ '<div class="record">#{data}<div class="info">Posted #{date}. <a href="/\##{author}/#{record}">[permalink]</a> <a href="#" onclick="postPopup(\'@#{author}/#{record}: \'); return false">[reply]</a></div></div>'
);
var tagRecordTemplate = new Template(
- '<div class="record">#{data}<div class="info">Posted by <a class="author ref" href="/\##{author}" onclick="return qlink()">@#{author}</a> on #{date}. <a href="/\##{author}/#{record}">[permalink]</a></div></div>'
+ '<div class="record">#{data}<div class="info">Posted by <a class="author ref" href="/\##{author}" onclick="return qlink()">@#{author}</a> on #{date}. <a href="/\##{author}/#{record}">[permalink]</a> <a href="#" onclick="postPopup(\'@#{author}/#{record}: \'); return false">[reply]</a></div></div>'
);
var latestRecordsTemplate = new Template(
'<div class="record"><a class="author ref" href="/\##{author}" onclick="return qlink()">@#{author}</a> #{data}</div>'
// Turn refs and tags into links
l = l.replace(/(\s|^)#([A-Za-z0-9_-]+)/g, '$1<a href="#/tag/$2" class="ref" onclick="return qlink()">#$2</a>');
- l = l.replace(/(\s|^)@([A-Za-z0-9_-]+)/g, '$1<a href="#$2" class="ref" onclick="return qlink()">@$2</a>');
+ l = l.replace(/(\s|^)@([A-Za-z0-9_-]+)(\/\d+)?/g, '$1<a href="#$2$3" class="ref" onclick="return qlink()">@$2</a>');
// Create lists when lines begin with *
if (l[0] == '*') {
}
-function postPopup() {
- if (loginStatus.loggedIn) {
+function postPopup(initial) {
+ if (loginStatus.loggedIn || initial) {
var post = $('post');
if (post.visible()) {
post.hide();
} else {
post.show();
- if (currentPager.username && currentPager.username != loginStatus.username && !$('post.content').value) {
+ if (initial) {
+ $('post.content').value = initial;
+ } else if (!$('post.content').value && currentPager.username && currentPager.username != loginStatus.username) {
$('post.content').value = '@' + currentPager.username + ': ';
}
$('post.content').focus();