<commit_before>var DELAY = 700, clicks = 0, timer = null;
$(document).ready(function() {
  $(function(){
    // because the elements are dynamically added:
    // http://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements
    $('#selectable').on('click', 'img.lazy', function(e) {
          clicks++;  //count clicks
          if(clicks === 1) {
              timer = setTimeout(function() {
                  clicks = 0;             //after action performed, reset counter
                  e.stopPropagation();
              }, DELAY);
          } else {
              clearTimeout(timer);    //prevent single-click action
              var img = $('#overlayImage');

              // query the database for the chosen image's info
              $.ajax({
                url: '/overlay',
                data: jQuery.param({'image_id': e.target.id}),
                type: 'POST',
                success: function(response) {
                  console.log('success: ' + response);
                  result = JSON.parse(response);

                  // populate the overlay image's info
                  $('#overlay_image_filepath').html('Filepath: ' + result['image_filepath']);
                  $('#overlay_image_date_collected').html('Collected on: ' + result['image_date_collected']);
                  $('#overlay_image_species').html('Species: ' + result['species_name']);
                  $('#overlay_image_added').html('Added by: ' + result['username_added'] + ' on ' + result['image_date_added']);
                  $('#overlay_image_annotated').html('Annotated by: ' + result['username_annotated'] + ' by ' + result['image_date_annotated']);
                  $('#overlay_image_dimensions').html('Height x Width: ' + result['image_height'] + ' x ' + result['image_width']);

                  // configure the html attributes of the overlay image
                  // want the full resolution image now...
                  img.attr('src', result['image_filepath'] + '?thumbnail=False');
                  img.attr('width', result['image_width']);
                  img.attr('height', result['image_height']);
                },
                error: function(error) {
                  console.log('error: ' + error);
                }
              });

              var content = $('#overlayContent');
              // center the image on the center of the viewport
              content.css({
                top: "50%",
                left: "50%",
                transform: "translate(-50%, -50%)",
              });
              $('#overlay').show();
              $('#overlayContent').show();
              clicks = 0;             //after action performed, reset counter
          }
      })
      .on("dblclick", function(e){
          e.preventDefault();  //cancel system double-click event
      });
  });
});
$(document).ready(function() {
    $('#overlayContent').click(function() {
    $('#overlayImage').attr('src', '');
    $('#overlay').hide();
    $('#overlayContent').hide();
  });
});<commit_msg>Minor changes.<commit_after>var DELAY = 700, clicks = 0, timer = null;
$(document).ready(function() {
  $(function(){
    // because the elements are dynamically added:
    // http://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements
    $('#selectable').on('click', 'img.lazy', function(e) {
          clicks++;  //count clicks
          if(clicks === 1) {
              timer = setTimeout(function() {
                  clicks = 0;             //after action performed, reset counter
                  e.stopPropagation();
              }, DELAY);
          } else {
              clearTimeout(timer);    //prevent single-click action
              var img = $('#overlayImage');

              // query the database for the chosen image's info
              $.ajax({
                url: '/overlay',
                data: jQuery.param({'image_id': e.target.id}),
                type: 'POST',
                success: function(response) {
                  console.log('success: ' + response);
                  result = JSON.parse(response);

                  // populate the overlay image's info
                  $('#overlay_image_filepath').html('Filepath: ' + result['image_filepath']);
                  $('#overlay_image_date_collected').html('Collected on: ' + result['image_date_collected']);
                  $('#overlay_image_species').html('Species: ' + result['species_name']);
                  $('#overlay_image_added').html('Added by: ' + result['username_added'] + ' on ' + result['image_date_added']);
                  $('#overlay_image_annotated').html('Annotated by: ' + result['username_annotated'] + ' by ' + result['image_date_annotated']);
                  $('#overlay_image_dimensions').html('Height x Width: ' + result['image_height'] + ' x ' + result['image_width']);

                  // configure the html attributes of the overlay image
                  // want the full resolution image now...
                  img.attr('width', result['image_width']);
                  img.attr('height', result['image_height']);
                  img.attr('src', result['image_filepath'] + '?thumbnail=False');
                },
                error: function(error) {
                  console.log('error: ' + error);
                }
              });

              var content = $('#overlayContent');
              // center the image on the center of the viewport
              content.css({
                top: "50%",
                left: "50%",
                transform: "translate(-50%, -50%)",
              });
              $('#overlay').show();
              $('#overlayContent').show();
              clicks = 0;             //after action performed, reset counter
          }
      })
      .on("dblclick", function(e){
          e.preventDefault();  //cancel system double-click event
      });
  });
});
$(document).ready(function() {
    $('#overlayContent').click(function() {
    $('#overlayImage').attr('src', '');
    $('#overlayImage').attr('height', '');
    $('#overlayImage').attr('width', '');
    $('#overlay').hide();
    $('#overlayContent').hide();
  });
});
{'fraction_non_alphanumeric': 0.1639845510138397, 'fraction_numerical': 0.0067589314451239136, 'mean_word_length': 1.8109452736318408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2717797', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1540, 'n_words': 321}