This repository was archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathapp.js
183 lines (159 loc) · 6.5 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
angular.module('codebrag.events', []);
angular.module('codebrag.common.services', ['ui.bootstrap.modal']);
angular.module('codebrag.common.filters', []);
angular.module('codebrag.common.directives', ['codebrag.common.services', 'codebrag.events']);
angular.module('codebrag.common', ['codebrag.common.services', 'codebrag.common.directives', 'codebrag.common.filters']);
angular.module('codebrag.auth', ['codebrag.events']);
angular.module('codebrag.session', ['ui.compat', 'codebrag.auth', 'codebrag.events', 'codebrag.common']);
angular.module('codebrag.repostatus', ['codebrag.events', 'codebrag.common', 'codebrag.templates']);
angular.module('codebrag.favicon', ['codebrag.events', 'codebrag.notifications']);
angular.module('codebrag.commits.comments', ['ui.compat', 'codebrag.events']);
angular.module('codebrag.commits', [
'ngResource',
'codebrag.auth',
'codebrag.commits.comments',
'codebrag.events',
'codebrag.tour',
'codebrag.branches',
'codebrag.notifications']);
angular.module('codebrag.followups', ['ngResource', 'ui.compat', 'codebrag.auth', 'codebrag.events', 'codebrag.tour']);
angular.module('codebrag.allfollowups', ['ngResource', 'ui.compat', 'codebrag.auth', 'codebrag.events', 'codebrag.tour','codebrag.followups']);
angular.module('codebrag.invitations', ['ui.validate', 'ui.keypress']);
angular.module('codebrag.profile', ['codebrag.session']);
angular.module('codebrag.tour', ['codebrag.templates', 'codebrag.auth', 'codebrag.profile', 'codebrag.common']);
angular.module('codebrag.branches', ['codebrag.notifications', 'codebrag.events']);
angular.module('codebrag.notifications', ['codebrag.branches', 'codebrag.events']);
angular.module('codebrag.userMgmt', ['ui.bootstrap.modal']);
angular.module('codebrag.registration', ['codebrag.branches']);
angular.module('codebrag', [
'codebrag.notifications',
'codebrag.templates',
'codebrag.auth',
'codebrag.common',
'codebrag.session',
'codebrag.registration',
'codebrag.commits',
'codebrag.branches',
'codebrag.followups',
'codebrag.allfollowups',
'codebrag.repostatus',
'codebrag.favicon',
'codebrag.tour',
'codebrag.profile',
'codebrag.invitations',
'codebrag.userMgmt']);
angular.module('codebrag')
.config(function ($provide) {
$provide.decorator('$http', function ($delegate, $q) {
return codebrag.uniqueRequestsAwareHttpService($delegate, $q);
});
})
.run(function($rootScope, repositoryStatusService, pageTourService, authService, $state) {
repositoryStatusService.checkRepoReady();
authService.isFirstRegistration().then(openFirstRegistrationIfNeeded);
pageTourService.initializeTour();
function openFirstRegistrationIfNeeded(firstRegistration) {
if (firstRegistration) {
$state.transitionTo('register', {});
} else {
authService.requestCurrentUser();
}
}
});
angular.module('codebrag.auth')
.config(function ($httpProvider) {
$httpProvider.responseInterceptors.push('httpAuthInterceptor');
$httpProvider.responseInterceptors.push('httpErrorsInterceptor');
});
angular.module('codebrag.session')
.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.when('', '/');
$stateProvider
.state('home', {
url: '/',
controller: 'HomeCtrl'
})
.state('firstReegistration', {
url: '/register',
controller: function($state) {
$state.transitionTo('register', {});
}
})
.state('register', {
url: '/register/{invitationId}',
templateUrl: 'views/register/register.html',
controller: 'RegistrationWizardCtrl',
resolve: {
invitationId: function($stateParams) {
return $stateParams.invitationId;
}
},
noLogin: true
})
});
angular.module('codebrag.commits')
.config(function ($stateProvider, authenticatedUser) {
$stateProvider
.state('commits', {
url: '/{repo}/commits',
abstract: true,
templateUrl: 'views/secured/commits/commits.html',
resolve: authenticatedUser,
onEnter: function($stateParams, currentRepoContext) {
currentRepoContext.ready().then(function() {
currentRepoContext.switchRepo($stateParams.repo);
})
}
})
.state('commits.list', {
url: '',
templateUrl: 'views/secured/commits/emptyCommits.html'
})
.state('commits.details', {
url: '/{sha}',
templateUrl: 'views/secured/commits/commitDetails.html'
});
});
angular.module('codebrag.followups')
.config(function ($stateProvider, authenticatedUser) {
$stateProvider
.state('followups', {
url: '/followups',
abstract: true,
templateUrl: 'views/secured/followups/followups.html',
resolve: authenticatedUser
})
.state('followups.list', {
url: '',
templateUrl: 'views/secured/followups/emptyFollowups.html'
})
.state('followups.details', {
url: '/{followupId}/comments/{commentId}',
templateUrl: 'views/secured/followups/followupDetails.html'
});
});
angular.module('codebrag.common')
.run(function() {
marked.setOptions({sanitize: true, gfm: true});
});
angular.module('codebrag.userMgmt').run(function(userMgmtService) {
userMgmtService.initialize();
});
angular.module('codebrag.allfollowups')
.config(function ($stateProvider, authenticatedUser) {
$stateProvider
.state('allfollowups', {
url: '/allfollowups',
abstract: true,
templateUrl: 'views/secured/followups/allfollowups.html',
resolve: authenticatedUser
})
.state('allfollowups.list', {
url: '',
templateUrl: 'views/secured/followups/emptyFollowups.html'
})
.state('allfollowups.details', {
url: '/{followupId}/comments/{commentId}',
templateUrl: 'views/secured/followups/allfollowupDetails.html'
});
});