<commit_before><!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Local Knowledge</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

    <script src="js/loadmask.min.js"></script>
    
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="LocalKnowledge.js"></script>
    <script type="text/javascript">
    
        
        var map;
        var marker;

        function initialize() {
            var mapDiv = document.getElementById('map-canvas');
            map = new google.maps.Map(mapDiv, {
                center: new google.maps.LatLng(-36.836767,174.766281),
                zoom: 13,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });

            var styleArray = [
                {
                    "elementType": "labels",
                    "stylers": [
                        { "visibility": "off" }
                    ]
                }
            ];

            map.setOptions({styles: styleArray});
            
            
            
            //goToNextIsland();
        }


        google.maps.event.addDomListener(window, 'load', initialize);
        
        
        $(function() {
            $("body").mask("Loading Data...");
            initLocalKnowledge(function() {
                //finished
                $("body").unmask();
            });
            
            //jquery ui buttons
            $("#user-submit").button();
            
            //error message
            $("#no-current-items-message").dialog({
                modal: true,
                autoOpen: false,
                buttons: {
                    Ok: function() {
                        $( this ).dialog("close");
                    }
                }
            });
            
            $("#user-submit").click(function() {
                if(!isCurrentlyGuessing)
                {
                    nextItem();
                }
                else
                {
                    isCurrentlyGuessing = false;
                    $("#user-submit").val("Next");
                    $("#answer-text").text(currentlyGuessingItem.name);
                    $("#answer-text").removeClass();
                    if($("#user-input").val() == currentlyGuessingItem.name)
                    {
                        $("#answer-text").addClass("correct-color");
                    }
                    else
                    {
                        $("#answer-text").addClass("incorrect-color");
                    }
                }
            });
        });
        
        
        var isCurrentlyGuessing = false;
        var currentlyGuessingItem;
        
        function nextItem() 
        {
        
            if(currentItemsToDisplay.length > 0)
            {
                currentlyGuessingItem = 
                    currentItemsToDisplay[Math.floor(Math.random() * currentItemsToDisplay.length)];
                    
                $("#answer-text").val("");
                isCurrentlyGuessing = true;
                
                $("#user-submit").val("Check!");
                $("#displayFeatureName").text(currentlyGuessingItem.featureType);
                $("#answer-text").text("");
            }
            else
            {
                $("#no-current-items-message").dialog( "open" );
            }
            
        
        }
        
        

    </script>
  </head>
  
    <body style="font-family: Arial; border: 0 none;">
        <div id="page-content">
        
            <h1 class="center-text">Local Knowledge</h1>

            <div id="map-canvas"></div><commit_msg>Hooked up maps location scrolling<commit_after><!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Local Knowledge</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

    <script src="js/loadmask.min.js"></script>
    
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="LocalKnowledge.js"></script>
    <script type="text/javascript">
    
        
        var map;
        var marker;

        function initialize() {
            var mapDiv = document.getElementById('map-canvas');
            map = new google.maps.Map(mapDiv, {
                center: new google.maps.LatLng(-36.836767,174.766281),
                zoom: 13,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });

            var styleArray = [
                {
                    "elementType": "labels",
                    "stylers": [
                        { "visibility": "off" }
                    ]
                }
            ];

            map.setOptions({styles: styleArray});
            
            
            
            //goToNextIsland();
        }


        google.maps.event.addDomListener(window, 'load', initialize);
        
        
        function mapItem(island)
        {
            //clear marker
            if(marker)
                marker.setMap(null);
            
            //create location
            var location;
            if(island.coords[0] && island.coords[1])
                location = new google.maps.LatLng(island.coords[0], island.coords[1]);
            else
                location = new google.maps.LatLng(island.coords.lat, island.coords.long);
            
            //pan to location
            map.panTo(location);
            
            //set marker
            marker = new google.maps.Marker({
                position: location,
                map: map
            });
            
        
        }
        
        
        $(function() {
            $("body").mask("Loading Data...");
            initLocalKnowledge(function() {
                //finished
                $("body").unmask();
            });
            
            //jquery ui buttons
            $("#user-submit").button();
            
            //error message
            $("#no-current-items-message").dialog({
                modal: true,
                autoOpen: false,
                buttons: {
                    Ok: function() {
                        $( this ).dialog("close");
                    }
                }
            });
            
            $("#user-submit").click(function() {
                if(!isCurrentlyGuessing)
                {
                    nextItem();
                }
                else
                {
                    isCurrentlyGuessing = false;
                    $("#user-submit").val("Next");
                    $("#answer-text").text(currentlyGuessingItem.name);
                    $("#answer-text").removeClass();
                    if($("#user-input").val() == currentlyGuessingItem.name)
                    {
                        $("#answer-text").addClass("correct-color");
                    }
                    else
                    {
                        $("#answer-text").addClass("incorrect-color");
                    }
                }
            });
        });
        
        
        var isCurrentlyGuessing = false;
        var currentlyGuessingItem;
        
        function nextItem() 
        {
        
            if(currentItemsToDisplay.length > 0)
            {
                currentlyGuessingItem = 
                    currentItemsToDisplay[Math.floor(Math.random() * currentItemsToDisplay.length)];
                    
                $("#answer-text").val("");
                $("#user-input").val("");
                isCurrentlyGuessing = true;
                
                $("#user-submit").val("Check!");
                $("#displayFeatureName").text(currentlyGuessingItem.featureType);
                $("#answer-text").text("");
                
                mapItem(currentlyGuessingItem);
            }
            else
            {
                $("#no-current-items-message").dialog( "open" );
            }
        }
        
        

    </script>
  </head>
  
    <body style="font-family: Arial; border: 0 none;">
        <div id="page-content">
        
            <h1 class="center-text">Local Knowledge</h1>

            <div id="map-canvas"></div>
{'fraction_non_alphanumeric': 0.1427370191297036, 'fraction_numerical': 0.010510826150935463, 'mean_word_length': 1.2314727954971858, 'pattern_counts': {'":': 6, '<': 59, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 4}, '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': '7025449', 'n_tokens_mistral': 2637, 'n_tokens_neox': 2432, 'n_words': 365}