<commit_before>(function () {

// Addresses of the agents the portal page needs to communicate with.
const CENO_CLIENT_BASE = 'http://localhost:3090';

// Agent API endpoints.
const CLIENT_LOOKUP_ROUTE = '/lookup';

/**
 * Produce a URL that can be redirected to in order to have the CENO client do a lookup
 * for a given site.
 * @param {string} siteUrl - The URL of the site the user wants to visit (e.g. https://google.ca/)
 * @return {string} the URL to request from the CENO client
 */
function lookupUrl(siteUrl) {
  return `${CENO_CLIENT_BASE}${CLIENT_LOOKUP_ROUTE}?url=${btoa(siteUrl)}`;
}

/**
 * When the user submits the form for requesting a site from the home page,
 * we want to intercept that request and base64-encode the URL they entered so that the
 * request integrates seamlessly with the existing direct lookup functionality.
 */
function encodeLookupUrl(e) {
  e.preventDefault();
  let urlInput = document.getElementById('indexUrlSearch');
  let newUrl = lookupUrl(urlInput.value);
  window.location.href = newUrl;
}

// Attach the encode above to the form if we're on the index page.
let urlInputForm = document.getElementById('lookupForm');
if (urlInputForm) {
  if (urlInputForm.attachEvent) {
    urlInputForm.attachEvent('submit', encodeLookupUrl);
  } else {
    urlInputForm.addEventListener('submit', encodeLookupUrl);
  }
}

// Attach an event handler to the Tell Me More button to show an overlay with more information
// about CENO when the button is clicked.
let tellMeMoreButton = document.getElementById('tellMeMore');
tellMeMoreButton.addEventListener('click', function () {
  let overlay = document.getElementById('cenoInfoOverlay');
  // The display property will be "none" while the overlay is not visible.
  overlay.style.display = '';
});

languages.setIndexText('en');

})();<commit_msg>Got the overlay to show when button is clicked and hide when anywhere else is clicked<commit_after>(function () {

// Addresses of the agents the portal page needs to communicate with.
const CENO_CLIENT_BASE = 'http://localhost:3090';

// Agent API endpoints.
const CLIENT_LOOKUP_ROUTE = '/lookup';

/**
 * Produce a URL that can be redirected to in order to have the CENO client do a lookup
 * for a given site.
 * @param {string} siteUrl - The URL of the site the user wants to visit (e.g. https://google.ca/)
 * @return {string} the URL to request from the CENO client
 */
function lookupUrl(siteUrl) {
  return `${CENO_CLIENT_BASE}${CLIENT_LOOKUP_ROUTE}?url=${btoa(siteUrl)}`;
}

/**
 * When the user submits the form for requesting a site from the home page,
 * we want to intercept that request and base64-encode the URL they entered so that the
 * request integrates seamlessly with the existing direct lookup functionality.
 */
function encodeLookupUrl(e) {
  e.preventDefault();
  let urlInput = document.getElementById('indexUrlSearch');
  let newUrl = lookupUrl(urlInput.value);
  window.location.href = newUrl;
}

// Attach the encode above to the form if we're on the index page.
let urlInputForm = document.getElementById('lookupForm');
if (urlInputForm) {
  if (urlInputForm.attachEvent) {
    urlInputForm.attachEvent('submit', encodeLookupUrl);
  } else {
    urlInputForm.addEventListener('submit', encodeLookupUrl);
  }
}

// Attach an event handler to the Tell Me More button to show an overlay with more information
// about CENO when the button is clicked.
let tellMeMoreButton = document.getElementById('tellMeMore');
let overlay = document.getElementById('cenoInfoOverlay');
tellMeMoreButton.addEventListener('click', () => {
  // The display property will be "none" while the overlay is not visible.
  overlay.style.display = 'block';
});

// When any part of the overlay outside the content section is clicked, hide it.
overlay.addEventListener('click', () => {
  overlay.style.display = 'none';
});
let overlayChildren = overlay.children;
for (let i = 0, len = overlayChildren.length; i < len; i++) {
  let child = overlayChildren[i];
  if (child.addEventListener) {
    child.addEventListener('click', (e) => e.preventDefault());
  }
}

overlay.style.display = 'none';
languages.setIndexText('en');

})();
{'fraction_non_alphanumeric': 0.11044417767106843, 'fraction_numerical': 0.00312124849939976, 'mean_word_length': 4.496042216358839, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '4202866', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1180, 'n_words': 438}