1jQuery( document ).ready( function( $ ) { 2 3// Add classes to different types of links. 4 $( 'a[href^="mailto:"]' ).addClass( 'email-link' ); 5 $( 'a[href$=".pdf"]' ).attr({ "target":"_blank" }).addClass( 'pdf-link' ); 6 $( 'a[href$=".doc"]' ).attr({ "target":"_blank" }).addClass( 'doc-link' ); 7 $( 'a[href$=".docx"]' ).attr({ "target":"_blank" }).addClass( 'docx-link' ); 8 $( 'a[href$=".xls"]' ).attr({ "target":"_blank" }).addClass( 'xls-link' ); 9 $( 'a[href$=".xlxs"]' ).attr({ "target":"_blank" }).addClass( 'xlsx-link' ); 10 $( 'a[href*="www.youtube.com/watch"]' ).attr({ "target":"_blank" }).addClass( 'youtube-link' ); 11 12// External Links. 13var h = window.location.host.toLowerCase(); 14$( '[href^="http"]' ).not( '[href*="' + h + '"]' ).addClass( 'external-link' ).attr( "target", "_new" ); 15 16//Hides resource results until search param is submitted. 17var queryString = window.location.search; 18 19if( queryString.length ) { 20 $('.hidden-resource' ).each( function() { 21 $(this).removeClass( 'hidden-resource'); 22 $('select#wpv-page-selector-2416-CPID48').css("display","block"); 23 $( this ).parent().addClass( 'resource-ready' ); 24 }); 25} else { 26 $('.hidden-resource' ).each( function() { 27 $( this ).html( '' ); 28 $( this ).parent().addClass( 'resource-ready' ); 29 }); 30} 31 32 33$('a').each(function(index) { 34 // Check if the anchor already has an aria-label 35 var existingAriaLabel = $(this).attr('aria-label'); 36 37 if (!existingAriaLabel) { 38 // Check if the anchor has a title attribute 39 var titleAttribute = $(this).attr('title'); 40 41 if (titleAttribute) { 42 // If the title attribute exists, set aria-label using the title 43 $(this).attr('aria-label', titleAttribute); 44 } else { 45 // If no title attribute, check for anchor content 46 var anchorText = $(this).text().trim(); 47 48 if (anchorText) { 49 // If anchor content exists, set aria-label using the anchor content 50 $(this).attr('aria-label', anchorText); 51 } else { 52 // If no title and no anchor content, add a counter 53 $(this).attr('aria-label', 'LINK ' + (index + 1)); 54 } 55 } 56 } 57}); 58 59 60});
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.