<commit_before>﻿@{
    ViewData["Title"] = "Home Page";
}

<div class="row">
    <div class="col-md-12">
        <form asp-action="Result" enctype="multipart/form-data">
            <div class="form-horizontal">
                <div class="form-group">
                    <input type="file" name="file" id="file" class="form-control">
                </div>
                <div class="form-group">
                    <input type="submit" value="Upload" class="btn btn-default" />
                </div>
            </div>
        </form>
    </div>
</div><commit_msg>Form UX<commit_after>﻿@{
    ViewData["Title"] = "Home Page";
}
<style>
    .btn-file {
        position: relative;
        overflow: hidden;
    }

        .btn-file input[type=file] {
            position: absolute;
            top: 0;
            right: 0;
            min-width: 100%;
            min-height: 100%;
            font-size: 100px;
            text-align: right;
            filter: alpha(opacity=0);
            opacity: 0;
            background: red;
            cursor: inherit;
            display: block;
        }

    input[readonly] {
        background-color: white !important;
        cursor: text !important;
    }
</style>

<div class="row">
    <div class="col-md-12">
        <form asp-action="Result" enctype="multipart/form-data">
            <div class="form-horizontal">

                <div class="form-group">

                    <div class="input-group">
                        <span class="input-group-btn">
                            <span class="btn btn-default btn-file">
                                Browse&hellip; <input type="file" name="file" id="file" class="form-control">
                            </span>
                        </span>
                        <input type="text" class="form-control" readonly>
                    </div>

                </div>
                <div class="form-group">
                    <input type="submit" value="Upload" class="btn btn-primary" />
                </div>
            </div>
        </form>
    </div>
</div>


<script type="text/javascript">
    $(document).on('change', '.btn-file :file', function () {
        var input = $(this),
          numFiles = input.get(0).files ? input.get(0).files.length : 1,
          label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
        input.trigger('fileselect', [numFiles, label]);
    });

    $(document).ready(function () {
        $('.btn-file :file').on('fileselect', function (event, numFiles, label) {

            var input = $(this).parents('.input-group').find(':text'),
              log = numFiles > 1 ? numFiles + ' files selected' : label;

            if (input.length) {
                input.val(log);
            } else {
                if (log) alert(log);
            }

        });
    });
</script>
{'fraction_non_alphanumeric': 0.163515406162465, 'fraction_numerical': 0.007352941176470588, 'mean_word_length': 1.4523605150214591, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 43, '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': '5268845', 'n_tokens_mistral': 839, 'n_tokens_neox': 789, 'n_words': 166}