PageSourceSearch

https://mais.opovo.com.br/includes/assets/opovomais/js/menu/new_menu2.min.js?733d07

js opovo.com.br collected 2026-09-24 08:28:13 UTC 6,607 bytes, 1 lines download raw bytes

1function menuIconsFix(){let t=document.querySelector(".btn.menu"),e=document.querySelector(".group-notification"),i=document.querySelector(".header-notification"),n=document.querySelector(".footer-notification");if(!e)return;let o=e.children,a=o[0],s=o[1],c=o[2],l=a.querySelector("a"),r=s.querySelector("button"),u=c.querySelector("button");t&&(t.classList="btn menu menu__btn"),a.classList="group-menu__item d-flex align-items-center",s.classList="group-menu__item menu-item__profile d-flex align-items-center",c.classList="group-menu__item d-flex align-items-center",l.classList="group-menu__btn btn btn-default icon-search p-0",r.classList="group-menu__btn btn btn-notifications profile-img",u.classList="group-menu__btn btn btn-notifications btn-default p-0",i.classList="header-notification c-menu__bb--dashed",n.classList="footer-notification c-menu__bt--dashed d-flex align-items-center justify-content-end pt-3",i.parentNode.parentNode.classList="menu-tab pt-3"}function notificationComponent(t){if(!t)return $(".alerta-notification p").text("Não há notificações disponíveis no momento."),$(".alerta-notification").show(),!1;let e=t.data&&t.data.image?t.data.image:null,i="";switch(t.notifications_type_id){case 1:i="Mensagens";break;case 2:i="Novidades"}let n=""+(e?`<figure class="detect-ratio rounded"><img src="${BASE64_SRC}" data-src="${e}" class="lazy" alt="Imagem da notificação: ${t.title}" onerror="errorImg(this)"></figure>`:""),o=""+(i?`<span class="tag-notification tag-alert font-weight-bold roboto">${i}</span>`:""),a=""+(t.description?`<p class="text-truncate-3 roboto">${t.description}</p>`:"");return`\n        <li class="mb-3 notification-item" data-categoria="${i.toLowerCase()}">\n          <a href="${t.link?t.link:"#"}" class="text-light d-flex">\n            ${n}\n            <div class="d-flex flex-column overflow-hidden">\n              <div class="info-notification d-flex align-items-center">\n                ${o}\n                <span class="text-muted  notification-time">\n                    ${t.time}\n                </span>\n              </div>\n              <h2 class="text-truncate-2 font-weight-bold mb-0">\n                ${t.title}\n              </h2>\n              ${a}\n            </div>\n          </a>\n        </li>`}function setGeralElements(t){var e={notifications:[]};e.notifications.ul=".list-notification",e.notifications.btn=document.getElementById("clear_notifications");let i=[],n=$(e.notifications.ul);if(!t)return i.push(notificationComponent(!1)),n.append(i),!1;setRedBall(t);try{$.each(t,function(t,e){i.push(notificationComponent(e))}),e.notifications.btn&&t.length>0&&(e.notifications.btn.setAttribute("last_time",t[0].created),e.notifications.btn.style="")}catch(e){console.log("err.message",e.message),console.log("data_elements",t)}0==i.length&&i.push(notificationComponent(!1)),n.append(i),initLazyObserver()}function setRedBall(t){let e=getLocalData("most_recent_notification_created")??0,i=0;t[0]&&(i=t[0].created),$("#btnNotification").attr("last_timestamp",i),i>e&&($(".btn-notifications[for=btnNotification]").addClass("notification-on"),$("#btnNotification").addClass("notification-on"))}function setDataNotifications(t){let e=t.data??null;e&&e.length>0?setGeralElements(e):setGeralElements(!1)}function checkFilterNotification(){$(".filter-input:checked").length>0?$(".filter-input:checked").each(function(){tipoNotificacao=$(this).attr("id");var t=$(`.notification-item[data-categoria=${tipoNotificacao}]`);"todas"==tipoNotificacao&&(t=$(".notification-item"),tipoNotificacao="notificações"),t.show(),$(".alerta-notification p").text(`Não há ${tipoNotificacao} disponíveis no momento.`),0==t.length&&$(".alerta-notification").show()}):$(".notification-item").show()}function getCleared(){return getLocalData("cleared_user")??{notifications:0}}function setCleared(t){window.setLocalData("cleared_user",t),window.setLocalData("all_user_notifications",null);let e={cleared:JSON.stringify(t)};sendRequestDefault("/call.php?class_name=notifications&method=setCleared",!1,e)}function verifyClearedResponse(t){console.log("response",t)}function sendRequestNotifications(t,e="GET",i=[],n=!1){var o={url:t,type:e,data:i};$.ajax(o).done(function(t){window.localStorage.setItem("last_date_notification_saved",(new Date).toJSON());var e=JSON.parse(t);n&&n(e)}).fail(function(t,e){console.error("retorno ["+e+"] | erro na requisição - "+JSON.stringify(o),t)})}function lodadMenuVerticais(){sendRequestMenu(`/_templates/opovomais/components/menu_verticais.html?${(new Date).getTime()}`,verifyVerticaisResponse)}function sendRequestMenu(t,e=!1){fetch(t,{method:"GET"}).then(t=>t.text()).then(t=>{e&&e(t)}
1).catch(function(i){console.error("erro na requisição ["+t+"]:",i),e&&e(!1)})}function verifyVerticaisResponse(t){if(!t||""==t)return;document.querySelector(".menu-options").innerHTML=t,document.getElementsByClassName("main-menu-close")[0].addEventListener("click",function(t){closeMenuExpanded()})}function lodadMenuUsuario(){sendRequestMenu(`/_templates/opovomais/components/menu_usuario.html?${(new Date).getTime()}`,verifyUsuarioResponse)}function verifyUsuarioResponse(t){if(!t||""==t)return;document.querySelector(".menu-profile").innerHTML=t,setDataUser(getLocalAuth()),document.getElementsByClassName("close-menu-profile")[0].addEventListener("click",function(t){closeMenuExpanded()})}$(document).ready(function(){let t=window.getLocalData("all_user_notifications",10);if(t)setDataNotifications(t);else if(window.init_js){if(!1===window.USER_LOGGED)return;insertRequestInQueue({type:"request_url",request:"/call.php?class_name=notifications&method=getAllNotifications",callback_success:setDataNotifications,local_cache_data:{slug:"all_user_notifications",life_time_minutes:10}})}else sendRequestNotifications("/call.php?class_name=notifications&method=getAllNotifications","POST",{},setDataNotifications);$(document).on("change",".filter-input",function(){$(".notification-item").hide(),$(".alerta-notification").hide(),checkFilterNotification()}),$(".menu-notification .btn-clear").click(function(){$(".menu-notification .container-notification").remove(),$(".alerta-notification").attr("role","alert").show(),checkFilterNotification();let t=getCleared();t.notifications=document.getElementById("clear_notifications").getAttribute("last_time"),setCleared(t),window.setLocalData("all_user_notifications",null)}),$("#btnNotification").click(function(){let t=$(this).attr("last_timestamp");window.setLocalData("most_recent_notification_created",t)})}),menuIconsFix(),lodadMenuVerticais(),lodadMenuUsuario();

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.