<commit_before>// General JS for all pages
$(document).ready(function(){
	// Jumping to page section
  $('.smooth-scroll').bind('click',function(event){
    var $anchor = $(this);
    var $navbar_position = $('.navbar').css('top');
    var $navbar_height = parseInt($('.navbar').css('height'));
    var $offset = 0;

    // Takes care of changing navbar size/position due to @media width
    if ($navbar_position == '0px') {
      $offset = $navbar_height + 10;
    }

    var target_offset = $($anchor.attr('href')).offset();
    if (target_offset == null) {
      var pixels = 0;
    } else {
      var pixels = target_offset.top - $offset;
    }

    $('html, body').stop().animate({
        scrollTop: pixels
    }, 250);
    event.preventDefault();
  });

  // Handle linking to tabs
  var hash = window.location.hash;
  hash && $('ul.nav a[href="' + hash + '"]').tab('show');

  $('.nav-tabs a, .nav-pills a').click(function (e) {
    $(this).tab('show');
    var scrollmem = $('body').scrollTop();
    window.location.hash = this.hash;
    $('html,body').scrollTop(scrollmem);
  });

	// Fancybox
	$(".fancybox").fancybox();

  // Tooltips
  $('body').tooltip({
      selector: '[rel=tooltip]'
  });

	// Fitvids
	$('.fitvids').fitVids();

	// JWPlayer
	if ($("#tbavideo_container").length != 0) {
    jwplayer("tbavideo_container").setup({
      players: [
          { type: "flash", src: "/jwplayer/player.swf" },
          { type: "html5" }
      ],
      provider: "http",
      controlbar: "bottom",
    });
	}

  // Featherlight Gallery<commit_msg>Fix scrolling to the top of the page when a tab is clicked<commit_after>// General JS for all pages
$(document).ready(function(){
	// Jumping to page section
  $('.smooth-scroll').bind('click',function(event){
    var $anchor = $(this);
    var $navbar_position = $('.navbar').css('top');
    var $navbar_height = parseInt($('.navbar').css('height'));
    var $offset = 0;

    // Takes care of changing navbar size/position due to @media width
    if ($navbar_position == '0px') {
      $offset = $navbar_height + 10;
    }

    var target_offset = $($anchor.attr('href')).offset();
    if (target_offset == null) {
      var pixels = 0;
    } else {
      var pixels = target_offset.top - $offset;
    }

    $('html, body').stop().animate({
        scrollTop: pixels
    }, 250);
    event.preventDefault();
  });

  // Handle linking to tabs
  var hash = window.location.hash;
  hash && $('ul.nav a[href="' + hash + '"]').tab('show');

  $('.nav-tabs a, .nav-pills a').click(function (e) {
    e.preventDefault();
    window.location.hash = this.hash;
  });

	// Fancybox
	$(".fancybox").fancybox();

  // Tooltips
  $('body').tooltip({
      selector: '[rel=tooltip]'
  });

	// Fitvids
	$('.fitvids').fitVids();

	// JWPlayer
	if ($("#tbavideo_container").length != 0) {
    jwplayer("tbavideo_container").setup({
      players: [
          { type: "flash", src: "/jwplayer/player.swf" },
          { type: "html5" }
      ],
      provider: "http",
      controlbar: "bottom",
    });
	}

  // Featherlight Gallery
{'fraction_non_alphanumeric': 0.20019467878001299, 'fraction_numerical': 0.006489292667099286, 'mean_word_length': 2.7597560975609756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '795859', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1008, 'n_words': 227}