1(()=>{const e=document.querySelectorAll(".coblocks-animate");if("IntersectionObserver"in window){const t=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(e.target.classList.add(e.target.dataset.coblocksAnimation),t.unobserve(e.target))}))}),{threshold:[.15]});e.forEach((e=>{t.observe(e)}))}else e.forEach((e=>{e.classList.remove("coblocks-animate"),delete e.dataset.coblocksAnimation}))})();; 2/** 3 * Makes "skip to content" link work correctly in IE9, Chrome, and Opera 4 * for better accessibility. 5 * 6 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ 7 */ 8 9 ( function() { 10 var isWebkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 11 isOpera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 12 isIE = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 13 14 if ( ( isWebkit || isOpera || isIE ) && document.getElementById && window.addEventListener ) { 15 window.addEventListener( 'hashchange', function() { 16 var id = location.hash.substring( 1 ), 17 element; 18 19 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 20 return; 21 } 22 23 element = document.getElementById( id ); 24 25 if ( element ) { 26 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 27 element.tabIndex = -1; 28 } 29 30 element.focus(); 31 32 // Repositions the window on jump-to-anchor to account for admin bar and border height. 33 window.scrollBy( 0, -53 ); 34 } 35 }, false ); 36 } 37} )(); 38; 39/* global screenReaderText */ 40/** 41 * Theme functions file. 42 * 43 * Contains handlers for navigation and widget area. 44 */ 45( function () { 46 'use strict'; 47 48 var mainNav, masthead, menuToggle, siteNavigation, socialNavigation, siteHeaderMenu, resizeTimer; 49 50 function matches( el, sel ) { 51 if ( Element.prototype.matches ) { 52 return el.matches( sel ); 53 } 54 55 if ( Element.prototype.msMatchesSelector ) { 56 return el.msMatchesSelector( sel ); 57 } 58 } 59 60 // Based on https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill 61 function closest( el, sel ) { 62 if ( el.closest ) { 63 return el.closest( sel ); 64 } 65 66 var current = el; 67 68 do { 69 if ( matches( el, sel ) ) { 70 return current; 71 } 72 current = current.parentElement || current.parentNode; 73 } while ( current !== null && current.nodeType === 1 ); 74 75 return null; 76 } 77 78 function forEachNode( parent, selector, fn ) { 79 var nodes = parent.querySelectorAll( selector ); 80 for ( var i = 0; i < nodes.length; i++ ) { 81 fn( nodes[ i ] ); 82 } 83 } 84 85 function initMainNavigation( container ) { 86 forEachNode( container, '.menu-item-has-children > a', function ( el ) { 87 // Add dropdown toggle that displays child menu items. 88 var dropdownToggle = document.createElement( 'button' ); 89 dropdownToggle.className = 'dropdown-toggle'; 90 dropdownToggle.setAttribute( 'aria-expanded', 'false' ); 91 92 var span = document.createElement( 'span' ); 93 span.className = 'screen-reader-text'; 94 span.textContent = screenReaderText.expand; 95 96 dropdownToggle.appendChild( span ); 97 98 el.parentNode.insertBefore( dropdownToggle, el.nextSibling ); 99 } ); 100 101 // Toggle buttons and submenu items with active children menu items. 102 forEachNode( container, '.current-menu-ancestor > button', function ( el ) { 103 el.classList.add( 'toggled-on' ); 104 } ); 105 forEachNode( container, '.current-menu-ancestor > .sub-menu', function ( el ) { 106 el.classList.add( 'toggled-on' ); 107 } ); 108 109 // Add menu items with submenus to aria-haspopup="true". 110 forEachNode( container, '.menu-item-has-children', function ( el ) { 111 el.setAttribute( 'aria-haspopup', 'true' ); 112 } ); 113 114 forEachNode( container, '.dropdown-toggle', function ( el ) { 115 el.addEventListener( 'click', function ( e ) { 116 var screenReaderSpan = el.querySelector( '.screen-reader-text' ); 117 118 e.preventDefault(); 119 el.classList.toggle( 'toggled-on' ); 120 var next = el.nextElementSibling; 121 if ( next && matches( next, '.children, .sub-menu' ) ) { 122 next.classList.toggle( 'toggled-on' ); 123 } 124 125 el.setAttribute( 126 'aria-expanded', 127 el.getAttribute( 'aria-expanded' ) === 'false' ? 'true' : 'false' 128 ); 129 screenReaderSpan.textContent = 130 screenReaderSpan.textContent === screenReaderText.expand ? screenReaderText.collapse: screenReaderText.expand; 131 } ); 132 } ); 133 } 134 135 mainNav = document.querySelector( '.main-navigation' ); 136 if ( mainNav ) { 137 initMainNavigation( mainNav ); 138 } 139 140 masthead = document.querySelector( '#masthead' ); 141 menuToggle = masthead && masthead.querySelector( '#menu-toggle' ); 142 siteHeaderMenu = masthead && masthead.querySelector( '#site-header-menu' ); 143 siteNavigation = masthead && masthead.querySelector( '#site-navigation' ); 144 socialNavigation = masthead && masthead.querySelector( '#social-navigation' ); 145 146 // Enable menuToggle. 147 ( function () { 148 // Return early if menuToggle is missing. 149 if ( ! menuToggle ) { 150 return; 151 } 152 153 var controls = [ menuToggle, siteNavigation, socialNavigation ].filter( Boolean ); 154 155 // Add an initial values for the attribute.
156 controls.forEach( function ( el ) { 157 el.setAttribute( 'aria-expanded', 'false' ); 158 } ); 159 160 menuToggle.addEventListener( 'click', function () { 161 menuToggle.classList.toggle( 'toggled-on' ); 162 siteHeaderMenu.classList.toggle( 'toggled-on' ); 163 164 var newVal = menuToggle.getAttribute( 'aria-expanded' ) === 'false' ? 'true' : 'false'; 165 controls.forEach( function ( el ) { 166 el.setAttribute( 'aria-expanded', newVal ); 167 } ); 168 } ); 169 } )(); 170 171 // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility. 172 ( function () { 173 if ( ! siteNavigation || ! siteNavigation.children.length ) { 174 return; 175 } 176 177 // Init `focus` class to allow submenu access on tablets. 178 function initFocusClassTouchScreen() { 179 document.body.addEventListener( 'touchstart', function ( e ) { 180 if ( ! closest( e.target, '.main-navigation li' ) ) { 181 forEachNode( document, '.main-navigation li', function ( el ) { 182 el.classList.remove( 'focus' ); 183 } ); 184 } 185 } ); 186 forEachNode( siteNavigation, '.menu-item-has-children > a', function ( link ) { 187 link.addEventListener( 'touchstart', function ( e ) { 188 if ( window.innerWidth >= 910 ) { 189 var el = link.parentElement; 190 191 if ( matches( el, 'li' ) && ! el.classList.contains( 'focus' ) ) { 192 e.preventDefault(); 193 el.classList.toggle( 'focus' ); 194 var children = el.parentElement.children; 195 for ( var i = 0; i < children.length; i++ ) { 196 if ( children[ i ] !== el ) { 197 children[ i ].classList.remove( 'focus' ); 198 } 199 } 200 } 201 } 202 } ); 203 } ); 204 } 205 206 function toggleFocus( el ) { 207 var item = closest( el, '.menu-item' ); 208 if ( item ) { 209 item.classList.toggle( 'focus' ); 210 } 211 } 212 213 if ( 'ontouchstart' in window ) { 214 initFocusClassTouchScreen(); 215 } 216 217 forEachNode( siteNavigation, 'a', function ( link ) { 218 link.addEventListener( 'focus', toggleFocus( link ) ); 219 link.addEventListener( 'blur', toggleFocus( link ) ); 220 } ); 221 } )(); 222 223 // Add the default ARIA attributes for the menu toggle and the navigations. 224 function onResizeARIA() { 225 if ( window.innerWidth < 910 ) { 226 if ( menuToggle && menuToggle.classList.contains( 'toggled-on' ) ) { 227 menuToggle.setAttribute( 'aria-expanded', 'true' ); 228 } else { 229 menuToggle.setAttribute( 'aria-expanded', 'false' ); 230 } 231 232 if ( siteHeaderMenu && siteHeaderMenu.classList.contains( 'toggled-on' ) ) { 233 siteNavigation && siteNavigation.setAttribute( 'aria-expanded', 'true' ); 234 socialNavigation && socialNavigation.setAttribute( 'aria-expanded', 'true' ); 235 } else { 236 siteNavigation && siteNavigation.setAttribute( 'aria-expanded', 'false' ); 237 socialNavigation && socialNavigation.setAttribute( 'aria-expanded', 'false' ); 238 } 239 240 menuToggle && menuToggle.setAttribute( 'aria-controls', 'site-navigation social-navigation' ); 241 } else { 242 menuToggle && menuToggle.removeAttribute( 'aria-expanded' ); 243 siteNavigation && siteNavigation.removeAttribute( 'aria-expanded' ); 244 socialNavigation && socialNavigation.removeAttribute( 'aria-expanded' ); 245 menuToggle && menuToggle.removeAttribute( 'aria-controls' ); 246 } 247 } 248 249 // Add 'below-entry-meta' class to elements. 250 function belowEntryMetaClass( selector ) { 251 if ( 252 document.body.classList.contains( 'page' ) || 253 document.body.classList.contains( 'search' ) || 254 document.body.classList.contains( 'single-attachment' ) || 255 document.body.classList.contains( 'error404' ) 256 ) { 257 return; 258 } 259 260 forEachNode( document, '.entry-content', function ( content ) { 261 forEachNode( content, selector, function ( element ) { 262 var elementPosTop = element.getBoundingClientRect().top; 263 var article = closest( element, 'article' ); 264 var entryFooter = article && article.querySelector( '.entry-footer' ); 265 var entryFooterPosBottom = 266 entryFooter ? entryFooter.getBoundingClientRect().top + entryFooter.offsetHeight + 28 : null; 267 var caption = closest( element, 'figure' ); 268 var next = element.nextSibling; 269 var figcaption = next && matches( next, 'figcaption' ) ? next : null; 270 var newImg; 271 272 // Add 'below-entry-meta' to elements below the entry meta. 273 if ( entryFooterPosBottom !== null && elementPosTop > entryFooterPosBottom ) { 274 // Check if full-size images and captions are larger than or equal to 840px. 275 if ( selector === 'img.size-full' || selector === '.wp-block-image img' ) { 276 // Create an image to find native image width of resized images (i.e. max-width: 100%). 277 newImg = new Image(); 278 newImg.src = element.getAttribute( 'src' ); 279 newImg.onload = function () { 280 if ( newImg.width >= 840 ) { 281 // Check if an image in an image block has a width attribute; if its value is less than 840, return. 282 if ( 283 selector === '.wp-block-image img' && 284 element.hasAttribute( 'width' ) && 285 element.getAttribute( 'width' ) < 840 286 ) { 287 return; 288 } 289 290 element.classList.add( 'below-entry-meta' ); 291 292 if ( caption && caption.classList.contains( 'wp-caption' ) ) { 293 caption.classList.add( 'below-entry-meta' ); 294 caption.removeAttribute( 'style' ); 295 } 296 297 if ( figcaption ) { 298 figcaption.classList.add( 'below-entry-meta' ); 299 } 300 } 301 }; 302 } else { 303 element.classList.add( 'below-entry-meta' ); 304 } 305 } else { 306 element.classList.remove( 'below-entry-meta' ); 307 caption && caption.classList.remove( 'below-entry-meta' ); 308 } 309 } ); 310 } ); 311 } 312
313 function init() { 314 window.addEventListener( 'load', onResizeARIA ); 315 window.addEventListener( 'resize', function () { 316 clearTimeout( resizeTimer ); 317 resizeTimer = setTimeout( function () { 318 belowEntryMetaClass( 'img.size-full' ); 319 belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); 320 belowEntryMetaClass( '.wp-block-image img' ); 321 }, 300 ); 322 onResizeARIA(); 323 } ); 324 325 belowEntryMetaClass( 'img.size-full' ); 326 belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); 327 belowEntryMetaClass( '.wp-block-image img' ); 328 } 329 330 if ( document.readyState === 'loading' ) { 331 document.addEventListener( 'DOMContentLoaded', init ); 332 } else { 333 init(); 334 } 335} )(); 336;
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.