1function parseDate(dateString) { 2 const parts = dateString.split('/'); 3 const day = parseInt(parts[0], 10); 4 const month = parseInt(parts[1], 10) - 1; 5 const year = parseInt(parts[2], 10); 6 return new Date(year, month, day); 7} 8 9const hostName = window.location.origin; 10const pathName = window.location.pathname; 11 12if (hostName === window.location.origin && pathName === '/') { 13 function getPopups(data) { 14 const popupContainer = document.getElementById('popup-alertas'); 15 popupContainer.innerHTML = ''; 16 const now = new Date(); 17 18 const nowDay = String(now.getDate()).padStart(2, '0'); 19 const nowMonth = String(now.getMonth() + 1).padStart(2, '0'); 20 const nowYear = now.getFullYear(); 21 const formattedNow = `${nowDay}/${nowMonth}/${nowYear}`; 22 let mostrar_em = true; 23 data.forEach(popup => { 24 mostrar_em = popup.bn_mostrar_em 25 26 if (mostrar_em) { 27 const popupDate = parseDate(popup.data_publicar); 28 29 if (popup.bn_ativo && popupDate <= parseDate(formattedNow)) { 30 const popupElement = document.createElement('div'); 31 popupElement.classList.add('modal_TRT'); 32 const Style = document.createElement('style'); 33 Style.innerHTML = ` 34 <style> 35 36 .corpo_TRT a { 37 display: flex; 38 flex-direction: column; 39 text-decoration: none; 40 } 41 42 #popup-alertas { 43 width: 100% !important; 44 height: 100% !important; 45 position: fixed; 46 z-index: 999; 47 top: 0; 48 left: 0; 49 background: rgba(11, 11, 11, 0.12); 50 backdrop-filter: blur(2px); 51 display: flex; 52 align-items: center; 53 justify-content: center; 54 flex-direction: column; 55 } 56 57 #popup-alertas img { 58 max-width: 980px; 59 } 60 61 .corpo_TRT { 62 overflow: hidden; 63 display: flex; 64 flex-direction: column; 65 } 66 67 @media (max-width: 991px) { 68 .corpo_TRT { 69 margin: 0 20px; 70 } 71 } 72 73 @media (max-width: 1440px) { 74 .popup { 75 width: 100%; 76 } 77 } 78 79 @media (max-width: 1024px) { 80 .v--modal-overlay .v--modal-box { 81 left: 7em !important; 82 width: 850px !important; 83 height: auto !important; 84 top: 4em !important; 85 } 86 87 .popup { 88 width: 100%; 89 } 90 } 91 92 @media (max-width: 768px) { 93 .v--modal-overlay .v--modal-box { 94 left: 5em !important; 95 width: 635px !important; 96 top: 7em !important; 97 } 98 } 99 100 @media (max-width: 425px) { 101 .v--modal-overlay .v--modal-box { 102 left: 5px !important; 103 width: 415px !important; 104 top: 15em !important; 105 } 106 } 107 108 .btn-fechapopup { 109 text-transform: uppercase; 110 cursor: pointer; 111 transition: all 0.3s ease; 112 border:none; 113 border-radius: 8px; 114 background: red; 115 padding: 15px; 116 color: #fff; 117 font-size: 18px !important; 118 font-weight: bold; 119 margin: auto !important; 120 margin-top: 10px !important; 121 width: 60%; 122 } 123 .btn-fechapopup:hover {
124 background: darkred; 125 } 126 127 </style> 128 ` 129 popupElement.innerHTML = ` 130 131 <span class="corpo_TRT" onclick="closePopup()"> 132 <a href="${popup.nm_link}" target="_blank"> 133 <img class="popup" src="${popup.img_path}" alt="${popup.nm_descricao}"> 134 </a> 135 <button onclick="closePopup()" class="btn-fechapopup"> 136 Fechar 137 </button>' 138 </span> 139 `; 140 141 popupContainer.append(Style); 142 popupContainer.appendChild(popupElement); 143 } 144 } 145 }); 146 147 if (popupContainer.children.length > 0 && mostrar_em) { 148 popupContainer.style.display = 'flex'; 149 } 150 } 151} 152 153function closePopup() { 154 const popupContainer = document.getElementById('popup-alertas'); 155 popupContainer.style.display = 'none'; 156}
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.