1const hamburgerMenu = document.querySelector('.js-hamburger-menu'); 2const mobileNavbarCloseBtn = document.querySelector('.js-mobile-navbar-close-btn'); 3const mobileNavbar = document.querySelector('.js-mobile-navbar'); 4const searchBtn = document.querySelector('.js-search-button'); 5const searchInputContainer = document.querySelector('.js-search-input-container'); 6const searchResult = document.querySelector('.js-search-result'); 7const searchRecommend = document.querySelector('.js-search-recommend'); 8const searchInput = document.querySelector('.js-search-input'); 9const headerEl = document.querySelector(".main-header"); 10var sticky = headerEl.offsetTop +450; 11 12 13window.onscroll = function () { 14 /* 15 var y = $(this).scrollTop(); 16 if (y > 140) { 17 headerEl.addClass('sticky', 1000, 'swing'); 18 } 19 else { 20 headerEl.removeClass('sticky', 1000, 'swing'); 21 } 22 */ 23 24 if (parseInt(window.pageYOffset) >= 450) { 25 26 $('#navMobil').show(); 27 28 // headerEl.classList.add("sticky"); 29 //$(headerEl).fadeIn(); 30 } else { 31 32 $('#navMobil').hide(); 33 34 //headerEl.classList.remove("sticky"); 35 //$(headerEl).fadeOut(); 36 } 37 38 //console.log(parseInt(window.pageYOffset)) 39 40 41}; 42 43//hamburgerMenu?.addEventListener('click', (e) => { 44// e.preventDefault(); 45// mobileNavbar.classList.remove("left-100") 46// mobileNavbar.classList.add("left-0") 47//}) 48 49//mobileNavbarCloseBtn?.addEventListener('click', (e) => { 50// e.preventDefault(); 51// mobileNavbar.classList.remove("left-0"); 52// mobileNavbar.classList.add("left-100"); 53//}) 54 55searchBtn?.addEventListener('click', (e) => { 56 e.preventDefault(); 57 searchRecommend.classList.add("hidden") 58 searchBtn.classList.add("radius-0") 59 searchInputContainer.classList.remove("border-left-4") 60 searchResult.classList.remove("hidden") 61}) 62 63searchInput?.addEventListener('input', (e) => { 64 e.preventDefault(); 65 _setAkilliAramaTimer(e.target.value); 66 67 if (e.target.value === '') { 68 document.querySelector(".main-section-search_container").classList.remove('mb-12'); 69 document.querySelector(".main-section-search_container").classList.add('mb-16'); 70 searchRecommend.classList.add("hidden"); 71 searchBtn.classList.remove("radius-0"); 72 searchInputContainer.classList.add("border-left-4"); 73 searchResult.classList.add("hidden") 74 return; 75 } 76 77 if (!searchResult.classList.contains('hidden')) return; 78 79 document.querySelector(".main-section-search_container").classList.remove('mb-16'); 80 document.querySelector(".main-section-search_container").classList.add('mb-12'); 81 searchInputContainer.classList.remove("border-left-4"); 82 searchBtn.classList.add("radius-0"); 83 searchRecommend.classList.remove("hidden"); 84}) 85 86var _akilliAramaSonuc = $(".js-search-recommend ul"); 87var _timerAkilliArama = null; 88function _setAkilliAramaTimer(input) { 89 if (_timerAkilliArama != null) 90 clearInterval(_timerAkilliArama); 91 _timerAkilliArama = setInterval(function () { 92 akilliArama(input); 93 if (_timerAkilliArama != null) 94 clearInterval(_timerAkilliArama); 95 }, 600); 96} 97 98const escapeHtml = (unsafe) => unsafe.replace(/[&<>"']/g, (m) => ({ 99 "&": "&", 100 "<": "<", 101 ">": ">", 102 '"': """, 103 "'": "'" 104}[m])); 105 106function akilliArama(input) { 107 _akilliAramaSonuc.html("<li>Lütfen en az 3 karakter giriniz.</li>"); 108 109 if (typeof (input) == "undefined" || input == null || input.length < 3) 110 return; 111 input = escapeHtml(input); 112 113 _akilliAramaSonuc.html("<li>Lütfen bekleyin ...</li>"); 114 115 $.ajax({
116 type:'post', 117 url: '/Home/AkilliArama?arama=' + input, 118 dataType: 'json', 119 // cache: false, 120 success: function (veri) { 121 122 if (veri == null || veri.length == 0) { 123 _akilliAramaSonuc.html('<li>"' + input + '" aramanız ile ilgili sonuç bulunamadı.</li>'); 124 return; 125 } 126 127 var html = ''; 128 for (var i = 0; i < veri.length; i++) { 129 html += '<li><h5>' + veri[i].grupAdi + '</h5></li>'; 130 for (var j = 0; j < veri[i].items.length; j++) { 131 html += '<li><a href="' + veri[i].items[j].seoUrl + '" style="margin-left:10px;">' + veri[i].items[j].baslik + '</a></li>'; 132 } 133 } 134 135 _akilliAramaSonuc.html(html); 136 }, 137 error: function () { 138 elem.trigger('change'); 139 }, 140 }); 141} 142 143window.addEventListener('DOMContentLoaded', (event) => { 144 const currentPath = window.location.pathname; 145 const menuItems = document.querySelectorAll('.sidebar-item'); 146 147 menuItems.forEach(item => { 148 if (item.getAttribute('href') === currentPath) { 149 item.classList.add('active'); // 'active' sınıfını ekle 150 } 151 }); 152}); 153 154 155function acceptCookies() { 156 $('#cookieBanner').hide(); 157 localStorage.setItem('cookiesAccepted', 'true'); 158} 159 160function rejectCookies() { 161 $('#cookieBanner').hide(); 162 localStorage.setItem('cookiesAccepted', 'false'); 163} 164 165window.addEventListener('load', function () { 166 if (localStorage.getItem('cookiesAccepted') == "" || localStorage.getItem('cookiesAccepted') == undefined) { 167 $('#cookieBanner').css("display", "flex"); 168 } 169}); 170 171document.addEventListener("DOMContentLoaded", function () { 172 const menuItems = document.querySelectorAll(".navbar_menu > li"); 173 174 menuItems.forEach(function (item) { 175 const submenu = item.querySelector("ul"); 176 177 if (submenu) { 178 item.addEventListener("click", function (e) { 179 // EÄer submenu içindeki bir Åey tıklanırsa kapanmayı engelle 180 e.stopPropagation(); 181 182 // DiÄer açık menüleri kapat 183 document.querySelectorAll(".navbar_menu > li.open").forEach(function (el) { 184 if (el !== item) { 185 el.classList.remove("open"); 186 } 187 }); 188 189 // Menüyü aç/kapat 190 item.classList.toggle("open"); 191 }); 192 193 // submenu içinde tıklanırsa sayfaya yayılmasını engelle 194 submenu.addEventListener("click", function (e) { 195 e.stopPropagation(); 196 }); 197 } 198 }); 199 200 // Sayfanın baÅka bir yerine tıklanırsa açık menüler kapansın 201 document.addEventListener("click", function () { 202 document.querySelectorAll(".navbar_menu > li.open").forEach(function (el) { 203 el.classList.remove("open"); 204 }); 205 }); 206});
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.