PageSourceSearch

https://www.frandroid.com/wp-content/themes/humanoid-redesign/dist…/chunks/Products-vyQczBFsvzCv1NAOhmP2c.js

js frandroid.com collected 2026-09-24 08:28:10 UTC 3,296 bytes, 91 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0ceb2-bdae-7a10-b33c-4d9afeaa4001")}catch(e){}}();import { g as getFilteredPosts } from "./Ajax-vfWOQKfrs8KB4xAPhlm4U.js";
2import "./humanoidfr-scripts-vBN19ewMCu5iXs-lLY9KC.js";
3const Products = () => {
4  const $jsResultWrapper = $(".js-results-wrapper");
5  function updateHistory(paged, category, search = "") {
6    let title;
7    let url;
8    if (category === "Tout") {
9      category = "Produits";
10    }
11    if (paged > 1) {
12      title = category + " - page " + paged + " - Frandroid";
13      url = "/produits/page/" + paged + window.location.search;
14    } else {
15      title = category + " - Frandroid";
16      url = "/produits";
17    }
18    if (history.pushState) {
19      window.history.pushState({ category, search, paged }, title, url);
20      document.title = title;
21    } else {
22      document.location.href = url;
23    }
24  }
25  function updateResults($jsResult, action, filters, paged, search) {
26    if (!search) {
27      search = "";
28    }
29    $jsResult.attr("data-search", search);
30    $jsResult.attr("data-paged", paged);
31    getFilteredPosts($jsResult, {
32      action,
33      filters,
34      paged,
35      search,
36      callback: () => {
37        $("html, body").animate({
38          scrollTop: $jsResult.offset().top - window.innerHeight * 0.25
39        });
40      }
41    });
42  }
43  $(".cat-button").click(() => {
44    const $jsResult = $jsResultWrapper.find(".js-result");
45    $jsResult.attr("data-search", "");
46    updateHistory(1, "Tout");
47    $('.filters__category-name[data-value="all"]').trigger("click");
48    $("html, body").animate({
49      scrollTop: $jsResult.offset().top - window.innerHeight * 0.25
50    });
51  });
52  $(".filters__category-name").click((e) => {
53    e.preventDefault();
54    const $jsResult = $jsResultWrapper.find(".js-result");
55    $jsResult.attr("data-search", "");
56    updateHistory(1, $(e.target).text().trim());
57  });
58  $jsResultWrapper.on("click", ".js-pagination", (e) => {
59    e.preventDefault();
60    const $jsResult = $jsResultWrapper.find(".js-result");
61    const $button = $(e.target);
62    let paged = $jsResult.attr("data-paged");
63    if ($button.hasClass("pagination-next")) {
64      paged = +paged + 1;
65    } else if ($button.hasClass("pagination-prev")) {
66      paged = +paged - 1;
67    }
68    const action = $jsResult.attr("data-action");
69    const searchParams = new URLSearchParams(window.location.search);
70    const search = searchParams.get("product-search");
71    let activefilters = $jsResult.attr("data-activefilters");
72    if (!$.isEmptyObject(activefilters)) {
73      activefilters = JSON.parse(activefilters);
74    }
75    updateHistory(paged, $(".filters__category-name.active").text().trim());
76    updateResults($jsResult, action, activefilters, paged, search);
77  });
78  window.onpopstate = (event) => {
79    let paged = 1;
80    if (event.state.paged > 0) {
81      paged = event.state.paged;
82    }
83    $(".js-results-wrapper .js-result").attr("data-paged", paged);
84    $(".js-pagination").trigger("click");
85  };
86};
87export {
88  Products as default
89};
90
91//# chunkId=01a0ceb2-bdae-7a10-b33c-4d9afeaa4001

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.