1// â ÐлокиÑÑем ÑолÑко вÑзов ÑÑандаÑÑного окна "СегоднÑÑние поÑеÑиÑели" 2document.addEventListener("DOMContentLoaded", function () { 3 document.querySelectorAll("a.fUsrList").forEach(link => { 4 link.removeAttribute("onclick"); // ÑдалÑем вÑÑÑоеннÑй uCoz ÑкÑÐ¸Ð¿Ñ 5 link.addEventListener("click", function (e) { 6 e.preventDefault(); 7 e.stopPropagation(); 8 openUserList(); // оÑкÑÑваем каÑÑомнÑÑ Ð¼Ð¾Ð´Ð°Ð»ÐºÑ 9 }); 10 }); 11}); 12 13// â ФÑнкÑÐ¸Ñ Ð¾ÑкÑÑÑÐ¸Ñ Ð¼Ð¾Ð´Ð°Ð»Ñного окна 14function openUserList() { 15 const modal = document.getElementById("userListModal"); 16 const content = document.getElementById("userListContent"); 17 if (!modal || !content) return; 18 19 modal.style.display = "flex"; 20 content.innerHTML = "ÐагÑÑзка..."; 21 22 fetch("/index/62-2") 23 .then(res => res.text()) 24 .then(xmlText => { 25 const parser = new DOMParser(); 26 const xml = parser.parseFromString(xmlText, "application/xml"); 27 const contentNode = xml.querySelector('cmd[p="content"]'); 28 29 if (contentNode) { 30 const cdataText = contentNode.textContent; 31 content.innerHTML = cdataText; 32 33 // ÐобавлÑем ID к ÐºÐ°Ð¶Ð´Ð¾Ð¼Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ 34 const users = content.querySelectorAll("ul.uz li"); 35 users.forEach(item => { 36 const link = item.querySelector("a[href*='/index/8-']"); 37 if (link) { 38 const match = link.href.match(/\/index\/8-(\d+)/); 39 if (match) { 40 const id = match[1]; 41 const span = document.createElement("span"); 42 span.textContent = ` [ID ${id}]`; 43 span.style.cssText = "font-size:11px; color:#5f5e5e; margin-left:5px;"; 44 link.after(span); 45 } 46 } 47 }); 48 49 // СÑÑÑÑик 50 const count = users.length; 51 function getWord(n) { 52 if (n % 10 === 1 && n % 100 !== 11) return "полÑзоваÑелÑ"; 53 if ([2, 3, 4].includes(n % 10) && ![12, 13, 14].includes(n % 100)) return "полÑзоваÑелÑ"; 54 return "полÑзоваÑелей"; 55} 56 57 const counter = document.createElement("div"); 58 counter.textContent = `ð¥ ${count} ${getWord(count)}`; 59 counter.style.cssText = "margin-bottom: 8px; font-weight: bold;"; 60 content.prepend(counter); 61 } else { 62 content.innerHTML = "â ï¸ Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ ÑпиÑок."; 63 } 64 }) 65 .catch(err => { 66 content.innerHTML = "â ï¸ ÐÑибка загÑÑзки."; 67 console.error(err); 68 }); 69} 70 71// â ÐакÑÑÑие модалки 72function closeUserList() { 73 const modal = document.getElementById("userListModal"); 74 if (modal) modal.style.display = "none"; 75}
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.