1jQuery( function ($) { 2 3 "use strict"; 4 5 var uniqId = ( function() { 6 var i=0; 7 return function() { 8 return i++; 9 } 10 })(); 11 12 // Add fresco to galleries 13 $( ".wp-block-gallery" ).each(function() { 14 15 var that = $(this); 16 17 that.attr('id', 'gallery-'+uniqId()); 18 19 that.find('.blocks-gallery-item').each(function(){ 20 21 var this_gallery_item = $(this); 22 23 var item_link = this_gallery_item.find('a').attr('href'); 24 25 if( item_link ) { 26 27 item_link = item_link.split('.').pop(); 28 29 if( item_link && ( typeof item_link === 'string') && ( item_link == 'jpg' || item_link == 'jpeg' || item_link == 'png' || item_link == 'gif' ) ) { 30 31 this_gallery_item.find('a').addClass('fresco'); 32 33 this_gallery_item.find('.fresco').attr('data-fresco-group', that.attr('id')); 34 35 if ( this_gallery_item.find('figcaption').length > 0 ) { 36 this_gallery_item.find('.fresco').attr('data-fresco-caption', this_gallery_item.find('figcaption').text()); 37 } 38 } 39 } 40 }); 41 }); 42});
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.