<commit_before>/*jslint browser: true, indent: 2, todo: true, unparam: true */
/*global jQuery,Ornament */

(function (document, window, $) {

  "use strict";

  $(function(){

    // only do all of this if there's pagination on the page.
    var $pagination = $(".pagination");
    if($pagination.length > 0) {

      var $current = $pagination.find(".page.current");

      var paginationIsFirstPage = function(){
        if ( $pagination.find(".page").first().hasClass("current") ) {
          return true;
        } else {
          return false;
        }
      }
      var paginationIsLastPage = function(){
        if ( $pagination.find(".page").last().hasClass("current") ) {
          return true;
        } else {
          return false;
        }
      }
      var paginationShowHide = function(){
        if(paginationIsLastPage() || paginationIsFirstPage()) {
          return false;
        }
        var windowWidth = Ornament.windowWidth();
        if(windowWidth <= 430) {
          $current.prev(".page").prev(".page").hide();
          $current.next(".page").next(".page").hide();
        } else {
          $current.prev(".page").prev(".page").show();
          $current.next(".page").next(".page").show();
        }
      }

      $(window).on("resize", function(){
        paginationShowHide();
      });

      paginationShowHide();

    }

  });

}(document, window, jQuery));<commit_msg>Refactored pagination helper in to component framework and disabled by default since it wasn't being used<commit_after>/*jslint browser: true, indent: 2, todo: true, unparam: true */
/*global jQuery,Ornament */

(function (document, window, $) {

  "use strict";

  $(document).on("ornament:refresh", function() {

    var PaginationHelper = Ornament.Components.PaginationHelper = {

      enabled: false,
      paginationSelector: ".pagination",
      currentPageSelector: ".page.current",
      pageSelector: ".page",

      getCurrentPage: function(){
        return PaginationHelper.$pagination.find(PaginationHelper.currentPageSelector);
      },

      getPages: function(){
        return PaginationHelper.$pagination.find(Pagination.pageSelector);
      },

      isOnFirstPage: function(){
        return PaginationHelper.getCurrentPage().is(PaginationHelper.getPages().first());
      },

      isOnLastPage: function(){
        return PaginationHelper.getCurrentPage().is(PaginationHelper.getPages().last());
      },

      showHidePagination: function(){
        if(PaginationHelper.isOnFirstPage() || PaginationHelper.isOnLastPage()) {
          return false;
        } else {
          var $current = PaginationHelper.getCurrentPage();
          if(Ornament.windowWidth() <= 430) {
            $current.prev(".page").prev(".page").hide();
            $current.next(".page").next(".page").hide();
          } else {
            $current.prev(".page").prev(".page").show();
            $current.next(".page").next(".page").show();
          }
        }
      },

      init: function(){
        // push the pagination to the component
        PaginationHelper.$pagination = $(PaginationHelper.paginationSelector);
        // listen on window resize to show or hide pagination 
        $(window).off("resize", PaginationHelper.showHidePagination).on("resize", PaginationHelper.showHidePagination);
        // show or hide pagination on page load
        PaginationHelper.showHidePagination();
      }
    }

    if(PaginationHelper.enabled && $(PaginationHelper.paginationSelector).length > 0) {
      PaginationHelper.init();
    }

  });

}(document, window, jQuery));
{'fraction_non_alphanumeric': 0.15358931552587646, 'fraction_numerical': 0.0027824151363383415, 'mean_word_length': 2.584247258225324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1895391', 'n_tokens_mistral': 1006, 'n_tokens_neox': 977, 'n_words': 193}