<commit_before>jQuery(function($){

    $('#footer').closest('table').css('border-spacing', 0);

    if(~document.cookie.indexOf('gravatar=')) {
        var gravatarUrl = readCookie('gravatar');
        renderGravatar(gravatarUrl);
        return;
    }

    var host            = location.protocol + '//' + location.host;
    var gravatarPlugin  = '/pluginManager/plugin/gravatar/thirdPartyLicenses';
    var requestUrl      = host + gravatarPlugin;
    
    $.ajax({
        type: "GET",
        url: requestUrl,
        error: function () {
            console.log("Could not find Gravatar Plugin");
            return;
        }
    });

    var gravatar    = 'https://www.gravatar.com/avatar/';
    var userName    = $('.model-link.inside').attr('href');
    var userApiUrl  = '/api/json?pretty=true';
    var request     = userName + userApiUrl;

    $.getJSON(request, function returnUserEmail(request) {
        var propertyArray = request.property;

        for(var i = 0; i < propertyArray.length; i++) {
            var obj = propertyArray[i];
            if (null != obj.address) {
                var email = obj.address;
                console.log(email);
            }   
        }

        var imgUrl  = gravatar + MD5(email);
        writeCookie('gravatar', imgUrl, 3);
        renderGravatar(imgUrl);
    });


    function writeCookie(name,value,days) {
        var date, expires;
        if (days) {
            date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            expires = "; expires=" + date.toGMTString();
        } else {
            expires = "";
        }
        document.cookie = name + "=" + value + expires + "; path=/";
    }

    function readCookie(name) {
        var i, c, ca, nameEQ = name + "=";
        ca = document.cookie.split(';');
        for(i=0;i < ca.length;i++) {
            c = ca[i];
            while (c.charAt(0)==' ') {
                c = c.substring(1,c.length);
            }
            if (c.indexOf(nameEQ) == 0) {
                return c.substring(nameEQ.length,c.length);
            }
        }<commit_msg>Gravatar requests are now only performed if gravatar plugin is installed<commit_after>jQuery(function($){

    $('#footer').closest('table').css('border-spacing', 0);

    if(~document.cookie.indexOf('gravatar=')) {
        var gravatarUrl = readCookie('gravatar');
        renderGravatar(gravatarUrl);
        return;
    }

    var host            = location.protocol + '//' + location.host;
    var gravatarPlugin  = '/pluginManager/plugin/gravatar/thirdPartyLicenses';
    var requestUrl      = host + gravatarPlugin;
    
    $.ajax({
        type: "GET",
        url: requestUrl,
        success: function() {
            var gravatar = 'https://www.gravatar.com/avatar/';
            var userName = $('.model-link.inside').attr('href');
            var userApiUrl = '/api/json?pretty=true';
            var request = userName + userApiUrl;

            $.getJSON(request, function returnUserEmail(request) {
                var propertyArray = request.property;

                for (var i = 0; i < propertyArray.length; i++) {
                    var obj = propertyArray[i];
                    if (obj.address) {
                        var imgUrl = gravatar + MD5(obj.address);
                        writeCookie('gravatar', imgUrl, 3);
                        renderGravatar(imgUrl);
                        return;
                    }
                }
            });
        }
    });
    function writeCookie(name,value,days) {
        var date, expires;
        if (days) {
            date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            expires = "; expires=" + date.toGMTString();
        } else {
            expires = "";
        }
        document.cookie = name + "=" + value + expires + "; path=/";
    }

    function readCookie(name) {
        var i, c, ca, nameEQ = name + "=";
        ca = document.cookie.split(';');
        for(i=0;i < ca.length;i++) {
            c = ca[i];
            while (c.charAt(0)==' ') {
                c = c.substring(1,c.length);
            }
            if (c.indexOf(nameEQ) == 0) {
                return c.substring(nameEQ.length,c.length);
            }
        }
{'fraction_non_alphanumeric': 0.14612511671335202, 'fraction_numerical': 0.008403361344537815, 'mean_word_length': 1.6681195516811955, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6835214', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1217, 'n_words': 241}