1var popupOpenTime = {}; 2var currentPopupId = null; 3 4function openPopup(popupId) { 5 var popup = document.getElementById(popupId); 6 if (popup) { 7 popup.style.display = "block"; 8 document.body.classList.add('no-scroll'); 9 currentPopupId = popupId; 10 popupOpenTime[popupId] = Date.now(); 11 history.pushState({ popupId: popupId }, "", "#" + popupId); 12 } else { 13 console.error("Popup with ID " + popupId + " not found"); 14 } 15} 16 17function closePopup(action = 'Fermeture') { 18 if (!currentPopupId) return; 19 var popupId = currentPopupId; 20 var popup = document.getElementById(popupId); 21 if (popup) { 22 popup.style.display = "none"; 23 document.body.classList.remove('no-scroll'); 24 var timeSpent = (Date.now() - popupOpenTime[popupId]) / 1000; 25 if (action !== 'Retour arrière') { 26 history.back(); 27 } 28 currentPopupId = null; 29 } else { 30 console.error("Popup with ID " + popupId + " not found"); 31 } 32} 33 34window.onclick = function(event) { 35 var popups = document.getElementsByClassName('popup'); 36 for (var i = 0; i < popups.length; i++) { 37 if (event.target == popups[i]) { 38 closePopup('Fermeture (clic extérieur)'); 39 } 40 } 41} 42 43window.addEventListener('popstate', function(event) { 44 if (currentPopupId) { 45 closePopup('Retour arrière'); 46 } 47});
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.