2
2
3
3
angular . module ( 'angularGoogleMapsApp' ) . controller ( 'FooterCtrl' , [
4
4
'$scope' , '$log' , '$q' , '$github' ,
5
- function ( $scope , $log , $q , $github ) {
5
+ function ( $scope , $log , $q , $github ) {
6
6
7
7
var githubCalled = false ;
8
8
9
9
if ( ! githubCalled ) {
10
10
// GitHub api calls
11
11
$q . all ( [ $github . getAllCommits ( ) , $github . getContributors ( ) , $github . getIssues ( ) , $github . getEvents ( ) ] )
12
- . then ( function ( results ) {
12
+ . then ( function ( results ) {
13
13
14
14
var commits = results [ 0 ] ,
15
15
contributors = results [ 1 ] ,
@@ -29,7 +29,7 @@ angular.module('angularGoogleMapsApp').controller('FooterCtrl', [
29
29
events : events
30
30
}
31
31
} ) ;
32
- } , function ( err ) {
32
+ } , function ( err ) {
33
33
$log . error ( err ) ;
34
34
$scope . github = null ;
35
35
} ) ;
@@ -41,49 +41,51 @@ angular.module('angularGoogleMapsApp').controller('FooterCtrl', [
41
41
return '<a href="' + actor . url + '" rel="external">' + actor . login + '</a>' ;
42
42
}
43
43
44
- $scope . eventLabel = function ( event ) {
44
+ $scope . thisYear = new Date ( ) . getFullYear ( ) ;
45
+
46
+ $scope . eventLabel = function ( event ) {
45
47
46
48
var pl = event . payload ;
47
49
48
50
switch ( event . type ) {
49
- case 'WatchEvent' :
50
- return 'starred this repository' ;
51
+ case 'WatchEvent' :
52
+ return 'starred this repository' ;
51
53
52
- case 'CreateEvent' :
53
- return 'created ' + pl . ref_type + ' ' + pl . ref ;
54
+ case 'CreateEvent' :
55
+ return 'created ' + pl . ref_type + ' ' + pl . ref ;
54
56
55
- case 'ForkEvent' :
56
- return 'forked this repository' ;
57
+ case 'ForkEvent' :
58
+ return 'forked this repository' ;
57
59
58
- case 'PushEvent' :
59
- return 'pushed ' + pl . size + ' commit(s) to ' + pl . ref . replace ( 'refs/heads/' , '' ) ;
60
+ case 'PushEvent' :
61
+ return 'pushed ' + pl . size + ' commit(s) to ' + pl . ref . replace ( 'refs/heads/' , '' ) ;
60
62
61
- case 'IssueCommentEvent' :
62
- return 'commented on issue ' + pl . issue . number ;
63
+ case 'IssueCommentEvent' :
64
+ return 'commented on issue ' + pl . issue . number ;
63
65
64
- case 'DeleteEvent' :
65
- return 'deleted ' + pl . ref_type + ' ' + pl . ref ;
66
+ case 'DeleteEvent' :
67
+ return 'deleted ' + pl . ref_type + ' ' + pl . ref ;
66
68
67
- case 'PullRequestEvent' :
68
- return pl . action + ' pull request ' + pl . pull_request . number ;
69
+ case 'PullRequestEvent' :
70
+ return pl . action + ' pull request ' + pl . pull_request . number ;
69
71
70
- case 'IssuesEvent' :
71
- return pl . action + ' issue ' + pl . issue . number ;
72
+ case 'IssuesEvent' :
73
+ return pl . action + ' issue ' + pl . issue . number ;
72
74
73
- case 'PullRequestReviewCommentEvent' :
74
- return 'commented on a <a href="' + pl . comment . html_url + '" rel="external">pull request</a>' ;
75
+ case 'PullRequestReviewCommentEvent' :
76
+ return 'commented on a <a href="' + pl . comment . html_url + '" rel="external">pull request</a>' ;
75
77
76
- case 'GollumEvent' :
77
- var page = pl . pages && pl . pages . length ? pl . pages [ 0 ] : null ;
78
+ case 'GollumEvent' :
79
+ var page = pl . pages && pl . pages . length ? pl . pages [ 0 ] : null ;
78
80
79
- if ( page ) {
80
- return page . action + ' page <a href="' + page . html_url + '" rel="external">' + page . title + '</a> on the wiki' ;
81
- }
81
+ if ( page ) {
82
+ return page . action + ' page <a href="' + page . html_url + '" rel="external">' + page . title + '</a> on the wiki' ;
83
+ }
82
84
83
- return '[api data error]' ;
85
+ return '[api data error]' ;
84
86
85
- case 'CommitCommentEvent' :
86
- return 'commented on commit ' + pl . comment . commit_id . substring ( 0 , 8 ) ;
87
+ case 'CommitCommentEvent' :
88
+ return 'commented on commit ' + pl . comment . commit_id . substring ( 0 , 8 ) ;
87
89
}
88
90
89
91
return "TODO (" + event . type + ")" ;
0 commit comments