1(function(Drupal, $) { 2 Drupal.behaviors.purposeCourseTypeSlider = { 3 attach: function(context, settings) { 4 if (context !== document) { 5 return; 6 } 7 8 9 $('.node-purpose-purposes-and-course-types__field-description').each(function( index ) { 10 var component = $(this).find('p'); 11 var componentText = component.text(); 12 var result = componentText.split(/[\n\r\!\,\.\?]/)[0]; 13 component.text(result); 14 }); // Show only first sentence 15 16 const arr = []; 17 $('.purposes-course-types__wrapper .field__item').each(function() { 18 const arrItem = $(this).find('.node-purpose-purposes-and-course-types__field-alternative-title').text(); 19 20 arr.push(arrItem); 21 }); 22 23 if ($(window).width() > 767) { 24 let swiper = new Swiper('.purposes-course-types__container', { 25 lazy: true, 26 pagination: { 27 el: '.swiper-pagination', 28 clickable: true, 29 renderBullet: function (index, className) { 30 return '<button class="' + className + '">' + (arr[index]) + '</button>'; 31 }, 32 }, 33 }); 34 } else { 35 $('.field__item:first-child').find('.node-purpose-purposes-and-course-types__content').slideDown(); 36 $('.field__item:first-child').find('.course-type-listing-container.mobile').addClass('opened'); 37 38 $('.course-type-listing-container.mobile').on('click', function (e) { 39 e.preventDefault(); 40 if ($(this).hasClass('opened')) { 41 $(this).removeClass('opened'); 42 $(this).closest('.field__item').find('.node-purpose-purposes-and-course-types__content').stop(true,true).slideUp(); 43 } else { 44 $('.course-type-listing-container.mobile').removeClass('opened'); 45 $(this).addClass('opened'); 46 $('.field__item').find('.node-purpose-purposes-and-course-types__content').stop(true,true).slideUp(); 47 $(this).closest('.field__item').find('.node-purpose-purposes-and-course-types__content').slideDown(); 48 } 49 50 }); 51 } 52 } 53 }; 54})(Drupal, jQuery);
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.