1- ( function ( $ ) {
1+ ( function ( $ ) {
22 function addRecentlyUpdatedRepo ( repo ) {
33 var $item = $ ( "<li>" ) ;
4-
4+
55 $item . append ( '<span class="name"><a href="' + repo . html_url + '">' + repo . name + '</a></span>' ) ;
66 $item . append ( '<span class="time"><a href="' + repo . html_url + '/commits">' + strftime ( "%h %e, %Y" , repo . pushed_at ) + '</a></span>' ) ;
77 $item . append ( '<span class="bullet">⋅</span>' ) ;
1111
1212 $item . appendTo ( "#recently-updated-repos" ) ;
1313 }
14-
14+
1515 function addProject ( project ) {
1616 var $project = $ ( "<div />" ) . addClass ( "project" ) ;
1717 $project . addClass ( project . language ) ;
2020 $project . append ( $ ( "<p />" ) . text ( project . description ) ) ;
2121 $project . appendTo ( "#projects" ) ;
2222 }
23-
23+
2424 $ . getJSON ( "https://api.github.com/users/twitter/repos?callback=?" , function ( result ) {
2525 var repos = result . data ;
26-
27- $ ( function ( ) {
28- $ ( "#num-repos" ) . val ( repos . length ) ;
2926
27+ $ ( function ( ) {
28+ $ ( "#num-repos" ) . text ( repos . length ) ;
29+
30+ // Convert pushed_at to Date.
3031 $ . each ( repos , function ( i , repo ) {
3132 repo . pushed_at = new Date ( repo . pushed_at ) ;
3233 } ) ;
3738 if ( b . pushed_at < a . pushed_at ) return - 1 ;
3839 return 0 ;
3940 } ) ;
40-
41+
4142 $ . each ( repos , function ( i , repo ) {
4243 addProject ( repo ) ;
4344 } ) ;
4445
4546 $ . each ( repos . slice ( 0 , 3 ) , function ( i , repo ) {
4647 addRecentlyUpdatedRepo ( repo ) ;
47- } ) ;
48+ } ) ;
4849 } ) ;
4950 } ) ;
50-
51- $ . getJSON ( "https://api.github.com/orgs/twitter/members?callback=?" , function ( members ) {
51+
52+ $ . getJSON ( "https://api.github.com/orgs/twitter/members?callback=?" , function ( result ) {
53+ var members = result . data ;
54+
5255 $ ( function ( ) {
53- $ ( "#num-members" ) . val ( members . length ) ;
56+ $ ( "#num-members" ) . text ( members . length ) ;
5457 } ) ;
5558 } ) ;
56- } ) ( jQuery ) ;
59+
60+ } ) ( jQuery ) ;
0 commit comments