<commit_before>(function(angular) {
    'use strict';
    var app = angular.module('discussion.directives', []);

    app.directive('files',
        function() {
            return {
                restrict: "E",
                templateUrl: "/static/templates/files.html",
                scope: {
                    files: '=',
                    progress: '=',
                    editable: '=',
                },
                controller: ['$scope', 'TopicFile', 'CommentFile', function($scope, TopicFile, CommentFile){
                    // $scope.deleteFile = function(i, post_files){
                    //     if($scope.isTopic)
                    //         TopicFile.delete({id: post_files[i].id});
                    //     else
                    //         CommentFile.delete({id: post_files[i].id});
                    //     post_files.splice(i,1);
                    // };
                }],
            };
        }
    );

})(window.angular);<commit_msg>File deletion support added (refs hacklabr/paralapraca#211)<commit_after>(function(angular) {
    'use strict';
    var app = angular.module('discussion.directives', []);

    app.directive('files',
        function() {
            return {
                restrict: "E",
                templateUrl: "/static/templates/files.html",
                scope: {
                    files: '=',
                    progress: '=',
                    editable: '=',
                    isTopic: '=',
                },
                controller: ['$scope', 'TopicFile', 'CommentFile', function($scope, TopicFile, CommentFile){
                    $scope.deleteFile = function(i){
                        if($scope.isTopic)
                            TopicFile.delete({id: $scope.files[i].id});
                        else
                            CommentFile.delete({id: $scope.files[i].id});
                        $scope.files.splice(i,1);
                    };
                }],
            };
        }
    );

})(window.angular);
{'fraction_non_alphanumeric': 0.14335145823035098, 'fraction_numerical': 0.002471576866040534, 'mean_word_length': 1.1395348837209303, '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': '1206176', 'n_tokens_mistral': 540, 'n_tokens_neox': 497, 'n_words': 74}