1function registerCarousel(SlideshowWidgetId) { 2 const carouselEl = document.querySelector(`#carousel_${SlideshowWidgetId}`) 3 const carousel = bootstrap.Carousel.getInstance(carouselEl); 4 // need this to force the carousel to restart after the edit/save has been done. Otherwise it won't cycle again. 5 // and be forever in a motionless state 6 if (!carousel && carousel !== null) { 7 carousel.cycle(); 8 } 9 10 $(`#play_${SlideshowWidgetId}`).on("click", function (evt) { 11 evt.preventDefault(); 12 13 var $icon = $(this).find('i'); 14 var isPaused = $icon.hasClass('fa-pause'); 15 16 $(`#carousel_${SlideshowWidgetId} .carousel-inner`).attr('aria-live', isPaused ? 'polite' : 'off'); 17 $(this).attr('aria-label', isPaused ? 'Play Slideshow' : 'Pause Slideshow'); 18 19 const carouselEl = document.querySelector(`#carousel_${SlideshowWidgetId}`) 20 const carousel = bootstrap.Carousel.getInstance(carouselEl); 21 if (isPaused) { 22 carousel.pause(); 23 } 24 else { 25 carousel.cycle(); 26 } 27 28 $icon 29 .removeClass(isPaused ? 'fa-pause' : 'fa-play') 30 .addClass(isPaused ? 'fa-play' : 'fa-pause'); 31 }); 32}
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.