From 8698a276f937cb1cd6f67f7f213e2ea438500d7e Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Mon, 30 May 2011 00:30:16 -0400 Subject: Cleaned out public from repository, updated gitignore, added syntax highlighting tests, improved syntax highlighting and styling of pre blocks. Overriding dynamic gist styling. Added a plugin for pygments caching which should speed things up terrifically. added ender.js as a lightweight way of scripting the DOM, events, etc. Some general typography and semantic html improvements. --- source/javascripts/twitter.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'source/javascripts/twitter.js') diff --git a/source/javascripts/twitter.js b/source/javascripts/twitter.js index d50efe1c..2dad2882 100644 --- a/source/javascripts/twitter.js +++ b/source/javascripts/twitter.js @@ -1,9 +1,3 @@ -/* http://www.JSON.org/json2.js 2009-09-29 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html */ -if(!this.JSON){this.JSON={}}(function(){function l(c){return c<10?'0'+c:c}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(c){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+l(this.getUTCMonth()+1)+'-'+l(this.getUTCDate())+'T'+l(this.getUTCHours())+':'+l(this.getUTCMinutes())+':'+l(this.getUTCSeconds())+'Z':null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(c){return this.valueOf()}}var o=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,m,r={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},j;function q(a){p.lastIndex=0;return p.test(a)?'"'+a.replace(p,function(c){var f=r[c];return typeof f==='string'?f:'\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function n(c,f){var a,e,d,i,k=h,g,b=f[c];if(b&&typeof b==='object'&&typeof b.toJSON==='function'){b=b.toJSON(c)}if(typeof j==='function'){b=j.call(f,c,b)}switch(typeof b){case'string':return q(b);case'number':return isFinite(b)?String(b):'null';case'boolean':case'null':return String(b);case'object':if(!b){return'null'}h+=m;g=[];if(Object.prototype.toString.apply(b)==='[object Array]'){i=b.length;for(a=0;a'+linkifyTweet(tweets[t].text)+''+prettyDate(tweets[t].created_at)+'

'+''; + timeline.innerHTML+='
  • '+'

    '+''+prettyDate(tweets[t].created_at)+''+linkifyTweet(tweets[t].text)+'

    '+'
  • '; } } function linkifyTweet(text){ - return text.replace(/(https?:\/\/[\w\-:;?&=+.%#\/]+)/gi, '$1') + return text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '$2') .replace(/(^|\W)@(\w+)/g, '$1@$2') - .replace(/(^|\W)#(\w+)/g, '$1#$2'); + .replace(/(^|\W)#(\w+)/g, '$1#$2'); } function prettyDate(date_str){ var time_formats = [ - [60, 'just now', 1], // 60 + [60, 'now', 1], // 60 [120, '1 min', '1 minute from now'], // 60*2 [3600, 'mins', 60], // 60*60, 60 [7200, '1 hour', '1 hour from now'], // 60*60*2 -- cgit v1.2.1