1 2; /* Start:"a:4:{s:4:"full";s:75:"/local/components/cmd_u/forms/templates/popup_city/script.js?17810192002300";s:6:"source";s:60:"/local/components/cmd_u/forms/templates/popup_city/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 3document.addEventListener("DOMContentLoaded", function() { 4 5 document.querySelectorAll("[data-open-popup]").forEach(btn => { 6 btn.addEventListener("click", () => { 7 const popup = document.querySelector(".popup_select_city"); 8 if(popup) popup.style.display = "block"; 9 }); 10 }); 11 12 const popup = document.querySelector(".popup_select_city"); 13 if(popup) { 14 popup.addEventListener("click", e => { 15 if(e.target === popup) popup.style.display = "none"; 16 }); 17 } 18 19 const closeBtn = popup?.querySelector(".popup_close"); 20 if(closeBtn) { 21 closeBtn.addEventListener("click", () => { 22 popup.style.display = "none"; 23 }); 24 } 25 26 const input = document.getElementById("citySearch"); 27 const results = document.getElementById("searchResults"); 28 let timer = null; 29 30 input.addEventListener("input", function() { 31 clearTimeout(timer); 32 let query = this.value.trim(); 33 34 if (!query) { 35 results.style.display = "none"; 36 results.innerHTML = ""; 37 return; 38 } 39 40 timer = setTimeout(() => { 41 fetch("/local/ajax/search_city.php?q=" + encodeURIComponent(query)) 42 .then(response => response.json()) 43 .then(data => { 44 results.innerHTML = ""; 45 if (data.length > 0) { 46 data.forEach(city => { 47 let wrapper = document.createElement("div"); 48 wrapper.className = "result_item"; 49 50 let link = document.createElement("a"); 51 link.href = city.URL; 52 link.textContent = city.NAME; 53 54 wrapper.appendChild(link); 55 results.appendChild(wrapper); 56 }); 57 results.style.display = "block"; 58 } else { 59 results.style.display = "none"; 60 } 61 }) 62 .catch(err => { 63 console.error("ÐÑибка поиÑка:", err); 64 }); 65 }, 300); 66 }); 67 68}); 69/* End */ 70;; /* /local/components/cmd_u/forms/templates/popup_city/script.js?17810192002300*/
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.