<commit_before>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
  Application
} from 'phosphide/lib/core/application';

import {
  Widget
} from 'phosphor-widget';
import {
  Message
} from 'phosphor-messaging';
import {
  WidgetTracker
} from '../widgettracker';

import {
  TabPanel
} from 'phosphor-tabs';

import $ = require('jquery');

/**
 * The faq page extension.
 */
export
const faqExtension = {
  id: 'jupyter.extensions.FAQ',
  activate: activateFAQ
};

var hasBeenAttatched = false;

class FAQWidget extends Widget{
  protected onAfterAttach(msg: Message): void {
    if (!hasBeenAttatched) {
      $(document).ready(function() {
        $('li.jp-FAQ-answer').addClass('jp-FAQ-hide');
        $('li.jp-FAQ-question').click(function(){
          $(this).data('clicked', false).next().slideToggle(200).siblings('li.jp-FAQ-answer').slideUp(200);
        })
      });
      hasBeenAttatched = true;
    }
  }
}

function activateFAQ(app: Application): void {
  let widget = new FAQWidget();
  let commandId = 'faq-jupyterlab:show';
  widget.id = 'faq-jupyterlab';
  widget.title.text = 'FAQ';
  widget.title.closable = true;

  // Create Frequently Asked Questions Header Section.
  let faq = document.createElement('section');
  faq.id = 'faq-header';
  widget.node.appendChild(faq);

  let questionIcon = document.createElement('span');
  questionIcon.className = 'jp-QuestionMark jp-FAQ-QuestionMark';
  faq.appendChild(questionIcon);

  let faqHeader = document.createElement('h1');
  faqHeader.className = 'jp-FAQ-h1';
  let faqTitle = document.createElement('span');
  faqTitle.className = 'jp-FAQ-title';
  faqTitle.textContent = 'Frequently Asked Questions';
  faq.appendChild(faqHeader);
  faqHeader.appendChild(faqTitle);

  let paragraph = document.createElement('p');
  widget.node.appendChild(paragraph);

  // Create a section element that all other FAQ Content will go under.
  let faqContent = document.createElement('section');
  faqContent.id = 'faq-content';
  paragraph.appendChild(faqContent);

  // Create Basics section.
  let basicsHeading = document.createElement('h2');
  basicsHeading.className = 'jp-FAQ-h2';
  basicsHeading.textContent = 'THE BASICS';
  faqContent.appendChild(basicsHeading);

  // Create unordered list of questions/answers under the Basics section.
  let basicsQA = document.createElement('ul');
  basicsQA.className = 'jp-FAQ-ul';<commit_msg>Fix merge conflicts<commit_after>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import {
  Application
} from 'phosphide/lib/core/application';

import {
  Widget
} from 'phosphor-widget';
import {
  Message
} from 'phosphor-messaging';
import {
  WidgetTracker
} from '../widgettracker';

import {
  TabPanel
} from 'phosphor-tabs';

import $ = require('jquery');

/**
 * The faq page extension.
 */
export
const faqExtension = {
  id: 'jupyter.extensions.FAQ',
  activate: activateFAQ
};

var hasBeenAttatched = false;

class FAQWidget extends Widget{
  protected onAfterAttach(msg: Message): void {
    if (!hasBeenAttatched) {
      $(document).ready(function() {
        $('li.jp-FAQ-answer').addClass('jp-FAQ-hide');
        $('li.jp-FAQ-question').click(function(){
          $(this).data('clicked', false).next().slideToggle(200).siblings('li.jp-FAQ-answer').slideUp(200);
        })
      });
      hasBeenAttatched = true;
    }
  }
}

function activateFAQ(app: Application): void {
  let widget = new FAQWidget();
  let commandId = 'faq-jupyterlab:show';
  widget.id = 'faq-jupyterlab';
  widget.title.text = 'FAQ';
  widget.title.closable = true;

  // Create Frequently Asked Questions Header Section.
  let faq = document.createElement('section');
  faq.id = 'faq-header';
  widget.node.appendChild(faq);

  let questionIcon = document.createElement('span');
<<<<<<< HEAD
  questionIcon.className = 'jp-QuestionMark jp-FAQ-QuestionMark';
=======
  questionIcon.className = 'jp-QuestionMark jp-faq-QuestionMark';
>>>>>>> 19d5cd9... QuestionMark SVG has 2 classes in FAQ plugin
  faq.appendChild(questionIcon);

  let faqHeader = document.createElement('h1');
  faqHeader.className = 'jp-FAQ-h1';
  let faqTitle = document.createElement('span');
  faqTitle.className = 'jp-FAQ-title';
  faqTitle.textContent = 'Frequently Asked Questions';
  faq.appendChild(faqHeader);
  faqHeader.appendChild(faqTitle);

  let paragraph = document.createElement('p');
  widget.node.appendChild(paragraph);

  // Create a section element that all other FAQ Content will go under.
  let faqContent = document.createElement('section');
  faqContent.id = 'faq-content';
  paragraph.appendChild(faqContent);

  // Create Basics section.
  let basicsHeading = document.createElement('h2');
  basicsHeading.className = 'jp-FAQ-h2';
  basicsHeading.textContent = 'THE BASICS';
  faqContent.appendChild(basicsHeading);

  // Create unordered list of questions/answers under the Basics section.
  let basicsQA = document.createElement('ul');
  basicsQA.className = 'jp-FAQ-ul';
{'fraction_non_alphanumeric': 0.1415929203539823, 'fraction_numerical': 0.004916420845624385, 'mean_word_length': 4.121852970795569, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1730100', 'n_tokens_mistral': 1690, 'n_tokens_neox': 1610, 'n_words': 350}