<commit_before>angular.module('directory.controllers', [])

.controller('EmployeeIndexCtrl', function($scope, EmployeeService) {

    $scope.searchKey = "";

    $scope.clearSearch = function() {
        $scope.searchKey = "";
        findAllEmployees();
    }

    $scope.search = function() {
        EmployeeService.findByName($scope.searchKey).then(function(employees) {
            $scope.employees = employees;
        });
    }

    var findAllEmployees = function() {
        EmployeeService.findAll().then(function(employees) {
            $scope.employees = employees;
        });
    }

    findAllEmployees();

})

/*

.controller('DocListCtrl', function ($scope, $stateParams, DocService) {
    DocService.findById($stateParams.doclistId).then(function(doclist) {
        $scope.doclist = doclist;
    });
}) */


.controller('FbCtrl', function($scope) {
    console.log("blah");
    $scope.logger = function() {
        //$scope.user = "hi";
        console.log("blah2");
        Parse.FacebookUtils.logIn(null, { //pass in age_range and location then get current_location from page, also user/picture
            success: function(user) {
                if (!user.existed()) {
                    if (!Parse.FacebookUtils.isLinked(user)) {
                        Parse.FacebookUtils.link(user, null, {
                            success: function(user) {
                                alert("Woohoo, user logged in with Facebook!");
                            },
                            error: function(user, error) {
                                alert("User cancelled the Facebook login or did not fully authorize.");
                            }
                        });
                    }
                    alert("User signed up and logged in through Facebook!");
                } else {
                    alert("User logged in through Facebook!");
                }
            },
            error: function(user, error) {
                alert("User cancelled the Facebook login or did not fully authorize.");
            }
        }); //just call user.get("key") for everything

        test();
    }
    var test = function() {
        console.log('inner');
    }

})<commit_msg>added more alerts<commit_after>angular.module('directory.controllers', [])

.controller('EmployeeIndexCtrl', function($scope, EmployeeService) {

    $scope.searchKey = "";

    $scope.clearSearch = function() {
        $scope.searchKey = "";
        findAllEmployees();
    }

    $scope.search = function() {
        EmployeeService.findByName($scope.searchKey).then(function(employees) {
            $scope.employees = employees;
        });
    }

    var findAllEmployees = function() {
        EmployeeService.findAll().then(function(employees) {
            $scope.employees = employees;
        });
    }

    findAllEmployees();

})

/*

.controller('DocListCtrl', function ($scope, $stateParams, DocService) {
    DocService.findById($stateParams.doclistId).then(function(doclist) {
        $scope.doclist = doclist;
    });
}) */


.controller('FbCtrl', function($scope) {
    console.log("blah");
    $scope.logger = function() {
        //$scope.user = "hi";
        console.log("blah2");
        Parse.FacebookUtils.logIn(null, { //pass in age_range and location then get current_location from page, also user/picture
            success: function(user) {
                if (!user.existed()) {
                    if (!Parse.FacebookUtils.isLinked(user)) {
                        Parse.FacebookUtils.link(user, null, {
                            success: function(user) {
                                alert("Woohoo, user logged in and linked with Facebook!");
                            },
                            error: function(user, error) {
                                alert("error in linkage.");
                            }
                        });
                    }
                    alert("User signed up and linked in through Facebook!");
                } else {
                    alert("User existed in system");
                }
            },
            error: function(user, error) {
                alert("User cancelled the Facebook login or did not fully authorize.");
            }
        }); //just call user.get("key") for everything

        test();
    }
    var test = function() {
        console.log('inner');
    }

})
{'fraction_non_alphanumeric': 0.127519818799547, 'fraction_numerical': 0.00045300113250283127, 'mean_word_length': 1.658639373871162, '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': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2540554', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1094, 'n_words': 228}