Permalink
Browse files

Change link color to user's preference.

  • Loading branch information...
1 parent 66063fa commit 8881d8afe9dc11cfc1381396a4075a63fa06012f @drdrang committed Jan 30, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 styleTweets.js
View
@@ -11,14 +11,19 @@ function styleTweets() {
$.getJSON(tweetURL, function(data){
var twDate = new Date(data.created_at);
var shortdate = twDate.toDateString();
+ // Remove plain attribution.
+ $("#" + divID + " .twMeta").css('display', 'none');
+ // Add styled attribution.
+ content = $("#" + divID + " .twContent").append('<p class="twDate"><a href="http://twitter.com/' + data.user.screen_name + '/status/' + tweetID + '">' + shortdate + '</a></p><p class="twAuthor"><a href="http://twitter.com/' + data.user.screen_name + '"><img src="' + data.user.profile_image_url + '" /></a><a href="http://twitter.com/' + data.user.screen_name + '"><strong>@' + data.user.screen_name + '</strong></a><br /><span class="realName">' + data.user.name + '</span></span></p>' );
+ // Set background image or color.
if (data.user.profile_use_background_image == true) {
$("#" + divID).css('background', 'url(' + data.user.profile_background_image_url + ') #' + data.user.profile_background_color);
}
else {
$("#" + divID).css('background', '#' + data.user.profile_background_color);
}
- $("#" + divID + " .twMeta").css('display', 'none');
- content = $("#" + divID + " .twContent").append('<p class="twDate"><a href="http://twitter.com/' + data.user.screen_name + '/status/' + tweetID + '">' + shortdate + '</a></p><p class="twAuthor"><a href="http://twitter.com/' + data.user.screen_name + '"><img src="' + data.user.profile_image_url + '" /></a><a href="http://twitter.com/' + data.user.screen_name + '"><strong>@' + data.user.screen_name + '</strong></a><br /><span class="realName">' + data.user.name + '</span></span></p>' );
+ // Set link color.
+ $("#" + divID + " a").css('color', '#' + data.user.profile_link_color);
});
});
}

0 comments on commit 8881d8a

Please sign in to comment.