PageSourceSearch

https://fontaines-saint-martin.fr/typo3conf/ext/e_magineurs/themes…/slick-play-pause-fix.js?1790261671

js fontaines-saint-martin.fr collected 2026-09-25 04:13:08 UTC 2,157 bytes, 86 lines download raw bytes

1(function () {
2    'use strict';
3
4    function getPauseButton(target) {
5        if (!target || typeof target.closest !== 'function') {
6            return null;
7        }
8
9        return target.closest('.play_pause_button');
10    }
11
12    function getSliderElement(button) {
13        var slider = button.closest('.slick-slider');
14
15        if (!slider) {
16            slider = button.parentElement;
17        }
18
19        return slider;
20    }
21
22    function setButtonToPlay(button) {
23        button.classList.remove('pause');
24        button.classList.add('play');
25        button.innerHTML = 'Lecture';
26        button.setAttribute('title', 'Activer la lecture automatique');
27    }
28
29    function setButtonToPause(button) {
30        button.classList.remove('play');
31        button.classList.add('pause');
32        button.innerHTML = 'Pause';
33        button.setAttribute('title', 'Mettre en pause la lecture automatique');
34    }
35
36    function toggleSliderAutoplay(button) {
37        if (!window.jQuery) {
38            return;
39        }
40
41        var sliderElement = getSliderElement(button);
42
43        if (!sliderElement) {
44            return;
45        }
46
47        var $slider = window.jQuery(sliderElement);
48
49        if (typeof $slider.slick !== 'function') {
50            return;
51        }
52
53        if (button.classList.contains('pause')) {
54            $slider
55                .slick('slickPause')
56                .slick('slickSetOption', 'autoplay', false);
57
58            setButtonToPlay(button);
59            return;
60        }
61
62        $slider
63            .slick('slickPlay')
64            .slick('slickSetOption', 'autoplay', true);
65
66        setButtonToPause(button);
67    }
68
69    // Capture phase prevents legacy direct click handlers from firing first.
70    document.addEventListener('click', function (event) {
71        var pauseButton = getPauseButton(event.target);
72
73        if (!pauseButton) {
74            return;
75        }
76
77        event.preventDefault();
78        event.stopPropagation();
79
80        if (typeof event.stopImmediatePropagation === 'function') {
81            event.stopImmediatePropagation();
82        }
83
84        toggleSliderAutoplay(pauseButton);
85    }, true);
86}());

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.