1(function($) { 2 $(document).ready(function() { 3 /* 4 * Add pdf notice if a link on the page is to a pdf 5 */ 6 if ($("a[href$='.pdf']").length) { 7 var pdfNotice = "<div id=\"pdfNotice\"> <p> PDF files require the <a href=\"http://www.adobe.com/reader/\">free Adobe Reader.</a><br> More information on Adobe Acrobat PDF files is available on our <a href=\"/global-pages/accessibility/\">Accessibility page</a>. </p> </div>"; 8 $("#main-col").append(pdfNotice); 9 } 10 /* 11 * Add help icon for description text 12 */ 13 $(".description").prev().prev().append('<i class="fa-2x fa fa-question-circle hover-help" title="Click for help"></i>'); 14 $(".description").each(function() { 15 $(this).appendTo($(this).prev().prev()); 16 }); 17 $(".description").hide(); 18 $(".hover-help").click(function() { 19 $(this).next().toggle() 20 }); 21 /* 22 * Force download for download links 23 */ 24 $("a.download-photo").each(function() { 25 $(this).attr('download', ''); 26 }); 27 /* 28 * Add external link icon 29 */ 30 31 (function(){ 32 //trusted domain name regular expression 33 /* 34 var trustedDomains = [ 35 'twitter\.com', 36 'youtube\.com', 37 'youtu\.be', 38 'recordsofrights\.org', 39 'presidentialtimeline\.org', 40 'nationalarchivesstore\.org', 41 'bush41\.org', 42 'nara\.learn\.com', 43 'bush41\.org', 44 'bushlibrary\.tamu\.edu', 45 'fdrlibrary\.marist\.edu', 46 'georgewbushlibrary\.smu\.edu', 47 'lbjlibrary\.org', 48 'trumanlibrary\.org', 49 'fdrlibrary\.org', 50 'archivesfoundation\.org', 51 'jfklibrary\.org', 52 'Myarchivesstore\.org', 53 'docsteach\.org', 54 'digitalvaults\.org', 55 'jfk50\.org', 56 'reagan\.utexas\.edu', 57 'clinton\.presidentiallibraries\.us', 58 'fdrlibrary\.org', 59 'us11\.campaign-archive.?\.com', 60 'lbjlibrary\.net', 61 'github\.io$', 62 'github\.com$' 63 ]; 64 */ 65 66 regexIndexOf = function(arry, str) { 67 if (typeof str === 'undefined' || !str){ 68 return -1; 69 } 70 for(i=0;i<arry.length;i++){ 71 var regex = new RegExp(arry[i]); 72 if(str.match(regex)) 73 return i; 74 } 75 return -1; 76 } 77 78 79 localabsolutelink = new RegExp('^http?://' + location.host,'i'); 80 $("a[href^='http://'],a[href^='https://']").each(function() { 81 var htmlContentLink = $(this).html(); 82 var url = $(this).attr('href'); 83 if ( url.search(localabsolutelink) == -1 ) { 84 var hostname = $('<a>').prop('href', url).prop('hostname'); 85 //console.log(hostname + ': ' + regexIndexOf(Drupal.settings.archives_ui.trustedDomains,hostname)); 86 if($(this).hasClass('untrusted')){ 87 $(this).html(htmlContentLink + ' <i class="fa fa-external-link" title="Our website includes links to many other federal agencies and, in some cases, we link to private organizations. Reference or links to any specific commercial products, service, or company does not constitute endorsement or recommendation by the U.S. Government or the National Archives. When you leave our website, you are subject to that site\'s privacy policy. We are not responsible for the content, information quality, security or Section 508 compliance (accessibility) of other websites."></i>'); 88 } 89 else if (hostname.substring(hostname.length - 4) != '.gov' && ! $(this).hasClass('trusted')) { 90 if ($(this).has('img').length > 0) { 91 } 92 else if (regexIndexOf(Drupal.settings.archives_ui.trustedDomains,hostname) >= 0) { 93 // do not show the exit link for these sites 94 95 } else { 96 //We have a link to an external non-government site so add the external link icon 97 $(this).html(htmlContentLink + ' <i class="fa fa-external-link" title="Our website includes links to many other federal agencies and, in some cases, we link to private organizations. Reference or links to any specific commercial products, service, or company does not constitute endorsement or recommendation by the U.S. Government or the National Archives. When you leave our website, you are subject to that site\'s privacy policy. We are not responsible for the content, information quality, security or Section 508 compliance (accessibility) of other websites."></i>'); 98 } 99 } 100 } 101 }); 102 /* 103 * Add pdf notice if a link on the page is to a pdf 104 * / 105 $("a[href$='.pdf']").each(function(){ 106 $(this).addClass('pdf'); 107 }); 108 */ 109 })(); 110 111 }); 112})(jQuery);
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.