1function inMobileMode() { 2 return $("#mobilenav").is(":visible"); 3} 4 5function cellHeaders(tableId) { 6 try { 7 let thArray = []; 8 const thead = document.getElementById(tableId); 9 const headers = thead.getElementsByTagName('th'); 10 for (let i = 0; i < headers.length; i++) { 11 const headingText = headers[i].textContent; 12 thArray.push(headingText); 13 } 14 const styleElm = document.createElement('style'); 15 let styleSheet; 16 document.head.appendChild(styleElm); 17 styleSheet = styleElm.sheet; 18 19 for (let i = 0; i < thArray.length; i++) { 20 styleSheet.insertRule( 21 '#' + 22 tableId + 23 ' tr td:nth-child(' + 24 (i + 1) + 25 ')::before {content:"' + 26 thArray[i] + 27 ': ";}', 28 styleSheet.cssRules.length 29 ); 30 } 31 32 33 } catch (err) { 34 console.log('cellHeaders(): ' + err); 35 } 36} 37 38$(document).ready(function () { 39 40 // mobile menu 41 $("header .menu").click(function () { 42 $("body").toggleClass("slideNav"); 43 }); 44 45 $(document).on('click touchstart', function (e) { 46 if ($("body").hasClass("slideNav") && !$(e.target).is('#navContainer, #navContainer *, .menu')) { 47 $("body").removeClass("slideNav"); 48 } 49 }); 50 51 $("#navContainer li.on").addClass('open').children('ul').css("display", "block"); 52 53 $("#navContainer li>span").click(function () { 54 if (inMobileMode()) { 55 if ($(this).parent().hasClass("open")) { 56 $(this).prev().css("display", "block").slideUp("400"); 57 } else { 58 $(this).prev().slideDown("400"); 59 } 60 $(this).parent().toggleClass("open"); 61 } 62 }); 63 64 $(window).scroll(function () { 65 if (inMobileMode()) { 66 if ($(window).scrollTop() > 200) { 67 $('.hamburger').addClass('on'); 68 } 69 if ($(window).scrollTop() < 200) { 70 $('.hamburger').removeClass('on'); 71 } 72 } 73 }); 74 75 function is_touch_device() { 76 var prefixes = ' -webkit- -moz- -o- -ms- '.split(' '); 77 var mq = function (query) { 78 return window.matchMedia(query).matches; 79 } 80 if (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints > 0) || window.DocumentTouch && document instanceof DocumentTouch) { 81 return true; 82 } 83 var query = ['(', prefixes.join('touch-enabled),('), 'heartz', ')'].join(''); 84 return mq(query); 85 } 86 87 if (is_touch_device()) { 88 $("#mainnav ul li > a").on('touchstart', function(event) { 89 var navlink = $(this); 90 if (navlink.parent().children('ul').length) { 91 navlink.parent().siblings().find('a').removeClass("tapped"); 92 navlink.toggleClass("tapped"); 93 if (navlink.hasClass("tapped")) { 94 event.preventDefault(); 95 } 96 } 97 }); 98 } 99 100 // -------------------------------------------------------- / 101 102 // II. STICKY HEADER 103 var buffer = 100, globalAlertBarHeight, alertBarHeight, body, delta, distanceFromTop, firstScroll, header, headerHeight, headerTopOffset, initialHeaderOffset, partialScrollDown, partialScrollUp, prevScrollPosition, scrollPosition, topPosition, wpAdminBarHeight, wsMgmtBarHeight; 104 105 alertBarHeight = wpAdminBarHeight = wsMgmtBarHeight = 0; 106 firstScroll = partialScrollDown = partialScrollUp = false; 107 108 body = jQuery('body'); 109 header = jQuery('body>header:first'); 110 111 prevScrollPosition = window.pageYOffset; 112 113 if (jQuery(window).scrollTop() == 0) 114 firstScroll = true; 115 116 jQuery(window).scroll(function() { 117 if(jQuery(document).height() > 1500 && !inMobileMode()) { 118 119 scrollPosition = jQuery(this).scrollTop(); 120 121 if (jQuery('#alertApp').length) 122 alertBarHeight = jQuery('#alertApp').outerHeight(); 123 if (jQuery('#globalAlertApp').length) 124 globalAlertBarHeight = jQuery('#globalAlertApp').outerHeight(); 125 if (jQuery('#wpadminbar').length) 126 wpAdminBarHeight = jQuery('#wpadminbar').outerHeight(); 127 if (jQuery('#wsManagementBar').length) 128 wsMgmtBarHeight = jQuery('#wsManagementBar').outerHeight(); 129 130 headerHeight = header.outerHeight(); 131 delta = headerHeight + alertBarHeight + globalAlertBarHeight; 132 initialHeaderOffset = alertBarHeight + globalAlertBarHeight; 133 topPosition = 0 + wpAdminBarHeight + wsMgmtBarHeight; 134 135 if (prevScrollPosition > scrollPosition) { 136 partialScrollUp = true; 137 if (!partialScrollDown) 138 header.addClass("sticky-header").css({"top": headerTopOffset}); 139 140 var headerPosition = header.offset().top - jQuery(this).scrollTop(); 141 if (headerPosition >= topPosition) { 142 header.css({"position": "fixed", "top": topPosition + "px"}); 143 firstScroll = partialScrollUp = partialScrollDown = false;
144 distanceFromTop = window.pageYOffset; 145 } 146 } 147 148 else if (firstScroll && scrollPosition > delta + buffer) { 149 headerTopOffset = scrollPosition - (delta + buffer); 150 header.css({"position": "absolute", "top": headerTopOffset}); 151 body.css({"padding-top": header.outerHeight()}); 152 firstScroll = false; 153 partialScrollDown = true; 154 } 155 156 else if (!firstScroll && !partialScrollUp) { 157 partialScrollDown = "true"; 158 header.css({"position": "absolute", "top": distanceFromTop + wpAdminBarHeight + wsMgmtBarHeight}); 159 body.css({"padding-top": header.outerHeight()}); 160 161 if ((header.offset().top + headerHeight + buffer) < scrollPosition) { 162 headerTopOffset = scrollPosition - (delta + buffer); 163 header.removeClass("sticky-header"); 164 partialScrollDown = false; 165 } 166 } 167 168 if (scrollPosition <= initialHeaderOffset) { 169 header.css({"position": "relative", "top": ""}).removeClass("sticky-header"); 170 body.css({"padding-top": 0}); 171 firstScroll = partialScrollDown = true; 172 partialScrollUp = false; 173 } 174 prevScrollPosition = scrollPosition; 175 } 176 }); 177 178 // -------------------------------------------------------- / 179 180 181 bindAnimations(); 182 jQuery(window).on('load resize scroll', function (e) { 183 animate(); 184 }); 185var $elements; 186 187// PAGE SCROLL ANIMATIONS 188function bindAnimations() { 189 $elements = $("body").find(".fade-in, .home-events .logo-top, .home-events .logo-mid, .home-events .logo-bottom, #maloney-logo, .animate-left, .animate-right, .animate-up, .animate-down, .animate-up-left, .animate-up-right, .animate-down-left, .animate-down-right"); 190 animate(); 191} 192 193function animate() { 194 $elements.each(function (i, elem) { 195 if (jQuery(this).hasClass('animated')) 196 return; 197 animateMe(jQuery(this)); 198 }); 199} 200 201function animateMe(elem) { 202 var winTop = jQuery(window).scrollTop(); 203 var winBottom = winTop + jQuery(window).height(); 204 var elemTop = jQuery(elem).offset().top + 175; 205 if ((elemTop <= winBottom) && (elemTop >= winTop)) { 206 jQuery(elem).addClass('animated'); 207 setTimeout(function () { 208 jQuery(elem).addClass('no-glide'); 209 }, 10000); 210 } 211} 212 213 214 $('a[href*="#"]:not([href="#"])').click(function (e) { 215 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 216 var target = $(this.hash); 217 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 218 if (target.length) { 219 e.preventDefault(); 220 $('html,body').animate({ 221 scrollTop: target.offset().top - $("body>header").height() 222 }, 1000, function () { 223 // Callback after animation, Must change focus! 224 var $target = $(target); 225 $target.focus(); 226 if ($target.is(":focus")) { // Checking if the target was focused 227 return false; 228 } else { 229 $target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable 230 $target.focus(); // Set focus again 231 } 232 }); 233 } 234 } 235 }); 236});
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.