X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjs%2Fblerg.js;h=b882dd9944425567d01f6844138216e8955978d0;hb=e5ddf802919d8f9d123d02b14602a98168c7bf6f;hp=28f0849b0355c84494d7b1c87b2124401793c8ea;hpb=4182838777472d5416bda381f784881e7948ecce;p=blerg.git diff --git a/www/js/blerg.js b/www/js/blerg.js index 28f0849..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}
' @@ -240,7 +240,7 @@ User.prototype.reload = function() { $$('[name=user.unsubscribelink]').each(Element.hide); if (loginStatus.loggedIn) { - new Ajax.Request(baseURL + '/feedinfo/' + username, { + new Ajax.Request(baseURL + '/feedinfo/' + this.username, { method: 'post', parameters: { username: loginStatus.username @@ -350,12 +350,9 @@ function mangleRecord(record, template) { l = l.replace(/([^\w\\]|^)\*\*(\w[^*]*)\*\*(\W|$)/g, '$1$2$3'); l = l.replace(/([^\w\\]|^)\*(\w[^*]*)\*(\W|$)/g, '$1$2$3'); - // Remove backslashes from escaped metachars - l = l.replace(/\\([*\[\]])/g, '$1'); - // 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] == '*') { @@ -380,6 +377,9 @@ function mangleRecord(record, template) { } } + // Remove backslashes from escaped metachars + l = l.replace(/\\([*\[\]@#])/g, '$1'); + out.push(l); if (endpush) { out.push(endpush); @@ -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();