<commit_before>/*
Layout of the AppLink object:

+---------------------------------+
|       +-----------------+       |
|       |   +---------+   |       |
|       |   |         |   |       |
|       |   | PICTURE |   |       |
|       |   |         |   |       |
|       |   +---------+   |       |
|       |                 |       |
|       |   +---------+   |       |
|       |   |  NAME   |   |       |
|       |   +---------+   |       |
|       |                 |       |
|       |    HYPERLINK    |       |
|       +-----------------+       |
|            CONTAINER            |
+---------------------------------+

      <div class='appLinkContainer'>
        <a class='appLinkHyperLink' href='#' onclick='this.href += "?" + document.getElementById("searchBar").value'>
          <img src='image' class='appLinkPic' />
          <div class='appLinkName'></div>
        </a>
      </div>
*/

function loadAppLinks(appLinkInfo, container) {

  // AppLink Object declaration
  function AppLink (name, image, link, color, tabindex) {

    // Create picture
    this.picture = document.createElement('img');
    this.picture.setAttribute('class', 'appLinkPic');
    this.picture.src = image;
    this.picture.alt = name;
    if (color) this.picture.style.backgroundColor = color;

    // Create Name
    this.name = document.createElement('p');
    this.name.setAttribute('class', 'appLinkName');
    this.name.textContent = name;

    // Create HyperLink
    this.hyperLink = document.createElement('a');
    this.hyperLink.setAttribute('class', 'appLinkHyperLink');
    this.hyperLink.setAttribute('href', link);
    this.hyperLink.setAttribute('onclick', 'putSearchQuery(this)');
    this.hyperLink.setAttribute('ontouchstart', '');
    if (tabindex) this.hyperLink.setAttribute('tabindex', tabindex);
    this.hyperLink.appendChild(this.picture);
    this.hyperLink.appendChild(this.name);

    // Create Container
    this.container = document.createElement('div');
    this.container.setAttribute('class', 'appLinkContainer');
    this.container.appendChild(this.hyperLink);
  }

  if (!container) container = document.body

  // Create a link for every sub-array within appLinkInfo.
  for (var i = 0; i < appLinkInfo.names.length; i++) {
    var tmp = new AppLink(appLinkInfo.names[i], appLinkInfo.imageurls[i], appLinkInfo.links[i], appLinkInfo.backgroundColors[i], i+1);
    container.appendChild(tmp.container);
  }<commit_msg>Older versions of IE now show the link name<commit_after>/*
Layout of the AppLink object:

+---------------------------------+
|       +-----------------+       |
|       |   +---------+   |       |
|       |   |         |   |       |
|       |   | PICTURE |   |       |
|       |   |         |   |       |
|       |   +---------+   |       |
|       |                 |       |
|       |   +---------+   |       |
|       |   |  NAME   |   |       |
|       |   +---------+   |       |
|       |                 |       |
|       |    HYPERLINK    |       |
|       +-----------------+       |
|            CONTAINER            |
+---------------------------------+

      <div class='appLinkContainer'>
        <a class='appLinkHyperLink' href='#' onclick='this.href += "?" + document.getElementById("searchBar").value'>
          <img src='image' class='appLinkPic' />
          <div class='appLinkName'></div>
        </a>
      </div>
*/

function loadAppLinks(appLinkInfo, container) {

  // AppLink Object declaration
  function AppLink (name, image, link, color, tabindex) {

    // Create picture
    this.picture = document.createElement('img');
    this.picture.setAttribute('class', 'appLinkPic');
    this.picture.src = image;
    this.picture.alt = name;
    if (color) this.picture.style.backgroundColor = color;

    // Create Name
    this.name = document.createElement('p');
    this.name.setAttribute('class', 'appLinkName');
    this.name.appendChild(document.createTextNode(name));

    // Create HyperLink
    this.hyperLink = document.createElement('a');
    this.hyperLink.setAttribute('class', 'appLinkHyperLink');
    this.hyperLink.setAttribute('href', link);
    this.hyperLink.setAttribute('onclick', 'putSearchQuery(this)');
    this.hyperLink.setAttribute('ontouchstart', '');
    if (tabindex) this.hyperLink.setAttribute('tabindex', tabindex);
    this.hyperLink.appendChild(this.picture);
    this.hyperLink.appendChild(this.name);

    // Create Container
    this.container = document.createElement('div');
    this.container.setAttribute('class', 'appLinkContainer');
    this.container.appendChild(this.hyperLink);
  }

  if (!container) container = document.body

  // Create a link for every sub-array within appLinkInfo.
  for (var i = 0; i < appLinkInfo.names.length; i++) {
    var tmp = new AppLink(appLinkInfo.names[i], appLinkInfo.imageurls[i], appLinkInfo.links[i], appLinkInfo.backgroundColors[i], i+1);
    container.appendChild(tmp.container);
  }
{'fraction_non_alphanumeric': 0.19878542510121458, 'fraction_numerical': 0.0008097165991902834, 'mean_word_length': 1.8793706293706294, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '3163443', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1421, 'n_words': 229}