Changeset 4260 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/stats.js
- Timestamp:
- 10/19/2016 02:30:54 AM (7 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/stats.js
r4258 r4260 3 3 ( function( $, settings ) { 4 4 $( function () { 5 jQuery.getJSON('https://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=' + settings.slug + '&limit=267&callback=?', function( downloads ) {5 $.getJSON('https://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=' + settings.slug + '&limit=267&callback=?', function( downloads ) { 6 6 var data = new google.visualization.DataTable(), 7 7 count = 0, … … 45 45 curveType: 'function' 46 46 } ); 47 } ); 48 49 $.getJSON('https://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=' + settings.slug + '&historical_summary=1&callback=?', function( summary ) { 50 var $tbody = $('table#plugin-download-history-stats tbody:last-child'); 51 52 for ( var summary_field in summary ) { 53 if ( ! summary.hasOwnProperty( summary_field ) ) { 54 continue; 55 } 56 57 var text = settings.l10n[summary_field]; 58 var count = parseInt(summary[ summary_field ]).toLocaleString(); 59 60 $newrow = $("<tr><th scope='row'></th><td>0</td></tr>"); 61 $newrow.find( 'th' ).text( text ); 62 $newrow.find( 'td' ).text( count ); 63 $tbody.append( $newrow ); 64 } 47 65 } ); 48 66
Note: See TracChangeset
for help on using the changeset viewer.