Using https rather than protocol relative urls

This commit is contained in:
Brandon Mathis 2012-10-01 07:26:26 -05:00
parent 7fbb696966
commit 4b5ffb725a
2 changed files with 7 additions and 7 deletions

View File

@ -165,9 +165,9 @@ var octopress = (function(){
function linkifyTweet(text, url) { function linkifyTweet(text, url) {
// Linkify urls, usernames, hashtags // Linkify urls, usernames, hashtags
text = text.replace(/(https?:)(\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$2$3">$3</a>') text = text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$1$2">$2</a>')
.replace(/(^|\W)@(\w+)/g, '$1<a href="//twitter.com/$2">@$2</a>') .replace(/(^|\W)@(\w+)/g, '$1<a href="https://twitter.com/$2">@$2</a>')
.replace(/(^|\W)#(\w+)/g, '$1<a href="//search.twitter.com/search?q=%23$2">#$2</a>'); .replace(/(^|\W)#(\w+)/g, '$1<a href="https://search.twitter.com/search?q=%23$2">#$2</a>');
// Use twitter's api to replace t.co shortened urls with expanded ones. // Use twitter's api to replace t.co shortened urls with expanded ones.
for (var u in url) { for (var u in url) {
@ -186,7 +186,7 @@ var octopress = (function(){
content = ''; content = '';
for (var t in tweets) { for (var t in tweets) {
content += '<li>'+'<p>'+'<a href="//twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+octopress.prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n/g, '<br>'), tweets[t].entities.urls)+'</p>'+'</li>'; content += '<li>'+'<p>'+'<a href="https://twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+octopress.prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n/g, '<br>'), tweets[t].entities.urls)+'</p>'+'</li>';
} }
timeline.innerHTML = content; timeline.innerHTML = content;
} }
@ -199,7 +199,7 @@ var octopress = (function(){
var count = parseInt(target.attr('data-count'), 10); var count = parseInt(target.attr('data-count'), 10);
var replies = target.attr('data-replies') == 'true'; var replies = target.attr('data-replies') == 'true';
$.ajax({ $.ajax({
url: "//api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (count + 20) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?" url: "https://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (count + 20) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?"
, dataType: 'jsonp' , dataType: 'jsonp'
, error: function (err) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); } , error: function (err) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); }
, success: function(data) { render(data.slice(0, count), user); } , success: function(data) { render(data.slice(0, count), user); }
@ -235,7 +235,7 @@ var octopress = (function(){
var count = parseInt(target.attr('data-count')) var count = parseInt(target.attr('data-count'))
var skip_forks = target.attr('data-skip') == 'true'; var skip_forks = target.attr('data-skip') == 'true';
$.ajax({ $.ajax({
url: "//api.github.com/users/"+user+"/repos?callback=?" url: "https://api.github.com/users/"+user+"/repos?callback=?"
, dataType: 'jsonp' , dataType: 'jsonp'
, error: function (err) { target.find('.loading').addClass('error').text("Error loading feed"); } , error: function (err) { target.find('.loading').addClass('error').text("Error loading feed"); }
, success: function(data) { , success: function(data) {

View File

@ -50,7 +50,7 @@ var pinboard = (function(){
return { return {
getFeed: function(options) { getFeed: function(options) {
this.element = options.target; this.element = options.target;
fetch("//feeds.pinboard.in/json/v1/u:"+options.user+"/?cb=pinboard.render\&count="+options.count); fetch("https://feeds.pinboard.in/json/v1/u:"+options.user+"/?cb=pinboard.render\&count="+options.count);
}, },
render: function(data) { render: function(data) {