<commit_before>(function($){$(function(){

    var interestingReferences = $("#interesting-references").text();
    if (interestingReferences) {
        interestingReferences = $.parseJSON(interestingReferences);
    }
    if (Object.keys(interestingReferences).length) {
        $("#settings-references").css('display', 'block');
    }

    
    
    var map_enabled = false;
    var marker = L.marker([0,0]);
    var map = null;

    function enable_map() {
        if (map_enabled) return;

        map = L.map('reference-map').setView([0, 0], 11);
        L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
            attribution: 'Map data &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
        }).addTo(map);

        map_enabled = true;
    }
    function disable_map() {
        $("#reference-map").hide('slow');
    }
    

    $("#reference-close").on("click", function() {
        $("#reference-box").hide();
    });
    
    $('a.reference').each(function() {
        $this = $(this);
        uri = $this.attr('data-uri');
        if (interestingReferences.hasOwnProperty(uri)) {
            $this.addClass('interesting');
            ref = interestingReferences[uri];

            $this.attr('href', ref.wikipedia_link);
            $this.attr('target', '_blank');
        }
    });


    $('a.reference.interesting').on('click', function(event) {
        event.preventDefault();

        $("#reference-box").show();

        $this = $(this);
        uri = $this.attr('data-uri');
        ref = interestingReferences[uri];

        if (ref.location) {
            enable_map();

            marker.setLatLng(ref.location);
            //marker.setContent(ref.label);
            marker.bindTooltip(ref.label).openTooltip();
            map.addLayer(marker);
            map.panTo(ref.location, {
                animate: true,
                duration: 1,
            });
        } else {
            disable_map();
            if (map) {
                map.removeLayer(marker);
            }
        }

        $("#reference-images img").remove();
        if (ref.images) {
            $.each(ref.images, function(i, e) {
                $i = $("<a target='_blank'><img></a>");
                $i.attr('href', e.page);
                $('img', $i).attr('src', e.url);
                $("#reference-images").append($i);
            })
        }

        $("#reference-link").text(ref.label);
        $("#reference-link").attr('href', ref.wikipedia_link);
    });
})})(jQuery);
<commit_msg>Click fix.<commit_after>(function($){$(function(){

    var interestingReferences = $("#interesting-references").text();
    if (interestingReferences) {
        interestingReferences = $.parseJSON(interestingReferences);
    }
    if (Object.keys(interestingReferences).length) {
        $("#settings-references").css('display', 'block');
    }

    
    
    var map_enabled = false;
    var marker = L.marker([0,0]);
    var map = null;

    function enable_map() {
        if (map_enabled) return;

        map = L.map('reference-map').setView([0, 0], 11);
        L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
            attribution: 'Map data &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
        }).addTo(map);

        map_enabled = true;
    }
    function disable_map() {
        $("#reference-map").hide('slow');
    }
    

    $("#reference-close").on("click", function(event) {
        event.preventDefault();
        $("#reference-box").hide();
    });
    
    $('a.reference').each(function() {
        $this = $(this);
        uri = $this.attr('data-uri');
        if (interestingReferences.hasOwnProperty(uri)) {
            $this.addClass('interesting');
            ref = interestingReferences[uri];

            $this.attr('href', ref.wikipedia_link);
            $this.attr('target', '_blank');
        }
    });


    $('a.reference.interesting').on('click', function(event) {
        event.preventDefault();

        $("#reference-box").show();

        $this = $(this);
        uri = $this.attr('data-uri');
        ref = interestingReferences[uri];

        if (ref.location) {
            enable_map();

            marker.setLatLng(ref.location);
            //marker.setContent(ref.label);
            marker.bindTooltip(ref.label).openTooltip();
            map.addLayer(marker);
            map.panTo(ref.location, {
                animate: true,
                duration: 1,
            });
        } else {
            disable_map();
            if (map) {
                map.removeLayer(marker);
            }
        }

        $("#reference-images img").remove();
        if (ref.images) {
            $.each(ref.images, function(i, e) {
                $i = $("<a target='_blank'><img></a>");
                $i.attr('href', e.page);
                $('img', $i).attr('src', e.url);
                $("#reference-images").append($i);
            })
        }

        $("#reference-link").text(ref.label);
        $("#reference-link").attr('href', ref.wikipedia_link);
    });
})})(jQuery);

{'fraction_non_alphanumeric': 0.18699029126213593, 'fraction_numerical': 0.0027184466019417475, 'mean_word_length': 1.9586444572085009, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '6265726', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1464, 'n_words': 218}