1(function ($, Drupal, once) { 2 'use strict'; 3 4 Drupal.behaviors.randomHomeHero = { 5 attach: function (context) { 6 once('random-home-hero', '.home-hero', context).forEach(function (hero) { 7 const myData = [ 8 { 9 imageUrl: '/sites/default/files/hero_images/hero_homepage/01-Jackson-MS-Andrew-Welch.jpg', 10 text: 'Capitol Street, Jackson - Andrew Welch' 11 }, 12 { 13 imageUrl: '/sites/default/files/hero_images/hero_homepage/07-Natural-Science-Museum-Brandon-Morgan.jpg', 14 text: 'Natural Science Museum, Jackson â Brandon Morgan' 15 }, 16 { 17 imageUrl: '/sites/default/files/hero_images/hero_homepage/08-Natchez-MS-James-Salvas.jpg', 18 text: 'Natchez-Vidalia Bridge â James Salvas' 19 }, 20 { 21 imageUrl: '/sites/default/files/hero_images/hero_homepage/15-Daffodils-Pearl%2CMS-Ryan-Wood.jpg', 22 text: 'Daffodils, Pearl â Ryan Wood' 23 }, 24 { 25 imageUrl: '/sites/default/files/hero_images/hero_homepage/14-Butterfly-Charlie-Waite.jpg', 26 text: 'Butterfly â Charlie Waite' 27 }, 28 { 29 imageUrl: '/sites/default/files/hero_images/hero_homepage/06-Ocean-Springs-Adobe-Stock.jpg', 30 text: 'Ocean Springs - Adobe Stock' 31 }, 32 { 33 imageUrl: '/sites/default/files/hero_images/hero_homepage/06-Ocean-Springs-Adobe-Stock.jpg', 34 text: 'Ocean Springs - Adobe Stock' 35 } 36 ]; 37 38 const randomItem = myData[Math.floor(Math.random() * myData.length)]; 39 40 $(hero).css('background-image', "url('" + randomItem.imageUrl + "')"); 41 $('#randomText', context).text(randomItem.text); 42 }); 43 } 44 }; 45 46})(jQuery, Drupal, once);
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.