<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global gNewTab*/

"use strict";

const TILES_INTRO_LINK = "https://www.mozilla.org/firefox/tiles/";

(function(exports) {
  const TILES_PRIVACY_LINK = "https://www.mozilla.org/privacy/";

  const gIntro = {
    _nodeIDSuffixes: [
      "mask",
      "modal",
      "text",
      "buttons",
      "header",
      "footer"
    ],

    _paragraphs: [],

    _nodes: {},

    init() {
      for (let idSuffix of this._nodeIDSuffixes) {
        this._nodes[idSuffix] =
          document.getElementById("newtab-intro-" + idSuffix);
      }
    },

    _showMessage() {
      // Set the paragraphs
      let paragraphNodes = this._nodes.text.getElementsByTagName("p");

      this._paragraphs.forEach((arg, index) => {
        paragraphNodes[index].innerHTML = arg;
      });

      // Set the button
      document.getElementById("newtab-intro-button")
        .dataset.value = gNewTab.newTabString("intro.gotit");
    },

    _bold: function(str) {
      return `<strong>${str}</strong>`;
    },

    _link: function(url, text) {
      return `<a href="${url}" target="_blank">${text}</a>`;
    },

    _exitIntro() {
      this._nodes.mask.style.opacity = 0;
      this._nodes.mask.addEventListener("transitionend", () => {
        this._nodes.mask.style.display = "none";
      });
    },

    _generateParagraphs() {
      let customizeIcon =
        `<input type="button" class="newtab-control newtab-customize"/>`;
      this._paragraphs.push(gNewTab.newTabString("intro1.paragraph1"));
      this._paragraphs.push(gNewTab.newTabString("intro1.paragraph2", [
        this._link(TILES_PRIVACY_LINK,
          gNewTab.newTabString("privacy.link")),
        customizeIcon
      ]));
    },

    showIfNecessary() {<commit_msg>Fix value on confirmation box<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global gNewTab*/

"use strict";

const TILES_INTRO_LINK = "https://www.mozilla.org/firefox/tiles/";

(function(exports) {
  const TILES_PRIVACY_LINK = "https://www.mozilla.org/privacy/";

  const gIntro = {
    _nodeIDSuffixes: [
      "mask",
      "modal",
      "text",
      "buttons",
      "header",
      "footer"
    ],

    _paragraphs: [],

    _nodes: {},

    init() {
      for (let idSuffix of this._nodeIDSuffixes) {
        this._nodes[idSuffix] =
          document.getElementById("newtab-intro-" + idSuffix);
      }
    },

    _showMessage() {
      // Set the paragraphs
      let paragraphNodes = this._nodes.text.getElementsByTagName("p");

      this._paragraphs.forEach((arg, index) => {
        paragraphNodes[index].innerHTML = arg;
      });

      // Set the button
      document.getElementById("newtab-intro-button")
        .value = gNewTab.newTabString("intro.gotit");
    },

    _bold: function(str) {
      return `<strong>${str}</strong>`;
    },

    _link: function(url, text) {
      return `<a href="${url}" target="_blank">${text}</a>`;
    },

    _exitIntro() {
      this._nodes.mask.style.opacity = 0;
      this._nodes.mask.addEventListener("transitionend", () => {
        this._nodes.mask.style.display = "none";
      });
    },

    _generateParagraphs() {
      let customizeIcon =
        `<input type="button" class="newtab-control newtab-customize"/>`;
      this._paragraphs.push(gNewTab.newTabString("intro1.paragraph1"));
      this._paragraphs.push(gNewTab.newTabString("intro1.paragraph2", [
        this._link(TILES_PRIVACY_LINK,
          gNewTab.newTabString("privacy.link")),
        customizeIcon
      ]));
    },

    showIfNecessary() {
{'fraction_non_alphanumeric': 0.15351101998974884, 'fraction_numerical': 0.0046130189646335215, 'mean_word_length': 2.6072088724584104, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '2590170', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1246, 'n_words': 230}