Changed theme.
This commit is contained in:
@ -1,33 +1,28 @@
|
||||
var github = (function(){
|
||||
function escapeHtml(str) {
|
||||
return $('<div/>').text(str).html();
|
||||
}
|
||||
function render(target, repos){
|
||||
var i = 0, fragment = '', t = $(target)[0];
|
||||
|
||||
for(i = 0; i < repos.length; i++) {
|
||||
fragment += '<li><a href="'+repos[i].url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
|
||||
fragment += '<li><a href="'+repos[i].html_url+'">'+repos[i].name+'</a><p>'+escapeHtml(repos[i].description||'')+'</p></li>';
|
||||
}
|
||||
t.innerHTML = fragment;
|
||||
}
|
||||
return {
|
||||
showRepos: function(options){
|
||||
$.ajax({
|
||||
url: "http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?"
|
||||
, type: 'jsonp'
|
||||
url: "https://api.github.com/users/"+options.user+"/repos?sort=pushed&callback=?"
|
||||
, dataType: 'jsonp'
|
||||
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
|
||||
, success: function(data) {
|
||||
var repos = [];
|
||||
if (!data || !data.repositories) { return; }
|
||||
for (var i = 0; i < data.repositories.length; i++) {
|
||||
if (options.skip_forks && data.repositories[i].fork) { continue; }
|
||||
repos.push(data.repositories[i]);
|
||||
if (!data || !data.data) { return; }
|
||||
for (var i = 0; i < data.data.length; i++) {
|
||||
if (options.skip_forks && data.data[i].fork) { continue; }
|
||||
repos.push(data.data[i]);
|
||||
}
|
||||
repos.sort(function(a, b) {
|
||||
var aDate = new Date(a.pushed_at).valueOf(),
|
||||
bDate = new Date(b.pushed_at).valueOf();
|
||||
|
||||
if (aDate === bDate) { return 0; }
|
||||
return aDate > bDate ? -1 : 1;
|
||||
});
|
||||
|
||||
if (options.count) { repos.splice(options.count); }
|
||||
render(options.target, repos);
|
||||
}
|
||||
|
||||
5
source/javascripts/libs/jquery.min.js
vendored
Normal file
5
source/javascripts/libs/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
source/javascripts/md5.js
Normal file
1
source/javascripts/md5.js
Normal file
@ -0,0 +1 @@
|
||||
var MD5=function(e){function t(e,t){return e<<t|e>>>32-t}function n(e,t){var n,r,i,s,o;i=e&2147483648;s=t&2147483648;n=e&1073741824;r=t&1073741824;o=(e&1073741823)+(t&1073741823);if(n&r){return o^2147483648^i^s}if(n|r){if(o&1073741824){return o^3221225472^i^s}else{return o^1073741824^i^s}}else{return o^i^s}}function r(e,t,n){return e&t|~e&n}function i(e,t,n){return e&n|t&~n}function s(e,t,n){return e^t^n}function o(e,t,n){return t^(e|~n)}function u(e,i,s,o,u,a,f){e=n(e,n(n(r(i,s,o),u),f));return n(t(e,a),i)}function a(e,r,s,o,u,a,f){e=n(e,n(n(i(r,s,o),u),f));return n(t(e,a),r)}function f(e,r,i,o,u,a,f){e=n(e,n(n(s(r,i,o),u),f));return n(t(e,a),r)}function l(e,r,i,s,u,a,f){e=n(e,n(n(o(r,i,s),u),f));return n(t(e,a),r)}function c(e){var t;var n=e.length;var r=n+8;var i=(r-r%64)/64;var s=(i+1)*16;var o=Array(s-1);var u=0;var a=0;while(a<n){t=(a-a%4)/4;u=a%4*8;o[t]=o[t]|e.charCodeAt(a)<<u;a++}t=(a-a%4)/4;u=a%4*8;o[t]=o[t]|128<<u;o[s-2]=n<<3;o[s-1]=n>>>29;return o}function h(e){var t="",n="",r,i;for(i=0;i<=3;i++){r=e>>>i*8&255;n="0"+r.toString(16);t=t+n.substr(n.length-2,2)}return t}function p(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t}var d=Array();var v,m,g,y,b,w,E,S,x;var T=7,N=12,C=17,k=22;var L=5,A=9,O=14,M=20;var _=4,D=11,P=16,H=23;var B=6,j=10,F=15,I=21;e=p(e);d=c(e);w=1732584193;E=4023233417;S=2562383102;x=271733878;for(v=0;v<d.length;v+=16){m=w;g=E;y=S;b=x;w=u(w,E,S,x,d[v+0],T,3614090360);x=u(x,w,E,S,d[v+1],N,3905402710);S=u(S,x,w,E,d[v+2],C,606105819);E=u(E,S,x,w,d[v+3],k,3250441966);w=u(w,E,S,x,d[v+4],T,4118548399);x=u(x,w,E,S,d[v+5],N,1200080426);S=u(S,x,w,E,d[v+6],C,2821735955);E=u(E,S,x,w,d[v+7],k,4249261313);w=u(w,E,S,x,d[v+8],T,1770035416);x=u(x,w,E,S,d[v+9],N,2336552879);S=u(S,x,w,E,d[v+10],C,4294925233);E=u(E,S,x,w,d[v+11],k,2304563134);w=u(w,E,S,x,d[v+12],T,1804603682);x=u(x,w,E,S,d[v+13],N,4254626195);S=u(S,x,w,E,d[v+14],C,2792965006);E=u(E,S,x,w,d[v+15],k,1236535329);w=a(w,E,S,x,d[v+1],L,4129170786);x=a(x,w,E,S,d[v+6],A,3225465664);S=a(S,x,w,E,d[v+11],O,643717713);E=a(E,S,x,w,d[v+0],M,3921069994);w=a(w,E,S,x,d[v+5],L,3593408605);x=a(x,w,E,S,d[v+10],A,38016083);S=a(S,x,w,E,d[v+15],O,3634488961);E=a(E,S,x,w,d[v+4],M,3889429448);w=a(w,E,S,x,d[v+9],L,568446438);x=a(x,w,E,S,d[v+14],A,3275163606);S=a(S,x,w,E,d[v+3],O,4107603335);E=a(E,S,x,w,d[v+8],M,1163531501);w=a(w,E,S,x,d[v+13],L,2850285829);x=a(x,w,E,S,d[v+2],A,4243563512);S=a(S,x,w,E,d[v+7],O,1735328473);E=a(E,S,x,w,d[v+12],M,2368359562);w=f(w,E,S,x,d[v+5],_,4294588738);x=f(x,w,E,S,d[v+8],D,2272392833);S=f(S,x,w,E,d[v+11],P,1839030562);E=f(E,S,x,w,d[v+14],H,4259657740);w=f(w,E,S,x,d[v+1],_,2763975236);x=f(x,w,E,S,d[v+4],D,1272893353);S=f(S,x,w,E,d[v+7],P,4139469664);E=f(E,S,x,w,d[v+10],H,3200236656);w=f(w,E,S,x,d[v+13],_,681279174);x=f(x,w,E,S,d[v+0],D,3936430074);S=f(S,x,w,E,d[v+3],P,3572445317);E=f(E,S,x,w,d[v+6],H,76029189);w=f(w,E,S,x,d[v+9],_,3654602809);x=f(x,w,E,S,d[v+12],D,3873151461);S=f(S,x,w,E,d[v+15],P,530742520);E=f(E,S,x,w,d[v+2],H,3299628645);w=l(w,E,S,x,d[v+0],B,4096336452);x=l(x,w,E,S,d[v+7],j,1126891415);S=l(S,x,w,E,d[v+14],F,2878612391);E=l(E,S,x,w,d[v+5],I,4237533241);w=l(w,E,S,x,d[v+12],B,1700485571);x=l(x,w,E,S,d[v+3],j,2399980690);S=l(S,x,w,E,d[v+10],F,4293915773);E=l(E,S,x,w,d[v+1],I,2240044497);w=l(w,E,S,x,d[v+8],B,1873313359);x=l(x,w,E,S,d[v+15],j,4264355552);S=l(S,x,w,E,d[v+6],F,2734768916);E=l(E,S,x,w,d[v+13],I,1309151649);w=l(w,E,S,x,d[v+4],B,4149444226);x=l(x,w,E,S,d[v+11],j,3174756917);S=l(S,x,w,E,d[v+2],F,718787259);E=l(E,S,x,w,d[v+9],I,3951481745);w=n(w,m);E=n(E,g);S=n(S,y);x=n(x,b)}var q=h(w)+h(E)+h(S)+h(x);return q.toLowerCase()}
|
||||
8
source/javascripts/modernizr-2.0.js
vendored
8
source/javascripts/modernizr-2.0.js
vendored
File diff suppressed because one or more lines are too long
@ -2,15 +2,16 @@ function getNav() {
|
||||
var mobileNav = $('nav[role=navigation] fieldset[role=search]').after('<fieldset class="mobile-nav"></fieldset>').next().append('<select></select>');
|
||||
mobileNav.children('select').append('<option value="">Navigate…</option>');
|
||||
$('ul[role=main-navigation]').addClass('main-navigation');
|
||||
$('ul.main-navigation a').each(function(link) {
|
||||
$('ul.main-navigation a').each(function(i, link) {
|
||||
mobileNav.children('select').append('<option value="'+link.href+'">» '+link.text+'</option>');
|
||||
});
|
||||
$('ul.subscription a').each(function(link) {
|
||||
$('ul.subscription a').each(function(i, link) {
|
||||
mobileNav.children('select').append('<option value="'+link.href+'">» '+link.text+'</option>');
|
||||
});
|
||||
mobileNav.children('select').bind('change', function(event) {
|
||||
if (event.target.value) { window.location.href = event.target.value; }
|
||||
});
|
||||
mobileNav.children('select').val('');
|
||||
}
|
||||
|
||||
function addSidebarToggler() {
|
||||
@ -40,7 +41,7 @@ function addSidebarToggler() {
|
||||
|
||||
function testFeatures() {
|
||||
var features = ['maskImage'];
|
||||
$(features).map(function(feature) {
|
||||
$(features).map(function(i, feature) {
|
||||
if (Modernizr.testAllProps(feature)) {
|
||||
$('html').addClass(feature);
|
||||
} else {
|
||||
@ -76,7 +77,7 @@ function flashVideoFallback(){
|
||||
$('video').each(function(video){
|
||||
video = $(video);
|
||||
if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") !== -1){
|
||||
video.children('source[src$=mp4]').first().map(function(source){
|
||||
video.children('source[src$=mp4]').first().map(function(i, source){
|
||||
var src = $(source).attr('src'),
|
||||
id = 'video_'+Math.round(1 + Math.random()*(100000)),
|
||||
width = video.attr('width'),
|
||||
@ -116,7 +117,7 @@ function renderDeliciousLinks(items) {
|
||||
$('#delicious').html(output);
|
||||
}
|
||||
|
||||
$.domReady(function() {
|
||||
$('document').ready(function() {
|
||||
testFeatures();
|
||||
wrapFlashVideos();
|
||||
flashVideoFallback();
|
||||
@ -159,3 +160,4 @@ b=j.userAgent.toLowerCase(),d=j.platform.toLowerCase(),g=d?/win/.test(d):/win/.t
|
||||
a&&b&&d&&i&&k){d+="";i+="";var p={};if(f&&typeof f===o)for(var m in f)p[m]=f[m];p.data=a;p.width=d;p.height=i;a={};if(c&&typeof c===o)for(var n in c)a[n]=c[n];if(e&&typeof e===o)for(var r in e)typeof a.flashvars!=l?a.flashvars+="&"+r+"="+e[r]:a.flashvars=r+"="+e[r];if(t(k))b=s(p,a,b),j.success=!0,j.ref=b}h&&h(j)},ua:g,getFlashPlayerVersion:function(){return{major:g.pv[0],minor:g.pv[1],release:g.pv[2]}},hasFlashPlayerVersion:t,createSWF:function(a,b,d){if(g.w3)return s(a,b,d)},getQueryParamValue:function(a){var b=
|
||||
i.location.search||i.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(a==null)return u(b);for(var b=b.split("&"),d=0;d<b.length;d++)if(b[d].substring(0,b[d].indexOf("="))==a)return u(b[d].substring(b[d].indexOf("=")+1))}return""}}}();
|
||||
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ function Pinboard_Linkroll() {
|
||||
if (it.t.length > 0) {
|
||||
for (var i = 0; i < it.t.length; i++) {
|
||||
var tag = it.t[i];
|
||||
str += " <a class=\"pin-tag\" href=\"http://pinboard.in/u:"+ this.cook(it.a) + "/t:" + this.cook(tag) + "\">" + this.cook(tag).replace(/^\s+|\s+$/g, '') + "</a> ";
|
||||
str += " <a class=\"pin-tag\" href=\"https://pinboard.in/u:"+ this.cook(it.a) + "/t:" + this.cook(tag) + "\">" + this.cook(tag).replace(/^\s+|\s+$/g, '') + "</a> ";
|
||||
}
|
||||
}
|
||||
str += "</p></li>\n";
|
||||
@ -52,5 +52,5 @@ function Pinboard_Linkroll() {
|
||||
}
|
||||
}
|
||||
Pinboard_Linkroll.prototype = new Pinboard_Linkroll();
|
||||
pinboardNS_fetch_script("http://feeds.pinboard.in/json/v1/u:"+pinboard_user+"/?cb=pinboardNS_show_bmarks\&count="+pinboard_count);
|
||||
pinboardNS_fetch_script("https://feeds.pinboard.in/json/v1/u:"+pinboard_user+"/?cb=pinboardNS_show_bmarks\&count="+pinboard_count);
|
||||
|
||||
|
||||
@ -1,92 +1,78 @@
|
||||
(function($){
|
||||
$.fn.getTwitterFeed = function(userid, count, reply){
|
||||
var banner = $(this),
|
||||
feed = banner.find('.feed'),
|
||||
interval = 10000,
|
||||
speed = 500;
|
||||
// JSON-P Twitter fetcher for Octopress
|
||||
// (c) Brandon Mathis // MIT License
|
||||
|
||||
var linkify = function(text){
|
||||
text = text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$1$2">$2</a>').replace(/(^|\W)@(\w+)/g, '$1<a href="http://twitter.com/$2">@$2</a>').replace(/(^|\W)#(\w+)/g, '$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>');
|
||||
/* Sky Slavin, Ludopoli. MIT license. * based on JavaScript Pretty Date * Copyright (c) 2008 John Resig (jquery.com) * Licensed under the MIT license. */
|
||||
function prettyDate(time) {
|
||||
if (navigator.appName === 'Microsoft Internet Explorer') {
|
||||
return "<span>∞</span>"; // because IE date parsing isn't fun.
|
||||
}
|
||||
var say = {
|
||||
just_now: " now",
|
||||
minute_ago: "1m",
|
||||
minutes_ago: "m",
|
||||
hour_ago: "1h",
|
||||
hours_ago: "h",
|
||||
yesterday: "1d",
|
||||
days_ago: "d",
|
||||
last_week: "1w",
|
||||
weeks_ago: "w"
|
||||
};
|
||||
|
||||
return text;
|
||||
}
|
||||
var current_date = new Date(),
|
||||
current_date_time = current_date.getTime(),
|
||||
current_date_full = current_date_time + (1 * 60000),
|
||||
date = new Date(time),
|
||||
diff = ((current_date_full - date.getTime()) / 1000),
|
||||
day_diff = Math.floor(diff / 86400);
|
||||
|
||||
var relativeDate = function(date){
|
||||
if (navigator.appName === 'Microsoft Internet Explorer') return '';
|
||||
if (isNaN(day_diff) || day_diff < 0) { return "<span>∞</span>"; }
|
||||
|
||||
var unit = {
|
||||
now: 'Now',
|
||||
minute: '1 min',
|
||||
minutes: ' mins',
|
||||
hour: '1 hr',
|
||||
hours: ' hrs',
|
||||
day: 'Yesterday',
|
||||
days: ' days',
|
||||
week: '1 week',
|
||||
weeks: ' weeks'
|
||||
};
|
||||
return day_diff === 0 && (
|
||||
diff < 60 && say.just_now ||
|
||||
diff < 120 && say.minute_ago ||
|
||||
diff < 3600 && Math.floor(diff / 60) + say.minutes_ago ||
|
||||
diff < 7200 && say.hour_ago ||
|
||||
diff < 86400 && Math.floor(diff / 3600) + say.hours_ago) ||
|
||||
day_diff === 1 && say.yesterday ||
|
||||
day_diff < 7 && day_diff + say.days_ago ||
|
||||
day_diff === 7 && say.last_week ||
|
||||
day_diff > 7 && Math.ceil(day_diff / 7) + say.weeks_ago;
|
||||
}
|
||||
|
||||
var current = new Date(),
|
||||
tweet = new Date(date),
|
||||
diff = (((current.getTime() + (1 * 60000)) - tweet.getTime()) / 1000),
|
||||
day_diff = Math.floor(diff / 86400);
|
||||
|
||||
if (day_diff == 0){
|
||||
if (diff < 60) return unit.now;
|
||||
else if (diff < 120) return unit.minute;
|
||||
else if (diff < 3600) return Math.floor(diff / 60) + unit.minutes;
|
||||
else if (diff < 7200) return unit.hour;
|
||||
else if (diff < 86400) return Math.floor(diff / 3600) + unit.hours;
|
||||
else return '';
|
||||
} else if (day_diff == 1) {
|
||||
return unit.day;
|
||||
} else if (day_diff < 7) {
|
||||
return day_diff + unit.days;
|
||||
} else if (day_diff == 7) {
|
||||
return unit.week;
|
||||
} else if (day_diff > 7) {
|
||||
return Math.ceil(day_diff / 7) + unit.weeks;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
function linkifyTweet(text, url) {
|
||||
// Linkify urls, usernames, hashtags
|
||||
text = text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$1$2">$2</a>')
|
||||
.replace(/(^|\W)@(\w+)/g, '$1<a href="https://twitter.com/$2">@$2</a>')
|
||||
.replace(/(^|\W)#(\w+)/g, '$1<a href="https://search.twitter.com/search?q=%23$2">#$2</a>');
|
||||
|
||||
if ($(window).width() > 600){
|
||||
var url = 'https://api.twitter.com/1/statuses/user_timeline/'+userid+'.json?count='+count+'&exclude_replies='+(reply ? '0' : '1')+'&trim_user=true&callback=?';
|
||||
banner.show();
|
||||
$.getJSON(url, function(json){
|
||||
var length = json.length,
|
||||
fragment = document.createDocumentFragment(),
|
||||
counts = 0,
|
||||
timeout;
|
||||
// Use twitter's api to replace t.co shortened urls with expanded ones.
|
||||
for (var u in url) {
|
||||
if(url[u].expanded_url != null){
|
||||
var shortUrl = new RegExp(url[u].url, 'g');
|
||||
text = text.replace(shortUrl, url[u].expanded_url);
|
||||
var shortUrl = new RegExp(">"+(url[u].url.replace(/https?:\/\//, '')), 'g');
|
||||
text = text.replace(shortUrl, ">"+url[u].display_url);
|
||||
}
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
for (var i=0; i<length; i++){
|
||||
var item = document.createElement('li');
|
||||
item.innerHTML = linkify(json[i].text) + '<small>'+relativeDate(json[i].created_at)+'</small>';
|
||||
fragment.appendChild(item);
|
||||
}
|
||||
function showTwitterFeed(tweets, twitter_user) {
|
||||
var timeline = document.getElementById('tweets'),
|
||||
content = '';
|
||||
|
||||
var play = function(){
|
||||
timeout = setTimeout(function(){
|
||||
feed.animate({top: '-='+30}, speed, function(){
|
||||
$(this).append($(this).children().eq(counts).clone());
|
||||
counts++;
|
||||
play();
|
||||
});
|
||||
}, interval);
|
||||
}
|
||||
for (var t in tweets) {
|
||||
content += '<li>'+'<p>'+'<a href="https://twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n/g, '<br>'), tweets[t].entities.urls)+'</p>'+'</li>';
|
||||
}
|
||||
timeline.innerHTML = content;
|
||||
}
|
||||
|
||||
var pause = function(){
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
banner.on('mouseenter', pause).on('mouseleave', play)
|
||||
.children('.loading').hide().end()
|
||||
.children('.container').show()
|
||||
.children('.feed').append(fragment);
|
||||
|
||||
play();
|
||||
});
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
function getTwitterFeed(user, count, replies) {
|
||||
count = parseInt(count, 10);
|
||||
$.ajax({
|
||||
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=?"
|
||||
, type: 'jsonp'
|
||||
, error: function (err) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); }
|
||||
, success: function(data) { showTwitterFeed(data.slice(0, count), user); }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user