1$('.open-modal').click(function (e) { 2 e.preventDefault(); 3 let target_modal = $(this).attr('data-id'); 4 5 // Special handling for donate button 6 if (target_modal === 'modal-donate') { 7 // Check if we're on the donate page (including language variants) 8 let currentPath = window.location.pathname; 9 let isDonatePage = currentPath === '/donate' || 10 currentPath === '/donate/' || 11 currentPath.match(/^\/[a-z]{2}\/donate\/?$/); // Matches /{lang}/donate or /{lang}/donate/ 12 13 if (!isDonatePage) { 14 // Extract language from current path and redirect to appropriate donate page 15 let langMatch = currentPath.match(/^\/([a-z]{2})\//); 16 let donateUrl = langMatch ? `/${langMatch[1]}/donate` : '/donate'; 17 window.location.href = donateUrl; 18 return; 19 } 20 // If on donate page, continue with normal modal behavior 21 } 22 23 openModal(target_modal); 24}) 25 26function openModal(target_modal) { 27 document.getElementById(`${target_modal}`).style.display = 'flex'; 28 document.documentElement.style.overflowY = 'hidden'; // prevent scrolling when opening modal 29 if (target_modal === 'modal-donate') { 30 initializeModalDonate(); 31 } 32} 33 34var modalTooltip = document.querySelector('.modal-donate__tooltip-title'); 35 36function closeModal(element) { 37 modalTooltip.classList.remove('active'); 38 $(element).closest('.modal-window').css('display', 'none'); 39 document.documentElement.style.overflowY = 'auto'; 40} 41 42$('.modal-close').click(function (e) { 43 e.preventDefault(); 44 closeModal(this); 45})
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.