1(function ($) { 2 // http://browserhacks.com/ 3 // https://getbootstrap.com/docs/5.2/components/collapse/ 4 // console.log( 'hello ncfc-archives.js' ); 5 6 $( document ).ready( function() { 7 // console.log( 'hello ncfc-archives.js document on ready function.' ); 8 9 // Call functions into action. 10 statutes_modified(); 11 accordion_mass_open_close(); 12 finance_in_fives_single_template(); 13 }); 14 15 // Allow users to open all or close all accordions / collapse. 16 function accordion_mass_open_close() { 17 // console.log( 'accordion_mass_open_close function.' ); 18 19 $( '#massCloseAccordions' ).on( 'click', function () { 20 $( '.collapse' ).removeClass( 'show' ); 21 }); 22 23 $( '#massOpenAccordions' ).on( 'click', function () { 24 $( '.collapse' ).addClass( 'show' ); 25 }); 26 27 // Hide the individual collapse's / accordions 28 $( '.collapse' ).on( 'click', function() { 29 $( this ).collapse( 'hide' ); 30 $( this ).removeClass( 'show' ); 31 }); 32 } 33 34 function finance_in_fives_single_template() { 35 // console.log( 'finance_in_fives_single_template function.' ); 36 37 // Finance in Five single page template - iframe tag. 38 // https://bootstrap-sog-ncfc-wp.pantheonsite.io/?post_type=toolkit&content-template-id=355 39 if( $( '.single-finance-in-five div' ).hasClass( 'video-embed-jquery' ) ) { 40 // For each 'jquery-wrapper-link' place a wrapper around them. 41 $( '.single-finance-in-five div.video-embed-jquery' ).each( function () { 42 // Get the raw field output. 43 var contents = $( this ).text(); 44 45 // Add wrapper around element. 46 $( this ).html( '<iframe src="' + contents + '" width="100%" height="100%" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" loading="lazy" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" data-ready="true" allowfullscreen></iframe>' ); 47 $( this ).removeClass( 'hide' ); 48 }); 49 } 50 } 51 52 function statutes_modified() { 53 // console.log( 'statutes_modified function.' ); 54 55 $( '.post-type-archive-statute .statute-item .modified-statute-link' ).each( function () { 56 // Take text from one field and put into the other. 57 var modified_statute_text = $( this ).siblings().text(); 58 var modified_statute_link_text = $( this ).text(); 59 60 // console.log( 'modified statute text: ' + modified_statute_text ); 61 // console.log( 'modified statute link text: ' + modified_statute_link_text ); 62 63 $( this ).html( '<a href="' + modified_statute_link_text + '" title="" target="_blank">SL ' + modified_statute_text + '</a>' ); 64 $( this ).removeClass( 'hide hidden' ); 65 }); 66 67 $( '.post-type-archive-statute .statute-item .statute-links .file-link-pdf' ).each( function () { 68 // Take text from one field and put into the other. 69 var statute_pdf_link_text = $( this ).text(); 70 71 // console.log( 'file link pdf: ' + statute_pdf_link_text ); 72 73 $( this ).html( '<a href="' + statute_pdf_link_text + '" title="" target="_blank"><i class="fa-regular fa-file-pdf fa-2xl" title="PDF Version" aria-hidden="true"></i><span class="sr-only">PDF Version</span></a>' ); 74 $( this ).removeClass( 'hide hidden' ); 75 }); 76 77 $( '.post-type-archive-statute .statute-item .statute-links .file-link-html' ).each( function () { 78 // Take text from one field and put into the other. 79 var statute_html_link_text = $( this ).text(); 80 81 // console.log( 'file link html: ' + statute_html_link_text ); 82 83 $( this ).html( '<a href="' + statute_html_link_text + '" title="" target="_blank"><i class="fa-regular fa-file-code fa-2xl" title="PDF Version" aria-hidden="true"></i><span class="sr-only">PDF Version</span></a>' ); 84 $( this ).removeClass( 'hide hidden' ); 85 }); 86 } 87})(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.