1var WADS = WADS || {}; 2var WEBVIEW = WEBVIEW || {}; 3 4$(document).ready(function(){ 5 6 // Sticky nav on mobile 7 8 var mobileNav = $('.mobile-floating-nav'); 9 //var sponsorAd = $('.header-sponsor-ad'); 10 11 function isMobileNav(){ 12 //console.log('width: '+$(window).width()); 13 if($(window).width() <= 600 && mobileNav.length > 0){ 14 var window_top = $(window).scrollTop(); 15 if(WADS.IS_STICKING && window_top > 100){ 16 mobileNav.addClass('sticky-mobile-nav'); 17 }else{ 18 mobileNav.removeClass('sticky-mobile-nav'); 19 } 20 //sponsorAd.addClass('sticky-sponsor-ad'); 21 }else{ 22 if(mobileNav.hasClass('sticky-mobile-nav')){ 23 mobileNav.removeClass('sticky-mobile-nav'); 24 //sponsorAd.removeClass('sticky-sponsor-ad'); 25 } 26 } 27 } 28 29 isMobileNav(); 30 $(window).resize(isMobileNav); 31 32 $(".sticky-mobile-nav").sticky({ 33 wrapperClassName: 'sticky-mobile-nav-wrapper', 34 topSpacing:0 35 }); 36 /* 37 $(".sticky-sponsor-ad").sticky({ 38 wrapperClassName: 'sticky-sponsor-ad-wrapper', 39 topSpacing:0 40 }); 41 */ 42 43 // Mobile menu slide down 44 45 var navMenu = $('.main-nav ul'); 46 47 function navSmall(){ 48 if($(window).width() <= 1000){ 49 navMenu.addClass('nav-small nav-closed'); 50 51 }else{ 52 navMenu.removeClass('nav-small'); 53 } 54 } 55 56 // set on load if nav is narrow version 57 navSmall(); 58 59 // set on window resize if nav is narrow version 60 $(window).resize(function(){ 61 navSmall(); 62 }); 63 64 65 // Hide/show main nav 66 $('.main-nav-menu-btn').click(function(){ 67 var me = $(this); 68 console.log(navMenu); 69 if(navMenu.hasClass('nav-closed')){ 70 me.addClass('selected'); 71 navMenu.removeClass('nav-closed').addClass('nav-open'); 72 if(WADS.IS_STICKING ){ 73 74 } 75 $(this).find('i.fa').removeClass('fa-bars').addClass('fa-times'); 76 if(!searchBar.hasClass('closed')){ 77 searchBar.removeClass('open').addClass('closed'); 78 $('.header-nav-search').removeClass('selected'); 79 } 80 $('.breaking-news-container').css('display', 'none'); 81 }else{ 82 me.removeClass('selected'); 83 navMenu.removeClass('nav-open').addClass('nav-closed'); 84 $(this).find('i.fa').removeClass('fa-times').addClass('fa-bars'); 85 $('.breaking-news-container').css('display', 'block'); 86 } 87 }); 88 89 // Open/close search form (responsive) 90 $('.main-nav-search-btn').click(function(){ 91 var searchForm = $('.header-social-search form'); 92 //var headerSponsor = $('.sticky-sponsor-ad-wrapper'); 93 if(searchForm.hasClass('search-form-open')){ 94 searchForm.removeClass('search-form-open'); 95 //headerSponsor.removeClass('header-sponsor-ad-extra-top'); 96 }else{ 97 searchForm.addClass('search-form-open'); 98 //headerSponsor.addClass('header-sponsor-ad-extra-top'); 99 } 100 }); 101 102 // Homepage twitter carousel 103 var socialSlider = $('.hp-twitter-carousel ul').bxSlider({ 104 maxSlides: 2, 105 minSlides: 1, 106 nextText: '<span class="hp-next-twitter-slide"><i class="fa fa-chevron-right"></i></span>', 107 pager: false, 108 prevText: '<span class="hp-prev-twitter-slide"><i class="fa fa-chevron-left"></i></span>', 109 slideWidth: 348 110 }); 111 112 // Main nav submenu 113 $('.submenu-wrap > a').click(function(e){ 114 e.preventDefault(); 115 var me = $(this); 116 var bod = $('body'); 117 if(me.parent().hasClass('submenu-wrap-open')){ 118 me.parent().removeClass('submenu-wrap-open'); 119 me.next('.submenu').removeClass('submenu-open'); 120 bod.removeClass('main-nav-push-body-toleft-sub'); 121 }else{ 122 $('.submenu-wrap').removeClass('submenu-wrap-open'); 123 $('.submenu').removeClass('submenu-open'); 124 me.parent().addClass('submenu-wrap-open'); 125 me.next('.submenu').addClass('submenu-open'); 126 bod.addClass('main-nav-push-body-toleft-sub'); 127 } 128 }); 129 130// Responsive push menu 131 $('.main-nav-menu-btn').click(function(){ 132 var bod = $('body'); 133 var nav = $('#main-nav'); 134 if(bod.hasClass('main-nav-push-body-toleft')){ 135 //alert('has class!'); 136 bod.removeClass('main-nav-push-body-toleft'); 137 nav.removeClass('main-nav-menu-open'); 138 }else{ 139 //alert('no class...'); 140 bod.addClass('main-nav-push-body-toleft'); 141 nav.addClass('main-nav-menu-open'); 142 } 143 }); 144 145 $('.main-nav-close-btn').click(function(){ 146 $('body').removeClass('main-nav-push-body-toleft main-nav-push-body-toleft-sub'); 147 $('#main-nav').removeClass('main-nav-menu-open'); 148 $('.submenu-wrap').removeClass('submenu-wrap-open'); 149 $('.submenu').removeClass('submenu-open'); 150 }); 151 152 $('#main-nav .submenu li.submenu-back-btn span').click(function(){ 153 $(this).parent().parent().removeClass('submenu-open'); 154 $(this).parent().parent().parent().removeClass('submenu-wrap-open'); 155 $('body').removeClass('main-nav-push-body-toleft-sub'); 156 }); 157 158/* $(document).mouseup(function (e){ 159 var container = $("#main-nav"); 160 if(!container.is(e.target) && container.has(e.target).length === 0){ 161 $('body').removeClass('main-nav-push-body-toleft main-nav-push-body-toleft-sub'); 162 container.removeClass('main-nav-menu-open'); 163 $('.submenu-wrap').removeClass('submenu-wrap-open'); 164 $('.submenu').removeClass('submenu-open'); 165 } 166 });*/ 167 168 // Search bar 169 170 var searchBar = $('.search-bar'); 171 var navMenu = $('.main-nav ul'); 172 173 // Hide/show search bar 174 $('.header-nav-search').click(function(){ 175 var me = $(this); 176 var searchBarInput = $('.search-bar input[type="text"]'); 177 if(searchBar.hasClass('closed')){ 178 me.addClass('selected'); 179 searchBar.removeClass('closed').addClass('open'); 180 searchBarInput.focus(); 181 if(navMenu.hasClass('nav-open')){ 182 navMenu.removeClass('nav-open').addClass('nav-closed'); 183 $('.header-nav-menu-tab').removeClass('selected'); 184 } 185 }else{ 186 me.removeClass('selected'); 187 searchBar.removeClass('open').addClass('closed'); 188 } 189 }); 190 191 // Article page slideshow 192 //done inside views/stories/slideshow.tpl 193 /* 194 if($('.content-slideshow ul img').length > 1){ 195 var contentSlideNum = $('.content-slide-num'); 196 197 var contentSlider = $('.content-slideshow ul').bxSlider({ 198 nextText: '<span class="content-next-slide"><i class="fa fa-chevron-right"></i></span>', 199 onSlideBefore: function ($slideElement, oldIndex, newIndex){ 200 contentSlideNum.text(newIndex + 1); 201 }, 202 onSliderLoad: function(currentIndex){ 203 contentSlideNum.text(currentIndex+1); 204 $('.content-slide-hidden').css('display', 'block'); 205 }, 206 pager: false, 207 prevText: '<span class="content-prev-slide"><i class="fa fa-chevron-left"></i></span>', 208 }); 209 210 $('.content-slide-count').append('/'+(contentSlider.getSlideCount())); 211 } 212 */ 213 214 // Weather Maps responsive dropdown btn 215 $('.weather-maps-btn').click(function(){ 216 var weatherTabs = $('.weather-maps-tabs'); 217 if(weatherTabs.hasClass('weather-tabs-open')){ 218 weatherTabs.removeClass('weather-tabs-open').hide(); 219 }else{ 220 weatherTabs.addClass('weather-tabs-open').show(); 221 } 222 }); 223 224 if (window.innerWidth <= 650) { 225 226 $('.weather-maps-li').click(function(){ 227 var weatherTabs = $('.weather-maps-tabs'); 228 if(weatherTabs.hasClass('weather-tabs-open')){ 229 weatherTabs.removeClass('weather-tabs-open').hide(); 230 }else{ 231 weatherTabs.addClass('weather-tabs-open').show(); 232 } 233 }); 234 235 } 236 237 // Weather Maps Tabs 238 $('.weather-maps-tabs ul').each(function(){ 239 // For each set of tabs, we want to keep track of 240 // which tab is active and its associated content 241 var $active, $activeText, $content, $links = $(this).find('a'), $weatherBtn = $('.weather-maps-btn'); 242 243 // If the location.hash matches one of the links, use that as the active tab. 244 // If no match is found, use the first link as the initial active tab. 245 $active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]); 246 $active.addClass('active'); 247 $activeText = $active.text(); 248 $weatherBtn.html($activeText + ' <i class="fa fa-caret-down" aria-hidden="true"></i>'); 249 250 251 $content = $($active[0].hash); 252 253 // Hide the remaining content 254 $links.not($active).each(function () { 255 $(this.hash).hide(); 256 }); 257 258 // Bind the click event handler 259 $(this).on('click', 'a', function(e){ 260 // Make the old tab inactive. 261 $active.removeClass('active'); 262 $content.hide(); 263 264 // Update the variables with the new link and content 265 $active = $(this); 266 $content = $(this.hash); 267 $weatherBtn.html($active.text() + ' <i class="fa fa-caret-down" aria-hidden="true"></i>') 268 269 // Make the tab active. 270 $active.addClass('active'); 271 $content.show(); 272
273 // Prevent the anchor's default click action 274 e.preventDefault(); 275 }); 276 }); 277 278 $('.refresh_image').each(function(i, item){ 279 setInterval(function(){ 280 if(typeof document.hidden !== "undefined"){ 281 if(document.hidden == false){ 282 item.src = item.src.split("?")[0] + "?" + Math.floor(new Date().getTime()/60).toString(); 283 } 284 } 285 }, 60000); 286 }); 287 288 $(".vjs-volume-panel.vjs-control .vjs-vol-0, .ima-controls-div .ima-muted").on('click', function(e) { 289 $('.mute-overlay').hide(); 290 }); 291 292 // Breaking News Alert Slider 293 294 //rotation speed and timer 295 $(".breaking-news-container").show(); 296 297 // calling next item 298 function rotate() { 299 var lastUpdateDiff = (new Date().getTime()) - lastUpdate; 300 if(lastUpdateDiff < 6000){ 301 return; 302 } 303 $('#next').click(); 304 } 305 306 var speed = 9000; 307 var run = setInterval(rotate, speed); 308 var slides = $('.slide'); 309 var container = $('.alert-slides-wrapper ul'); 310 var elm = container.find(':first-child').prop("tagName"); 311 var item_width = container.width(); 312 var previous = 'prev'; // id of previous button 313 var next = 'next'; // id of next button 314 315 if(slides.length > 1){ // if more than one slide initiate slider 316 slides.width(item_width); // set the slides to the correct pixel width 317 container.parent().width(item_width); 318 container.width(slides.length * item_width); // set the slides container to the correct total width 319 container.find(elm + ':first').before(container.find(elm + ':last')); 320 resetSlides(); 321 var len = container.find(elm).length; 322 $('.breaking-news-count').html("1 / " + len); 323 var lastUpdate = new Date().getTime(); 324 325 $('.alert-arrows a > i.fas').click(function (e) { 326 // slide the item 327 if (container.is(':animated')) { 328 return false; 329 } 330 331 if (e.target.id == previous) { 332 container.stop().animate({ 333 'left': 0 334 }, 700, function () { 335 var newId = container.find(elm + ':first').attr('id'); 336 var len = container.find(elm).length; 337 var x = newId.split('-')[1]; 338 $('.breaking-news-count').html(x.toString() + " / " + len); 339 container.find(elm + ':first').before(container.find(elm + ':last')); 340 341 resetSlides(); 342 }); 343 } 344 345 if (e.target.id == next) { 346 var $clone = container.find(elm + ':first').clone(); 347 container.find(elm + ':last').after($clone); 348 container.width(9999999999999); 349 container.stop().animate({ 350 'left': item_width * -2 351 }, 700, function () { 352 $clone.remove(); 353 container.width(slides.length * (item_width)); 354 container.find(elm + ':last').after(container.find(elm + ':first')); 355 setTimeout(function(){ 356 var newId = container.find(elm + ':first').next().attr('id'); 357 var len = container.find(elm).length; 358 var x = newId.split('-')[1]; 359 $('.breaking-news-count').html(x.toString() + " / " + len); 360 }, 10); 361 resetSlides(); 362 363 }); 364 } 365 lastUpdate = new Date().getTime(); 366 367 //cancel the link behavior 368 return false; 369 370 }); 371 372 // on mouse hover, pause the auto rotation 373 container.parent().mouseenter(function () { 374 clearInterval(run); 375 }).mouseleave(function () { 376 run = setInterval(rotate, speed); 377 }); 378 379 function resetSlides() { 380 // adjust the container so current item is in the frame 381 container.css({ 382 'left': -1 * item_width 383 }); 384 } 385 } 386 //sticky ads 387 var width = window.innerWidth || document.documentElement.clientWidth; 388 if(!WADS.DISABLED){ 389 if(width > 900){ 390 //there is a sidebar and the sidebar you stick it by the anch
390or, but because it becomes absolute add float_spacer that has extra 800 pixels 391 $("#" + ADS_SITE_NAME + "_float").sticky({topSpacing:53}); 392 $(window).scroll(sticky_sidebar); 393 sticky_sidebar(); 394 $('#float_spacer').css('height', '200px'); 395 }else{ 396 //728x90 need at least that space 397 $('#float_spacer').css('height', '90px'); 398 //no sidebar, the add sticks to the bottom of the page on page load 399 //$("#start_float").sticky({bottomSpacing:0}); 400 $(window).scroll(sticky_footer); 401 sticky_footer(); 402 } 403 404 refreshAdSizes(); 405 } 406 407 favoriteHandlers(); 408 if(WEBVIEW.only_content){ 409 WEBVIEW.linkClickHandler(); 410 WEBVIEW.heightChangeHandler(); 411 } 412 413 if($(".owl-carousel.thecw25-slider").length > 0){ 414 var $wciu_slider = $(".owl-carousel.thecw25-slider"); 415 //initialize handler needed before creation 416 $wciu_slider.on('initialized.owl.carousel', function(e) { 417 //takes class name 418 updateDotPosition('thecw25-slider'); 419 }); 420 421 var OWL_WCIU = $wciu_slider.owlCarousel({ 422 loop: true, 423 center: true, 424 nav: true, 425 dots: true, 426 navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"], 427 autoplay: true, 428 autoplayHoverPause: true, 429 responsive:{ 430 0:{ 431 items:1 432 } 433 } 434 }); 435 OWL_WCIU.on('changed.owl.carousel', function(e) { 436 updateDotPosition('thecw25-slider'); 437 }); 438 } 439 440 441 var site_name = WEBVIEW.site_name; 442 window.MSC = window.MSC || {}; 443 444 MSC.sendbeacon = function(action, nonInteraction, value, eventLabel) { 445 var eventCategory = 'Social Click'; 446 if (window.gtag) { 447 gtag('event', action, { 448 'event_category': eventCategory, 449 'event_label': eventLabel, 450 'value': value, 451 'non_interaction': nonInteraction 452 }); 453 } 454 }; 455 456 // Allows the share native button in embedded sweepstakes to work 457 window.addEventListener('message', function(event) { 458 //check event.origin if needed. 459 // const allowedOrigins = [ 460 // 'http://dev.weigelbroadcasting.com.localhost', 461 // 'https://dev.weigelbroadcasting.com', 462 // 'https://www.weigelbroadcasting.com', 463 // 'https://lwadmin.weigelbroadcasting.com' 464 // ]; 465 466 // if (!allowedOrigins.includes(event.origin)) { 467 // alert("Origin not allowed: " + event.origin); 468 // return; // Ignore messages from untrusted sources. 469 // } 470 471 if (event.data && event.data.type === 'shareRequest') { 472 const shareData = event.data.data; 473 // Override the URL with the parent's URL. 474 shareData.url = window.location.href; 475 476 if (navigator.share) { 477 navigator.share(shareData) 478 .then(() => console.log('Share successful from parent')) 479 .catch(err => console.error('Share failed from parent:', err)); 480 } else { 481 // Optionally, provide a fallback here. 482 } 483 } 484 }); 485 486 //toast notification for share feedback 487 function showShareToast(message, anchorEl) { 488 const toast = document.createElement('div'); 489 toast.innerHTML = '<i class="fa fa-check-circle" style="color:#0086AC;margin-right:8px;font-size:16px;"></i>' + message; 490 toast.style.cssText = 'position:absolute;background:#fff;color:#333;padding:10px 16px;border-radius:4px;font-size:14px;font-weight:500;z-index:10000;opacity:0;transition:opacity 0.3s ease;box-shadow:0 4px 12px rgba(0,0,0,0.15);border-left:3px solid #0086AC;display:flex;align-items:center;font-family:"Open Sans",sans-serif;white-space:nowrap;'; 491 document.body.appendChild(toast); 492
493 // Position next to the anchor element (share button) 494 if (anchorEl) { 495 const rect = anchorEl.getBoundingClientRect(); 496 const toastRect = toast.getBoundingClientRect(); 497 let left = rect.right + 10; 498 let top = rect.top + (rect.height / 2) - (toastRect.height / 2) + window.scrollY; 499 500 // If toast would go off-screen right, position it to the left of the button 501 if (left + toastRect.width > window.innerWidth - 10) { 502 left = rect.left - toastRect.width - 10; 503 } 504 // If still off-screen, center below the button 505 if (left < 10) { 506 left = rect.left + (rect.width / 2) - (toastRect.width / 2); 507 top = rect.bottom + 10 + window.scrollY; 508 } 509 510 toast.style.left = left + 'px'; 511 toast.style.top = top + 'px'; 512 } 513 514 requestAnimationFrame(() => toast.style.opacity = '1'); 515 setTimeout(() => { 516 toast.style.opacity = '0'; 517 setTimeout(() => toast.remove(), 300); 518 }, 2500); 519 } 520 521 //new sharing button 522 $('body').on('click touch', '.share-btn', function(){ 523 const btn = this; 524 const ogTitle = $('meta[property="og:title"]').attr('content'); 525 const shareData = { 526 title: ogTitle, 527 text: '', 528 url: window.location.href 529 }; 530 531 if (navigator.share) { 532 // Web Share API is supported: use native share dialog 533 navigator.share(shareData) 534 .then(() => { 535 console.log('Share successful'); 536 MSC.sendbeacon("Share-Native-click-" + site_name, true, 1, 'shareClick'); 537 }) 538 .catch(err => console.error('Share failed:', err)); 539 } else { 540 // Web Share API not supported: fallback copy to clipboard 541 const url = shareData.url; 542 if (navigator.clipboard && window.isSecureContext) { 543 // Use Clipboard API if available (modern browsers) 544 navigator.clipboard.writeText(url) 545 .then(() => { 546 showShareToast('Link copied!', btn); 547 }) 548 .catch(err => { 549 console.error('Clipboard error:', err); 550 showShareToast('Copy failed. Please copy manually.', btn); 551 }); 552 } else { 553 // Clipboard API not available: use older execCommand method 554 const textArea = document.createElement('textarea'); 555 textArea.value = url; 556 textArea.style.position = 'fixed'; // avoid scrolling to bottom 557 textArea.style.left = '-9999px'; // move off-screen 558 document.body.appendChild(textArea); 559 textArea.focus(); 560 textArea.select(); 561 try { 562 document.execCommand('copy'); 563 showShareToast('Link copied!', btn); 564 } catch (err) { 565 //alert('Please copy this link: ' + url); 566 } 567 document.body.removeChild(textArea); 568 } 569 } 570 }); 571 572 573 574 575}); 576 577 //function to reposition the sliders 578 function updateDotPosition(sliderClass, extraOffset){ 579 //console.log("updating the position"); 580 581 var $img = $('.' + sliderClass + ' .owl-item.active').find('img'); 582 583 if($img.length > 0){ 584 setTimeout(function(){ 585 var $nav = $('.' + sliderClass + ' .owl-nav'); 586 var $dots = $('.' + sliderClass + ' .owl-dots'); 587 var bounds = $img.get(0).getBoundingClientRect(); 588 var navBounds = $nav.get(0).getBoundingClientRect(); 589 var targetY = bounds.bottom + 50; 590 591 var shiftY = navBounds.bottom - targetY; 592 var topNav = parseInt($nav.css('top').replace('px', '')); 593 var topDots = parseInt($dots.css('top').replace('px', '')); 594 var newNav = topNav - shiftY; 595 //extra minus 50 dont know why 596 var newDots = (topNav - shiftY) - 50; 597 598 //console.log("newnav " + newNav); 599 //console.log("newDots " + newDots); 600 601 $nav.css('top', newNav + "px"); 602 $dots.css('top', newDots + "px"); 603 }, 100); 604 } 605 606 } 607 608function sticky_sidebar() { 609 refreshAdSizes(); 610 var window_top = $(window).scrollTop(); 611 var footer_top = $("footer").offset().top; 612 613 if($('#float_anchor').length <= 0){ 614 console.log("no floaterrr"); 615 616 //console.log("exiting... "); 617 return; 618 } 619 var floatAnchorOffset = 50; 620 if(WADS.IS_STICKING && !WADS.TOP_AD_VIEWED){ 621 floatAnchorOffset = 50 + 90; 622 } 623 624 var anchorTop = parseInt($('#float_anchor').offset().top); 625 626 var div_top = parseInt($('#float_anchor').offset().top) - floatAnchorOffset; 627 var div_height = $('#' + ADS_SITE_NAME + '_float iframe').first().height(); //$('#' + ADS_SITE_NAME + '_float').height(); 628 //console.log("windowtop " + window_top + " divtop " + div_top);
629 //console.log("anchorTop " + anchorTop); 630 //console.log("windowtop " + window_top + " divtop " + div_top); 631 if ((window_top + div_height) > (footer_top) && anchorTop > 100) { 632 $('#' + ADS_SITE_NAME + '_float').addClass('stick'); 633 $('#' + ADS_SITE_NAME + '_float').css({top: (window_top + div_height - footer_top) * -1}) 634 } 635 else if (window_top > div_top && anchorTop > 100) { 636 $('#' + ADS_SITE_NAME + '_float').addClass('stick'); 637 $('#' + ADS_SITE_NAME + '_float').css({top: floatAnchorOffset, position: 'fixed'}); 638 } else { 639 $('#' + ADS_SITE_NAME + '_float').css({position: 'static'}); 640 $('#' + ADS_SITE_NAME + '_float').removeClass('stick'); 641 } 642} 643 644function sticky_footer() { 645 refreshAdSizes(); 646 if(WADS.USE_NEXT_MILLENNIUM || TAKEOVER_ACTIVE || WADS.HIDE_FLOATER_FOR_NM){ 647 return; 648 } 649 650 651 var width = window.innerWidth || document.documentElement.clientWidth; 652 var adWidth = 320; 653 var adHeight = 50; 654 if(width >= 730){ 655 adWidth = 728; 656 adHeight = 90; 657 } 658 else if(width > 470){ 659 adWidth = 468; 660 adHeight = 60; 661 } 662 663 if($('#float_anchor').length <= 0){ 664 console.log("no floaterrr"); 665 return; 666 } 667 668 //console.log("blah3"); 669 var scrollPos = parseInt($(window).scrollTop() + window.innerHeight - adHeight); 670 var scrollTop = $(window).scrollTop(); 671 var startFloat = 100; 672 if($('.header-nav').length > 0){ 673 var headTop = parseInt($('header').offset().top) - 10; 674 if(headTop > 100){ 675 startFloat = headTop; 676 } 677 } 678 //console.log("viewport height " + window.innerHeight); 679 //console.log("ad width " + adWidth); 680 681 //console.log("orig pos " + $('#float_anchor').offset().top); 682 //console.log("scroll pos " + scrollPos); 683 684 var div_top = parseInt($('#float_anchor').offset().top); 685 if(scrollPos > div_top){ 686 $('#' + ADS_SITE_NAME + '_float').css('position', 'static'); 687 $('#' + ADS_SITE_NAME + '_float').css('margin', '0 auto 7.894736842105263%'); 688 $('#' + ADS_SITE_NAME + '_float').css('width', adWidth + "px"); 689 } 690 //console.log("scrollpos " + scrollPos + " vs " + div_top); 691 //console.log("scrolltop: " + scrollTop + " vs " + startFloat); 692 if(scrollPos < div_top && scrollTop > startFloat){ 693 $('#' + ADS_SITE_NAME + '_float').css('position', 'fixed'); 694 695 $('#' + ADS_SITE_NAME + '_float').css('bottom', '-55px'); 696 $('#' + ADS_SITE_NAME + '_float').css('z-index', '9999'); 697 setTimeout(function(){ 698 $('#' + ADS_SITE_NAME + '_float').addClass('float-transition'); 699 700 }, 500); 701 702 if(!WADS.IS_STICKING){ 703 704 }else{ 705 //$('#' + ADS_SITE_NAME + '_float').css('bottom', '120px'); 706 } 707 708 var leftPos = parseInt((width - adWidth) / 2); 709 $('#' + ADS_SITE_NAME + '_float').css('left', leftPos + "px"); 710 $('#' + ADS_SITE_NAME + '_float').css('margin', '0px'); 711 712 $('#float_spacer').css('height', adHeight + 'px'); 713 714 } 715} 716 717function refreshAdSizes(){ 718 //console.log("here"); 719 var startTopWidth = $('#' + ADS_SITE_NAME + '_top iframe').first().width(); 720 var startSideWidth = $('#' + ADS_SITE_NAME + '_side iframe').first().width(); 721 var startMiddleWidth = $('#' + ADS_SITE_NAME + '_middle iframe').first().width(); 722 var floatWidth = $('#' + ADS_SITE_NAME + '_float iframe').first().width(); 723 var cwidth = window.innerWidth || document.documentElement.clientWidth; 724 725 if(BAD_ADS){ 726 if(cwidth > 900){ 727 startTopWidth = 728; 728 }else{ 729 startTopWidth = 320; 730 } 731 }else{ 732 733 } 734 735 736 $('.aside-ad-2').css('width', floatWidth); 737 /* 738 if($('.leaderboard-wrap').length > 0){ 739 $('#static_takeover_background').css('display', 'none'); 740 } 741 */ 742 //console.log("start middle iframe width " + startMiddleWidth); 743 //console.log("css width " + $('#' + ADS_SITE_NAME + '_middle').
743css('width')); 744 //console.log("jquery width " + $('#' + ADS_SITE_NAME + '_middle').width()); 745 if(startTopWidth > 200 && startTopWidth != $('#' + ADS_SITE_NAME + '_top').css('width')){ 746 // console.log("changed top width " + startTopWidth); 747 $('#' + ADS_SITE_NAME + '_top').width(startTopWidth); 748 if($('#' + ADS_SITE_NAME + '_top').css('position') == 'fixed'){ 749 //calculate left 750 var width = window.innerWidth || document.documentElement.clientWidth; 751 var leftPos = parseInt((width - startTopWidth) / 2); 752 //console.log("left is " + leftPos); 753 $('#' + ADS_SITE_NAME + '_top').css('left', leftPos + "px"); 754 } 755 } 756 757 if(startMiddleWidth > 0 && startMiddleWidth != $('#' + ADS_SITE_NAME + '_middle').css('width')){ 758 //console.log("changed middle width " + startMiddleWidth); 759 $('#' + ADS_SITE_NAME + '_middle').width(startMiddleWidth); 760 var $parent = $('#' + ADS_SITE_NAME + '_middle').parent(); 761 var parentWidth = parseInt($parent.width()); 762 if($parent.children().length == 1 && parentWidth > 0 && parentWidth != startMiddleWidth && $parent.prop("tagName") != "LI"){ 763 $parent.width(startMiddleWidth); 764 } 765 } 766 767 if(startSideWidth > 0 && startSideWidth != $('#' + ADS_SITE_NAME + '_side').css('width')){ 768 //console.log("changed side width " + startSideWidth); 769 $('#' + ADS_SITE_NAME + '_side').width(startSideWidth); 770 } 771 var $parent = $('#' + ADS_SITE_NAME + '_side').parent(); 772 //console.log($parent.get(0)); 773 var parentWidth = parseInt($parent.width()); 774 775 if($parent.children().length == 1 && parentWidth > 0 && parentWidth != startSideWidth){ 776 $parent.width(startSideWidth); 777 if(cwidth < 900){ 778 $parent.css('margin', "0px auto 4rem"); 779 } 780 } 781 782 if(cwidth < 850){ 783 $('#' + ADS_SITE_NAME + '_side').css('margin', "0px auto rem"); 784 }else{ 785 $parent.css('margin', "0px auto 4rem"); 786 } 787 788 if(!WADS.USE_NEXT_MILLENNIUM){ 789 var startFloatWidth = $('#' + ADS_SITE_NAME + '_float iframe').first().width(); 790 if(startFloatWidth > 0 && startFloatWidth != $('#' + ADS_SITE_NAME + '_float').css('width')){ 791 //console.log("changed float width " + startFloatWidth); 792 $('#' + ADS_SITE_NAME + '_float').width(startFloatWidth); 793 if($('#' + ADS_SITE_NAME + '_float').css('position') == 'fixed'){ 794 //calculate left 795 var width = window.innerWidth || document.documentElement.clientWidth; 796 var leftPos = parseInt((width - startFloatWidth) / 2); 797 $('#' + ADS_SITE_NAME + '_top').css('left', leftPos + "px !important"); 798 } 799 } 800 } 801} 802 803// Owl Carousel 804$(document).ready(function(){ 805 if($(".owl-carousel.spotlight").length > 0){ 806 $(".owl-carousel.spotlight").owlCarousel({ 807 loop: true, 808 dots: false, 809 center: false, 810 nav: true, 811 autoplay: false, 812 margin: 10, 813 autoplayHoverPause: true, 814 navText : ["<i></i>","<i class='fa fa-chevron-right'></i>"], 815 responsive:{ 816 0:{ 817 items: 1.5 818 }, 819 767: { 820 items: 2 821 } 822 } 823 }); 824 }; 825});
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.