1const modalOverlay = document.getElementById('modalOverlay'); 2const modalContent = document.getElementById('modalContent'); 3const closeBtn = document.getElementById('closeModalBtn'); 4 5document.querySelectorAll('.openModalBtn').forEach(btn => { 6 btn.addEventListener('click', function(e) { 7 e.preventDefault(); 8 e.stopImmediatePropagation(); 9 10 const url = this.getAttribute('href'); 11 12 fetch(url) 13 .then(response => { 14 if (!response.ok) throw new Error('Erreur de chargement : ' + response.status); 15 return response.text(); 16 }) 17 .then(html => { 18 modalContent.innerHTML = html; 19 modalOverlay.style.display = 'flex'; 20 document.body.classList.add('modal-open'); 21 }) 22 .catch(error => { 23 modalContent.innerHTML = `<p style="color:red">Impossible de charger le contenu.</p>`; 24 console.error(error); 25 }); 26 }); 27}); 28 29closeBtn.addEventListener('click', function() { 30 modalOverlay.style.display = 'none'; 31 document.body.classList.remove('modal-open'); 32 modalContent.innerHTML = ''; 33}); 34 35modalOverlay.addEventListener('click', function(e) { 36 if (e.target === this) { 37 modalOverlay.style.display = 'none'; 38 document.body.classList.remove('modal-open'); 39 modalContent.innerHTML = ''; 40 } 41});
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.