1(function ($) { 2 'use strict'; 3 $(document).ready(function () { 4 const calculateSlidesToShow_v3 = () => Math.max(Math.floor($('.repocean-slider-main-v3 .right').width() / 305), 1); 5 const initializeSlider_v3 = () => { 6 const slidesToShow_v3 = calculateSlidesToShow_v3(); 7 $('.repocean-slider-main-v3 .slider-box-parent').slick({ 8 dots: false, 9 autoplay: true, 10 infinite: true, 11 autoplaySpeed: 6100, 12 prevArrow: '<button class="slide-arrow prev-arrow" aria-label="Previous"><svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9,18 15,12 9,6"></polyline></svg></button>', 13 nextArrow: '<button class="slide-arrow next-arrow" aria-label="Next"><svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9,18 15,12 9,6"></polyline></svg></button>', 14 speed: 700, 15 slidesToShow: slidesToShow_v3, 16 slidesToScroll: 1, 17 variableWidth: false, 18 arrows: repocean_slider_js_v3.arrowVisibility === 'true' 19 }); 20 }; 21 const refreshReadMore = () => { 22 $('.repocean-slider-main-v3 .slider-box-inner').each(function () { 23 const $desc = $(this).find('.description'); 24 const $btn = $(this).find('.button-content'); 25 if (!$desc.length || !$btn.length || $desc.hasClass('expanded')) { 26 return; 27 } 28 const el = $desc[0]; 29 const fits = el.scrollHeight <= el.clientHeight + 2; 30 const hasPhotos = $(this).find('.repocean-review-photos').length > 0; 31 $btn.toggleClass('hide', fits && !hasPhotos); 32 $btn.toggleClass('is-placeholder', fits && hasPhotos); 33 }); 34 }; 35 setTimeout(() => { 36 $('.slider-box-inner, .left-inner').show(); 37 $('.repocean-slider-main-v3 .repocean-content-wrapper').css('visibility', 'visible'); 38 refreshReadMore(); 39 }, 1); 40 initializeSlider_v3(); 41 $(window).on('resize', () => { 42 $('.repocean-slider-main-v3 .slider-box-parent').slick('unslick'); 43 initializeSlider_v3(); 44 refreshReadMore(); 45 }); 46 }); 47 48 $('.repocean-slider-main-v3').on('click', '.button-content .rep-button a', function (event) { 49 event.preventDefault(); 50 51 const $button = $(this); 52 const $description = $button.closest('.slider-box-inner').find('.description'); 53 const isExpanded = $description.hasClass('expanded'); 54 const fullHeight = $description[0].scrollHeight; 55 const collapsedHeight = 40; 56 const totalSteps = 15; 57 const delay = 10 / totalSteps; 58 const heightStep = (fullHeight - collapsedHeight) / totalSteps; 59 60 if ($description.data('animating')) { 61 return; 62 } 63 $description.data('animating', true); 64 65 function expandLoop(currentHeight, stepCount) { 66 if (stepCount >= totalSteps) { 67 $description.addClass('expanded').removeData('animating').css('max-height', fullHeight + 'px'); 68 return; 69 } 70 currentHeight += heightStep; 71 $description.css('max-height', currentHeight + 'px'); 72 setTimeout(() => expandLoop(currentHeight, stepCount + 1), delay); 73 } 74 75 function collapseLoop(currentHeight, stepCount) { 76 if (stepCount >= totalSteps) { 77 $description.removeClass('expanding expanded').removeData('animating').css('max-height', ''); 78 return; 79 } 80 currentHeight -= heightStep; 81 $description.css('max-height', currentHeight + 'px'); 82 setTimeout(() => collapseLoop(currentHeight, stepCount + 1), delay); 83 } 84 85 if (isExpanded) { 86 $description.removeClass('expanded'); 87 collapseLoop(fullHeight, 0); 88 $button.text(repocean_slider_js_v3.read_more); 89 } else { 90 $description.addClass('expanding').css('max-height', collapsedHeight + 'px'); 91 expandLoop(collapsedHeight, 0); 92 $button.text(repocean_slider_js_v3.hide); 93 } 94 });
95})(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.