<commit_before>/* -*- coding: utf-8 -*- */

$(document).ready(function() {
  if($('.cf-tab-content').length == 0) {
    return;
  }

  var targetlist = '<nav><ul class="tabswitcher"></ul></nav>', targets = '';
  $('.cf-tab-content').prepend(targetlist);
  $('.cf-tab-pane').each(function(){
    targets += '<li><a href="#' + this.id + '">' + $(this).children('legend').text() + '</a></li>';
  });

  $('.tabswitcher').append(targets);
  $("body").addClass("tabs-active");

  var hash = document.location.hash;
  if(!hash && history.pushState) {
    var first = $(".tabswitcher li a:first");

    if(first.length == 0) {
      return;
    }

    hash = first.attr("href");
    history.pushState({}, first.text(), hash);
  }

  $(hash).addClass('active');
  $('.tabswitcher a[href="' + hash + '"]').parent().addClass("active");

  $('.tabswitcher li a').on('click', function(ev) {
    ev.preventDefault();
    $(".cf-tab-pane.active").removeClass("active");
    $(".tabswitcher .active").removeClass("active");

    var anchor = $(this).attr("href");
    $(anchor).addClass("active");
    $(this).parent().addClass("active");

    if(history.pushState) {
      history.pushState({}, $(this).text(), anchor);
    }
  });

  $(window).on('popstate', function() {
    var anchor = document.location.hash || $(".tabswitcher li a:first").attr("href");

    $(".cf-tab-pane.active").removeClass("active");
    $(".tabswitcher .active").removeClass("active");

    $(anchor).addClass("active");
    $('.tabswitcher a[href="' + anchor + '"]').parent().addClass("active");
  });
});

/* eof */<commit_msg>ref: use history.replaceState when initializing<commit_after>/* -*- coding: utf-8 -*- */

$(document).ready(function() {
  if($('.cf-tab-content').length == 0) {
    return;
  }

  var targetlist = '<nav><ul class="tabswitcher"></ul></nav>', targets = '';
  $('.cf-tab-content').prepend(targetlist);
  $('.cf-tab-pane').each(function(){
    targets += '<li><a href="#' + this.id + '">' + $(this).children('legend').text() + '</a></li>';
  });

  $('.tabswitcher').append(targets);
  $("body").addClass("tabs-active");

  var hash = document.location.hash;
  if(!hash && history.replaceState) {
    var first = $(".tabswitcher li a:first");

    if(first.length == 0) {
      return;
    }

    hash = first.attr("href");
    history.replaceState({}, first.text(), hash);
  }

  $(hash).addClass('active');
  $('.tabswitcher a[href="' + hash + '"]').parent().addClass("active");

  $('.tabswitcher li a').on('click', function(ev) {
    ev.preventDefault();
    $(".cf-tab-pane.active").removeClass("active");
    $(".tabswitcher .active").removeClass("active");

    var anchor = $(this).attr("href");
    $(anchor).addClass("active");
    $(this).parent().addClass("active");

    if(history.pushState) {
      history.pushState({}, $(this).text(), anchor);
    }
  });

  $(window).on('popstate', function() {
    var anchor = document.location.hash || $(".tabswitcher li a:first").attr("href");

    $(".cf-tab-pane.active").removeClass("active");
    $(".tabswitcher .active").removeClass("active");

    $(anchor).addClass("active");
    $('.tabswitcher a[href="' + anchor + '"]').parent().addClass("active");
  });
});

/* eof */
{'fraction_non_alphanumeric': 0.26579925650557623, 'fraction_numerical': 0.0018587360594795538, 'mean_word_length': 3.706997084548105, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '346873', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1063, 'n_words': 162}