<commit_before>$(function() {
    $('#btnToggleMenu').click(function() {
        $('#panMenuBg').removeClass('hide');
        $('#rightMenu').animate({
            right: '0px'
        }, 200);
    });

    $('#panMenuBg').click(function() {
        var bg = $(this);
        $('#rightMenu').animate({
            right: '-300px'
        }, 200, function() {
            bg.addClass('hide');
        });
    });

    $(window).resize(function() {
        if (!$('#btnToggleMenu').is(':visible')) {
            $('#rightMenu').animate({
                right: '-300px'
            }, 200, function() {
                $('#panMenuBg').addClass('hide');
            });
        }
    });

    $('#frmDemo').submit(function(e) {
        if (!validate()) {
            e.preventDefault();
            return false;
        }
    });

    $('input.required').blur(function() {
        var ctr = $(this),
            val = $.trim(ctr.val());

        if (val != '') {
            removeError(ctr);
        } else {
            setMessage(ctr, Message.required);
        }
    });

    $('#txtEmail').blur(function() {
        var ctr = $(this),
            val = $.trim(ctr.val());

        if (val != '') {
            removeError(ctr);
        } else {
            setMessage(ctr, Message.required);
            return false;
        }

        if (validateEmail(val)) {
            removeError(ctr);
        } else {
            setMessage(ctr, Message.emailInvalid);
        }
    });

    var chkEnglish = $('#chkEnglish'),
        chkKhmer = $('#chkKhmer');
    chkEnglish.change(function() {
        var ctr = $(this);
        if (ctr.prop('checked') || chkKhmer.prop('checked')) {
            removeError(ctr.closest('label'));
        } else {
            setMessage(chkKhmer.closest('label'), Message.languageRequired);
        }
    });
    chkKhmer.change(function() {
        var ctr = $(this);
        if (ctr.prop('checked') || chkEnglish.prop('checked')) {
            removeError(ctr.closest('label'));
        } else {
            setMessage(chkKhmer.closest('label'), Message.languageRequired);
        }
    });
});
var Message = {
    en: {
        required: 'Please input for required field.',
        languageRequired: 'Please select language.',
        emailInvalid: "Please input an correct email."
    },<commit_msg>change language validation<commit_after>$(function() {
    $('#btnToggleMenu').click(function() {
        $('#panMenuBg').removeClass('hide');
        $('#rightMenu').animate({
            right: '0px'
        }, 200);
    });

    $('#panMenuBg').click(function() {
        var bg = $(this);
        $('#rightMenu').animate({
            right: '-300px'
        }, 200, function() {
            bg.addClass('hide');
        });
    });

    $(window).resize(function() {
        if (!$('#btnToggleMenu').is(':visible')) {
            $('#rightMenu').animate({
                right: '-300px'
            }, 200, function() {
                $('#panMenuBg').addClass('hide');
            });
        }
    });

    $('#frmDemo').submit(function(e) {
        if (!validate()) {
            e.preventDefault();
            return false;
        }
    });

    $('input.required').blur(function() {
        var ctr = $(this),
            val = $.trim(ctr.val());

        if (val != '') {
            removeError(ctr);
        } else {
            setMessage(ctr, Message[lang]['required']);
        }
    });

    $('#txtEmail').blur(function() {
        var ctr = $(this),
            val = $.trim(ctr.val());

        if (val != '') {
            removeError(ctr);
        } else {
            setMessage(ctr, Message[lang]['required']);
            return false;
        }

        if (validateEmail(val)) {
            removeError(ctr);
        } else {
            setMessage(ctr, Message[lang]['emailInvalid']);
        }
    });

    var chkEnglish = $('#chkEnglish'),
        chkKhmer = $('#chkKhmer');
    chkEnglish.change(function() {
        var ctr = $(this);
        if (ctr.prop('checked') || chkKhmer.prop('checked')) {
            removeError(ctr.closest('label'));
        } else {
            setMessage(chkKhmer.closest('label'), Message[lang]['languageRequired']);
        }
    });
    chkKhmer.change(function() {
        var ctr = $(this);
        if (ctr.prop('checked') || chkEnglish.prop('checked')) {
            removeError(ctr.closest('label'));
        } else {
            setMessage(chkKhmer.closest('label'), Message[lang]['languageRequired']);
        }
    });
});
var Message = {
    en: {
        required: 'Please input for required field.',
        languageRequired: 'Please select language.',
        emailInvalid: "Please input an correct email."
    },
{'fraction_non_alphanumeric': 0.18760575296108292, 'fraction_numerical': 0.00676818950930626, 'mean_word_length': 1.762266355140187, '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': '5860285', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1350, 'n_words': 222}