<commit_before>(function(module) {
    module.directive("displayFileContents", displayFileContentsDirective);
    function displayFileContentsDirective() {
        return {
            restrict: "E",
            controller: 'DisplayFileContentsDirectiveController',
            controllerAs: 'view',
            bindToController: true,
            scope: {
                file: '=file'
            },
            templateUrl: 'application/core/projects/project/files/display-file-contents.html'
        };
    }

    module.controller("DisplayFileContentsDirectiveController", DisplayFileContentsDirectiveController);
    DisplayFileContentsDirectiveController.$inject = ["mcfile"];

    /* @ngInject */
    function DisplayFileContentsDirectiveController(mcfile) {
        var ctrl = this;
        ctrl.fileType = determineFileType(ctrl.file.mediatype);
        ctrl.fileSrc = mcfile.src(ctrl.file.id);

        //////////////

        function determineFileType(mediatype) {
            if (isImage(mediatype.mime)) {
                return "image";
            } else {
                switch(mediatype.mime) {
                case "application/pdf":
                    return "pdf";
                case "application/vnd.ms-excel":
                    return "excel";
                default:
                    return mediatype.mime;
                }
            }
        }
    }
}(angular.module('materialscommons')));<commit_msg>Return xls as type for application/vnd.ms-excel.<commit_after>(function(module) {
    module.directive("displayFileContents", displayFileContentsDirective);
    function displayFileContentsDirective() {
        return {
            restrict: "E",
            controller: 'DisplayFileContentsDirectiveController',
            controllerAs: 'view',
            bindToController: true,
            scope: {
                file: '=file'
            },
            templateUrl: 'application/core/projects/project/files/display-file-contents.html'
        };
    }

    module.controller("DisplayFileContentsDirectiveController", DisplayFileContentsDirectiveController);
    DisplayFileContentsDirectiveController.$inject = ["mcfile"];

    /* @ngInject */
    function DisplayFileContentsDirectiveController(mcfile) {
        var ctrl = this;
        ctrl.fileType = determineFileType(ctrl.file.mediatype);
        ctrl.fileSrc = mcfile.src(ctrl.file.id);

        //////////////

        function determineFileType(mediatype) {
            if (isImage(mediatype.mime)) {
                return "image";
            } else {
                switch(mediatype.mime) {
                case "application/pdf":
                    return "pdf";
                case "application/vnd.ms-excel":
                    return "xls";
                default:
                    return mediatype.mime;
                }
            }
        }
    }
}(angular.module('materialscommons')));
{'fraction_non_alphanumeric': 0.1104631217838765, 'fraction_numerical': 0.0, 'mean_word_length': 1.8310679611650484, 'pattern_counts': {'":': 4, '<': 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': '3440838', 'n_tokens_mistral': 737, 'n_tokens_neox': 697, 'n_words': 110}