1$(document).ready(function() { 2 3 // Count the number of .review-product-container elements 4 var containerCount = $(".review-product-container").length; 5 6 // Iterate over each .review-product-container element 7 $(".review-product-container").each(function(index) { 8 9 // Add id on loop 10 $(this).find('.rp-score').attr('id', 'rpq' + (index + 1)); 11 12 // Update the .total-no span with the total count 13 $(this).find(".total-no").text(containerCount); 14 15 // Update the .win-no span with the current index + 1 16 $(this).find(".win-no").text(index + 1); 17 18 // Add circleProgress for rating 19 var item_rating = $(this).data('rating') * 0.1; 20 if(!item_rating){ 21 item_rating = 0.25; 22 } 23 24 var progressBarOptions = { 25 startAngle: -1.55, 26 size: 90, 27 value: item_rating * 1, 28 fill: { 29 color: "#019309" 30 } 31 } 32 33 $(this).find('.rp-score').circleProgress(progressBarOptions).on('circle-animation-progress', function(event, progress, stepValue) { 34 $(this).find('.rp-score .score').text(String(stepValue.toFixed(2))); 35 }); 36 37 }); 38 39 $(".rp-star-rating").each(function() { 40 var $this = $(this); 41 var ratingScore = $this.data("rating-score"); 42 43 $this.starRating({ 44 totalStars: ratingScore, 45 starSize: 15, 46 emptyColor: "lightgray", 47 hoverColor: "#FFA41C", 48 activeColor: "#FFA41C", 49 initialRating: 25, 50 strokeWidth: 0, 51 useGradient: false, 52 minRating: 1, 53 readOnly: true 54 }); 55 }); 56 57 $('.sbly--ads-btn').hover(function() { 58 $('.sbly--hidden-bubble').fadeIn(300); 59 }, function() { 60 $('.sbly--hidden-bubble').fadeOut(300); 61 }); 62 63 function getLabelForItem(index) { 64 if (index === 0) { // For the first item 65 var currentYear = new Date().getFullYear(); 66 return `"#1 PICK IN ${currentYear}"`; 67 } else { 68 return getOrdinalIndicator(index + 1); 69 } 70 } 71 72 function getOrdinalIndicator(i) { 73 var j = i % 10, 74 k = i % 100; 75 if (j == 1 && k != 11) { 76 return `"${i}st"`; 77 } 78 if (j == 2 && k != 12) { 79 return `"${i}nd"`; 80 } 81 if (j == 3 && k != 13) { 82 return `"${i}rd"`; 83 } 84 return `"${i}th"`; 85 } 86 87 var styleHTML = "<style>"; 88 $('.sbly--review-top-3-item').each(function(index) { 89 var label = getLabelForItem(index); 90 styleHTML += `.sbly--review-top-3-item:nth-child(${index + 1})::before { content: ${label}; }`; 91 }); 92 styleHTML += "</style>"; 93 94 // Append the styles to the head 95 $('head').append(styleHTML); 96 97 $('.content-article').prepend($('<div id="above-title-container"></div>')); 98 const firstImageElement = $('.content-article > img[id="top-image"]').first()[0]; 99 if (firstImageElement) { 100 $('#above-title-container').append(firstImageElement.cloneNode()); 101 } 102 $('.review-product-container').first().css({ 'margin-top': '2.75rem', 'margin-bottom': '1.5rem' } ); 103 $('#above-title-container').append($('#above-title-description')); 104 $('#above-title-description').show(); 105 $('#above-title-container').append($('#above-title')); 106});
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.