Index: trunk/extensions/CentralNotice/bannerstats.js |
— | — | @@ -4,22 +4,24 @@ |
5 | 5 | */ |
6 | 6 | $( document ).ready( function () { |
7 | 7 | /* |
8 | | - $.each( wgCentralNoticeAllocationCampaigns, function( index, campaignName ) { |
9 | | - var statUrl = 'http://fundraising-analytics.wikimedia.org/live_stats/' + campaignName; |
10 | | - $.ajax( { |
11 | | - 'url': statUrl, |
12 | | - 'data': {}, |
13 | | - 'dataType': 'jsonp', |
14 | | - 'type': 'GET', |
15 | | - 'success': function( data ) { |
16 | | - //console.debug( "Success" ); |
17 | | - //console.debug( data ); |
18 | | - }, |
19 | | - 'error': function( xhr ) { |
20 | | - //console.debug( "Error" ); |
21 | | - //console.debug( xhr ); |
22 | | - } |
23 | | - } ); |
24 | | - } ) |
| 8 | + if ( typeof wgCentralNoticeAllocationCampaigns !== 'undefined' ) { |
| 9 | + $.each( wgCentralNoticeAllocationCampaigns, function( index, campaignName ) { |
| 10 | + var statUrl = 'http://fundraising-analytics.wikimedia.org/json_reporting/' + campaignName; |
| 11 | + $.ajax( { |
| 12 | + 'url': statUrl, |
| 13 | + 'data': {}, |
| 14 | + 'dataType': 'jsonp', |
| 15 | + 'type': 'GET', |
| 16 | + 'success': function( data ) { |
| 17 | + //console.debug( "Success" ); |
| 18 | + //console.debug( data ); |
| 19 | + }, |
| 20 | + 'error': function( xhr ) { |
| 21 | + //console.debug( "Error" ); |
| 22 | + //console.debug( xhr ); |
| 23 | + } |
| 24 | + } ); |
| 25 | + } ) |
| 26 | + } |
25 | 27 | */ |
26 | 28 | } ); |