<commit_before>/**

*/
(function($) {
 
    $.fn.inputFileText = function(userOptions) {
        var MARKER_ATTRIBUTE = 'data-inputFileText';

        if(this.attr(MARKER_ATTRIBUTE) === 'true') {
            // Plugin has already been applied to input file element
            return this;
        }

        var options = $.extend({
            // Defaults
            text: 'Choose File',
            remove: false
        }, userOptions);

        // Hide input file element
        this.css({
            display: 'none'
            //width:  0
        });

        // Insert button after input file element
        var button = $(
            '<input type="button" value="' + options.text + '" />'
            ).insertAfter(this);

        // Insert text after button element
        var text = $(
            '<input type="text" style="readonly:true; border:none; margin-left: 5px" />'
            ).insertAfter(button);

        // Open input file dialog when button clicked
        var self = this;
        button.click(function() {
            self.click();
        });

        // Update text when input file chosen
        this.change(function() {
            // Chrome puts C:\fakepath\... for file path
            text.val(self.val().replace('C:\\fakepath\\', ''));
        });
 
        // Mark that this plugin has been applied to the input file element
        return this.attr(MARKER_ATTRIBUTE, 'true');
    };
 
}(jQuery));<commit_msg>Use span rather than input text element to display selected file<commit_after>/**

*/
(function($) {
 
    $.fn.inputFileText = function(userOptions) {
        var MARKER_ATTRIBUTE = 'data-inputFileText';

        if(this.attr(MARKER_ATTRIBUTE) === 'true') {
            // Plugin has already been applied to input file element
            return this;
        }

        var options = $.extend({
            // Defaults
            text: 'Choose File',
            remove: false
        }, userOptions);

        // Hide input file element
        this.css({
            display: 'none'
            //width:  0
        });

        // Insert button after input file element
        var button = $(
            '<input type="button" value="' + options.text + '" />'
            ).insertAfter(this);

        // Insert text after button element
        var text = $(
            '<span style="margin-left: 5px"></span>'
            ).insertAfter(button);

        // Open input file dialog when button clicked
        var self = this;
        button.click(function() {
            self.click();
        });

        // Update text when input file chosen
        this.change(function() {
            // Chrome puts C:\fakepath\... for file path
            text.text(self.val().replace('C:\\fakepath\\', ''));
        });
 
        // Mark that this plugin has been applied to the input file element
        return this.attr(MARKER_ATTRIBUTE, 'true');
    };
 
}(jQuery));
{'fraction_non_alphanumeric': 0.13030095759233926, 'fraction_numerical': 0.0013679890560875513, 'mean_word_length': 1.6327632763276327, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '5499725', 'n_tokens_mistral': 776, 'n_tokens_neox': 748, 'n_words': 222}