<commit_before>$(document).ready(function() {

    // Edit Add-on
    if($("#edit-addon").length){
        initEditAddon();
    }

    //Ownership
    if ($("#author_list").length) {
        initAuthorFields();
        initLicenseFields();
    }

    //Payments
    if ($('.payments').length) {
        initPayments();
    }

    // Edit Versions
    if($('.edit-version').length) {
        initEditVersions();
    }

    // View versions
    if($('#version-list').length) {
        initVersions();
    }

    // Submission process
    if($('.addon-submission-process').length) {
        initSubmit();
        initLicenseFields();
        initCharCount();
        $('.upload-status').bind('upload-success', function(e, json) {
            $("#submit-upload-file-finish").attr("disabled", false);
            $("#id_upload").val(json.upload);
        }).bind('upload-error', function() {
            $("#submit-upload-file-finish").attr("disabled", true);
        });
    }

    // Upload form submit
    if($('.upload-status').length) {
        initUploadControls();
    }

    // Submission > Describe
    if ($("#submit-describe").length) {
        initCatFields();
    }

    // Submission > Media
    if($('#submit-media').length) {
        initUploadIcon();
        initUploadPreview();
    }

    if ($(".version-upload").length) {
        $modal = $(".add-file-modal").modal(".version-upload", {
            width: '450px',
            hideme: false
        });
        $('.upload-status').bind('upload-success', function(e, json) {
            $("#upload-file-finish").attr("disabled", false);
            $("#id_upload").val(json.upload);
            $modal.setPos();
        }).bind('upload-error', function() {
            $("#upload-file-finish").attr("disabled", true);
            $modal.setPos();
        });
        $('.upload-file-cancel').click(_pd($modal.hideMe));
        $('#upload-file').submit(_pd(function(e) {
            $.ajax({
                url: $(this).attr('action'),
                type: 'post',
                data: $(this).serialize(),
                success: function(response) {
                    if (response.url) {
                        window.location = response.url;
                    }
                },
                error: function(xhr) {
                    var errors = $.parseJSON(xhr.responseText);
                    $("#upload-file").find(".errorlist").remove();
                    $("#upload-file").find(".upload-status").before(generateErrorList(errors));
                    $modal.setPos();
                }
            });
        }));
        if (window.location.hash === '#version-upload') {
            $modal.render();
        }
    }

    // Choosing platform when submitting an Addon and/or files.
    if ($('input.platform').length) {
        initPlatformChooser();
    }
});
<commit_msg>Adding some redundancy to the upload buttons<commit_after>$(document).ready(function() {

    // Edit Add-on
    if($("#edit-addon").length){
        initEditAddon();
    }

    //Ownership
    if ($("#author_list").length) {
        initAuthorFields();
        initLicenseFields();
    }

    //Payments
    if ($('.payments').length) {
        initPayments();
    }

    // Edit Versions
    if($('.edit-version').length) {
        initEditVersions();
    }

    // View versions
    if($('#version-list').length) {
        initVersions();
    }

    // Submission process
    if($('.addon-submission-process').length) {
        initSubmit();
        initLicenseFields();
        initCharCount();
        $('.upload-status').bind('upload-success', function(e, json) {
            $("#submit-upload-file-finish").attr("disabled", false);
            $("#id_upload").val(json.upload);
        }).bind('upload-error', function() {
            $("#submit-upload-file-finish").attr("disabled", true);
        });
    }

    // Upload form submit
    if($('.upload-status').length) {
        initUploadControls();
    }

    // Submission > Describe
    if ($("#submit-describe").length) {
        initCatFields();
    }

    // Submission > Media
    if($('#submit-media').length) {
        initUploadIcon();
        initUploadPreview();
    }

    if ($(".version-upload").length) {
        $modal = $(".add-file-modal").modal(".version-upload", {
            width: '450px',
            hideme: false
        });
        $('.upload-status').bind('upload-success', function(e, json) {
            $("#upload-file-finish").attr("disabled", false);
            $("#id_upload").val(json.upload);
            $modal.setPos();
        }).bind('upload-error', function() {
            $("#upload-file-finish").attr("disabled", true);
            $modal.setPos();
        });
        $('.upload-file-cancel').click(_pd($modal.hideMe));
        $('#upload-file').submit(_pd(function(e) {
            $.ajax({
                url: $(this).attr('action'),
                type: 'post',
                data: $(this).serialize(),
                success: function(response) {
                    if (response.url) {
                        window.location = response.url;
                    }
                },
                error: function(xhr) {
                    var errors = $.parseJSON(xhr.responseText);
                    $("#upload-file").find(".errorlist").remove();
                    $("#upload-file").find(".upload-status").before(generateErrorList(errors));
                    $modal.setPos();
                }
            });
        }));
        if (window.location.hash === '#version-upload') {
            $modal.render();
        }
    }

    $(".invisible-upload").click(function() {
        $(this).children("input").click();
    });
    $(".invisible-upload a").click(_pd(function() {}));

    // Choosing platform when submitting an Addon and/or files.
    if ($('input.platform').length) {
        initPlatformChooser();
    }
});

{'fraction_non_alphanumeric': 0.19063714720297448, 'fraction_numerical': 0.001014027378739226, 'mean_word_length': 1.758974358974359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6170374', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1603, 'n_words': 232}