<commit_before>window.onmouseup = function() {
  var data = getSelectionText();
  var str1 = "http://en.wikipedia.org/w/api.php?action=parse&section=0&page=";
  var str2 = str1.concat(data);
  var callStr = str2.concat("&rvsection=0&prop=text&format=json&callback=?");
  console.log("MouseUp");
  console.log("Text = ",data);
  $( "#view" ).append("<div class='wikiWindow' id='wikiInfo'>&nbsp</div>");


  var wiki =  $.getJSON(callStr, function(json) {
    $('#wikiInfo').html(json.parse.text['*']);
    $("#wikiInfo").find("a:not(.references a)").attr("href", function(){ return "http://www.wikipedia.org" + $(this).attr("href");});
    $("#wikiInfo").find("a").attr("target", "_blank");
  });
  // console.log("Wiki= ",wiki);
  };<commit_msg>The mouse release trigger now only works in the article area, and if you click in the dialog it removes it from the dom<commit_after>$('article').mouseup (function() {
  var data = getSelectionText();
  var str1 = "http://en.wikipedia.org/w/api.php?action=parse&section=0&page=";
  var str2 = str1.concat(data);
  var callStr = str2.concat("&rvsection=0&prop=text&format=json&callback=?");
  console.log("MouseUp");
  console.log("Text = ",data);
  $( "#view" ).append("<div class='wikiWindow' id='wikiInfo'>&nbsp</div>");
    var wiki =  $.getJSON(callStr, function(json) {
      $('#wikiInfo').html(json.parse.text['*']);
      $("#wikiInfo").find("a:not(.references a)").attr("href", function(){ return "http://www.wikipedia.org" + $(this).attr("href");});
      $("#wikiInfo").find("a").attr("target", "_blank");
    });
    // console.log("Wiki= ",wiki);

});
$("#view").click(function() {
  $("#view").empty();
});
{'fraction_non_alphanumeric': 0.24924924924924924, 'fraction_numerical': 0.007207207207207207, 'mean_word_length': 5.08029197080292, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2431202', 'n_tokens_mistral': 567, 'n_tokens_neox': 566, 'n_words': 97}