<commit_before>var app = angular.module('messageboard', []);

app.config(['$httpProvider', function($httpProvider) {
    $httpProvider.defaults.xsrfCookieName = 'csrftoken';
    $httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
    }]);


app.controller('messageCtrl', function($scope, $http, $interval) {


    var urlBase = '/messages';

    var refresh_data = function(){
        $http.get(urlBase + '/all')
        .success(function(data){
            $scope.messages = data;
        });
    }
    
    $interval(refresh_data,1000);


    $scope.delete = function(id){
        $http.delete(urlBase + '/' + id)
        .success(function(data){
            console.log('ok');
        });
    }

    $scope.save = function(){
        $http.post(urlBase + "/", {message:$scope.message}).<commit_msg>Add TODO<commit_after>var app = angular.module('messageboard', []);

app.config(['$httpProvider', function($httpProvider) {
    $httpProvider.defaults.xsrfCookieName = 'csrftoken';
    $httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
    }]);


app.controller('messageCtrl', function($scope, $http, $interval) {

    //TODO: encode the file to base64 and add it the POST request
    var urlBase = '/messages';

    var refresh_data = function(){
        $http.get(urlBase + '/all')
        .success(function(data){
            $scope.messages = data;
        });
    }
    
    $interval(refresh_data,1000);


    $scope.delete = function(id){
        $http.delete(urlBase + '/' + id)
        .success(function(data){
            console.log('ok');
        });
    }

    $scope.save = function(){
        $http.post(urlBase + "/", {message:$scope.message}).
{'fraction_non_alphanumeric': 0.1720623501199041, 'fraction_numerical': 0.005995203836930456, 'mean_word_length': 2.750561797752809, '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': '4125581', 'n_tokens_mistral': 531, 'n_tokens_neox': 509, 'n_words': 82}