<commit_before>﻿$().ready(function () {
    var $newsletterButton = $('#newsletterButton');

    $newsletterButton.on('click', function () {
        var $newsletterEmailInput = $('#newsletterEmailInput'),
            emailPattern = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i,
            email = $newsletterEmailInput.val();

        if (emailPattern.test(email)) {
            $.getJSON(
                '/Newsletter/Subscribe',
                {
                    email: email
                },
                function (response) {
                    if (reseponse.status) {
                        $newsletterEmailInput.val('');
                        toastr.success('You have successfully subscribed email ' + response.data + ' to our newsletter.');
                    } else {
                        toastr.error('An error has occured during trying to register to newsletter. Please try again or contact our team for help.');
                    }
                }
            )
        } else {
            toastr.error('You have entered invalid email.');
        }<commit_msg>Fix newsletter js bug.<commit_after>﻿$().ready(function () {
    var $newsletterButton = $('#newsletterButton');

    $newsletterButton.on('click', function () {
        var $newsletterEmailInput = $('#newsletterEmailInput'),
            emailPattern = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i,
            email = $newsletterEmailInput.val();

        if (emailPattern.test(email)) {
            $.ajax({
                type: "POST",
                url: '/Newsletter/Subscribe',
                data: {
                    email: email
                },
                success: function (response) {
                    if (response.Status) {
                        $newsletterEmailInput.val('');
                        toastr.success('You have successfully subscribed email ' + response.Data + ' to our newsletter.');
                    } else {
                        toastr.error('An error has occured during trying to register to newsletter. Please try again or contact our team for help.');
                    }
                }
            });
        } else {
            toastr.error('You have entered invalid email.');
        }
{'fraction_non_alphanumeric': 0.19662921348314608, 'fraction_numerical': 0.02247191011235955, 'mean_word_length': 1.759297520661157, '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': '3234290', 'n_tokens_mistral': 872, 'n_tokens_neox': 835, 'n_words': 126}