<commit_before>'use strict';

var routes_path =
{
  '/register':{templateUrl: 'partials/register.html', controller: 'UsersRegisterCtrl'},
  '/upload_resume': {templateUrl: 'partials/upload_resume.html', controller: 'uploadResume'},
  '/users': {templateUrl: 'partials/users.html', controller: 'UsersCtrl',requireLogin: true},
  '/user/edit/:userId/': {templateUrl: 'partials/editprofile.html', controller: 'UserEditCtrl',requireLogin: true},
  '/user/view/:userId/':{templateUrl: 'partials/viewprofile.html', controller: 'UserViewCtrl',requireLogin: true},
  '/user/delete/:userId/':{templateUrl: 'partials/users.html', controller: 'UserDeleteCtrl',requireLogin: true},
  '/login':{templateUrl: 'partials/login.html', controller: 'LoginCtrl',requireLogin: false},
  '/logout':{templateUrl: 'partials/logout.html', controller: 'LogoutCtrl',requireLogin: true}
};
// Declare app level module which depends on filters, and services
angular.module('myApp', [
  'ngRoute',
  'myApp.entity',
  'myApp.services',
  'myApp.fbService',
  'myApp.directives',
  'myApp.controllers',
  'myApp.alert',
  'restangular',
  'facebook'
]).
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider, $httpProvider) {

  for(var path in routes_path) {
        $routeProvider.when(path, routes_path[path]);
    }
  $routeProvider.otherwise({redirectTo: '/login'});
  
  
}])
.run(['$rootScope','$location',function($rootScope,$location){
    $rootScope.$on("$locationChangeStart", function(event, next, current) {
    	$rootScope.is_logged = window.sessionStorage.getItem('is_logged');
        for(var i in routes_path) {
                if(routes_path[i].requireLogin && $rootScope.is_logged == 'false') {
                	console.log("Need to be logged in");
                	$location.path('/login');
        }
    }}
)}
])
//app_secret = '<KEY>'

.config(['FacebookProvider', function(FacebookProvider) {
     // Here you could set your appId throug the setAppId method and then initialize
     // or use the shortcut in the initialize method directly.
     FacebookProvider.init('1421859234725543');
}])

.config(function(RestangularProvider) {
  RestangularProvider.setBaseUrl('http://localhost:3000/');
 // RestangularProvider.setDefaultRequestParams({ apiKey: '<KEY>' });<commit_msg>Update .run functionality inapp.js<commit_after>'use strict';

var routes_path =
{
  '/register':{templateUrl: 'partials/register.html', controller: 'UsersRegisterCtrl'},
  '/upload_resume': {templateUrl: 'partials/upload_resume.html', controller: 'uploadResume'},
  '/users': {templateUrl: 'partials/users.html', controller: 'UsersCtrl',requireLogin: true},
  '/user/edit/:userId/': {templateUrl: 'partials/editprofile.html', controller: 'UserEditCtrl',requireLogin: true},
  '/user/view/:userId/':{templateUrl: 'partials/viewprofile.html', controller: 'UserViewCtrl',requireLogin: true},
  '/user/delete/:userId/':{templateUrl: 'partials/users.html', controller: 'UserDeleteCtrl',requireLogin: true},
  '/login':{templateUrl: 'partials/login.html', controller: 'LoginCtrl',requireLogin: false},
  '/logout':{templateUrl: 'partials/logout.html', controller: 'LogoutCtrl',requireLogin: true}
};
// Declare app level module which depends on filters, and services
angular.module('myApp', [
  'ngRoute',
  'myApp.entity',
  'myApp.services',
  'myApp.fbService',
  'myApp.directives',
  'myApp.controllers',
  'myApp.alert',
  'restangular',
  'facebook'
]).
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider, $httpProvider) {

  for(var path in routes_path) {
        $routeProvider.when(path, routes_path[path]);
    }
  $routeProvider.otherwise({redirectTo: '/login'});
  
  
}])
.run(['$rootScope','$location',function($rootScope,$location){
    $rootScope.$on("$locationChangeStart", function(event, next, current) {
    	$rootScope.is_logged = window.sessionStorage.getItem('is_logged');
        for(var i in routes_path) {
        		if (current == "http://resume.app/app/#"+$location.path()){
        			if (routes_path[i].requireLogin){
	        			if ($rootScope.is_logged == 'false') {
	                		console.log("Need to be logged in");
	                		$location.path('/login');
	        			}
        			}	
        		}
    }}
)}

])
//app_secret = '<KEY>'

.config(['FacebookProvider', function(FacebookProvider) {
     // Here you could set your appId throug the setAppId method and then initialize
     // or use the shortcut in the initialize method directly.
     FacebookProvider.init('1421859234725543');
}])

.config(function(RestangularProvider) {
  RestangularProvider.setBaseUrl('http://localhost:3000/');
 // RestangularProvider.setDefaultRequestParams({ apiKey: '<KEY>' });
{'fraction_non_alphanumeric': 0.16782627029306346, 'fraction_numerical': 0.00843348091924942, 'mean_word_length': 4.640903686087991, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2585235', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1459, 'n_words': 268}