<commit_before>angular.module("hackGMS", [])

.controller("hackGMSController", ['$http', '$scope', function($http, $scope) {

    $scope.reloadMessages = function() {
        $http.get('api/messages').then(function(response) {
            $scope.messages = response.data;
            _.each($scope.messages, function(message) {
                message.date = new Date(message.date);
            })
        });
    }

    $scope.addMessage = function() {
        var newMessageData = {
            text: $scope.messageText,
            date: new Date()
        };
        $http.post('api/messages/create', newMessageData)
            .then($scope.reloadMessages)
            .then(function() {
                $scope.messageText = "";
            });
    }

    $scope.deleteMessage = function(message) {
        $http.get('api/messages/delete/' + message.id)
            .then($scope.reloadMessages)
    }

    $scope.reloadMessages()

}])
.directive("gmsMessage", function() {
    return {
        templateUrl: "static/templates/message.html"
    }
})<commit_msg>Main page automatically checks for updates<commit_after>angular.module("hackGMS", [])

.controller("hackGMSController", ['$http', '$interval', '$scope', function($http, $interval, $scope) {

    $scope.reloadMessages = function() {
        $http.get('api/messages').then(function(response) {
            $scope.messages = response.data;
            _.each($scope.messages, function(message) {
                message.date = new Date(message.date);
            })
        });
    }

    $scope.addMessage = function() {
        var newMessageData = {
            text: $scope.messageText,
            date: new Date()
        };
        $http.post('api/messages/create', newMessageData)
            .then($scope.reloadMessages)
            .then(function() {
                $scope.messageText = "";
            });
    }

    $scope.deleteMessage = function(message) {
        $http.get('api/messages/delete/' + message.id)
            .then($scope.reloadMessages)
    }

    $interval($scope.reloadMessages, 5000)

}])
.directive("gmsMessage", function() {
    return {
        templateUrl: "static/templates/message.html"
    }
})
{'fraction_non_alphanumeric': 0.15664845173041894, 'fraction_numerical': 0.0018214936247723133, 'mean_word_length': 2.1702741702741704, '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': '503766', 'n_tokens_mistral': 634, 'n_tokens_neox': 617, 'n_words': 90}