projects
/
blerg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3f2f34b
)
Add perma-reflink functionality and reply
author
Chip Black
<bytex64@bytex64.net>
Fri, 4 Mar 2011 08:47:09 +0000
(
00:47
-0800)
committer
Chip Black
<bytex64@bytex64.net>
Fri, 4 Mar 2011 08:47:09 +0000
(
00:47
-0800)
www/js/blerg.js
patch
|
blob
|
history
diff --git
a/www/js/blerg.js
b/www/js/blerg.js
index
944f112
..
b882dd9
100644
(file)
--- a/
www/js/blerg.js
+++ b/
www/js/blerg.js
@@
-5,10
+5,10
@@
// Config
var baseURL = '';
var recordTemplate = new Template(
// 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(
);
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>'
);
var latestRecordsTemplate = new Template(
'<div class="record"><a class="author ref" href="/\##{author}" onclick="return qlink()">@#{author}</a> #{data}</div>'
@@
-352,7
+352,7
@@
function mangleRecord(record, template) {
// 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>');
// 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] == '*') {
// 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();
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();
$('post.content').value = '@' + currentPager.username + ': ';
}
$('post.content').focus();