<commit_before>// ==========================================================================
// Main module
// ==========================================================================

var instaLurker = angular.module('InstaLurker', ['ui.router','satellizer','infinite-scroll','ngProgressLite','linkify','envConstant','vesparny.fancyModal']);

// Startup
instaLurker.run(['$rootScope', '$window', '$auth', 'ngProgressLite', function($rootScope, $window, $auth, ngProgressLite) {
    // If authenticated load user on start and redirect to 'MyFeed' page
    if ($auth.isAuthenticated()) {
        $rootScope.currentUser = JSON.parse($window.localStorage.currentUser);
        //$state.go('myfeed');
    }

    // Loading progressbar and cancel routing to private path
    $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
        if (toState !== null && toState.authRequired && !$auth.isAuthenticated()) {
            event.preventDefault();
        }
        else {
            $rootScope.searchActive = false;
            $rootScope.fixView = false;
/*            if($rootScope.currentModal)
                $rootScope.currentModal.close();*/
            ngProgressLite.start();
        }
    });
    $rootScope.$on('$stateChangeSuccess', function () {
        ngProgressLite.done();
    });
    $rootScope.$on('$stateChangeError', function () {
        ngProgressLite.done();
    });
}]);

// Configuration
instaLurker.config(['$stateProvider', '$urlRouterProvider', '$authProvider', '$locationProvider', '$sceDelegateProvider', 'ENV',
    function($stateProvider, $urlRouterProvider, $authProvider, $locationProvider, $sceDelegateProvider, ENV) {

    // Routing
    $locationProvider.html5Mode(true);
    $urlRouterProvider.otherwise('/');

    $stateProvider
        .state('home', {
            url: '/',
            templateUrl: 'views/home.html',
            controller: 'HomeCtrl as home',
            resolve: {
                popular: function(InstagramAPI) {
                    return InstagramAPI.popular();
                }
            }
        })
        .state('myfeed', {
            url: '/myfeed',
            templateUrl: 'views/myfeed.html',
            authRequired: true,
            controller: 'MyFeedCtrl as myFeed',
        })
        .state('followed', {
            url: '/followed',
            templateUrl: 'views/followed.html',
            controller: 'FollowedListCtrl as followedListCtrl',
            authRequired: true,
            resolve: {
                usersData: function(FollowedAPI) {
                    return FollowedAPI.list();
                }
            }
        })
        .state('user', {<commit_msg>forgot...<commit_after>// ==========================================================================
// Main module
// ==========================================================================

var instaLurker = angular.module('InstaLurker', ['ui.router','satellizer','infinite-scroll','ngProgressLite','linkify','envConstant']);

// Startup
instaLurker.run(['$rootScope', '$window', '$auth', 'ngProgressLite', function($rootScope, $window, $auth, ngProgressLite) {
    // If authenticated load user on start and redirect to 'MyFeed' page
    if ($auth.isAuthenticated()) {
        $rootScope.currentUser = JSON.parse($window.localStorage.currentUser);
        //$state.go('myfeed');
    }

    // Loading progressbar and cancel routing to private path
    $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
        if (toState !== null && toState.authRequired && !$auth.isAuthenticated()) {
            event.preventDefault();
        }
        else {
            $rootScope.searchActive = false;
            $rootScope.fixView = false;
/*            if($rootScope.currentModal)
                $rootScope.currentModal.close();*/
            ngProgressLite.start();
        }
    });
    $rootScope.$on('$stateChangeSuccess', function () {
        ngProgressLite.done();
    });
    $rootScope.$on('$stateChangeError', function () {
        ngProgressLite.done();
    });
}]);

// Configuration
instaLurker.config(['$stateProvider', '$urlRouterProvider', '$authProvider', '$locationProvider', '$sceDelegateProvider', 'ENV',
    function($stateProvider, $urlRouterProvider, $authProvider, $locationProvider, $sceDelegateProvider, ENV) {

    // Routing
    $locationProvider.html5Mode(true);
    $urlRouterProvider.otherwise('/');

    $stateProvider
        .state('home', {
            url: '/',
            templateUrl: 'views/home.html',
            controller: 'HomeCtrl as home',
            resolve: {
                popular: function(InstagramAPI) {
                    return InstagramAPI.popular();
                }
            }
        })
        .state('myfeed', {
            url: '/myfeed',
            templateUrl: 'views/myfeed.html',
            authRequired: true,
            controller: 'MyFeedCtrl as myFeed'
        })
        .state('followed', {
            url: '/followed',
            templateUrl: 'views/followed.html',
            controller: 'FollowedListCtrl as followedListCtrl',
            authRequired: true,
            resolve: {
                usersData: function(FollowedAPI) {
                    return FollowedAPI.list();
                }
            }
        })
        .state('user', {
{'fraction_non_alphanumeric': 0.19217213874976813, 'fraction_numerical': 0.0003709886848451122, 'mean_word_length': 2.4365838113448057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3344409', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1392, 'n_words': 250}