<commit_before>$.fn.imagePreview = function (input)
{
  var $container = this;
  var $input = $(input);
  var id = "image_preview_" + Date.now();
  $container.append("<img id='" + id + "'>" );
  var $img = $("#" + id);
  //Start the image as hidden
  $img.hide();

  //When the input has a file chosen start loading the image
  $input.change(function() {
    if ($input.files && $input.files[0])
    {
        var reader = new FileReader();
        reader.onload = function (e) {
            $img.attr('src', e.target.result);
            $img.show();
        }
        reader.readAsDataURL(input.files[0]);
    }
    else
    {
      $img.hide();
    }
  });



};
<commit_msg>Fixed input to use the DOM instead of jQuery<commit_after>$.fn.imagePreview = function (input)
{
  var $container = this;
  var $input = $(input); //jQuery version
  var input = $input.get(0); //Node version
  var id = "image_preview_" + Date.now();
  $container.append("<img id='" + id + "'>" );
  var $img = $("#" + id);
  //Start the image as hidden
  $img.hide();

  //When the input has a file chosen start loading the image
  $input.change(function() {

    if (input.files && input.files[0])
    {
        var reader = new FileReader();
        reader.onload = function (e) {
            $img.attr('src', e.target.result);
            $img.show();
        }
        reader.readAsDataURL(input.files[0]);
    }
    else
    {
      $img.hide();
    }
  });



};

{'fraction_non_alphanumeric': 0.1769177608845888, 'fraction_numerical': 0.0034554250172771253, 'mean_word_length': 2.2834467120181405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2874505', 'n_tokens_mistral': 483, 'n_tokens_neox': 475, 'n_words': 121}