1jQuery( function( $ ) { 2 const ratings = $( '.wpzoom-rcb-comment-rating-stars' ); 3 const selectedClass = 'wpz-full-star'; 4 5 function toggleStyles( currentInput ) { 6 const thisInput = $( currentInput ); 7 const index = parseInt( thisInput.val() ); 8 9 stars.removeClass( selectedClass ); 10 stars.slice( 0, index + 1 ).addClass( selectedClass ); 11 } 12 13 // If the ratings exist on the page 14 if ( ratings.length !== 0 ) { 15 const inputs = ratings.find( 'input[type="radio"]' ); 16 const labels = ratings.find( 'label' ); 17 var stars = inputs.next(); 18 19 inputs.on( 'change', function( event ) { 20 toggleStyles( event.target ); 21 } ); 22 23 labels.hover( function( event ) { 24 $curInput = $( event.currentTarget ).find( 'input' ); 25 toggleStyles( $curInput ); 26 }, function() { 27 $currentSelected = ratings.find( 'input[type="radio"]:checked' ); 28 toggleStyles( $currentSelected ); 29 } ); 30 } 31} );
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.