PageSourceSearch

https://hispanica.cz/assets/js/testimonials.js?v=2026092901

js hispanica.cz collected 2026-10-03 01:16:59 UTC 1,338 bytes, 54 lines download raw bytes

1/**
2 * Listování v ohlasech studentů.
3 *
4 * Trojice ohlasů jsou v HTML všechny, vidět je vždy jedna. Bez tohohle skriptu
5 * zůstane první a šipky se schovají (CSS je ukazuje jen pod html.js), takže
6 * sekce dává smysl i bez JavaScriptu.
7 */
8(function () {
9	'use strict';
10
11	var koren = document.querySelector('[data-testimonials]');
12
13	if (!koren) {
14		return;
15	}
16
17	var stranky = koren.querySelectorAll('.his-testimonials__page');
18	var predchozi = koren.querySelector('.his-testimonials__arrow--prev');
19	var dalsi = koren.querySelector('.his-testimonials__arrow--next');
20
21	if (stranky.length < 2) {
22		// Jediná trojice — listovat není kam.
23		if (predchozi) { predchozi.hidden = true; }
24		if (dalsi) { dalsi.hidden = true; }
25		return;
26	}
27
28	var aktualni = 0;
29
30	function ukaz(index) {
31		// Dokola: za poslední trojicí je zase první.
32		aktualni = (index + stranky.length) % stranky.length;
33
34		Array.prototype.forEach.call(stranky, function (s, i) {
35			s.hidden = i !== aktualni;
36		});
37	}
38
39	predchozi.addEventListener('click', function () {
40		ukaz(aktualni - 1);
41	});
42
43	dalsi.addEventListener('click', function () {
44		ukaz(aktualni + 1);
45	});
46
47	koren.addEventListener('keydown', function (e) {
48		if (e.key === 'ArrowLeft') {
49			ukaz(aktualni - 1);
50		} else if (e.key === 'ArrowRight') {
51			ukaz(aktualni + 1);
52		}
53	});
54})();

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.