r106873 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106872‎ | r106873 | r106874 >
Date:21:54, 20 December 2011
Author:kaldari
Status:ok
Tags:
Comment:
make sure we dont throw a js error when no campaigns are running
Modified paths:
  • /trunk/extensions/CentralNotice/bannerstats.js (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/bannerstats.js
@@ -4,22 +4,24 @@
55 */
66 $( document ).ready( function () {
77 /*
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+ }
2527 */
2628 } );

Follow-up revisions

RevisionCommit summaryAuthorDate
r107015MFT r103297, r104003, r104210, r104999, r105015, r105740, r105800, r106166, r...awjrichards23:56, 21 December 2011

Status & tagging log