1jQuery( 2 function( $ ) 3 { 4 // Correct the header and items width 5 var correct_header = function() 6 { 7 $( '.music-store-items,.music-store-pagination' ).each( 8 function() 9 { 10 var e = $( this ); 11 if( e.parents( '.widget' ).length == 0 ) 12 { 13 e.css( 'min-width', $( '.music-store-header' ).outerWidth() ); 14 } 15 } 16 ); 17 }; 18 19 correct_header(); 20 $( window ).load( correct_header ); 21 $( window ).bind( 'orientationchange resize', correct_header ); 22 23 // Replace the popularity texts with the stars 24 var popularity_top = 0; 25 $( '.collection-popularity,.song-popularity' ).each( 26 function() 27 { 28 var e = $( this ), 29 p = parseInt( e.find( 'span' ).remove().end().text().replace( /\s/g, '' ) ); 30 31 e.text( '' ).attr( 'popularity', p ); 32 popularity_top = Math.max( popularity_top, p ); 33 } 34 ); 35 36 $( '.collection-popularity,.song-popularity' ).each( 37 function() 38 { 39 40 var e = $( this ), 41 p = e.attr( 'popularity' ), 42 str = '', 43 active = 0; 44 45 if( popularity_top > 0 ) 46 { 47 active = Math.ceil( p / popularity_top * 100 / 20 ); 48 } 49 50 for( var i = 0; i < active; i++ ) 51 { 52 str += '<div class="star-active"></div>'; 53 } 54 55 for( var i = 0, h = 5 - active; i < h; i++ ) 56 { 57 str += '<div class="star-inactive"></div>'; 58 } 59 e.html( str ); 60 } 61 ); 62 63 // Correct the item heights 64 var height_arr = [], 65 max_height = 0; 66 67 window[ 'ms_correct_heights' ] = function() 68 { 69 $( '.music-store-items' ).children( 'div' ).each( 70 function() 71 { 72 var e = $( this ); 73 if( e.hasClass( 'music-store-item' ) ) 74 { 75 max_height = Math.max( e.height(), max_height ); 76 } 77 else 78 { 79 height_arr.push( max_height ); 80 max_height = 0; 81 } 82 } 83 ); 84 85 if( height_arr.length ) 86 { 87 $( '.music-store-items' ).children( 'div' ).each( 88 function() 89 { 90 var e = $( this ); 91 if( e.hasClass( 'music-store-item' ) ) 92 { 93 e.height( height_arr[ 0 ] ); 94 } 95 else 96 { 97 height_arr.splice( 0, 1 ); 98 } 99 } 100 ); 101 } 102 }; 103 104 $( window ).load( function(){ ms_correct_heights(); } ); 105 106 // Modify the price box 107 $( '.song-price' ).each( 108 function() 109 { 110 var e = $( this ); 111 e.closest( 'div' ).addClass( 'price-box' ).find( 'span.invalid,span.label' ).remove(); 112 } 113 ); 114 115 $( '.collection-price' ).each( 116 function() 117 { 118 var e = $( this ); 119 e.closest( 'div' ).addClass( 'price-box' ).find( 'span.label,span.invalid' ).remove(); 120 } 121 ); 122 123 // Indicate the active tab 124 125 $( '.music-store-tabs' ).children( 'li' ).click( 126 function() 127 { 128 var e = $( this ), 129 p = e.position(), 130 w = e.width()/2; 131 132 if( $( '.music-store-corner' ).length == 0 ) 133 $( '.music-store-tabs-container' ).prepend( $( '<div class="music-store-corner"></div>' ) ); 134 $( '.music-store-corner' ).css( 'margin-left', ( p.left + w ) + 'px' ); 135 } 136 ); 137 $( 'li.active-tab' ).click(); 138 } 139);
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.