<commit_before>$(document).ready(function () {
	//do not show when upgrade is in progress or an error message
	//is visible on the login page
	if (jQuery('#upgrade').length === 0 && jQuery('#body-login .error').length === 0) {
		showSetPassword();
	}
});

// Done when "colorBox" is displayed
function showSetPasswordComplete() {
    $("#userSetPassword #passwordform").on('submit', function(){

        // TODO: implement basic tests (fields must be set, fields must be same)

        if ($('#pass1').val() !== '') {
            // Serialize the data
            var post = $( "#passwordform" ).serialize();
            $('#passwordchanged').hide();
            $('#passworderror').hide();<commit_msg>Add js tests<commit_after>$(document).ready(function () {
	//do not show when upgrade is in progress or an error message
	//is visible on the login page
	if (jQuery('#upgrade').length === 0 && jQuery('#body-login .error').length === 0) {
		showSetPassword();
	}
});

// Done when "colorBox" is displayed
function showSetPasswordComplete() {
    $("#userSetPassword #passwordform").on('submit', function(){

        // TODO: implement basic tests (fields must be set, fields must be same)
        if (($('#pass1').val() == '') || ($('#pass2').val() == '')) {
            $('#passworderror').html("Faut remplir les 2 champs !");
            $('#passworderror').show();
            return false;
        }

        if ($('#pass1').val() != $('#pass2').val()) {
            $('#passworderror').html("Les 2 champs sont pas pareils !");
            $('#passworderror').show();
            return false;
        }

        if ($('#pass1').val() !== '') {
            // Serialize the data
            var post = $( "#passwordform" ).serialize();
            $('#passwordchanged').hide();
            $('#passworderror').hide();
{'fraction_non_alphanumeric': 0.1964873765093304, 'fraction_numerical': 0.006586169045005488, 'mean_word_length': 2.682828282828283, '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': '1493320', 'n_tokens_mistral': 490, 'n_tokens_neox': 494, 'n_words': 142}