[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/processing/processing-docs/master/javascript/site.js [Back]  [Original]

$(function(){ // redirect download to support $('.download [href*="download.processing.org"]').on('click', function (e) { e.preventDefault() .attr('href')) window.focus() }) // sticky scroll if(!Modernizr.touch){ $(window).scroll(function(){ if($(this).scrollTop() < 114){ $('.navBar').removeClass('stuck') } else { $('.navBar').addClass('stuck') } }) } // if on the homepage, gather recent tweets/commits if($('body').attr('id')=='Cover'){ // recent tweets $.getJSON('/content/static/feeds/twitter.php', function(data) { $.each(data, function(i, tweet) { var time = parse_date(tweet.created_at); var timeText = format_relative_time(extract_relative_time(time)); var tweet_html = '
  • '+tweet.text.parseURL().parseUsername().parseHashtag(); tweet_html += ' about'; tweet_html += '' + timeText + ''; tweet_html += ''; $('.latest-tweets').append(tweet_html) }) }) // recent commits $.getJSON('/content/static/feeds/github.php', function(data) { $.each(data, function(i, commit) { if(i 2 ) return ' ' + time_ago.days + ' days ago'; if ( time_ago.hours > 24 ) return ' a day ago'; if ( time_ago.hours > 2 ) return ' ' + time_ago.hours + ' hours ago'; if ( time_ago.minutes > 45 ) return ' an hour ago'; if ( time_ago.minutes > 2 ) return ' ' + time_ago.minutes + ' minutes ago'; if ( time_ago.seconds > 1 ) return ' ' + time_ago.seconds + ' seconds ago'; return 'just now'; }
    Web Proxy Viewer  |  New URL  |  Original Page