1 2let navigation; 3let content; 4let footer; 5 6content = document.querySelectorAll('[role="main"]')[0]; 7navigation = document.querySelectorAll('[aria-label="Off Canvas Content"]'); 8footer = document.querySelectorAll('footer')[0]; 9 10// Skip to Content Link 11content.setAttribute('id', 'main'); 12 13let link = document.createElement("a"); 14link.setAttribute('class', 'screen-reader-text'); 15link.setAttribute('href', `#${content.id}`); 16link.setAttribute('id', 'top-of-page'); 17link.innerHTML = "Skip to Content"; 18 19 20// Skip to footer navigation link and return to header 21if (navigation.length !== 0 && footer.length !== 0) { 22 footer.setAttribute('id', 'footer-mobile-navigation'); 23 let navLink = document.createElement("a"); 24 navLink.setAttribute('class', 'screen-reader-text'); 25 navLink.setAttribute('href', `#${footer.id}`); 26 navLink.innerHTML = "Skip to footer navigation"; 27 let footerLink = document.createElement("a"); 28 footerLink.setAttribute('class', 'screen-reader-text'); 29 footerLink.setAttribute('href', `#${link.id}`); 30 footerLink.innerHTML = "Return to start of page"; 31 32 footer.insertBefore(footerLink, footer.childNodes[0]); 33 document.body.prepend(navLink); 34 35} 36//Make sure accessing content comes first 37document.body.prepend(link); 38 39jQuery('a[href^="#"]').click(function(){ 40 let anchorTarget = jQuery(this).attr('href'); 41 jQuery(anchorTarget).attr('tabindex', -1).focus(); 42}); 43 44if (window.location.hash) { 45 jQuery(window.location.hash).attr('tabindex', -1).focus(); 46}
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.