1document.addEventListener('DOMContentLoaded', function() { 2 // Featured image layout: 'image-size', 'above-sidebar', or 'next-to-sidebar' 3 const featured_image_sizing = 'next-to-sidebar'; 4 5 const seeAllButtons = document.querySelectorAll('.see-all-vibes'); 6 7 seeAllButtons.forEach(button => { 8 // Set initial text 9 const hiddenVibes = button.closest('.vibe-chips').querySelectorAll('.hidden-vibe').length; 10 button.textContent = `+${hiddenVibes} more`; 11 12 button.addEventListener('click', function() { 13 const vibeChipsContainer = this.closest('.vibe-chips'); 14 vibeChipsContainer.classList.toggle('show-all-vibes'); 15 16 // Set button text based on state 17 this.textContent = vibeChipsContainer.classList.contains('show-all-vibes') 18 ? 'Show less' 19 : `+${vibeChipsContainer.querySelectorAll('.hidden-vibe').length} more`; 20 }); 21 }); 22 23 // Only check image dimensions if we're using image-size setting 24 if (featured_image_sizing === 'image-size') { 25 // Check both old featured image and new hero images block 26 const wideImage = document.querySelector('.featured-image-wide img, .wp-block-vibemap-hero-image.featured-image-wide img'); 27 const narrowImage = document.querySelector('.featured-image-narrow img, .wp-block-vibemap-hero-image.featured-image-narrow img'); 28 const featuredImage = wideImage || narrowImage; 29 30 console.log('Wide Image:', wideImage); 31 console.log('Narrow Image:', narrowImage); 32 console.log('Featured Image:', featuredImage); 33 34 if (featuredImage) { 35 // If image is already loaded 36 if (featuredImage.complete) { 37 checkImageWidth(featuredImage); 38 } else { 39 // If image is still loading 40 featuredImage.onload = function() { 41 checkImageWidth(featuredImage); 42 }; 43 } 44 } 45 } else if (featured_image_sizing === 'above-sidebar') { 46 document.body.classList.add('has-wide-image'); 47 } else if (featured_image_sizing === 'next-to-sidebar') { 48 document.body.classList.add('hide-wide-image'); 49 } 50 51 function checkImageWidth(img) { 52 // Add class to body if image is wide enough 53 if (img.naturalWidth >= 1000) { 54 document.body.classList.add('has-wide-image'); 55 } 56 } 57});
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.