Permalink
Browse files

Timestamps now link to the tweet

  • Loading branch information...
elektronaut committed Jul 16, 2010
1 parent 749b1da commit 185fd21a0f1a9637cf589b3f0b6d2677786710d6
Showing with 14 additions and 8 deletions.
  1. +4 −0 README.rdoc
  2. +5 −4 example.html
  3. +4 −3 jquery.livetwitter.js
  4. +1 −1 jquery.livetwitter.min.js
View
@@ -81,6 +81,10 @@ If you want to apply behavior when new tweets are loaded, you can pass a callbac
== Changelog
+=== 1.5.2
+
+* Timestamp now links to the tweet.
+
=== 1.5.1
* You can now clear the tweets (thanks to Ryan!).
View
@@ -43,12 +43,15 @@
.tweet .text {
margin: 0;
}
- .tweet .time {
+ .tweet .time a {
font-size: 80%;
color: #888;
white-space: nowrap;
+ text-decoration: none;
+ }
+ .tweet .time a:hover {
+ text-decoration: underline;
}
-
#twitterSearch .tweet {
min-height: 24px;
}
@@ -76,8 +79,6 @@ <h2>User timeline for <a href="http://twitter.com/elektronaut">@elektronaut</a><
$('#searchLinks a').each(function(){
var query = $(this).text();
$(this).click(function(){
- // Clear the tweets
- $('#twitterSearch').each(function(){this.twitter.clear()});
// Update the search
$('#twitterSearch').liveTwitter(query);
// Update the header
View
@@ -1,5 +1,5 @@
/*
- * jQuery LiveTwitter 1.5.1
+ * jQuery LiveTwitter 1.5.2
* - Live updating Twitter plugin for jQuery
*
* Copyright (c) 2009-2010 Inge Jørgensen (elektronaut.no)
@@ -97,7 +97,7 @@
refreshTime: function() {
var twitter = this;
$(twitter.container).find('span.time').each(function(){
- $(this).html(twitter.relativeTime(this.timeStamp));
+ $(this).find('a').html(twitter.relativeTime(this.timeStamp));
});
},
@@ -159,6 +159,7 @@
// Fix for IE
created_at_date = this.created_at.replace(/^(\w+)\s(\w+)\s(\d+)(.*)(\s\d+)$/, "$1, $3 $2$5$4");
}
+ var tweet_url = 'http://twitter.com/'+screen_name+'/statuses/'+this.id;
var userInfo = this.user;
var linkified_text = this.text.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(m) { return m.link(m); });
linkified_text = linkified_text.replace(/@[A-Za-z0-9_]+/g, function(u){return u.link('http://twitter.com/'+u.replace(/^@/,''));});
@@ -178,7 +179,7 @@
}
tweetHTML +=
linkified_text +
- ' <span class="time">'+twitter.relativeTime(created_at_date)+'</span>' +
+ ' <span class="time"><a href="'+tweet_url+'">'+twitter.relativeTime(created_at_date)+'</a></span>' +
'</p>' +
'</div>';
$(twitter.container).prepend(tweetHTML);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 185fd21

Please sign in to comment.