PageSourceSearch

https://customrooflights.co.uk/wp-content/plugins/ithemeland-free-…/frontend/assets/js/pagination.js?ver=1.0

js customrooflights.co.uk collected 2026-09-28 12:57:31 UTC 1,995 bytes, 56 lines download raw bytes

1(function ($) {
2  function initializePagination() {
3    $(".wgb-gift-cart-pagination-items").hide();
4
5    $(".wgb-pagination").each(function () {
6      var $pagination = $(this);
7      var ruleUid = $pagination.data("rule-uid");
8      var $container = $pagination.closest(".wgb-promotion-template-wrapper");
9      var $items = $container.find('.wgb-gift-cart-pagination-items[data-rule-uid="' + ruleUid + '"]');
10
11      function getPerPage() {
12        if (typeof cart_ajax !== "undefined" && cart_ajax.per_page) {
13          return parseInt(cart_ajax.per_page);
14        }
15        return 5;
16      }
17
18      function loadPage(page, per_page) {
19        if (typeof per_page === "undefined" || per_page === null) {
20          per_page = getPerPage();
21        }
22        var start = (page - 1) * per_page;
23        var end = start + per_page;
24        $items.removeClass("wgb-visible");
25        $items.slice(start, end).addClass("wgb-visible");
26        var totalItems = $items.length;
27        var totalPages = Math.ceil(totalItems / per_page);
28        var paginationHtml = "";
29        for (var i = 1; i <= totalPages; i++) {
30          var activeClass = i === page ? "active" : "";
31          paginationHtml += '<a href="#" class="page-link ' + activeClass + '" data-page="' + i + '" data-rule-uid="' + ruleUid + '">' + i + "</a>";
32        }
33        $pagination.html(paginationHtml);
34        localStorage.setItem("gift_current_page_" + ruleUid, page);
35      }
36
37      var savedPage = localStorage.getItem("gift_current_page_" + ruleUid) || 1;
38      loadPage(parseInt(savedPage));
39
40      $pagination.off("click", ".page-link").on("click", ".page-link", function (e) {
41        e.preventDefault();
42        var page = $(this).data("page");
43        loadPage(page);
44      });
45    });
46  }
47
48  $(document).ready(function () {
49    initializePagination();
50  });
51
52  // Re-initialize pagination after AJAX cart updates
53  $(document.body).on("updated_cart_totals", function () {
54    initializePagination();
55  });
56})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.