1$(".menu-item-has-children > a").each(function (index) { 2 $(".menu-item-has-children > a")[index].setAttribute("href", "javascript:;"); 3}); 4 5// Força git 6// FUNÃÃO PARA VERIFICAR SE à FILHO 7function childOf(c, p) { 8 while ((c = c.parentNode) && c !== p); 9 return !!c; 10} 11 12// VARIÃVEIS 13var bodySelector = document.querySelector("body"); 14 15var mainHeader = document.querySelector("body>header"); 16 17var headerDiv = document.querySelector("body>header>div"); 18 19if (mainHeader) { 20 var mainHeaderHeight = mainHeader.offsetHeight; 21} 22 23var scrollInicial = 0; 24 25let sponsorSticky = document.getElementById("sponsored-sticky"); 26if ( 27 typeof document.getElementsByClassName("mobile-assine")[0] !== "undefined" 28) { 29 document.getElementsByClassName("mobile-assine")[0].style.top = "0"; 30} 31 32// evento Veja BTE View 33let elementView = [].slice.call( 34 document.querySelectorAll( 35 "body > main > section.block.edicao-semana > div > div > div.col-s-12.col-l-3 > div > div > a.link" 36 ) 37); 38const link_bte = document.querySelector( 39 "body > main > section.block.edicao-semana > div > div > div.col-s-12.col-l-3 > div > div > a.link" 40); 41let wh_link_bte = ""; 42if (link_bte) { 43 wh_link_bte = link_bte.getBoundingClientRect(); 44} 45var view = false; 46 47if ("" !== wh_link_bte && isInViewport(wh_link_bte)) { 48} else if ( 49 "IntersectionObserver" in window && 50 "IntersectionObserverEntry" in window && 51 "intersectionRatio" in window.IntersectionObserverEntry.prototype 52) { 53 let elementViewObserver = new IntersectionObserver(function ( 54 entries, 55 observer 56 ) { 57 entries.forEach(function (entry) { 58 if (entry.isIntersecting) { 59 elementViewObserver.unobserve(entry.target); 60 } 61 }); 62 }); 63 64 elementView.forEach(function (elView) { 65 elementViewObserver.observe(elView); 66 }); 67} 68// evento Veja BTE Click 69if (link_bte) { 70 link_bte.addEventListener("click", function () { 71 }); 72} 73 74// LISTENER PARA PEGAR SCROLL DA PÃGINA E DEIXAR MENU FIXADO 75window.addEventListener("scroll", function (event) { 76 var pageScrollTop = document.documentElement.scrollTop; 77 78 if (pageScrollTop > mainHeaderHeight + 1) { 79 if ( 80 typeof document.getElementsByClassName("mobile-assine")[0] !== "undefined" 81 ) { 82 document.getElementsByClassName("mobile-assine")[0].style.display = 83 "block"; 84 } 85 if ( 86 (mainHeader && mainHeader.style.paddingBottom == "0px") || 87 mainHeader.style.paddingBottom == "" 88 ) { 89 mainHeader.setAttribute( 90 "style", 91 "height:" + mainHeader.offsetHeight + "px" 92 ); 93 } 94 95 if (pageScrollTop > scrollInicial && window.innerWidth < 991) { 96 setTimeout(function () { 97 bodySelector.classList.remove("fixed"); 98 }, 200); 99 if (sponsorSticky !== null) { 100 setTimeout(function () { 101 sponsorSticky.classList.remove("fixed"); 102 }, 200); 103 } 104 if ( 105 typeof document.getElementsByClassName("mobile-assine")[0] !== 106 "undefined" 107 ) { 108 document.getElementsByClassName("mobile-assine")[0].style.top = "0"; 109 document.getElementsByClassName("mobile-assine")[0].style.marginBottom = 110 "-5px"; 111 if ($("body.branded-hub")) { 112 document.getElementsByClassName( 113 "mobile-assine" 114 )[0].style.marginBottom = "-15px"; 115 } 116 } 117 if (sponsorSticky !== null) { 118 setTimeout(function () { 119 sponsorSticky.classList.remove("fixed"); 120 }, 200); 121 } 122 bodySelector.classList.remove("searchOpen"); 123 } else { 124 bodySelector.classList.add("fixed"); 125 if ( 126 typeof document.getElementsByClassName("mobile-assine")[0] !== 127 "undefined" 128 ) { 129 document.getElementsByClassName("mobile-assine")[0].style.top = "52px"; 130 } 131 if (sponsorSticky !== null) { 132 sponsorSticky.classList.add("fixed"); 133 } 134 } 135 136 scrollInicial = pageScrollTop; 137 } else { 138 bodySelector.classList.remove("fixed"); 139 if ( 140 typeof document.getElementsByClassName("mobile-assine")[0] !== "undefined" 141 ) { 142 document.getElementsByClassName("mobile-assine")[0].style.top = "0"; 143 } 144 if (sponsorSticky !== null) { 145 sponsorSticky.classList.remove("fixed"); 146 } 147 if (mainHeader) { 148 mainHeader.setAttribute("style", "height:auto"); 149 } 150 } 151}); 152 153 154 155window.lazySizesConfig = window.lazySizesConfig || {}; 156window.lazySizesConfig.requireJs = function (modules, cb) { 157 window.require(modules, cb); 158}; 159 160$(".ingrediente-check").on("click", function (event) { 161 $(event.target).toggleClass("checked"); 162 $(event.target) 163 .closest("li")
164 .find(".ingrediente-formatado") 165 .toggleClass("checked"); 166}); 167 168$(".ingrediente-formatado").on("click", function (event) { 169 $(this).toggleClass("checked"); 170 $(this).prev().toggleClass("checked"); 171}); 172 173// Video Broadcast - Troca a thumbnail pelo iframe no cliq 174$(".video-overlay").click(function (e) { 175 e.preventDefault(); 176 var th = $(this); 177 var embed_url = th.data("src"); 178 var width = th.width(); 179 var height = th.height(); 180 var iframe = 181 '<iframe src="' + 182 embed_url + 183 '?mute=0&showinfo=0&controls=1&autoplay=1" width="' + 184 width + 185 '" height="' + 186 height + 187 '" frameborder="0" allow="autoplay" allowfullscreen></iframe>'; 188 th.parent().html(iframe); 189}); 190 191 192 193$( 194 ".injected-paywall .new-paywall-promotion-sign .new-paywall-promotion-sign-abril-button" 195).click(function () { 196 if (this.innerHTML == "Conheça outros planos") { 197 198 } else { 199 tituloOferta = jQuery(this).parent().parent().parent().parent(); 200 tituloOferta = tituloOferta[0].getAttribute("data-type"); 201 positionOferta = 202 $(".new-paywall-promotion-sign-abril-button").index(this) + 1; 203 204 } 205}); 206 207if (window.location.href.indexOf("ofertas") > -1) { 208 setTimeout(function () { 209 let queryString = window.location.search; 210 let urlParams = new URLSearchParams(queryString); 211 var pushOrigem = urlParams.get("utm_source"); 212 var tipoOrigem = urlParams.get("tipo_origem"); 213 214 }, 3500); 215 216 $(".new-paywall-promotion-sign-abril-button").click(function (e) { 217 e.stopPropagation(); 218 tituloOferta = jQuery(this).parent().parent().parent().parent(); 219 tituloOferta = tituloOferta[0].getAttribute("data-type"); 220 positionOferta = $(".new-paywall-promotion-sign-abril-button").index(this) + 1; 221 222 }); 223} 224 225if (document.readyState !== "loading") { 226 if ($("body.home").length > 0) { 227 removeLazyloadViewport(); 228 } 229} else { 230 document.addEventListener("DOMContentLoaded", function () { 231 if ($("body.home").length > 0) { 232 removeLazyloadViewport(); 233 } 234 }); 235} 236 237// Script que remove o lazyload da primeira dobra na home 238function removeLazyloadViewport() { 239 let firstBlock = $(".block:first"); 240 241 $(firstBlock) 242 .find("img") 243 .each(function (index, value) { 244 if (checkIsInViewport($(this))) { 245 $(this).removeAttr("loading"); 246 $(this).removeClass("lazyload"); 247 $(this).removeClass("lazyloaded"); 248 249 let datasrc = $(this).data('src'); 250 $(this).attr('src', datasrc); 251 } 252 }); 253} 254 255function checkIsInViewport(element) { 256 var rect = element[0].getBoundingClientRect(); 257 var isInViewport = 258 rect.top >= 0 && 259 rect.left >= 0 && 260 rect.bottom <= 261 (window.innerHeight || document.documentElement.clientHeight) && 262 rect.right <= (window.innerWidth || document.documentElement.clientWidth); 263 return isInViewport; 264} 265 266// Script que faz o lazy loading em imagens de background em blocos 267// Para utilizar, apenas incluir a classe lazy-bg no elemento e trocar o style="backgroung-img(url)", colocando o src como data-src, assim que ele aparecer no viewport a imagem será carregada 268function lazyloadBlockImage() { 269 let lazyBackgrounds = [].slice.call(document.querySelectorAll(".lazy-bg")); 270 271 if ( 272 "IntersectionObserver" in window && 273 "IntersectionObserverEntry" in window && 274 "intersectionRatio" in window.IntersectionObserverEntry.prototype 275 ) { 276 let lazyBackgroundObserver = new IntersectionObserver(function ( 277 entries, 278 observer 279 ) { 280 entries.forEach(function (entry) { 281 if (entry.isIntersecting) { 282 entry.target.style.backgroundImage = 283 "url(" + entry.target.dataset.src + ")"; 284 lazyBackgroundObserver.unobserve(entry.target); 285 } 286 }); 287 }); 288 289 lazyBackgrounds.forEach(function (lazyBackground) { 290 lazyBackgroundObserver.observe(lazyBackground); 291 }); 292 } 293} 294 295if (document.readyState !== "loading") { 296 lazyloadBlockImage(); 297 if ($("body.home").length > 0) { 298 removeLazyloadViewport(); 299 } 300} else { 301 document.addEventListener("DOMContentLoaded", function () { 302 lazyloadBlockImage(); 303 if ($("body.home").length > 0) { 304 removeLazyloadViewport(); 305 } 306 }); 307} 308 309if(document.body.classList.contains('archive') || document.body.classList.contains('search-results')){ 310 311 $("#leia-mais-bairro").on("click", function () { 312 console.log('entrou leia mais') 313 $("#leia-mais-bairro")[0].style.display = "none"; 314 $("#leia-menos-bairro")[0].style.display = "block"; 315 $(".o-que-fazer")[0].style.display = "block"; 316 $(".onde-ir")[0].style.display = "block";
317 $(".galeria-person")[0].style.display = "block"; 318 $('.sobre-bairro')[0].style.display = "block"; 319 }); 320 321 $("#leia-menos-bairro").on("click", function () { 322 console.log('entrou leia menos') 323 $("#leia-menos-bairro")[0].style.display = "none"; 324 $("#leia-mais-bairro")[0].style.display = "block"; 325 $('.sobre-bairro')[0].style.display = "-webkit-box"; 326 $(".o-que-fazer")[0].style.display = "none"; 327 $(".onde-ir")[0].style.display = "none"; 328 $(".galeria-person")[0].style.display = "none"; 329 }); 330 331 $(window).one('scroll',function() { 332 $('.fotos-galeria-person').each(function( index ) { 333 Fancybox.bind('[data-fancybox="gallery-tag-'+$( this )[0].getAttribute('dataIdGallery')+'"]', { 334 groupAll: true, 335 }); 336 }); 337 }); 338} 339 340if(document.body.classList.contains('tag')){ 341 $('.fotos-galeria-person').each(function( index ) { 342 Fancybox.bind('[data-fancybox="gallery-tag-'+$( this )[0].getAttribute('dataIdGallery')+'"]', { 343 groupAll: true, 344 }); 345 }); 346} 347 348if ($("#completeText")[0] !== undefined) { 349 var textoTagPerson = $("#completeText")[0].textContent; 350 if (textoTagPerson.length > 189) { 351 $("#ler-mais-person")[0].style.display = "initial"; 352 $("#ler-mais-person").on("click", function () { 353 $("#shortText")[0].style.display = "none"; 354 $("#completeText")[0].style.display = "block"; 355 $("#ler-mais-person")[0].style.display = "none"; 356 }); 357 } 358} 359 360$(document).ready(function () { 361 // verifica se a votação não está desabilitada pelo usuário já ter votado anteriormente 362 let changeText = false; 363 if ($(".kksr-disabled").length === 0) { 364 // Altera o texto da avaliação se não tiver votado 365 $("#kk_star_texto_avaliacao").text( 366 "Avalie essa receita e confira a classificação geral" 367 ); 368 369 // mapeia todos os elementos com a classe .kksr-star 370 var starChild = $(".kksr-star") 371 .map(function () { 372 return this; 373 }) 374 .get(); 375 376 // para cada elemento, encontra o elemento filho 377 $(starChild).each(function (star, value) { 378 $(star).each(function (el, value) { 379 // se o elemento filho possui nota, continua 380 if ($($(starChild)[value - 1]).attr("data-star") !== undefined) { 381 // atribui um evento de one ao clique, para selecionar a nota que o usuário der 382 $($(starChild)[value - 1]).one("click", function (el) { 383 $("#custom_rating_recipe").css("pointerEvents", "none"); 384 let currentVote = $(this).attr("data-star"); 385 gaSendEvent({ 386 "category": "Star Rating", 387 "action": "Voto do leitor", 388 "label": currentVote + " estrelas", 389 }); 390 391 // Descolore as estrelas do lado direito da votação se estiverem ativas 392 if (currentVote < 5) { 393 let activeStars = $(".kksr-stars-active .kksr-star"); 394 395 jQuery.each(activeStars, function (index, starActive) { 396 if (index > currentVote - 1) { 397 let starChildrenActive = $(starActive).find(".kksr-icon"); 398 starChildrenActive.css({ 399 "background-image": 400 "url(/wp-content/plugins/kk-star-ratings-custom/src/core/public/svg/inactive.svg)" 401 }); 402 } 403 }); 404 } 405 406 let starSiblingsp = []; 407 let starSiblingsPrev = $(this).prev(); 408 starSiblingsp.push($(this)); 409 410 // Colore as estrelas da votação 411 for (xp = 0; xp < 4; xp++) { 412 if ($(starSiblingsPrev).hasClass("kksr-star")) { 413 starSiblingsp.push($(starSiblingsPrev)); 414 starSiblingsPrev = $(starSiblingsPrev).prev(); 415 } 416 } 417 418 jQuery.each(starSiblingsp, function (index, starPrev) { 419 let starChildrenPrev = $(starPrev).find(".kksr-icon"); 420 starChildrenPrev.css({ 421 "background-image": 422 "url(/wp-content/plugins/kk-star-ratings-custom/src/core/public/svg/active.svg)" 423 }); 424 }); 425 426 if (changeText === false) { 427 setTimeout(function () { 428 $("#kk_star_texto_avaliacao").text( 429 "Classificação média dos usuários" 430 ); 431 432 // O plugin Star Rating possui também uma modificaçao que inclui o 433 // setTimeout, ao dar manutenção em um, não esquecer o outro 434 }, 1000); 435 } 436 changeText = true; 437 }); 438 } 439 }); 440 }); 441 } else { 442 if ($("#kk_star_texto_avaliacao").length !== 0) { 443 // Altera o texto da avaliação caso já tenha votado 444 $("#kk_star_texto_avaliacao").text("Classificação média dos usuários"); 445 } 446 } 447}); 448 449if ($(".MGID").length > 0) { 450 const mgidObserver = new IntersectionObserver((entries, observer) => {
451 entries.forEach(entry => { 452 if(entry.isIntersecting) { 453 mgidObserver.unobserve(entry.target); 454 gaSendEvent({ 455 "category": "Parceiros", 456 "action": "View", 457 "label": "MGID", 458 "ga_free": true 459 }); 460 } 461 }); 462 }, {}); 463 464 mgidObserver.observe(document.querySelector(".MGID")); 465} 466 467$( 468 '.sidebarMenu > ul > li.menu-item:not(.menu-item-has-children) > a, .sidebarMenu > ul > li.menu-item.menu-item-has-children > ul.sub-menu > li.menu-item > a' 469).click(function () { 470 var href = $(this).attr('href') 471 if ('javascript:;' !== href) { 472 if (href.indexOf('://') >= 0) { 473 gaSendEvent({ 474 category: 'Menu hamburguer', 475 action: 'Click', 476 label: href, 477 }) 478 } else { 479 gaSendEvent({ 480 category: 'Menu hamburguer', 481 action: 'Click', 482 label: window.location.origin + href, 483 }) 484 } 485 } 486 window.location = href 487 return false 488}) 489 490let menuOpener = document.querySelectorAll(".menuOpener"), 491 searchOpener = document.querySelectorAll(".searchOpener"), 492 itemHasChildren = document.querySelectorAll(".menu-item-has-children"); 493 494// LISTENER PARA ABRIR MENU QUANDO CLICADO 495menuOpener.forEach(function (e) { 496 e.addEventListener("click", function () { 497 498 bodySelector.classList.toggle("menuOpen"); 499 if (bodySelector.classList.contains("menuOpen")) { 500 gaSendEvent({ 501 "category": "Menu hamburguer", 502 "action": "View" 503 }); 504 } 505 }); 506}); 507 508// LISTENER PARA ABRIR A BUSCA QUANDO CLICADO 509searchOpener.forEach(function (e) { 510 e.addEventListener("click", function () { 511 window.location.href = '/busca'; 512 }); 513}); 514 515// LISTENER PARA FECHAR A BUSCA E O MENU QUANDO CLICADO EM UM LUGAR QUE NÃO SEJAM ELES 516document.addEventListener("click", function (e) { 517 if ( 518 typeof e.target.className !== "undefined" && 519 typeof e.target.className !== "object" 520 ) { 521 if ( 522 e.target.className.indexOf("searchOpener") == -1 &&
523 !childOf(e.target, document.querySelector(".searchOpener")) && 524 !childOf(e.target, document.querySelector(".searchOpener + form")) 525 ) { 526 bodySelector.classList.remove("searchOpen"); 527 } 528 if ( 529 e.target.className.indexOf("menuCloser") !== -1 || 530 (e.target.className.indexOf("menuOpener") == -1 && 531 !childOf(e.target, document.querySelector(".sidebarMenu")) && 532 !childOf(e.target, document.querySelector(".menuOpener"))) 533 ) { 534 bodySelector.classList.remove("menuOpen"); 535 } 536 } 537}); 538 539// LISTENER PARA ABRIR SUBMENU 540itemHasChildren.forEach(function (e) { 541 e.addEventListener("click", function () { 542 this.classList.toggle("active"); 543 }); 544}); 545 546 547 548// Seleciona a tag body 549const body = document.body; 550let eventSent = false; 551 552// Cria uma instância do MutationObserver 553const observer = new MutationObserver((mutationsList) => { 554 for (let mutation of mutationsList) { 555 if (mutation.attributeName === 'class' && body.classList.contains('mg-additional-page') && !eventSent) { 556 // Envia o evento pro GA 557 eventSent = true; 558 gaSendEvent({ 559 "category": "MGID BackButton", 560 "action": "Click", 561 "label": "" 562 }); 563 564 // Para de observar as mudanças 565 observer.disconnect(); 566 } 567 } 568}); 569 570// Configura o observer para observar alterações nos atributos 571observer.observe(body, { attributes: true }); 572 573// JS OFERTA AO VIVO TOPO COLAPSADO 574function manterMenuOfertaNoHeader() { 575 const body = document.querySelector('body'); 576 const subHeader = document.querySelector('.sub-header.container'); 577 const menu = document.querySelector('.menu-oferta-aovivo'); 578 579 if (!subHeader || !menu) return; 580 581 const isFixed = body.classList.contains('fixed'); 582 583 if (isFixed) { 584 const subHeaderBottom = subHeader.getBoundingClientRect().bottom; 585 586 menu.style.setProperty('position', 'fixed', 'important'); 587 menu.style.setProperty('top', `${subHeaderBottom}px`, 'important'); 588 menu.style.setProperty('left', '0', 'important'); 589 menu.style.setProperty('width', '100%', 'important'); 590 menu.style.setProperty('z-index', '999', 'important'); 591 } else { 592 menu.style.removeProperty('position'); 593 menu.style.removeProperty('top'); 594 menu.style.removeProperty('left'); 595 menu.style.removeProperty('width'); 596 menu.style.removeProperty('z-index'); 597 } 598} 599 600['scroll', 'resize', 'DOMContentLoaded', 'load'].forEach(event => { 601 window.addEventListener(event, manterMenuOfertaNoHeader); 602}); 603 604 605// EVENTO TEMPO REGRESSIVO DA OFERTA AO VIVO 606function isFixedMode() { 607 return document.body.classList.contains("fixed"); 608} 609 610function formatFullTime(totalSeconds, useSideLabels = false) { 611 const dias = Math.floor(totalSeconds / 86400); 612 const horas = Math.floor((totalSeconds % 86400) / 3600); 613 const minutos = Math.floor((totalSeconds % 3600) / 60); 614 const segundos = totalSeconds % 60; 615 616 const labelD = useSideLabels ? 'd' : 'Dias'; 617 const labelH = useSideLabels ? 'h' : 'Horas'; 618 const labelM = useSideLabels ? 'm' : 'Min'; 619 const labelS = useSideLabels ? 's' : 'Seg'; 620 621 const labelClass = useSideLabels ? 'label-side' : 'label-bottom'; 622 623 return ` 624 <span class="time-block"><span class="number">${dias}</span><span class="${labelClass}">${labelD}</span></span> : 625 <span class="time-block"><span class="number">${String(horas).padStart(2, '0')}</span><span class="${labelClass}">${labelH}</span></span> : 626 <span class="time-block"><span class="number">${String(minutos).padStart(2, '0')}</span><span class="${labelClass}">${labelM}</span></span> : 627 <span class="time-block"><span class="number">${String(segundos).padStart(2, '0')}</span><span class="${labelClass}">${labelS}</span></span> 628 `; 629} 630 631function formatTime(seconds, useSideLabels = false) { 632 const hora = String(Math.floor(seconds / 3600)).padStart(2, '0'); 633 const minuto = String(Math.floor((seconds % 3600) / 60)).padStart(2, '0'); 634 const segundo = String(seconds % 60).padStart(2, '0'); 635 636 const labelH = useSideLabels ? 'h' : 'Horas'; 637 const labelM = useSideLabels ? 'm' : 'Min'; 638 const labelS = useSideLabels ? 's' : 'Seg'; 639 640 const labelClass = useSideLabels ? 'label-side' : 'label-bottom'; 641 642 return ` 643 <span class="time-block"><span class="number">${hora}</span><span class="${labelClass}">${labelH}</span></span> : 644 <span class="time-block"><span class="number">${minuto}</span><span class="${labelClass}">${labelM}</span></span> : 645 <span class="time-block"><span class="number">${segundo}</span><span class="${labelClass}">${labelS}</span></span> 646 `; 647} 648 649function getSecondsUntil(endTimeString, endTimeMode = 'legacy') { 650 const now = new Date(); 651 const endTime = new Date(endTimeString.replace(' ', 'T')); 652 if (endTimeMode !== 'site') { 653 endTime.setHours(endTime.getHours() - 3); 654 } 655 const diff = Math.floor((endTime.getTime() - now.getTime()) / 1000); 656 return diff > 0 ? diff : 0; 657} 658 659function startCountdown() { 660 const normalTimer = document.getElementById('timerRegressivoNormal'); 661 const fixedTimer = document.getElementById('timerRegressivoFixed'); 662 663 if (!normalTimer || !fixedTimer) { 664 return; 665 } 666 667 const endTimeString = normalTimer.dataset.endTime; 668 const endTimeMode = normalTimer.dataset.endTimeMode || 'legacy'; 669 let countdown; 670 671 function updateTimer() { 672 const totalSeconds = getSecondsUntil(endTimeString, endTimeMode); 673 674 if (totalSeconds <= 0) { 675 clearInterval(countdown); 676 677 const finalHTMLNormal = formatTime(0, false); 678 const finalHTMLFixed = formatTime(0, true); 679 680 normalTimer.innerHTML = finalHTMLNormal; 681 fixedTimer.innerHTML = finalHTMLFixed; 682 const ofertaDiv = document.querySelector('.menu-oferta-aovivo'); 683 if (ofertaDiv) { 684 ofertaDiv.remove(); 685 } 686 687 return; 688 } 689 690 691 const seventyTwoHoursInSeconds = 72 * 3600; 692 693 const newHTMLNormal = totalSeconds > seventyTwoHoursInSeconds 694 ? formatFullTime(totalSeconds, false) 695 : formatTime(totalSeconds, false); 696 697 const newHTMLFixed = totalSeconds > seventyTwoHoursInSeconds 698 ? formatFullTime(totalSeconds, true) 699 : formatTime(totalSeconds, true); 700 701 if (normalTimer.innerHTML !== newHTMLNormal) { 702 normalTimer.innerHTML = newHTMLNormal; 703 } 704 705 if (fixedTimer.innerHTML !== newHTMLFixed) { 706 fixedTimer.innerHTML = newHTMLFixed; 707 } 708 709 const label = document.getElementById('labelTerminaAovivo'); 710 if (label) { 711 const twoHoursInSeconds = 2 * 3600; 712 label.textContent = totalSeconds >
712 twoHoursInSeconds ? 'TERMINA EM:' : 'ESTÃ TERMINANDO:'; 713 } 714 715 normalTimer.style.visibility = 'visible'; 716 fixedTimer.style.visibility = 'visible'; 717 } 718 719 updateTimer(); 720 countdown = setInterval(updateTimer, 1000); 721} 722 723window.addEventListener('DOMContentLoaded', startCountdown); 724 725const brandPartnerHeader = document.querySelectorAll(".brand-partner"); 726if (brandPartnerHeader.length) { 727 brandPartnerHeader.forEach(function (textD) { 728 const brandPartnerHeaderLink = textD.querySelector("a"); 729 if (brandPartnerHeaderLink) { 730 brandPartnerHeaderLink.addEventListener("click", function (event) { 731 gaSendEvent({ 732 "category": "Patrocinio Header", 733 "action": "Click", 734 "label": this.getAttribute("href"), 735 "ga_free": false 736 }); 737 }); 738 } 739 }); 740}
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.