1(function ($, Drupal, drupalSettings) { 2 3 'use strict'; 4 5 /** 6 * Image background behind images card 7 */ 8 Drupal.behaviors.backgroundImage = { 9 attach: function (context) { 10 once('card', '.node--type-actualite .fr-card__header .fr-card__img').forEach(function () { 11 // $('#block-views-block-liste-actualites-actualites-meme-thematique .fr-card__header .fr-card__img').once().each(function (i, e) { 12 let arrayImagesBackground = ["Antisemitisme.jpg", "Discrimination.jpg", "Haine-Ligne.jpg", "LGBT.jpg", "Racisme.jpg"]; 13 let images = document.querySelectorAll('.node--type-actualite .fr-card__header .fr-card__img'); 14 // let images = document.querySelectorAll('#block-views-block-liste-actualites-actualites-meme-thematique .fr-card__header .fr-card__img'); 15 16 if(images){ 17 for(let item in images) { 18 let rand = arrayImagesBackground[Math.floor(Math.random() * arrayImagesBackground.length)]; 19 if(images[item].style) { 20 images[item].style.backgroundImage = "url(/themes/custom/dilcrah/img/fond/" + rand + ")"; 21 } 22 } 23 } 24 }); 25 } 26 } 27 28})(jQuery, Drupal, drupalSettings);
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.