<commit_before>{% extends "base.html" %}
{% load url from future %}

{% block title %}Active on IRC in the past hour{% endblock %}

{% block js %}{% load thumbnail %}
{% if results %}
<script src="http://www.google.com/jsapi?key={{ api_key }}" type="text/javascript">
</script>
<script type="text/javascript">
google.load('maps', '2');

var people = [
    // latitude, longitude, name, username, location description
    {% for person in results %}
    [{{ person.latitude }}, {{ person.longitude }}, "{{ person|escapejs }}", "{{ person.user.username|escapejs }}", "{{ person.location_description|escapejs }}", "{% if person.photo %}{% thumbnail person.photo 40x40 crop %}{% else %}/static/img/person_small_blank.png{% endif %}", "{{ person.country.iso_code|lower }}"]{% if not forloop.last %},{% endif %}
    {% endfor %}
];

window.onload = function() {
    window.gmap = new google.maps.Map2(document.getElementById('gmap'));
    gmap.addControl(new google.maps.SmallMapControl());
    gmap.addControl(new google.maps.MapTypeControl());
    // We have to render the map first or the bounds calculations will fail
    gmap.setCenter(new google.maps.LatLng(0, 0));
    var bounds = new google.maps.LatLngBounds();
    
    // Plot the people as markers
    $.each(people, function() {
        var lat = this[0];
        var lon = this[1];
        var name = this[2];
        var username = this[3];
        var location_description = this[4];
        var photo = this[5];
        var iso_code = this[6];
        var point = new google.maps.LatLng(lat, lon);
        var marker = new google.maps.Marker(point, getMarkerOpts());
        bounds.extend(point);
        gmap.addOverlay(marker);
        // Hook up the marker click event
        google.maps.Event.addListener(marker, 'click', function() {
            marker.openInfoWindow(makeWindow(
                name, username, location_description, photo, iso_code, 
                lat, lon
            ));
        });
    });
    gmap.setZoom(Math.min(gmap.getBoundsZoomLevel(bounds) - 1, 8));
    gmap.setCenter(bounds.getCenter());
};
</script><commit_msg>Upgraded maps to v3 in templates/irc_active.html<commit_after>{% extends "base.html" %}
{% load url from future %}

{% block title %}Active on IRC in the past hour{% endblock %}

{% block js %}{% load thumbnail %}
{% if results %}
<script type="text/javascript">

var people = [
    // latitude, longitude, name, username, location description
    {% for person in results %}
    [{{ person.latitude }}, {{ person.longitude }}, "{{ person|escapejs }}", "{{ person.user.username|escapejs }}", "{{ person.location_description|escapejs }}", "{% if person.photo %}{% thumbnail person.photo 40x40 crop %}{% else %}/static/img/person_small_blank.png{% endif %}", "{{ person.country.iso_code|lower }}"]{% if not forloop.last %},{% endif %}
    {% endfor %}
];

window.onload = function() {
    var gmap = new google.maps.Map(document.getElementById('gmap'));
    var bounds = new google.maps.LatLngBounds();
    var myOptions = {
          zoom: 5,
          maxZoom: 12,
          center: new google.maps.LatLng(0,0), 
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
    var gmap = new google.maps.Map(document.getElementById('gmap'), myOptions);
    // Plot the people as markers
    $.each(people, function() {
        var lat = this[0];
        var lon = this[1];
        var name = this[2];
        var username = this[3];
        var location_description = this[4];
        var photo = this[5];
        var iso_code = this[6];
        var point = new google.maps.LatLng(lat, lon);
        bounds.extend(point);

        var marker = new google.maps.Marker({
            map: gmap,
            position: point,
        });

        var infoWindow = new google.maps.InfoWindow({
            content: makeWindow(
                         name, username, location_description, photo, iso_code, 
                         lat, lon
                         )
        });

        // Hook up the marker click event
        google.maps.event.addListener(marker, 'click', function() {
            infoWindow.open(gmap, marker);
        });
    });


    gmap.fitBounds(bounds);

};
</script>
{'fraction_non_alphanumeric': 0.15454113171659534, 'fraction_numerical': 0.008083689966714217, 'mean_word_length': 2.661444734551784, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '5699840', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1237, 'n_words': 310}