1/** 2 * File skip-link-focus-fix.js. 3 * 4 * Helps with accessibility for keyboard only users. 5 * 6 * Learn more: https://git.io/vWdr2 7 * 8 * @package Icelander 9 * @copyright WebMan Design, Oliver Juhas 10 * 11 * @since 1.0.0 12 * @version 1.4.0 13 */ 14 15( function() { 16 17 18 19 20 21 var 22 is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 23 is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 24 is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 25 26 if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { 27 window.addEventListener( 'hashchange', function() { 28 29 var 30 id = location.hash.substring( 1 ), 31 element; 32 33 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 34 return; 35 } 36 37 element = document.getElementById( id ); 38 39 if ( element ) { 40 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 41 element.tabIndex = -1; 42 } 43 44 element.focus(); 45 } 46 47 }, false ); 48 } 49 50 51 52 53 54} )();
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.