| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var app = angular.module('app', [ | 
					
						
							|  |  |  |   'ngRoute', | 
					
						
							|  |  |  |   'ui.filters' | 
					
						
							|  |  |  | ]); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-09-30 01:05:01 -07:00
										 |  |  | // First, parse the query string
 | 
					
						
							|  |  |  | var params = {}, queryString = location.hash.substring(1), | 
					
						
							|  |  |  | 	regex  = /([^&=]+)=([^&]*)/g, m; | 
					
						
							|  |  |  | while (m = regex.exec(queryString)) { | 
					
						
							|  |  |  | 	params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // if the user is authenticated we should add Basic
 | 
					
						
							|  |  |  | // auth token to each request.
 | 
					
						
							|  |  |  | if (params.access_token) { | 
					
						
							|  |  |  | 	localStorage.setItem("access_token", params.access_token); | 
					
						
							|  |  |  | 	history.replaceState({}, document.title, location.pathname); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-16 13:52:33 -07:00
										 |  |  | app.config(['$routeProvider', '$locationProvider', '$httpProvider', function($routeProvider, $locationProvider, $httpProvider) { | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 	$routeProvider.when('/', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/home.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'HomeController', | 
					
						
							|  |  |  | 			title: 'Dashboard', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2014-07-09 22:24:06 -07:00
										 |  |  | 		.when('/sync', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/sync.html', | 
					
						
							| 
									
										
										
										
											2014-07-09 22:24:06 -07:00
										 |  |  | 			controller: 'SyncController', | 
					
						
							|  |  |  | 			title: 'Sync' | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		.when('/login', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/login.html', | 
					
						
							| 
									
										
										
										
											2014-07-12 19:01:58 -07:00
										 |  |  | 			controller: 'LoginController', | 
					
						
							| 
									
										
										
										
											2014-10-13 21:10:55 -07:00
										 |  |  | 			title: 'Login' | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/logout', { | 
					
						
							|  |  |  | 			templateUrl: '/static/views/logout.html', | 
					
						
							|  |  |  | 			controller: 'LogoutController', | 
					
						
							|  |  |  | 			title: 'Logout' | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2014-09-03 00:43:36 -07:00
										 |  |  | 		.when('/gitlab', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/login_gitlab.html', | 
					
						
							| 
									
										
										
										
											2014-09-03 00:43:36 -07:00
										 |  |  | 			title: 'GitLab Login', | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		.when('/setup', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/setup.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'SetupController', | 
					
						
							|  |  |  | 			title: 'Setup' | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/setup/:remote', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/setup.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'SetupController', | 
					
						
							|  |  |  | 			title: 'Setup' | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/account/profile', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/account.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'UserController', | 
					
						
							|  |  |  | 			title: 'Profile', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/account/repos', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/repo_list.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'AccountReposController', | 
					
						
							|  |  |  | 			title: 'Repositories', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2014-07-09 14:25:11 -07:00
										 |  |  | 		.when('/admin/users/add', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/users_add.html', | 
					
						
							| 
									
										
										
										
											2014-07-09 14:25:11 -07:00
										 |  |  | 			controller: 'UserAddController', | 
					
						
							|  |  |  | 			title: 'Add User', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/admin/users/:host/:login', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/users_edit.html', | 
					
						
							| 
									
										
										
										
											2014-07-09 14:25:11 -07:00
										 |  |  | 			controller: 'UserEditController', | 
					
						
							|  |  |  | 			title: 'Edit User', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		.when('/admin/users', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/users.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'UsersController', | 
					
						
							|  |  |  | 			title: 'System Users', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/admin/settings', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/config.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'ConfigController', | 
					
						
							|  |  |  | 			title: 'System Settings', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/:remote/:owner/:name/settings', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/repo_edit.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'RepoConfigController', | 
					
						
							|  |  |  | 			title: 'Repository Settings', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/:remote/:owner/:name/:branch/:commit', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/commit.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'CommitController', | 
					
						
							|  |  |  | 			title: 'Recent Commits', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.when('/:remote/:owner/:name', { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 			templateUrl: '/static/views/repo.html', | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 			controller: 'RepoController', | 
					
						
							|  |  |  | 			title: 'Recent Commits', | 
					
						
							|  |  |  | 			resolve: { | 
					
						
							|  |  |  | 				user: function(authService) { | 
					
						
							|  |  |  | 					return authService.getUser(); | 
					
						
							|  |  |  | 				}, | 
					
						
							| 
									
										
										
										
											2014-07-11 13:46:04 -07:00
										 |  |  | 				repo: function($route, repos) { | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 					var remote = $route.current.params.remote; | 
					
						
							|  |  |  | 					var owner  = $route.current.params.owner; | 
					
						
							|  |  |  | 					var name   = $route.current.params.name; | 
					
						
							| 
									
										
										
										
											2014-07-11 13:46:04 -07:00
										 |  |  | 					return repos.getRepo(remote, owner, name); | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// use the HTML5 History API
 | 
					
						
							|  |  |  | 	$locationProvider.html5Mode(true); | 
					
						
							| 
									
										
										
										
											2014-08-16 13:52:33 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-09-30 01:05:01 -07:00
										 |  |  | 	$httpProvider.defaults.headers.common.Authorization = 'Bearer '+localStorage.getItem('access_token'); | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-16 13:52:33 -07:00
										 |  |  | 	$httpProvider.interceptors.push(function($q, $location) { | 
					
						
							|  |  |  | 		return { | 
					
						
							|  |  |  | 			'responseError': function(rejection) { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 				if (rejection.status == 401 && rejection.config.url != "/api/user") { | 
					
						
							| 
									
										
										
										
											2014-08-16 13:52:33 -07:00
										 |  |  | 					$location.path('/login'); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				return $q.reject(rejection); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}; | 
					
						
							|  |  |  | 	}); | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | }]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* also see https://coderwall.com/p/vcfo4q */ | 
					
						
							| 
									
										
										
										
											2014-07-11 15:29:31 -07:00
										 |  |  | app.run(['$location', '$rootScope', '$routeParams', 'feed', 'stdout', function($location, $rootScope, $routeParams, feed, stdout) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	$rootScope.$on('$routeChangeStart', function (event, next) { | 
					
						
							|  |  |  | 		feed.unsubscribe(); | 
					
						
							|  |  |  | 		stdout.unsubscribe(); | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  |     $rootScope.$on('$routeChangeSuccess', function (event, current, previous) { | 
					
						
							|  |  |  |         document.title = current.$$route.title + ' · drone.io'; | 
					
						
							|  |  |  |     }); | 
					
						
							| 
									
										
										
										
											2014-08-16 13:52:33 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | }]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Controllers */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | app.controller("AccountReposController", function($scope, $http, user) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	$scope.user = user; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// get the user details
 | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 	$http({method: 'GET', url: '/api/user/repos'}). | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		success(function(data, status, headers, config) { | 
					
						
							|  |  |  | 			$scope.repos = (typeof data==='string')?[]:data; | 
					
						
							|  |  |  | 		}). | 
					
						
							|  |  |  | 		error(function(data, status, headers, config) { | 
					
						
							|  |  |  | 			console.log(data); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	$scope.active=""; | 
					
						
							|  |  |  | 	$scope.remote=""; | 
					
						
							|  |  |  | 	$scope.byActive = function(entry){ | 
					
						
							|  |  |  | 			switch (true) { | 
					
						
							|  |  |  | 			case $scope.active == "true"  && !entry.active: return false; | 
					
						
							|  |  |  | 			case $scope.active == "false" &&  entry.active: return false; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			return true; | 
					
						
							|  |  |  | 		}; | 
					
						
							|  |  |  | 	$scope.byRemote = function(entry){ | 
					
						
							|  |  |  | 			return $scope.remote == "" || $scope.remote == entry.remote;  | 
					
						
							|  |  |  | 		};  | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-25 21:34:27 +02:00
										 |  |  | app.controller("CommitController", function($scope, $http, $route, $routeParams, stdout, feed) { | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	var remote = $routeParams.remote; | 
					
						
							|  |  |  | 	var owner  = $routeParams.owner; | 
					
						
							|  |  |  | 	var name   = $routeParams.name; | 
					
						
							|  |  |  | 	var branch = $routeParams.branch; | 
					
						
							|  |  |  | 	var commit = $routeParams.commit; | 
					
						
							| 
									
										
										
										
											2014-07-11 19:10:18 -07:00
										 |  |  | 	$scope.console=''; | 
					
						
							| 
									
										
										
										
											2014-10-25 21:34:27 +02:00
										 |  |  | 	 | 
					
						
							|  |  |  | 	var handleOutput = function(id, clearConsole) { | 
					
						
							|  |  |  | 		var lineFormatter = new Drone.LineFormatter(); | 
					
						
							|  |  |  | 		var el = document.querySelector('#output'); | 
					
						
							|  |  |  | 		if(clearConsole === true) { | 
					
						
							|  |  |  | 			el.innerHTML = '';  | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		stdout.subscribe(id, function(out){ | 
					
						
							|  |  |  | 			angular.element(el).append(lineFormatter.format(out)); | 
					
						
							|  |  |  | 			if ($scope.following) { | 
					
						
							|  |  |  | 				window.scrollTo(0, document.body.scrollHeight); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-22 03:02:22 -07:00
										 |  |  | 	feed.subscribe(function(item) { | 
					
						
							| 
									
										
										
										
											2014-07-11 19:10:18 -07:00
										 |  |  | 		if (item.commit.sha    == commit && | 
					
						
							|  |  |  | 			item.commit.branch == branch) { | 
					
						
							| 
									
										
										
										
											2014-10-25 21:34:27 +02:00
										 |  |  | 			if(item.commit.status == "Started") { | 
					
						
							|  |  |  | 				handleOutput(item.commit.id, true); | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2014-06-22 03:02:22 -07:00
										 |  |  | 			$scope.commit = item.commit; | 
					
						
							|  |  |  | 			$scope.$apply(); | 
					
						
							| 
									
										
										
										
											2014-10-25 21:34:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-22 03:02:22 -07:00
										 |  |  | 		} else { | 
					
						
							| 
									
										
										
										
											2014-07-13 16:46:49 -07:00
										 |  |  | 			// we trigger an toast notification so the
 | 
					
						
							| 
									
										
										
										
											2014-06-22 03:02:22 -07:00
										 |  |  | 			// user is aware another build started
 | 
					
						
							| 
									
										
										
										
											2014-07-13 16:46:49 -07:00
										 |  |  | 			 | 
					
						
							| 
									
										
										
										
											2014-06-22 02:04:07 -07:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 	// load the repo meta-data
 | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 	$http({method: 'GET', url: '/api/repos/'+remote+'/'+owner+"/"+name}). | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		success(function(data, status, headers, config) { | 
					
						
							|  |  |  | 			$scope.repo = data; | 
					
						
							|  |  |  | 		}). | 
					
						
							|  |  |  | 		error(function(data, status, headers, config) { | 
					
						
							|  |  |  | 			console.log(data); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// load the repo commit data
 | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 	$http({method: 'GET', url: '/api/repos/'+remote+'/'+owner+"/"+name+"/branches/"+branch+"/commits/"+commit}). | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		success(function(data, status, headers, config) { | 
					
						
							|  |  |  | 			$scope.commit = data; | 
					
						
							| 
									
										
										
										
											2014-06-22 02:04:07 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			if (data.status!='Started' && data.status!='Pending') { | 
					
						
							| 
									
										
										
										
											2014-09-30 00:43:50 -07:00
										 |  |  | 				$http({method: 'GET', url: '/api/repos/'+remote+'/'+owner+"/"+name+"/branches/"+branch+"/commits/"+commit+"/console"}). | 
					
						
							| 
									
										
										
										
											2014-07-11 16:52:22 -07:00
										 |  |  | 					success(function(data, status, headers, config) { | 
					
						
							| 
									
										
										
										
											2014-07-11 19:10:18 -07:00
										 |  |  | 						var lineFormatter = new Drone.LineFormatter(); | 
					
						
							|  |  |  | 						var el = document.querySelector('#output'); | 
					
						
							|  |  |  | 						angular.element(el).append(lineFormatter.format(data)); | 
					
						
							| 
									
										
										
										
											2014-07-11 16:52:22 -07:00
										 |  |  | 					}). | 
					
						
							|  |  |  | 					error(function(data, status, headers, config) { | 
					
						
							|  |  |  | 						console.log(data); | 
					
						
							|  |  |  | 					}); | 
					
						
							| 
									
										
										
										
											2014-07-11 19:10:18 -07:00
										 |  |  | 				return; | 
					
						
							| 
									
										
										
										
											2014-06-22 02:04:07 -07:00
										 |  |  | 			} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-25 21:34:27 +02:00
										 |  |  | 			handleOutput(data.id, false); | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 		}). | 
					
						
							|  |  |  | 		error(function(data, status, headers, config) { | 
					
						
							|  |  |  | 			console.log(data); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-09-28 02:52:10 +00:00
										 |  |  | 	$scope.following = false; | 
					
						
							|  |  |  | 	$scope.follow = function() { | 
					
						
							|  |  |  | 		$scope.following = true; | 
					
						
							|  |  |  | 		window.scrollTo(0, document.body.scrollHeight); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	$scope.unfollow = function() { | 
					
						
							|  |  |  | 		$scope.following = false; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-09-08 02:11:20 +04:00
										 |  |  | 	$scope.rebuildCommit = function() { | 
					
						
							| 
									
										
										
										
											2014-10-25 21:34:27 +02:00
										 |  |  |         $http({method: 'POST', url: '/api/repos/'+remote+'/'+owner+'/'+name+'/'+'branches/'+branch+'/'+'commits/'+commit+'?action=rebuild' }); | 
					
						
							| 
									
										
										
										
											2014-09-08 02:11:20 +04:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-07-11 16:52:22 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-21 14:22:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-12 19:07:18 +00:00
										 |  |  | }); |