<commit_before>/* globals $, history, analytics */

'use strict'

$(function () {
  var $window = $(window)
  var $docs = $('#documentation')

  $('.navbar-toggle').on('click', function () {
    var $navbar = $($(this).data('target'))
    $navbar.slideToggle(150)
  })

  $('.scroll-to').on('click', function (e) {
    e.preventDefault()

    $('html, body').animate({
      scrollTop: $($(this).attr('href')).offset().top - 107 // Header height
    }, 700)
  })

  // Change header download button color

  if (!$('body#enterprise').length) {
    var introSectionHeight = $('.section.intro-section').outerHeight() || 50
    var $downloadBtn = $('.navbar-nav').find('.button')

    $window.on('scroll', function () {
      var scrollTop = $(this).scrollTop()

      if (scrollTop > introSectionHeight) {
        $downloadBtn.removeClass('button-dark').addClass('button-primary')
      } else {
        $downloadBtn.removeClass('button-primary').addClass('button-dark')
      }
    })
  }

  // Cookie Policy
  // Check for cookie
  if (!document.cookie.split(';').filter(function (item) {
    return item.indexOf('cookie-policy=') >= 0
  }).length) {
    $('.cookie-policy-container').addClass('show')
    $('.page').addClass('page-cookie-policy')
  }

  // Hide banner on "I accept" and set cookie
  $('.cookie-policy-accept').on('click', function (e) {
    e.preventDefault()

    $('.cookie-policy-container').removeClass('show')
    $('.page').removeClass('page-cookie-policy')
    var CookieDate = new Date()
    CookieDate.setFullYear(CookieDate.getFullYear() + 10)
    document.cookie = 'cookie-policy; expires=' + CookieDate.toGMTString() + ';path=/'
  })

  // Page section on contribute page

  $('.toggle-page-section').on('click', function (e) {
    e.preventDefault()
    var $link = $(this)

    $link.parent().next('.page-section').stop().slideToggle(300, function () {
      $link.toggleClass('active')
    })
  })

  // Tabs on download page

  var $tabs = $('.tab-list li')
  var $tabPanes = $('.tab-pane')<commit_msg>fix(cookie-policy) Typo in check function<commit_after>/* globals $, history, analytics */

'use strict'

$(function () {
  var $window = $(window)
  var $docs = $('#documentation')

  $('.navbar-toggle').on('click', function () {
    var $navbar = $($(this).data('target'))
    $navbar.slideToggle(150)
  })

  $('.scroll-to').on('click', function (e) {
    e.preventDefault()

    $('html, body').animate({
      scrollTop: $($(this).attr('href')).offset().top - 107 // Header height
    }, 700)
  })

  // Change header download button color

  if (!$('body#enterprise').length) {
    var introSectionHeight = $('.section.intro-section').outerHeight() || 50
    var $downloadBtn = $('.navbar-nav').find('.button')

    $window.on('scroll', function () {
      var scrollTop = $(this).scrollTop()

      if (scrollTop > introSectionHeight) {
        $downloadBtn.removeClass('button-dark').addClass('button-primary')
      } else {
        $downloadBtn.removeClass('button-primary').addClass('button-dark')
      }
    })
  }

  // Cookie Policy
  // Check for cookie
  if (!document.cookie.split(';').filter(function (item) {
    return item.indexOf('cookie-policy') >= 0
  }).length) {
    $('.cookie-policy-container').addClass('show')
    $('.page').addClass('page-cookie-policy')
  }

  // Hide banner on "I accept" and set cookie
  $('.cookie-policy-accept').on('click', function (e) {
    e.preventDefault()

    $('.cookie-policy-container').removeClass('show')
    $('.page').removeClass('page-cookie-policy')
    var CookieDate = new Date()
    CookieDate.setFullYear(CookieDate.getFullYear() + 1)
    document.cookie = 'cookie-policy; expires=' + CookieDate.toGMTString() + ';path=/'
  })

  // Page section on contribute page

  $('.toggle-page-section').on('click', function (e) {
    e.preventDefault()
    var $link = $(this)

    $link.parent().next('.page-section').stop().slideToggle(300, function () {
      $link.toggleClass('active')
    })
  })

  // Tabs on download page

  var $tabs = $('.tab-list li')
  var $tabPanes = $('.tab-pane')
{'fraction_non_alphanumeric': 0.20644216691068815, 'fraction_numerical': 0.008052708638360176, 'mean_word_length': 3.2876569037656904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3371870', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1253, 'n_words': 245}