From e5ddf802919d8f9d123d02b14602a98168c7bf6f Mon Sep 17 00:00:00 2001 From: Chip Black Date: Fri, 4 Mar 2011 00:47:09 -0800 Subject: [PATCH] Add perma-reflink functionality and reply --- www/js/blerg.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/www/js/blerg.js b/www/js/blerg.js index 944f112..b882dd9 100644 --- a/www/js/blerg.js +++ b/www/js/blerg.js @@ -5,10 +5,10 @@ // Config var baseURL = ''; var recordTemplate = new Template( - '
#{data}
Posted #{date}. [permalink]
' + '
#{data}
Posted #{date}. [permalink] [reply]
' ); var tagRecordTemplate = new Template( - '
#{data}
Posted by @#{author} on #{date}. [permalink]
' + '
#{data}
Posted by @#{author} on #{date}. [permalink] [reply]
' ); var latestRecordsTemplate = new Template( '
@#{author} #{data}
' @@ -352,7 +352,7 @@ function mangleRecord(record, template) { // Turn refs and tags into links l = l.replace(/(\s|^)#([A-Za-z0-9_-]+)/g, '$1#$2'); - l = l.replace(/(\s|^)@([A-Za-z0-9_-]+)/g, '$1@$2'); + l = l.replace(/(\s|^)@([A-Za-z0-9_-]+)(\/\d+)?/g, '$1@$2'); // Create lists when lines begin with * if (l[0] == '*') { @@ -514,14 +514,16 @@ Feed.prototype.show = function() { } -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(); -- 2.25.1