1$(function () { 2 3 $(".op-c").removeClass("op-c").addClass("op-a"); 4 const $window = $(window); 5 const $body = $("body"); 6 const $fixHeader = $(".fix-header"); 7 const $botHeader = $(".fix-header.botheader"); 8 const $ads1 = $(".ads1"); 9 const $ads2 = $(".ads2"); 10 const $twoAds = $(".ads1, .ads2"); 11 const $container = $(".container-xl"); 12 const $footer = $("footer"); 13 const $siteTopElements = $(".site-top-elements"); 14 15 let fixHeaderHeight = $fixHeader.outerHeight() || 0; 16 let topElementsBottomValue = 0; 17 let topElementsHeightValue = 0; 18 let footerTop = 0; 19 let totalFixHeaderHeight = 0; 20 let adsHeight = 0; 21 let isTicking = false; 22 23 const refreshMetrics = () => { 24 const winWidth = $window.width(); 25 26 if (winWidth < 1200) { 27 $twoAds.addClass("d-none"); 28 } else { 29 $twoAds.removeClass("d-none"); 30 } 31 32 footerTop = $footer.length ? $footer.offset().top : $(document).height(); 33 adsHeight = Math.max($ads1.outerHeight() || 0, $ads2.outerHeight() || 0); 34 35 totalFixHeaderHeight = 0; 36 $fixHeader.each(function () { 37 totalFixHeaderHeight += $(this).outerHeight(); 38 }); 39 40 topElementsHeightValue = 0; 41 $siteTopElements.each(function () { 42 topElementsHeightValue += $(this).outerHeight(); 43 }); 44 45 calculateHorizontalMargins(); 46 }; 47 48 const calculateHorizontalMargins = () => { 49 if ($container.length === 0 || $window.width() < 1200) return; 50 let conLeft = $container.offset().left; 51 let conWidth = $container.outerWidth(); 52 let gap = 15; 53 54 let ads1Width = $ads1.outerWidth(); 55 if (ads1Width) { 56 $ads1.css("left", (conLeft - ads1Width - gap) + "px"); 57 } 58 59 let ads2Width = $ads2.outerWidth(); 60 if (ads2Width) { 61 let targetLeftPos = conLeft + conWidth + gap; 62 $ads2.css("left", targetLeftPos + "px"); 63 } 64 }; 65 66 const calculateTopElementsBottomValue = () => { 67 let maxBottomValue = 0; 68 let winScrollTop = $window.scrollTop(); 69 70 $siteTopElements.each(function () { 71 let $el = $(this); 72 if ($el.is(":visible")) { 73 let offset = $el.offset(); 74 if (offset) { 75 let bottom = (offset.top - winScrollTop) + $el.outerHeight(); 76 if (bottom > maxBottomValue) { 77 maxBottomValue = bottom; 78 } 79 } 80 } 81 }); 82 83 topElementsBottomValue = maxBottomValue; 84 }; 85 86 const stickHeaderLogic = () => { 87 calculateTopElementsBottomValue(); 88 let scrollTop = $window.scrollTop(); 89 const doFix = scrollTop >= topElementsHeightValue; 90 const isBannerCloseBottom = (scrollTop + totalFixHeaderHeight + adsHeight + 40) > footerTop; 91 92 if (isBannerCloseBottom) { 93 // Footer'a çarptıÄında: SabitliÄi boz, absolute yap 94 $fixHeader.removeClass("position-fixed top-0 headerfix-active").addClass("position-relative"); 95 $botHeader.css("margin-top", "0"); 96 $body.css("padding-top", "0"); 97 $twoAds.removeClass("position-fixed top-0").addClass("position-absolute") 98 .css({ 99 "top": (footerTop - adsHeight - 20) + "px", 100 "margin-top": "0" 101 }); 102 } else if (doFix) { 103 // Header ve Reklamlar Fixed 104 $fixHeader.removeClass("position-relative").addClass("position-fixed top-0 headerfix-active"); 105 $botHeader.addClass("position-fixed top-0 start-0 end-0").css("margin-top", fixHeaderHeight + "px"); 106 107 $twoAds.removeClass("position-absolute").addClass("position-fixed top-0") 108 .css({ 109 "top": "0", 110 "margin-top": (totalFixHeaderHeight + 20) + "px" 111 }); 112 113 $body.css("padding-top", totalFixHeaderHeight + "px"); 114 } else { 115 // Normal Durum (Sayfanın en üstü) 116 $fixHeader.removeClass("position-fixed top-0 headerfix-active").addClass("position-relative"); 117 $botHeader.removeClass("position-fixed top-0 start-0 end-0").css("margin-top", "0"); 118 119 $twoAds.removeClass("position-absolute").addClass("position-fixed top-0") 120 .css({ 121 "top": "0", 122 "margin-top": (topElementsBottomValue + 18) + "px" 123 }); 124 125 $body.css("padding-top", "0"); 126 } 127 128 isTicking = false; 129 }; 130 131 const onScroll = () => { 132 if (!isTicking) { 133 requestAnimationFrame(stickHeaderLogic);
134 isTicking = true; 135 } 136 }; 137 138 const throttledResizeHandler = throttle(() => { 139 refreshMetrics(); 140 onScroll(); 141 }, 100); 142 143 const resizeObserver = new ResizeObserver(throttledResizeHandler); 144 145 resizeObserver.observe(document.documentElement); 146 147 $window.on("scroll", onScroll); 148 149 refreshMetrics(); 150 stickHeaderLogic(); 151 152 const menus = () => { 153 let allMenus = $(".menu-cont-opener"); 154 155 allMenus.each((i, el) => { 156 let $this = $(el); 157 let menuTimeout; 158 159 $this.on("mouseenter", function() { 160 clearTimeout(menuTimeout); 161 $(this).addClass("active"); 162 }); 163 164 $this.on("mouseleave", function() { 165 menuTimeout = setTimeout(() => { 166 $(this).removeClass("active"); 167 }, 150); 168 }); 169 170 let openMenuItems = $this.find(".open-menu-item"); 171 172 openMenuItems.each((i, el) => { 173 let itemTimeout; 174 175 $(el).on("mouseenter", function() { 176 clearTimeout(itemTimeout); 177 $(this).addClass("active"); 178 }); 179 180 $(el).on("mouseleave", function() { 181 itemTimeout = setTimeout(() => { 182 $(this).removeClass("active"); 183 }, 150); 184 }); 185 }); 186 }); 187 }; 188 189 menus(); 190 191 var setCookie = function (cname, cvalue, exminutes = 10) { 192 const d = new Date(); 193 d.setTime(d.getTime() + (exminutes * 60 * 1000)); 194 let expires = "expires=" + d.toUTCString(); 195 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 196 } 197 198 var getCookie = function(cname) { 199 let name = cname + "="; 200 let ca = document.cookie.split(';'); 201 for(let i = 0; i < ca.length; i++) { 202 let c = ca[i]; 203 while (c.charAt(0) == ' ') { 204 c = c.substring(1); 205 } 206 if (c.indexOf(name) == 0) { 207 return c.substring(name.length, c.length); 208 } 209 } 210 return ""; 211 } 212 213 if(getCookie("cookiePolicy") !== "false"){ 214 $(".footer-end-bar").removeClass("d-none"); 215 }else{ 216 $(".footer-end-bar").remove(); 217 } 218 219 $(".close-footer-endbar").click(function(){ 220 $(this).closest(".footer-end-bar").remove(); 221 setCookie("cookiePolicy", false,30); 222 }); 223 224 const windowHrefChange = (link) => { 225 window.location.href = link; 226 } 227 228 let $dataPills = $("[data-bs-toggle='pill']"); 229 230 $dataPills.click(function(){ 231 let $this = $(this); 232 setCookie("activePill", $this.data("bs-target")); 233 }); 234 235 let controlPills = function(){ 236 if(getCookie("activePill") && $(`${getCookie("activePill")}`).length){ 237 238 $dataPills.removeClass("active"); 239 240 $(`[data-bs-target='${getCookie("activePill")}']`).addClass("active"); 241 242 $(".tab-content#v-pills-tabContent >.tab-pane").removeClass("active show"); 243 244 $(`${getCookie("activePill")}`).addClass("active show"); 245 246 } 247 } 248 249 controlPills(); 250 251 $("#popupAdvertClose").click(function(){ 252 setCookie('popupAdvertClose', true, 6); 253 }); 254 255 if(getCookie('popupAdvertClose') === '' || getCookie('popupAdvertClose') === 'false'){ 256 $("#popupAdvert").modal("show"); 257 } 258 259 let $articlePostDetail = $("#article_post_detail"); 260 261 if ($articlePostDetail.length) { 262 $articlePostDetail.html($articlePostDetail.html().replaceAll("style=", '')); 263 } 264 265 let $articleInside = $(".article-inside"); 266 267 if ($articleInside.length) { 268 269 $articleInside.html($articleInside.html().replaceAll("style=", '')); 270 } 271 272 let $loginWarning = $(".login-warning"); 273 274 if($loginWarning.length > 0){ 275 $loginWarning.html($loginWarning.html().replace("üye giriÅi", `<span class="user-operations c-pointer text-red user-login">üye giriÅi</span>`)) 276 $loginWarning.html($loginWarning.html().replace("üye olmalı", `<span class="user-operations c-pointer text-red user-register">üye olmalı</span>`)) 277 $loginWarning.html($loginWarning.html().replace("giriÅ yapabilir", `<span class="user-operations c-pointer text-red user-login">giriÅ yapabilir</span>`)) 278 $loginWarning.html($loginWarning.html().replace("kayıt olabilirsiniz", `<span class="user-operations c-pointer text-red user-register">kayıt olabilirsiniz</span>`)) 279 } 280 281 let $makeSlideableMobile = $(".makeSlideable-mobile"); 282 283 const sliderReplacementCode = function(){ 284 if($(window).width() < 500){ 285 286 $makeSlideableMobile.addClass("active"); 287 288 let newsGalleriesCont = $(".news-galleriesv8"); 289 290 // mobile-slider-replace-box 291 292 newsGalleriesCont.each(function(i, el){
293 let $this = $(el); 294 if($this.find(".mobile-slider-replace-box").length <= 1){ 295 let $sliderCont = $this.find(".mobile-slider-replace-box"); 296 $sliderCont.find('.galleriesv8-slider').removeClass("col-7").addClass("col-12 pt-1"); 297 if($sliderCont.find('.galleriesv8-slider').hasClass("slick-initialized")){ 298 $sliderCont.find('.galleriesv8-slider').slick("unslick"); 299 } 300 $this.siblings(".mobile-slider-place").append($sliderCont.clone(true).removeClass("position-absolute").addClass("mobile-slider")); 301 $this.find(".mobile-slider-replace-box.position-absolute").remove(); 302 303 } 304 }); 305 }else{ 306 $makeSlideableMobile.removeClass("active"); 307 let newsGalleriesCont = $(".news-galleriesv8"); 308 309 newsGalleriesCont.each(function(i, el){ 310 let $this = $(el); 311 if($this.siblings(".mobile-slider-place").find(".mobile-slider-replace-box").length){ 312 let $sliderCont = $this.siblings(".mobile-slider-place").find(".mobile-slider-replace-box"); 313 $sliderCont.find('.galleriesv8-slider').addClass("col-7").removeClass("col-12 pt-1"); 314 if($sliderCont.find('.galleriesv8-slider').hasClass("slick-initialized")){ 315 $sliderCont.find('.galleriesv8-slider').slick("unslick"); 316 } 317 $this.append($sliderCont.addClass('position-absolute').clone(true).removeClass("mobile-slider")); 318 $this.siblings(".mobile-slider-place").find(".mobile-slider-replace-box.mobile-slider").remove(); 319 320 } 321 }); 322 323 } 324 325 $(".galleriesv8-slider").each(function(i, el){ 326 let $this = $(el); 327 $this.removeClass("slider-items-wrapper"); 328 if(!$this.hasClass("slick-initialized")){ 329 $(el).slick({ 330 dots: false, 331 arrows: true, 332 slidesToShow: 6, 333 swipeToSlide: true, 334 speed: 400, 335 autoplay: true, 336 autoplaySpeed: 2500, 337 infinite: true, 338 waitForAnimate: false, 339 touchThreshold: 30, 340 responsive: [{ 341 breakpoint: 1025, 342 settings: { 343 slidesToShow: 5 344 } 345 }, 346 { 347 breakpoint: 768, 348 settings: { 349 slidesToShow: 4 350 } 351 }, 352 { 353 breakpoint: 500, 354 settings: { 355 slidesToShow: 3 356 } 357 }] 358 }).on('afterChange', function(event, slick, currentSlide){ 359 slick.$slides.each(function(i, el){ 360 let $el = $(el); 361 if($el.hasClass("slick-current") && $el.closest(".
361news-galleriesv8").length){ 362 $el.closest(".news-galleriesv8").find(".galleriesv8-img-box .galleriesv8-img").attr("src", $el.find("img").data('img-url')); 363 $el.closest(".news-galleriesv8").find(".galleriesv8-category").text($el.find("img").data('img-category')); 364 $el.closest(".news-galleriesv8").find(".galleriesv8-news-title").text($el.find("img").data('img-title')); 365 $el.closest(".news-galleriesv8").find("a").attr("href", $el.find("img").data('img-href')); 366 }else if($el.hasClass("slick-current") && $el.closest(".mobile-slider-place").length){ 367 $el.closest(".mobile-slider-place").siblings(".news-galleriesv8").find(".galleriesv8-img-box .galleriesv8-img").attr("src", $el.find("img").data('img-url')); 368 $el.closest(".mobile-slider-place").siblings(".news-galleriesv8").find(".galleriesv8-category").text($el.find("img").data('img-category')); 369 $el.closest(".mobile-slider-place").siblings(".news-galleriesv8").find(".galleriesv8-news-title").text($el.find("img").data('img-title')); 370 $el.closest(".mobile-slider-place").siblings(".news-galleriesv8").find("a").attr("href", $el.find("img").data('img-href')); 371 } 372 }); 373 }); 374 } 375 }); 376 377 $(".galleriesv8-slider .slider-item").on("click", function(){ 378 $(this).closest(".news-galleriesv8").find(".galleriesv8-slider").slick('slickGoTo', $(this).data("slick-index")); 379 }); 380 } 381 382 sliderReplacementCode(); 383 384 $(window).resize(debounce(function(){ 385 sliderReplacementCode(); 386 }, 250)); 387 388 $(document).on("click", ".getPageUrl", function(){ 389 $("#copyPageLinkInput").val(window.location.href); 390 }); 391 392 $('.share-btn').each(function () { 393 if ($(this).data('handled')) return; 394 395 // Click eventini tanımla 396 $(this).on('click', function (e) { 397 e.stopPropagation(); 398 e.preventDefault(); 399 const link = $(this).data('link'); 400 401 if (link) { 402 navigator.clipboard.writeText(link).then(() => { 403 const toastHTML = ` 404 <div class="toast align-items-center text-bg-success border-0 position-fixed bottom-0 end-0 m-3" role="alert" aria-live="assertive" aria-atomic="true"> 405 <div class="d-flex"> 406 <div class="toast-body"> 407 BaÄlantı panoya kopyalandı! 408 </div> 409 <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button> 410 </div> 411 </div> 412 `; 413 414 const $toast = $(toastHTML); 415 $('body').append($toast); 416 const toast = new bootstrap.Toast($toast[0]); 417 toast.show(); 418 419 setTimeout(() => { 420 $toast.remove(); 421 }, 2000); 422 }).catch(err => { 423 console.error('BaÄlantı panoya kopyalanamadı: ', err); 424 }); 425 } 426 }); 427 428 $(this).data('handled', true); 429 }); 430 431 $(".copy-page-url").click(function(){ 432 let url = $("#copyPageLinkInput"); 433 url[0].select(); 434 url[0].setSelectionRange(0, 99999); 435 436 navigator.clipboard.writeText(url.val()); 437 }) 438 439 $(".user-operations, .sidemenu-user-login, .sidemenu-user-register").click(function(){ 440 $(".user-operations-container").parent().fadeIn("fast"); 441 }); 442 443 $(".trigger-search-news").click(function(){ 444 $(".header-search-bar").fadeIn("fast"); 445 $(".header-search-bg").fadeIn("fast"); 446 }) 447 $(".header-search-bg").click(function(){ 448 $(".header-search-bar").fadeOut("fast"); 449 $(".header-search-bg").fadeOut("fast"); 450 }) 451 452 $(".close-bottom-ad-btn").click(function() { 453 $(".bottom-advert-cont").fadeOut(300); 454 });
455 456 $(".user-operations").click(function(){ 457 $(".user-operations-container").fadeIn("fast"); 458 }); 459 460 let $leftMenuContainer = $(".left-menu-container"); 461 462 $(".close-left-menu").click(function(){ 463 $leftMenuContainer.fadeOut("fast"); 464 }); 465 466 $(".open-left-menu, .side-menu-open").click(function(){ 467 $leftMenuContainer.fadeIn("fast"); 468 }) 469 470 $(".user-operations-container").mousedown(function(e){ 471 if(e.target.classList.value.indexOf("user-operations-container") > -1){ 472 $(".user-operations-container").parent().fadeOut("fast"); 473 } 474 }) 475 476 $leftMenuContainer.click(function(e){ 477 if(e.target.classList.value.indexOf("left-menu-container") > -1){ 478 $leftMenuContainer.fadeOut("fast"); 479 } 480 }) 481 482 $(".user-login, .sidemenu-user-login").click(function(){ 483 $(".user-register, .user-login").removeClass("text-danger"); 484 $(".register-stick, .login-stick").removeClass("bg-red").addClass("bg-dark"); 485 $(".register-box").addClass("d-none").removeClass("d-block"); 486 $(".login-box").addClass("d-block").removeClass("d-none"); 487 $(".login-stick").removeClass("bg-dark").addClass("bg-red"); 488 }); 489 490 $(".user-register, .sidemenu-user-register").click(function(){ 491 $(".user-register, .user-login").removeClass("text-danger"); 492 $(".register-stick, .login-stick").removeClass("bg-red").addClass("bg-dark"); 493 $(".register-box").addClass("d-block").removeClass("d-none"); 494 $(".login-box").addClass("d-none").removeClass("d-block"); 495 $(".register-stick").removeClass("bg-dark").addClass("bg-red"); 496 }); 497 498 $(".slick-slider .slick-dots button").hover(function(){ 499 $(this).closest(".slick-slider").slick('slickGoTo', $(this).text()-1); 500 }); 501 502 $(".slick-dots").each(function() { 503 $(this).find("button").each(function(i) { 504 var href = $(this).closest(".slick-dots").parent().find(".slick-slide").eq(i+1).prop("href"); 505 href = href ? href : $(this).closest(".slick-dots").parent().find(".slick-slide").eq(i+1).find("a").attr("href"); 506 $(this).attr("href", href); 507 $(this).click(function() { 508 window.location.href = href; 509 }); 510 }); 511 }); 512 513 $(".survey-answer").click(function(){ 514 $(this).closest(".survey-answer-box").find("input[type='radio']").prop("checked", true); 515 }); 516 517 $(".fast-access button").click(function(){ 518 $(".tab-name").text($(this).text()); 519 }); 520 $(".api-newspaper").click(function(){ 521 $("#full_screen_newspaper").attr("src",$(this).attr("src").replace("gazetelerimg","gazetelerimgkirpilmamis")) 522 }); 523 $(".egazete-slider, .kimdir-slider, .yazarlar-slider").removeClass("preview_opacity"); 524 525 $(".new-firm-like, .firm-star").click(function(){ 526 $(this).toggleClass("active"); 527 }); 528 529 $(".hidden-cont-opener").click(function(){ 530 let $footerCont = $(".footer-hidden-cont"); 531 let $this = $(this); 532 $footerCont.toggleClass("active"); 533 if($footerCont.hasClass("active")){ 534 $this.removeClass("fa-caret-down py-0").addClass("fa-caret-up"); 535 }else{ 536 $this.addClass("fa-caret-down py-0").removeClass("fa-caret-up"); 537 } 538 }); 539 540 $(".firm-list-sss").click(function(){ 541 $(this).toggleClass("opened"); 542 $(this).find('.firm-list-sss-answer').css({"margin-top":$(this).outerHeight()}); 543 }); 544 545 $(".fikstur-table-button").click(function(){ 546 $(".fikstur-table-button").removeClass("active"); 547 $(this).toggleClass("active"); 548 }); 549 550 let $firmDetailCommentStar = $(".firm-detail-comment-star"); 551 552 $firmDetailCommentStar.click(function(){ 553 const activatedStar = `<svg xmlns="http://www.w3.org/2000/svg" width="28.133" height="27.1" viewBox="0 0 23.071 22.209"><g transform="translate(0 0)"><path d="M23.071,18.052,14.688,17.5,11.531,9.569,8.374,17.5,0,18.052l6.423,5.454L4.315,31.778l7.216-4.561,7.216,4.561L16.64,23.505Z" transform="translate(0 -9.569)" fill="#f0b440"/></g></svg>`; 554 const deactivatedStar = `<svg xmlns="http://www.w3.org/2000/svg" width="28.133" height="27.1" viewBox="0 0 28.133 27.1"><g transform="translate(2.529 2.704)"><g transform="translate(0 0)"><path d="M23.071,18.052,14.688,17.5,11.531,9.569,8.374,17.5,0,18.052l6.423,5.454L4.315,31.778l7.216-4.561,7.216,4.561L16.64,23.505Z" transform="translate(0 -9.569)" fill="none" stroke="#f0b440" stroke-width="2"/></g></g></svg>`; 555 556 $firmDetailCommentStar.html(deactivatedStar); 557 558 for(let i = 0; i <= $(this).index(); i++){
559 $firmDetailCommentStar.eq(i).html(activatedStar); 560 } 561 }); 562 563 if($(window).width() <= 768){ 564 setInterval( 565 function(){ 566 if($(".admin-sort-item").hasClass("ui-sortable-handle")){ 567 $(".admin-sort-item").removeClass("ui-sortable-handle"); 568 clearInterval(this); 569 } 570 }, 1000); 571 } 572 573 $("#gazete-mansetleri-tablinks .nav-item .nav-link").on("click", function(){ 574 if($(`${$(this).data('bs-target')} .sidebar-news-icon-list`).hasClass('slick-initialized')){ 575 $(`${$(this).data('bs-target')} .sidebar-news-icon-list`).slick('refresh'); 576 } 577 }); 578 579 let defaultFontSize = parseInt($(".article_post_detail p").css("font-size")?.replace('px', '')); 580 let newsDetailFontSize = defaultFontSize; 581 582 $(document).on("click", ".news-operation-button", throttle(function(){ 583 let articlePostSelector = $(`.article_post_detail p`); 584 let articleHeadingsSelector = $('.article_post_detail h2, .article_post_detail h3, .article_post_detail h4, .article_post_detail h5, .article_post_detail h6'); 585 let summaryPostSelector = $(`.post-summary p, .post-summary h2, .post-summary h3, .post-summary h4, .post-summary h5, .post-summary h6`); 586 587 if ($(this).data("operation") === "increase") { 588 newsDetailFontSize += 1; 589 } else if ($(this).data("operation") === "decrease") { 590 newsDetailFontSize -= 1; 591 } else { 592 newsDetailFontSize = defaultFontSize; 593 } 594 595 articlePostSelector.css({ 596 "font-size": `${newsDetailFontSize}px`, 597 "line-height": `${newsDetailFontSize + 10}px` 598 }); 599 600 articleHeadingsSelector.each(function() { 601 let tag = $(this).prop("tagName").toLowerCase(); 602 let increment = 0; 603 switch(tag) { 604 case 'h2': increment = 10; break; 605 case 'h3': increment = 8; break; 606 case 'h4': increment = 6; break; 607 case 'h5': increment = 4; break; 608 case 'h6': increment = 2; break; 609 } 610 $(this).css({ 611 "font-size": `${newsDetailFontSize + increment}px`, 612 "line-height": `${newsDetailFontSize + increment + 10}px` 613 }); 614 }); 615 616 summaryPostSelector.css({ 617 "font-size": `${newsDetailFontSize}px`, 618 "line-height": `${newsDetailFontSize + 10}px` 619 }); 620 }, 250)); 621 622 623 624 $(document).on("click", ".open-mobile-shares", function(){ 625 $(this).closest(".socialmedias-and-share-container").find(".mobile-social-medias-container").toggleClass("d-none"); 626 }); 627 628 $(".col-three-ads-cont img").addClass("col-three-advert"); 629 630 $(".header-side-weather-box").click(function(){ 631 let $this = $(this); 632 $this.toggleClass("active"); 633 $this.find('.weather-select-open-box').css({ 634 top: $this.offset().top + $this.height() + 10 635 }); 636 }); 637 638 window.makeSlideable = function(slidingElement){ 639 let isDragging = false; 640 let isMoving = false; 641 let startPositionX; 642 let startScrollLeft; 643 let dragElement = slidingElement; 644 645 dragElement.mousedown(function(e) { 646 if ($(e.target).closest('select').length > 0) return; 647 isDragging = true; 648 startPositionX = e.clientX; 649 startScrollLeft = this.scrollLeft; 650 e.preventDefault(); 651 }); 652 653 $(document).mouseup(function() { 654 isDragging = false; 655 }); 656 657 dragElement.mousemove(function(e) { 658 if (!isDragging) return; 659 660 if (!isMoving) { 661 requestAnimationFrame(() => { 662 let deltaX = startPositionX - e.clientX; 663 this.scrollLeft = startScrollLeft + deltaX; 664 isMoving = false; 665 }); 666 isMoving = true; 667 } 668 }); 669 670 dragElement.mouseleave(function() { 671 if (isDragging) { 672 isDragging = false; 673 } 674 }); 675 676 dragElement.on("touchstart", function(e) { 677 if ($(e.target).closest('select').length > 0) return; 678 isDragging = true; 679 startPositionX = e.touches[0].clientX; 680 startScrollLeft = this.scrollLeft; 681 }); 682 683 dragElement.on("touchend", function() { 684 isDragging = false; 685 }); 686 687 dragElement.on("touchmove", function(e) { 688 if (!isDragging) return; 689 690 if (!isMoving) { 691 requestAnimationFrame(() => { 692 let deltaX = startPositionX - e.touches[0].clientX; 693 this.scrollLeft = startScrollLeft + deltaX; 694 isMoving = false; 695 }); 696 isMoving = true; 697 } 698 }); 699 } 700 701 makeSlideable($(".makeSlideable")); 702 703 // if($(window).width() < 500){ 704 // makeSlideable($(".makeSlideable-mobile"));
705 // } 706 707 let totalFixedHeight = 0; 708 setTimeout(() => { 709 $(".fix-header").each(function() { 710 totalFixedHeight += $(this).height(); 711 }); 712 713 $(".columnSticky").theiaStickySidebar({ 714 additionalMarginTop: totalFixedHeight + 20, 715 updateSidebarHeight: false 716 }); 717 718 let isRefreshed = false; 719 720 const observer = new MutationObserver((mutations) => { 721 mutations.forEach((mutation) => { 722 if (!isRefreshed && mutation.addedNodes.length > 0) { 723 isRefreshed = true; 724 setTimeout(() => { 725 isRefreshed = false; 726 }, 1000); 727 } 728 }); 729 }); 730 731 const targetNode = document.querySelector('.columnSticky'); 732 if (targetNode) { 733 observer.observe(targetNode, { childList: true, subtree: true }); 734 } 735 736 }, 2000); 737 738 $(".have-search-table").addClass("position-relative").prepend(` 739 <div class="position-absolute top-0 end-0 rounded-bottom-1 rounded-start-1 bg-white py-1 px-2 z-1"> 740 <div class="table-search-box d-flex flex-row align-items-center"> 741 <input class="form-control search-currency-name d-none me-1" placeholder="Ara" type="text"> 742 <button class="btn search-currency-name-btn border-0 outline-0 p-0"> 743 <i class="fa fa-search fs-22" aria-hidden="true"></i> 744 </button> 745 </div> 746 </div> 747 `); 748 749 $(document).on("click", ".search-currency-name-btn", function(){ 750 $(this).closest(".table-search-box").find(".search-currency-name").val(''); 751 $(document).find(".search-currency-name").trigger("input"); 752 $(this).closest(".table-search-box").find(".search-currency-name").toggleClass("d-none"); 753 754 }); 755 756 $(document).on("input", ".search-currency-name", debounce(function(){ 757 let value = $(this).val().toLocaleLowerCase(navigator.language || navigator.userLanguage); 758 759 let parent = $(this).closest(".have-search-table"); 760 761 parent.find(`.${parent.data("search-class")}`).each(function(){ 762 if($(this).text().toLocaleLowerCase(navigator.language || navigator.userLanguage).indexOf(value) > -1){ 763 $(this).closest("tr").show(); 764 } 765 else{ 766 $(this).closest("tr").hide(); 767 } 768 } 769 ); 770 771 if($(this).val() == ""){ 772 $(`.${parent.data("search-class")}`).closest("tr").show(); 773 } 774 }, 300)); 775 776 window.refreshRelateNews = function () { 777 $(".related-news-box").each(function() { 778 const link = $(this).data("related-new-link"); 779 if (link && link.trim() !== "") { 780 $(this).wrap('<a href="' + link + '"></a>'); 781 } 782 const color = $(this).find("[data-related-color]").data("related-color"); 783 if (color) { 784 $(this).find(".related-news-box-bg").css("background", color); 785 } 786 $(this).closest("td").addClass("border-0 p-0").closest("tr").addClass("border-0 p-0").closest("tbody").addClass("border-0 p-0").closest("figure").addClass("m-0"); 787 }); 788 } 789 790 refreshRelateNews(); 791 792 $(".economic-calendar-filter-box .open-filter-box").click(function(){ 793 $(this).closest(".economic-calendar-filter-box").toggleClass("active"); 794 }); 795 796 $(".focus-clear").on("focus", function(){ 797 $(this).val(''); 798 }); 799 800 $(".gazete-mansetleri-select-box select").on("change", function(){ 801 windowHrefChange($(this).val()); 802 }); 803 804 $(".process-response-cont.just-info").fadeOut(3000); 805 806 $(".comment-delete").click(function(){ 807 $(this).addClass("deleteInProgress"); 808 }); 809 810 // $(".duty-pharmacies-btn") 811 812 $(".viewImageFullScreen").on("click", function() { 813 814 return ''; 815 816 let imageCounts = $(".viewImageFullScreen").length; 817 818 $("body").append(` 819 <div class="fullScreenImgBg position-fixed top-0 start-0 bottom-0 end-0 z-3 d-flex align-items-center justify-content-center" style="background: #00000021;"> 820 <img class="fullScreenIMG" style="max-width:100%;max-height:100%; width:calc(100% - 5vw); object-fit:contain" src="${$(this).attr("src")}" data-img-number="${$(this).data("img-sort")}" /> 821 822 <div class="position-absolute top-0 w-100 d-flex"> 823 <i class="close-gallery fa fa-times c-pointer fs-40 ms-auto me-lg-4 me-md-4 me-2 mt-3" aria-hidden="true"></i> 824 </div> 825 826 <div class="arrow-cont d-none position-absolute w-100 d-flex flex-row justify-content-between"> 827 <div class="change-img-btn me-auto ms-lg-5 ms-md-4 ms-2" data-prop-val="-1"> 828 <i class="fa fa-chevron-left c-pointer fs-40" aria-hidden="true"></i> 829 </div> 830 831 <div class="change-img-btn ms-auto me-lg-5 ms-md-4 me-2" data-prop-val="1"> 832 <i class="fa fa-chevron-right c-pointer fs-40" aria-hidden="true"></i> 833 </div> 834 </div> 835 </div> 836 `); 837 838 if (imageCounts > 1) { 839 $(".fullScreenImgBg").find(".arrow-cont").removeClass("d-none"); 840 841 $(".change-img-btn").click(function() { 842 let $arrow = $(this); 843 let imgSortNumber = parseInt($arrow.closest(".fullScreenImgBg").find("img").data("img-number")); 844 let newImgSortNumber = imgSortNumber + parseInt($arrow.data("prop-val")); 845 846 if (newImgSortNumber > 0 && newImgSortNumber <= imageCounts) { 847 $(".fullScreenIMG").attr("src", $(`[data-img-sort=${newImgSortNumber}]`).attr("src")) 848 .data("img-number", newImgSortNumber); 849 } 850 }); 851 } 852 853 $(".fullScreenImgBg").click(event => {
854 let $this = $(event.target); 855 if ($this.hasClass("fullScreenImgBg") || $this.hasClass("close-gallery")) { 856 $this.closest(".fullScreenImgBg").remove(); 857 } 858 }); 859 860 }); 861 862 $(".gobackbtn").on("click", function(){ 863 window.history.back(); 864 }); 865 866 let isStorySwiping = false; 867 let holdTimeout; 868 869 $(".story1-slider, .story2-slider").on('mousedown touchstart', function() { 870 const $slider = $(this); 871 872 holdTimeout = setTimeout(function() { 873 isStorySwiping = true; 874 $slider.find(".story-item").addClass("pe-none"); 875 }, 150); 876 }); 877 878 $(document).on('mouseup touchend', function() { 879 clearTimeout(holdTimeout); 880 881 if (isStorySwiping) { 882 setTimeout(function() { 883 $(".story1-slider, .story2-slider").find(".story-item").removeClass("pe-none"); 884 isStorySwiping = false; 885 }, 100); 886 } 887 }); 888 889 $(document).on('mouseup touchend', function() { 890 clearTimeout(holdTimeout); 891 892 if (isStorySwiping) { 893 setTimeout(function() { 894 $(".story1-slider, .story2-slider").find(".story-item").removeClass("pe-none"); 895 isStorySwiping = false; 896 }, 100); 897 } 898 }); 899 900 var storyTimeoutRef; 901 var $focusedStoryItemIndex; 902 903 const progressTimerFunc = () => { 904 $(".story-progress-bar-cont .story-progress-bar .bar-partial").css("animation","none"); 905 let $targetProgressElement = $(".story-progress-bar-cont .story-progress-bar").eq($focusedStoryItemIndex); 906 let progressTimer = $targetProgressElement.data('progress-timer'); 907 908 clearTimeout(storyTimeoutRef); 909 910 $targetProgressElement.find(".bar-partial").css({ 911 animationName: "fillProgress", 912 animationDuration: `${progressTimer}s`, 913 animationTimingFunction: "linear" 914 }); 915 916 storyTimeoutRef = setTimeout(() => { 917 $(".next-story").click(); 918 progressTimerFunc(); 919 }, progressTimer * 1000); 920 }; 921 922 923 $(".story-el-cont .story-item").click(function(event){ 924 925 if (isStorySwiping) { 926 event.preventDefault(); 927 return; 928 } 929 930 let $this = $(this); 931 932 $(".story-el-cont .story-item").removeClass("focused-story").closest(".story-el-cont").removeClass("focused-stories-cont"); 933 934 $this.addClass("focused-story").closest(".story-el-cont").addClass("focused-stories-cont"); 935 936 const focusedStoryArray = []; 937 938 $(".story-el-cont.focused-stories-cont").find(".story-item").each(function(i, el){ 939 let $storyItem = $(el); 940 941 if($storyItem.hasClass("focused-story")){ 942 $focusedStoryItemIndex = i; 943 } 944 945 focusedStoryArray.push({ 946 "story_title": $storyItem.data("story-title"), 947 "story_src": $storyItem.data("story-src"), 948 "story_src_type": $storyItem.data("story-src-type"), 949 "story_link": $storyItem.data("story-link") || "#", 950 "story_time": $storyItem.data("story-time") || 6 951 }); 952 953 }); 954 955 if(focusedStoryArray.length){ 956 $("body").append(` 957 <div class="story-slide-cont d-flex align-items-center justify-content-center position-fixed top-0 start-0 bottom-0 end-0" style="background:#000;z-index:5;"> 958 <div class="stories-box position-relative w-100 h-100 d-flex align-items-center justify-content-center"> 959 960 <div class="story-progress-bar-cont position-absolute top-0 start-0 end-0 row gx-1 px-1 mt-1"> 961 962 </div> 963 964 <div class="story-items w-100 h-100"> 965 </div> 966 967 <div class="story-controls w-100 mw-100 position-absolute d-flex flex-column align-items-between justify-content-between top-0 bottom-0"> 968 <div class="d-flex align-items-center justify-content-between z-2"> 969 <div></div> 970 <div class="px-3 pt-2"> 971 <i class="fa fa-times text-white fs-30 close-story" aria-hidden="true"></i> 972 </div> 973 </div> 974 975 <div class="d-flex flex-row align-items-center justify-content-between"> 976 <div class="prev-story story-control-btn opacity-0 pe-none"> 977 <i class="fa fa-angle-left" aria-hidden="true"></i> 978 </div> 979 980 <div class="next-story story-control-btn opacity-0 pe-none"> 981 <i class="fa fa-angle-right" aria-hidden="true"></i> 982 </div> 983 </div> 984 <div></div> 985 </div> 986 </div> 987 </div> 988 `); 989 focusedStoryArray.forEach((element, index) => { 990 if(element.story_src_type == 'image'){ 991 $(".story-slide-cont .story-items").append(` 992 <div class="story-item-box z-1 ${index == $focusedStoryItemIndex ? "story-active" : ""} position-relative w-100 h-100 justify-content-center align-items-center" data-progress-target="${index}"> 993 <img class="mw-100 mh-100" src="${element.story_src}"> 994 <div class="position-absolute bottom-0 start-0 end-0"> 995 <div class="oz-story-text">${element.story_title}</div> 996 <div class="text-center mb-3"> 997 <a class="oz-story-link" href="${element.story_link}">Linke Git</a> 998 </div> 999 </div> 1000 </div> 1001 `); 1002 $(".story-progress-bar-cont").append(` 1003 <div class="story-progress-bar col" data-progress-target="${index}" data-progress-timer="${element.story_time}"> 1004 <div class="story-progress pt-1 rounded-1"> 1005 <div class="bar-partial"></div> 1006 </div> 1007 </div> 1008 `); 1009 } 1010 }); 1011 1012 function updateStoryButtons() { 1013 $(".prev-story").toggleClass("opacity-0 pe-none", $focusedStoryItemIndex === 0); 1014 $(".next-story").toggleClass("opacity-0 pe-none", $focusedStoryItemIndex === focusedStoryArray.length - 1); 1015 } 1016 1017 updateStoryButtons(); 1018 1019 $(".close-story").click(function(){ 1020 $(".story-slide-cont").remove(); 1021 }); 1022 1023 progressTimerFunc(); 1024 1025 $(".prev-story").click(function(){ 1026 if ($focusedStoryItemIndex > 0) { 1027 $focusedStoryItemIndex--; 1028 $(".story-item-box").removeClass("story-active").eq($focusedStoryItemIndex).addClass("story-active"); 1029 updateStoryButtons(); 1030 progressTimerFunc(); 1031 } 1032 }); 1033 1034 $(".next-story").click(function(){ 1035 if ($focusedStoryItemIndex < focusedStoryArray.length - 1) { 1036 $focusedStoryItemIndex++; 1037 $(".story-item-box").removeClass("story-active").eq($focusedStoryItemIndex).addClass("story-active"); 1038 updateStoryButtons(); 1039 progressTimerFunc(); 1040 } 1041 }); 1042 } 1043 });
1044 1045 1046 let hoverTimeout; 1047 let autoPlayInterval; 1048 const $items = $('.changer-hover-item'); 1049 const intervalTime = 3000; 1050 1051 function changeContent($item) { 1052 const $container = $item.closest('.changer-hover-cont'); 1053 const newImage = $item.data('image'); 1054 const newTitle = $item.data('title'); 1055 const newCategory = $item.data('category'); 1056 const newHref = $item.data('href'); 1057 1058 const $mainImg = $container.find('.image-cont img'); 1059 if ($mainImg.attr('src') !== newImage) { 1060 $($mainImg).attr('src', newImage) 1061 } 1062 1063 $container.find('> a').attr('href', newHref); 1064 $container.find('.content-category .text').text(newCategory); 1065 $container.find('.content-title .text').text(newTitle); 1066 1067 $item.addClass('active').siblings().removeClass('active'); 1068 } 1069 1070 function startAutoPlay() { 1071 stopAutoPlay(); 1072 autoPlayInterval = setInterval(function() { 1073 let $next = $items.filter('.active').next('.changer-hover-item'); 1074 if ($next.length === 0) { 1075 $next = $items.first(); 1076 } 1077 changeContent($next); 1078 }, intervalTime); 1079 } 1080 1081 function stopAutoPlay() { 1082 clearInterval(autoPlayInterval); 1083 } 1084 1085 if ($items.filter('.active').length === 0) { 1086 $items.first().addClass('active'); 1087 } 1088 startAutoPlay(); 1089 1090 $items.on('mouseenter', function() { 1091 const $item = $(this); 1092 stopAutoPlay(); 1093 clearTimeout(hoverTimeout); 1094 1095 hoverTimeout = setTimeout(function() { 1096 changeContent($item); 1097 }, 100); 1098 1099 }).on('mouseleave', function() { 1100 clearTimeout(hoverTimeout); 1101 startAutoPlay(); 1102 }); 1103});
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.