Making WordPress.org

Ticket #3969: 3969.patch

File 3969.patch, 918 bytes (added by ishitaka, 6 years ago)
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/stats.js

     
    148148                                        barValues   = [ '' ],
    149149                                        versionList = [],
    150150                                        index       = 0,
     151                                        sum         = 0,
    151152                                        data, formatter;
    152153
     154                                // Set the total value to 100.
     155                                $.each( versions, function( version ) {
     156                                        sum += parseFloat( versions[ version ] );
     157                                } );
     158                                if ( sum > 100 ) {
     159                                        $.each( versions, function( version ) {
     160                                                versions[ version ] = 100.0 / sum * parseFloat( versions[ version ] );
     161                                        } );
     162                                }
     163
    153164                                // Gather and sort the list of versions.
    154165                                $.each( versions, function( version ) {
    155166                                        versionList.push( version );