1(function ($, Drupal, drupalSettings) { 2 Drupal.behaviors.viewport = { 3 attach: function attach(context) { 4 once('dfpIframeWatcher', 'body', context).forEach(function () { 5 waitForIframeAndBind(); 6 }); 7 8 function waitForIframeAndBind() { 9 var iframeId = 'google_ads_iframe_//307922/meetingstoday.tmus/SuperLeaderboard_0'; 10 var attempts = 0; 11 var maxAttempts = 20; 12 var interval = setInterval(function () { 13 var iframeElement = document.getElementById(iframeId); 14 15 if (iframeElement && iframeElement.contentWindow) { 16 clearInterval(interval); 17 tryBindClickEvent(iframeElement); 18 } else { 19 attempts += 1; 20 21 if (attempts >= maxAttempts) { 22 clearInterval(interval); 23 } 24 } 25 }, 300); 26 } 27 28 function tryBindClickEvent(iframeElement) { 29 var iframeDocument = void 0; // Safely access the iframe's document; exit if cross-origin access fails. 30 31 try { 32 iframeDocument = iframeElement.contentWindow.document || iframeElement.contentDocument; 33 } catch (e) { 34 // Cross-origin access error; cannot proceed. 35 return; 36 } // Find the pushdown expand button inside the iframe. 37 38 39 var pushExpandButton = iframeDocument.querySelector('#pushdown_expand_btn'); 40 41 if (!pushExpandButton) { 42 return; 43 } // Bind click event to the pushdown expand button. 44 45 46 pushExpandButton.addEventListener('click', function () { 47 setTimeout(function () { 48 var imageUrl = null; // Try to get the image URL from the ad container. 49 50 try { 51 var img = iframeDocument.querySelector('#pushdown_ad_container img'); 52 53 if (img && img.src) { 54 imageUrl = img.src; 55 } 56 } catch (e) {// Ignore errors if image is not accessible. 57 } // Send POST request to increment click count. 58 59 60 fetch(Drupal.url('dfp-click-count/increment'), { 61 method: 'POST', 62 headers: { 63 'Content-Type': 'application/json', 64 'X-CSRF-Token': drupalSettings.dfpclick.csrfToken 65 }, 66 body: JSON.stringify({ 67 ad_id: 'pushdown_via_iframe', 68 image_url: imageUrl 69 }) 70 }).catch(function () {}); 71 }, 300); 72 }); 73 } 74 75 $(document).ready(function () { 76 setTimeout(function () { 77 if (screen.width <= 500) { 78 window.scrollTo(0, 0); 79 } 80 }, 1500); 81 }); 82 $(document).ready(function ($) { 83 setTimeout(function () { 84 if (!document.getElementById('js-dfp-tag-superleaderboard').hasAttribute('data-google-query-id') || $('#js-dfp-tag-superleaderboard').find('iframe').length === 0 || $('#js-dfp-tag-superleaderboard').find('iframe').is(':hidden')) { 85 $('.pre-header-gutter').find('.vertical_spacer').removeClass('vertical_spacer'); 86 $('.pre-header-gutter').find('.justify-content-between').addClass('preheader_ad_no_space'); 87 } 88 }, 1000); 89 }); 90 91 if (screen.width > 450) { 92 document.getElementById('viewport').setAttribute('content', 'width=1200, user-scalable=1.0'); 93 } else { 94 $(window).on('deviceorientation', function () { 95 if (window.matchMedia('(orientation: landscape)').matches) { 96 if ('ontouchstart' in window == true) { 97 document.getElementById('viewport').setAttribute('content', 'width=1200, user-scalable=1.0, maximum-scale=1.0'); 98 } 99 } 100 }); 101 } 102 103 if (window.DeviceOrientationEvent) { 104 window.addEventListener('orientationchange', function () { 105 location.reload(); 106 }); 107 } 108 109 if ('ontouchstart' in window == false) { 110 $(window).bind('resize', function () { 111 if (window.innerHeight != screen.height) { 112 this.location.reload(); 113 } 114 }); 115 } // logo resize on superLeaderboard ad 116 117 118 if (screen.width >= 1201) { 119 $(document).ready(function () { 120 setTimeout(function () { 121 if ($('.vertical_spacer .region-header-ad-space .block-dfp iframe').contents().find('#google_image_div img').width() > 729) { 122 $('.header__branding').removeClass('col-lg-4').css({ 123 transition: 'all 0.3s ease-in-out' 124 }); 125 $('.header__branding').addClass('col-lg-2').css({ 126 padding: 0, 127 transform: 'translateX(30px) scale(1.09)', 128 transition: 'all 0.3s ease-in-out' 129 }); 130 $('.header__ad-space').removeClass('col-lg-8').css({ 131 transition: 'all 0.3s ease-in-out' 132 }); 133 $('.header__ad-space').addClass('col-sm-10').css({ 134 paddingLeft: 0, 135 maxWidth: '78%', 136 transition: 'all 0.3s ease-in-out' 137 }); 138 } 139 140 $('#wallpaper_ad iframe').css({ 141 width: '100%' 142 }); 143 $('#wallpaper_ad iframe').contents().find('#google_image_div').css({ 144 left: 0, 145 right: 0, 146 marginLeft: 'auto', 147 marginRight: 'auto' 148 }); 149 $('#wallpaper_ad iframe').contents().find('#google_image_div img').css({ 150 width: '100%' 151 }); 152 }, 1000); 153 }); 154 } 155 156 var url = window.location; 157 var splitURL = url.toString().split('/')[3]; 158 var appended = '/' + splitURL; 159 $(document).ready(function () { 160 if (appended == '/events') {// $('.pre-header-gutter .vertical_spacer').addClass( 161 // 'event_page_header-spacing' 162 // ); 163 } 164 }); 165 var image_file = $('.block-field-blocknodepagebody .field--name-body img[data-entity-type="file"]'); 166 var attrheight = image_file.attr('height'); 167 image_file.css({ 168 height: attrheight 169 }); // slick slider nav dots 170 171 var slickImage = $('.view-stories-hero-carousel .slick__slide img'); 172 slickImage.on('load', function () { 173 var actualHeight = slickImage.height(); 174 var cssTop = actualHeight + 25; 175 $('.view-stories-hero-carousel .slick-dots').css({
176 top: cssTop 177 }); 178 }); // catfish close button 179 180 function is_touch_device() { 181 if ('ontouchstart' in window == true) { 182 $('#catfish').ready(function () { 183 $('#closeCat').css('display', 'block'); 184 }); 185 } 186 } 187 188 $('#closeCat').click(function () { 189 $('#catfish, #block-catfishad').hide(); 190 }); 191 $('#closePopup').click(function () { 192 $('#popup').css('display', 'none'); 193 $('body').removeClass('body-blur'); 194 }); 195 $(document).ready(function ($) { 196 setTimeout(function () { 197 if ($('#ad_block iframe').contents().find('#google_image_div * img').height() == 1 || $('#ad_block iframe').contents().find('#google_image_div * img').height() == 0) { 198 $('#catfish #closeCat').css('display', 'none'); 199 $('#catfish, #block-catfishad').hide(); 200 } else { 201 if ($('#ad_block iframe').contents().find('#google_image_div * img').height() >= 75) { 202 is_touch_device(); // for touch devices 203 // $('#catfish').mouseover(function () { 204 205 $('#closeCat').css('display', 'block'); // }); 206 } 207 } 208 209 if ($('#ad_popup_block iframe').contents().find('#google_image_div * img').height() == 1 || $('#ad_popup_block iframe').contents().find('#google_image_div * img').height() == 0) { 210 $('#popup #closePopup').css('display', 'none'); 211 $('#popup, #block-catfishad').hide(); 212 } else { 213 if ($('#ad_popup_block iframe').contents().find('#google_image_div * img').height() >= 75) { 214 is_touch_device('#popup', '#closePopup'); // for touch devices 215 216 $('#closePopup').css('display', 'block'); 217 $(once('body-blur-main', 'body', context)).addClass('body-blur'); 218 219 if (screen.width <= 500) { 220 $('#ad_popup_block iframe').contents().find('#google_image_div * img').css({ 221 width: '300px', 222 height: '400px' 223 }); 224 } 225 } 226 } // js to show close button only when image is available. 227 228 229 var popupImg = $('#popup').find('#google_image_div').length; 230 231 if (popupImg) { 232 $('#closePopup').css('display', 'block'); 233 $(once('body-blur-main', 'body', context)).addClass('body-blur'); 234 } 235 }, 1000); 236 }); 237 } 238 }; 239})(jQuery, Drupal, drupalSettings);
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.