<commit_before>'use strict';
angular.module("schoolines")
    .controller('indexController', ["$scope", "$localStorage", "$timeout", "$mdSidenav", "$log", "$location", "$routeParams", "$window", "IVLEService", "DeadlineService", "AuthService", "Session",
            function($scope, $localStorage, $timeout, $mdSidenav, $log, $location, $routeParams, $window, IVLEService, DeadlineService, AuthService, Session) {
                $scope.$watch('online', function(newStatus) {

                });
                console.log(navigator.onLine);
                $scope.title = "Schoolines";
                $window.ga('send', 'pageview', { page: $location.url() });

                AuthService.autologin().then(function(){
                    console.log(Session.token);
                    console.log(Session.userId);
                });

                $scope.redirectTo = function(url){
                    $location.path(url);
                }
                    // Save token to session
                    // first time log in
                // if ($routeParams.token) {
                //     IVLEService.createUser(Session.token);
                //
                //     AuthService.login($routeParams.token);
                //     IVLEService.createUser(Session.token).then(function(){
                //         var userId = Session.userId;
                //
                //         $location.url('/');
                //     });
                // }


            }]);<commit_msg>disable deadline create when offline<commit_after>'use strict';
angular.module("schoolines")
    .controller('indexController', ["$scope", "$localStorage", "$timeout", "OnlineStatusService,"
        "$mdSidenav", "$log", "$location", "$routeParams", "$window", "IVLEService", "DeadlineService", "AuthService", "Session",
        function($scope, $localStorage, $timeout, OnlineStatusService, $mdSidenav, $log, $location, $routeParams, $window, IVLEService, DeadlineService, AuthService, Session) {

            $scope.title = "Schoolines";
            $window.ga('send', 'pageview', {
                page: $location.url()
            });

            AuthService.autologin().then(function() {
                console.log(Session.token);
                console.log(Session.userId);
            });

            $scope.redirectTo = function(url) {
                    if (onlineStatus.isOnline()) {
                        $location.path(url);
                    } else {
                        sweetAlert("Oops...", "Service not available offline.", "error");
                    }
                }
                // Save token to session
                // first time log in
                // if ($routeParams.token) {
                //     IVLEService.createUser(Session.token);
                //
                //     AuthService.login($routeParams.token);
                //     IVLEService.createUser(Session.token).then(function(){
                //         var userId = Session.userId;
                //
                //         $location.url('/');
                //     });
                // }


        }
    ]);
{'fraction_non_alphanumeric': 0.14718063077413188, 'fraction_numerical': 0.0, 'mean_word_length': 1.4802527646129542, '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': '666781', 'n_tokens_mistral': 804, 'n_tokens_neox': 749, 'n_words': 132}