<commit_before>$( document ).ready(function() {
    //********************************************************************
    //          Upload
    //********************************************************************
    $('#formUpload').submit(function(){
        var title = document.forms["formUpload"]["title"].value;
        var camera = document.forms["formUpload"]["camera"].value;
        var focal = document.forms["formUpload"]["focal"].value;
        var exposure = document.forms["formUpload"]["exposure"].value;
        var aperture = document.forms["formUpload"]["aperture"].value;
        var iso = document.forms["formUpload"]["iso"].value;
        var picture = document.forms["formUpload"]["picture"].files;
        if ((title==null || title=="") & (picture==null || picture==""))
        {
            $('#response').addClass('send_message_error');
            $('#response').css('visibility', 'visible');
            $('#response').html('<i class="fa fa-exclamation-triangle"></i> All fields are required!');
            setTimeout(function() {   
                $('#response').css('visibility', 'hidden');
                $('#response').removeClass('send_message_error');
	        }, 3000);  
           
        } else {
            $('#submit').attr('disabled');
            var data = {};
            data.title = title;
            data.camera = camera;
            data.focal = focal;
            data.exposure = exposure;
            data.aperture = aperture;
            data.iso = iso;
            data.picture = picture;
            $.ajax({
                type: 'POST',
                url: '/account/upload',
                data: JSON.stringify(data),
                contentType: 'application/json',
                success: function(msg) {
                    $('#response').addClass('send_message_success');
                    $('#response').css('visibility', 'visible');
                    $('#response').html('<i class="fa fa-check"></i> '+ msg);
                    setTimeout(function() {   
                        $('#response').css('visibility', 'hidden');
                        $('#response').removeClass('send_message_success');
                        $('#popup_name').css('visibility', 'hidden');
                        $('#popup_background').css('visibility', 'hidden');
	               }, 3000);
                }
            });
        }
        return false;
    });
    
    
    //********************************************************************
    //          Settings
    //********************************************************************
    //Form Name
    $('#form_name').submit(function(){
        var forename = document.forms["form_name"]["forename"].value;
        var surname = document.forms["form_name"]["surname"].value;
        if ((forename==null || forename=="") & (surname==null || surname==""))
        {
            $('#response').addClass('send_message_error');
            $('#response').css('visibility', 'visible');
            $('#response').html('<i class="fa fa-exclamation-triangle"></i> All fields are required!');
            setTimeout(function() {   
                $('#response').css('visibility', 'hidden');
                $('#response').removeClass('send_message_error');
	        }, 3000);  
           
        } else {
            $('#submit').attr('disabled');
            var data = {};
            data.forename = forename;
            data.surname = surname;
            $.ajax({
                type: 'POST',
                url: '/account/settings',
                data: JSON.stringify(data),
                contentType: 'application/json',
                success: function(msg) {
                    $('#response').addClass('send_message_success');
                    $('#response').css('visibility', 'visible');
                    $('#response').html('<i class="fa fa-check"></i> '+ msg);
                    setTimeout(function() {   
                        $('#response').css('visibility', 'hidden');
                        $('#response').removeClass('send_message_success');
                        $('#popup_name').css('visibility', 'hidden');
                        $('#popup_background').css('visibility', 'hidden');
	               }, 3000);
                }
            });
        }
        return false;
    });
    
    //Form Mail
    $('#form_mail').submit(function(){
        var mail = document.forms["form_mail"]["mail"].value;
        if (mail==null || mail=="")
        {
            $('#response').addClass('send_message_error');
            $('#response').css('visibility', 'visible');
            $('#response').html('<i class="fa fa-exclamation-triangle"></i> The mail field is required!');
            setTimeout(function() {   
                $('#response').css('visibility', 'hidden');
                $('#response').removeClass('send_message_error');
	        }, 3000);  
           
        } else {
            $('#submit').attr('disabled');
            var data = {};
            data.mail = mail;
            $.ajax({
                type: 'POST',
                url: '/account/settings',
                data: JSON.stringify(data),
                contentType: 'application/json',
                success: function(msg) {
                    $('#response').addClass('send_message_success');
                    $('#response').css('visibility', 'visible');
                    $('#response').html('<i class="fa fa-check"></i> '+ msg);
                    setTimeout(function() {   
                        $('#response').css('visibility', 'hidden');
                        $('#response').removeClass('send_message_success');
                        $('#popup_name').css('visibility', 'hidden');
                        $('#popup_background').css('visibility', 'hidden');
	               }, 3000);
                }
            });<commit_msg>send.js valid email<commit_after>$( document ).ready(function() {
    //********************************************************************
    //          Upload
    //********************************************************************
    $('#formUpload').submit(function(){
        var title = document.forms["formUpload"]["title"].value;
        var camera = document.forms["formUpload"]["camera"].value;
        var focal = document.forms["formUpload"]["focal"].value;
        var exposure = document.forms["formUpload"]["exposure"].value;
        var aperture = document.forms["formUpload"]["aperture"].value;
        var iso = document.forms["formUpload"]["iso"].value;
        var picture = document.forms["formUpload"]["picture"].files;
        if ((title==null || title=="") & (picture==null || picture==""))
        {
            $('#response').addClass('send_message_error');
            $('#response').css('visibility', 'visible');
            $('#response').html('<i class="fa fa-exclamation-triangle"></i> All fields are required!');
            setTimeout(function() {   
                $('#response').css('visibility', 'hidden');
                $('#response').removeClass('send_message_error');
	        }, 3000);  
           
        } else {
            $('#submit').attr('disabled');
            var data = {};
            data.title = title;
            data.camera = camera;
            data.focal = focal;
            data.exposure = exposure;
            data.aperture = aperture;
            data.iso = iso;
            data.picture = picture;
            $.ajax({
                type: 'POST',
                url: '/account/upload',
                data: JSON.stringify(data),
                contentType: 'application/json',
                success: function(msg) {
                    $('#response').addClass('send_message_success');
                    $('#response').css('visibility', 'visible');
                    $('#response').html('<i class="fa fa-check"></i> '+ msg);
                    setTimeout(function() {   
                        $('#response').css('visibility', 'hidden');
                        $('#response').removeClass('send_message_success');
                        $('#popup_name').css('visibility', 'hidden');
                        $('#popup_background').css('visibility', 'hidden');
	               }, 3000);
                }
            });
        }
        return false;
    });
    
    
    //********************************************************************
    //          Settings
    //********************************************************************
    //Form Name
    $('#form_name').submit(function(){
        var forename = document.forms["form_name"]["forename"].value;
        var surname = document.forms["form_name"]["surname"].value;
        if ((forename==null || forename=="") & (surname==null || surname==""))
        {
            $('#response').addClass('send_message_error');
            $('#response').css('visibility', 'visible');
            $('#response').html('<i class="fa fa-exclamation-triangle"></i> All fields are required!');
            setTimeout(function() {   
                $('#response').css('visibility', 'hidden');
                $('#response').removeClass('send_message_error');
	        }, 3000);  
           
        } else {
            $('#submit').attr('disabled');
            var data = {};
            data.forename = forename;
            data.surname = surname;
            $.ajax({
                type: 'POST',
                url: '/account/settings',
                data: JSON.stringify(data),
                contentType: 'application/json',
                success: function(msg) {
                    $('#response').addClass('send_message_success');
                    $('#response').css('visibility', 'visible');
                    $('#response').html('<i class="fa fa-check"></i> '+ msg);
                    setTimeout(function() {   
                        $('#response').css('visibility', 'hidden');
                        $('#response').removeClass('send_message_success');
                        $('#popup_name').css('visibility', 'hidden');
                        $('#popup_background').css('visibility', 'hidden');
	               }, 3000);
                }
            });
        }
        return false;
    });
    
    //Form Mail
    $('#form_mail').submit(function(){
        var mail = document.forms["form_mail"]["mail"].value;
        if (mail==null || mail=="")
        {
            $('#response').addClass('send_message_error');
            $('#response').css('visibility', 'visible');
            $('#response').html('<i class="fa fa-exclamation-triangle"></i> The mail field is required!');
            setTimeout(function() {   
                $('#response').css('visibility', 'hidden');
                $('#response').removeClass('send_message_error');
	        }, 3000);  
           
        } else {
            var val = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;	
	       if (!val.test(mail))
	       {
               $('#response').addClass('send_message_error');
               $('#response').css('visibility', 'visible');
               $('#response').html('<i class="fa fa-exclamation-triangle"></i> Please provide a valid email address!');
                setTimeout(function() {   
                    $('#response').css('visibility', 'hidden');
                    $('#response').removeClass('send_message_error');
	           }, 3000);  
               return false;
           }
            $('#submit').attr('disabled');
            var data = {};
            data.mail = mail;
            $.ajax({
                type: 'POST',
                url: '/account/settings',
                data: JSON.stringify(data),
                contentType: 'application/json',
                success: function(msg) {
                    $('#response').addClass('send_message_success');
                    $('#response').css('visibility', 'visible');
                    $('#response').html('<i class="fa fa-check"></i> '+ msg);
                    setTimeout(function() {   
                        $('#response').css('visibility', 'hidden');
                        $('#response').removeClass('send_message_success');
                        $('#popup_name').css('visibility', 'hidden');
                        $('#popup_background').css('visibility', 'hidden');
	               }, 3000);
                }
            });
{'fraction_non_alphanumeric': 0.22515974440894568, 'fraction_numerical': 0.005670926517571885, 'mean_word_length': 1.7646279531905498, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '4246280', 'n_tokens_mistral': 3076, 'n_tokens_neox': 2939, 'n_words': 462}