<commit_before>/* ========================================================================
 * DOM-based Routing
 * Based on http://goo.gl/EUTi53 by <NAME>
 *
 * Only fires on body classes that match. If a body class contains a dash,
 * replace the dash with an underscore when adding it to the object below.
 *
 * .noConflict()
 * The routing is enclosed within an anonymous function so that you can
 * always reference jQuery with $, even when in .noConflict() mode.
 * ======================================================================== */

(function($) {

  // Use this variable to set up the common and page specific functions. If you
  // rename this variable, you will also need to rename the namespace below.
  var Sage = {
    // All pages
    'common': {
      init: function() {
        $('[data-toggle="tooltip"]').tooltip();

        function adjustContainerPadding () {
          var body = document.querySelector( "body" );
          var footer = document.querySelector( "footer" );

          body.style.paddingBottom = window.getComputedStyle( footer ).height;
          return adjustContainerPadding;
        }

        var resize_actions = function(){

          adjustContainerPadding();

          $(".brand .fit-text-holder").lettering();

          $('.brand .fit-text-holder').each(function(){
              var target = $(this).closest('.brand');
              var new_position = $('.brand .fit-text-holder').position().left-1;
              var positions = target.css('background-position');
              positions = positions.split(", ");
              positions[1] = positions[1].split(" ");
              positions[3] = positions[3].split(" ");
              positions[1][0] = new_position+"px";
              positions[3][0] = new_position+"px";
              positions[1] = positions[1].join(" ");
              positions[3] = positions[3].join(" ");
              positions = positions.join(", ");
              target.css('background-position',positions);
          });

        };
        resize_actions();

        function throttle ( method, waitTime ) {
        		var working = false;
        		return function () {
        			if ( working ) {
                return;
              }
        			working = true;
        			setTimeout( function () {
        				method(); working = false;
        			}, waitTime );
        		};
        	}

        window.addEventListener(
            "resize", throttle( resize_actions(), 500 )
        );


        var navbar_control = function(){
          // display or show navbar on scroll
          var navbar = $('#navbar-collapsed'),
              brandbar = $('.brand'),
          		distance = brandbar.position().top + brandbar.outerHeight(),
              $window = $(window);

          $window.scroll(function() {
              if ($window.scrollTop() >= distance) {
                  navbar.addClass('active');
              } else {
                  navbar.removeClass('active');
              }
          });
        };
        navbar_control();


      },
      finalize: function() {<commit_msg>remove throttle<commit_after>/* ========================================================================
 * DOM-based Routing
 * Based on http://goo.gl/EUTi53 by <NAME>
 *
 * Only fires on body classes that match. If a body class contains a dash,
 * replace the dash with an underscore when adding it to the object below.
 *
 * .noConflict()
 * The routing is enclosed within an anonymous function so that you can
 * always reference jQuery with $, even when in .noConflict() mode.
 * ======================================================================== */

(function($) {

  // Use this variable to set up the common and page specific functions. If you
  // rename this variable, you will also need to rename the namespace below.
  var Sage = {
    // All pages
    'common': {
      init: function() {
        $('[data-toggle="tooltip"]').tooltip();

        function adjustContainerPadding () {
          var body = document.querySelector( "body" );
          var footer = document.querySelector( "footer" );

          body.style.paddingBottom = window.getComputedStyle( footer ).height;
          return adjustContainerPadding;
        }

        var resize_actions = function(){

          adjustContainerPadding();

          $(".brand .fit-text-holder").lettering();

          $('.brand .fit-text-holder').each(function(){
              var target = $(this).closest('.brand');
              var new_position = $('.brand .fit-text-holder').position().left-1;
              var positions = target.css('background-position');
              positions = positions.split(", ");
              positions[1] = positions[1].split(" ");
              positions[3] = positions[3].split(" ");
              positions[1][0] = new_position+"px";
              positions[3][0] = new_position+"px";
              positions[1] = positions[1].join(" ");
              positions[3] = positions[3].join(" ");
              positions = positions.join(", ");
              target.css('background-position',positions);
          });

        };
        resize_actions();



        window.addEventListener(
            "resize", resize_actions
        );


        var navbar_control = function(){
          // display or show navbar on scroll
          var navbar = $('#navbar-collapsed'),
              brandbar = $('.brand'),
          		distance = brandbar.position().top + brandbar.outerHeight(),
              $window = $(window);

          $window.scroll(function() {
              if ($window.scrollTop() >= distance) {
                  navbar.addClass('active');
              } else {
                  navbar.removeClass('active');
              }
          });
        };
        navbar_control();


      },
      finalize: function() {
{'fraction_non_alphanumeric': 0.17793411118737132, 'fraction_numerical': 0.005662319835277968, 'mean_word_length': 2.021772939346812, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3181145', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1381, 'n_words': 375}