1jQuery(document).ready(function ($) { 2 $.jMaskGlobals.watchDataMask = true; 3 4 $('.banner-slide').slick({ 5 slidesToShow: 1, 6 slidesToScroll: 1, 7 dots: false, 8 arrows: false, 9 infinite: false, 10 adaptiveHeight: true, 11 speed: 500, 12 autoplaySpeed: 6000, 13 fade: true, 14 autoplay: true, 15 draggable: false, 16 }); 17 18 slideJquerySlick($, '#slide-colunista'); 19 slideJquerySlick($, '#slide-edicao'); 20 slideJquerySlick($, '#slide-categoria'); 21 slideJquerySlick($, '#slide-edicao-anterior', 4); 22 slideJquerySlick($, '#slide-depoimentos', 1); 23 24 $('.marquee').marquee({ 25 duration: 25000, 26 gap: 0, 27 delayBeforeStart: 0, 28 direction: 'left', 29 duplicated: true, 30 pauseOnHover: true, 31 startVisible: true, 32 }); 33 34}); 35 36 37document.addEventListener("DOMContentLoaded", function () { 38 bgFUll(); 39 menu(); 40 menuSizeScroll(); 41 artigo_underline(); 42 login_modal(); 43 esqueci_senha_modal(); 44 apagarBusca(); 45}); 46 47window.addEventListener('resize', function (event) { 48 bgFUll(); 49 menuSizeScroll(); 50}, true); 51 52function slideJquerySlick($, id, slides = 3) { 53 if ($(id + ' .slide-artigo-relacao').length > 0) { 54 55 const dots_desktop = $(id).find('.dots-desktop .dots'); 56 const next_desktop = $(id).find('.dots-desktop .dot-next'); 57 const prev_desktop = $(id).find('.dots-desktop .dot-prev'); 58 59 const dots_mobile = $(id).find('.dots-mobile .dots'); 60 const next_mobile = $(id).find('.dots-mobile .dot-next'); 61 const prev_mobile = $(id).find('.dots-mobile .dot-prev'); 62 63 $(id + ' .slide-artigo-relacao').slick({ 64 slidesToShow: slides, 65 slidesToScroll: slides, 66 dots: true, 67 arrows: true, 68 infinite: false, 69 adaptiveHeight: true, 70 draggable: true, 71 appendDots: dots_desktop, 72 prevArrow: prev_desktop, 73 nextArrow: next_desktop, 74 responsive: [ 75 { 76 breakpoint: 768, 77 settings: { 78 arrows: true, 79 dots: true, 80 //centerMode: true, 81 //centerPadding: '40px', 82 slidesToShow: (slides - 1), 83 slidesToScroll: (slides - 1), 84 appendDots: dots_mobile, 85 prevArrow: prev_mobile, 86 nextArrow: next_mobile, 87 } 88 }, 89 { 90 breakpoint: 480, 91 settings: { 92 arrows: true, 93 dots: true, 94 //centerMode: true, 95 //centerPadding: '40px', 96 slidesToShow: 1, 97 slidesToScroll: 1, 98 appendDots: dots_mobile, 99 prevArrow: prev_mobile, 100 nextArrow: next_mobile, 101 } 102 } 103 ] 104 }); 105 106 107 } 108} 109 110function header_logo() { 111 bgFUll(); 112} 113 114function menu() { 115 const menuNav = document.querySelector('.nav-icon'); 116 const body = document.querySelector('body'); 117 const fullMenu = document.querySelector('.full-menu'); 118 const header = document.querySelector('header'); 119 const menuLandingPage = document.querySelector('.menu_landingpage'); 120 const closeMenu = document.getElementById('closeMenu'); 121 122 menuNav.addEventListener('click', function () { 123 menuSizeScroll(); 124 menuNav.classList.toggle('open'); 125 fullMenu.classList.toggle('open'); 126 header.classList.toggle('open'); 127 body.classList.toggle('overflow-hidden'); 128 }, false); 129 130 if (menuLandingPage !== null) { 131 menuLandingPage.addEventListener('click', function (e) { 132 e.preventDefault(); 133 menuSizeScroll(); 134 menuNav.classList.toggle('open'); 135 fullMenu.classList.toggle('open'); 136 header.classList.toggle('open'); 137 body.classList.toggle('overflow-hidden'); 138 }, false); 139 } 140 141 if (closeMenu !== null) { 142 closeMenu.addEventListener('click', function (e) { 143 e.preventDefault(); 144 close_menu(); 145 }, false); 146 } 147 148} 149 150function close_menu() { 151 const menuNav = document.querySelector('.nav-icon'); 152 const body = document.querySelector('body'); 153 const fullMenu = document.querySelector('.full-menu'); 154 const header = document.querySelector('header'); 155 156 menuSizeScroll(); 157 menuNav.classList.remove('open'); 158 fullMenu.classList.remove('open'); 159 header.classList.remove('open'); 160 body.classList.remove('overflow-hidden'); 161} 162 163function menuSizeScroll() { 164 let height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; 165 const menuFull = document.querySelector('.full-menu'); 166 const adminbar = document.querySelector('.admin-bar'); 167 const menuScroll = document.querySelector('.full-menu .scroll'); 168 const header = document.querySelector('header'); 169 170 if (adminbar !== null) { 171 height = height - 32; 172 } 173 174 if (menuScroll !== null && menuFull !== null) { 175 const altura_final = height - header.clientHeight - 10; 176 menuScroll.style['max-height'] = altura_final + 'px'; 177 } 178 179} 180 181function bgFUll() { 182 let height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; 183 const bgfull = document.getElementById('bg-full'); 184 const header = document.querySelector('header'); 185 const adminbar = document.querySelector('.admin-bar'); 186 187 if (adminbar !== null) { 188 height = height - 32; 189 } 190 191 if (null !== bgfull && null !== header && height > 0) { 192 //console.log('ajustar altura imagem...'); 193 let porcentagem = bgfull.dataset.porcentagem; 194 if (porcentagem === undefined) { 195 porcentagem = 1; 196 } 197 const altura_final = ((height - header.clientHeight) * porcentagem / 100); 198 bgfull.style.height = altura_final + 'px'; 199 200 } 201} 202 203function artigo_underline() { 204 const artigos_underline = document.querySelectorAll('.artigo-underline p'); 205 206 artigos_underline.forEach(function (artigo) { 207 const html = artigo.innerHTML; 208 artigo.innerHTML = '<span>' + html + '</span>'; 209 }); 210} 211 212function login_modal() { 213 214 const modalToggle = document.getElementById('loginModal'); 215 216 const myModal = new bootstrap.Modal(modalToggle); 217 218 document.querySelectorAll('.login-modal').forEach(function (el) { 219 el.addEventListener('click', function (e) { 220 e.preventDefault(); 221 222 close_menu(); 223 224 const modalToggleEsqueci = document.getElementById('esqueciModal'); 225 const modal = bootstrap.Modal.getInstance(modalToggleEsqueci); 226 227 if (null !== modal) { 228 modal.hide(); 229 } 230
231 myModal.toggle(); 232 }) 233 }); 234} 235 236function esqueci_senha_modal() { 237 238 const modalToggle = document.getElementById('esqueciModal'); 239 240 const myModal = new bootstrap.Modal(modalToggle); 241 242 document.querySelectorAll('.esqueci-senha-modal').forEach(function (el) { 243 el.addEventListener('click', function (e) { 244 e.preventDefault(); 245 246 close_menu(); 247 248 const modalToggleLogin = document.getElementById('loginModal'); 249 const modal = bootstrap.Modal.getInstance(modalToggleLogin); 250 251 if (null !== modal) { 252 modal.hide(); 253 } 254 255 myModal.toggle(); 256 }) 257 }); 258} 259 260function apagarBusca() { 261 const btnImg = document.querySelector('#apagarInput'); 262 const input = document.querySelector('#busca'); 263 264 if (input === null) { 265 return; 266 } 267 268 // verificar mudança de valores no input 269 input.addEventListener('input', function () { 270 if (input.value !== '') { 271 btnImg.style.display = 'block'; 272 } else { 273 btnImg.style.display = 'none'; 274 } 275 }); 276 277 btnImg.addEventListener('click', function () { 278 input.value = ''; 279 btnImg.style.display = 'none'; 280 }); 281 282}
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.