1ACC.ratingstars = { 2 3 _autoload: [ 4 ["bindRatingStars", $(".js-ratingCalc").length > 0], 5 ["bindRatingStarsSet", $(".js-ratingCalcSet").length > 0] 6 ], 7 8 bindRatingStars: function(){ 9 10 $(".js-ratingCalc").each(function(){ 11 var rating = $(this).data("rating"); 12 $(this).find(".js-greenStars").width($(this).width() * ( parseFloat(rating.rating, 10) / rating.total )) 13 }) 14 }, 15 bindRatingStarsSet: function(){ 16 $('.js-writeReviewStars').on({ 17 mouseleave: function mouseleave(){ 18 clearReviewState(); 19 var sV = (parseFloat( $(".js-ratingSetInput").val(), 10)) * 2; 20 (typeof sV === "number" && !isNaN(sV) )? setReviewState(sV) : clearReviewState(); 21 } 22 }); 23 var ratingIcons = $('.js-writeReviewStars .js-ratingIcon'); 24 var setReviewState = function(index){ 25 ratingIcons.slice(0, parseFloat(index,10) ).addClass('active'); 26 }; 27 var clearReviewState = function(){ 28 ratingIcons.removeClass('active'); 29 }; 30 ratingIcons.on({ 31 mouseenter: function mouseenter(){ 32 clearReviewState(); 33 setReviewState( $(this).index()+1 ); 34 }, 35 mouseleave: function mouseleave(){ 36 $(this).removeClass('active'); 37 }, 38 click: function click(){ 39 $(".js-ratingSetInput").val( ($(this).index() + 1) /2); 40 } 41 }); 42 43 } 44 45};
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.