<commit_before><div>Latitude: <span id="latitude"></span></div>
<div>Longitude: <span id="longitude"><span></div>
<div id="error"></div>

<%= javascript_tag do %>
  navigator.geolocation.getCurrentPosition(function(success) {
    $('#latitude').text(success.coords.latitude)
    $('#longitude').text(success.coords.longitude)
  }, function(error) {
    switch(error.code) {
      case error.PERMISSION_DENIED:
        $('#error').text('Permission Denied')
    }
  });
<% end %><commit_msg>Don't show latitude/longitude when there's an error<commit_after><div id="success">
  Latitude: <span id="latitude"></span><br>
  Longitude: <span id="longitude"></span>
</div>

<div id="error"></div>

<%= javascript_tag do %>
  navigator.geolocation.getCurrentPosition(function(position) {
    $('#latitude').text(position.coords.latitude)
    $('#longitude').text(position.coords.longitude)
  }, function(positionError) {
    switch(positionError.code) {
      case positionError.PERMISSION_DENIED:
        $('#error').text('Permission Denied')
        $('#success').hide()
    }
  });
<% end %>
{'fraction_non_alphanumeric': 0.19797421731123388, 'fraction_numerical': 0.0, 'mean_word_length': 4.781914893617022, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, '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': '6426192', 'n_tokens_mistral': 364, 'n_tokens_neox': 354, 'n_words': 50}