1function showPersistentGlobalNotify() { 2 const shownKey = "shownGlobalNotify"; 3 4 fetch("https://majesticredux.ru/cache/global_notification.json?ts=" + Date.now()) 5 .then(r => r.json()) 6 .then(data => { 7 const lastShown = localStorage.getItem(shownKey); 8 if (data.message && String(data.timestamp) !== lastShown) { 9 createGlobalNotification(data.type, data.message, data.sound || null, data.timestamp, data.style || "admin"); 10 11 } 12 }) 13 .catch(e => console.warn("â Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ Ð³Ð»Ð¾Ð±Ð°Ð»Ñное Ñведомление", e)); 14} 15 16showPersistentGlobalNotify(); 17 18function createGlobalNotification(type, message, sound = null, timestamp = null, style = "admin") { 19 const config = { 20 success: { icon: "https://majestic-mods.ru/images/icons_popup/succes.png", color: "#28a745", sound: "success.mp3" }, 21 error: { icon: "https://majestic-mods.ru/images/icons_popup/error.png", color: "#dc3545", sound: "error.mp3" }, 22 warn: { icon: "https://majestic-mods.ru/images/icons_popup/warning.png", color: "#ffc107", sound: "warning.mp3" }, 23 info: { icon: "https://majestic-mods.ru/images/icons_popup/info.png", color: "#17a2b8", sound: "info.mp3" }, 24 mmc: { icon: "https://majestic-mods.ru/images/icons_popup/mmc.png", color: "#e81c5a", sound: "kassa.mp3" } 25 }; 26 27 const { icon, color, sound: defaultSound } = config[type] || config.info; 28 let finalSound = sound || defaultSound; 29 30// ÐÑли ÑÑÐ¸Ð»Ñ "admin" â иÑполÑзоваÑÑ ÑпеÑиалÑнÑй звÑк 31if (style === "admin") { 32 finalSound = "notification.mp3"; 33} 34 35 36 if (timestamp && localStorage.getItem("shownGlobalNotify") === String(timestamp)) return; 37 38 let popup = document.getElementById("global-notify-box"); 39 if (popup) popup.remove(); 40 41 popup = document.createElement("div"); 42 popup.id = "global-notify-box"; 43 popup.className = "site-notification"; 44 popup.classList.add("type-" + type); 45 popup.classList.add("style-" + style); 46 popup.style.borderRight = `3px solid ${color}`; 47 48 // ÐаÑÐ¸Ð°Ð½Ñ Ð¾ÑоÑÐ¼Ð»ÐµÐ½Ð¸Ñ 49 popup.innerHTML = style === "admin" ? ` 50 <div class="site-notification-icon"><img src="${icon}" alt="${type}"></div> 51 <div class="site-notification-wrapper"> 52 <div class="site-notification-title">ð¢ СообÑение Ð¾Ñ Ð°Ð´Ð¼Ð¸Ð½Ð¸ÑÑÑаÑоÑа</div> 53 <div class="site-notification-text"></div> 54 </div> 55 <div class="site-notification-close" title="ÐакÑÑÑÑ">â</div> 56 ` : ` 57 <div class="site-notification-icon"><img src="${icon}" alt="${type}"></div> 58 <div class="site-notification-text"></div> 59 <div class="site-notification-close" title="ÐакÑÑÑÑ">â</div> 60 `; 61 62 popup.querySelector(".site-notification-text").innerHTML = message; 63 64 document.body.appendChild(popup); 65 requestAnimationFrame(() => popup.classList.add("notify-show")); 66 67 const audio = new Audio(`https://majestic-mods.ru/audio/${finalSound}`); 68 audio.play().catch(err => console.warn("ð ÐвÑк не воÑпÑоизводиÑÑÑ:", err)); 69 70 popup.querySelector(".site-notification-close").onclick = () => { 71 popup.classList.remove("notify-show"); 72 popup.classList.add("notify-hide"); 73 setTimeout(() => popup.remove(), 500); 74 if (timestamp) { 75 localStorage.setItem("shownGlobalNotify", String(timestamp)); 76 } 77 }; 78}
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.