PageSourceSearch

https://www.aveyron-culture.com/sites/all/modules/custom/listes_recherche/js/liste-une.js?tluhp4

js aveyron-culture.com collected 2026-09-24 23:11:06 UTC 2,157 bytes, 84 lines download raw bytes

1(function () {
2  'use strict';
3
4  function getPerPage() {
5    var width = window.innerWidth || document.documentElement.clientWidth;
6    if (width >= 992) {
7      return 3;
8    }
9    if (width >= 640) {
10      return 2;
11    }
12    return 1;
13  }
14
15  function initUneCarousel() {
16    if (typeof Splide === 'undefined') {
17      return;
18    }
19
20    var roots = document.querySelectorAll('.lr__liste-une.splide');
21    if (!roots.length) {
22      return;
23    }
24
25    Array.prototype.forEach.call(roots, function (root) {
26      if (root.dataset.splideReady === '1') {
27        return;
28      }
29
30      var count = parseInt(root.getAttribute('data-splide-count') || '0', 10);
31      var perPage = getPerPage();
32
33      // Pas de carrousel si tout tient déjà dans la vue.
34      // Splide masque .splide (visibility:hidden) tant qu'il n'est pas initialisé :
35      // forcer is-rendered pour afficher le mode grille statique.
36      if (count > 0 && count <= perPage) {
37        root.classList.add('lr__liste-une--static', 'is-rendered');
38        root.dataset.splideReady = '1';
39        return;
40      }
41
42      var splide = new Splide(root, {
43        type: 'slide',
44        perPage: 3,
45        perMove: 1,
46        gap: '1rem',
47        pagination: true,
48        arrows: true,
49        drag: true,
50        speed: 400,
51        i18n: {
52          prev: 'Événement précédent',
53          next: 'Événement suivant',
54          first: 'Premier événement',
55          last: 'Dernier événement',
56          slideX: 'Aller à l’événement %s',
57          pageX: 'Aller à la page %s',
58          play: 'Démarrer le défilement automatique',
59          pause: 'Mettre en pause le défilement automatique',
60          select: 'Sélectionner un événement',
61          slideLabel: '%s sur %s',
62        },
63        breakpoints: {
64          991: {
65            perPage: 2,
66          },
67          639: {
68            perPage: 1,
69          },
70        },
71      });
72
73      splide.mount();
74      root.dataset.splideReady = '1';
75    });
76  }
77
78  if (document.readyState === 'loading') {
79    document.addEventListener('DOMContentLoaded', initUneCarousel);
80  }
81  else {
82    initUneCarousel();
83  }
84})();

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.