Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -85,9 +85,10 @@ |
86 | 86 | 'moodbar-feedback-permalink' => 'link to here', |
87 | 87 | 'moodbar-feedback-noresults' => 'There are no comments that match your filters.', |
88 | 88 | 'moodbar-feedback-more' => 'More', |
89 | | - 'moodbar-feedback-nomore' => 'There are no more results to show', |
| 89 | + 'moodbar-feedback-nomore' => 'There are no more results to show.', |
90 | 90 | 'moodbar-feedback-newer' => 'Newer', |
91 | 91 | 'moodbar-feedback-older' => 'Older', |
| 92 | + 'moodbar-feedback-ajaxerror' => 'An error occurred while fetching more results.', |
92 | 93 | // Mood types |
93 | 94 | 'moodbar-type-happy' => 'Happy', |
94 | 95 | 'moodbar-type-sad' => 'Sad', |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js |
— | — | @@ -37,8 +37,14 @@ |
38 | 38 | $.ajax( mw.util.wikiScript( 'api' ), { |
39 | 39 | 'data': reqData, |
40 | 40 | 'success': function( data ) { |
| 41 | + // Remove the spinner and restore the "More" link |
| 42 | + $( '#fbd-list-more' ) |
| 43 | + .removeClass( 'mw-ajax-loader' ) |
| 44 | + .children( 'a' ) |
| 45 | + .css( 'visibility', 'visible' ); |
| 46 | + |
41 | 47 | if ( !data || !data.query || !data.query.moodbarcomments ) { |
42 | | - // TODO error |
| 48 | + $( '#fbd-list-more' ).text( mw.msg( 'moodbar-feedback-ajaxerror' ) ); |
43 | 49 | return; |
44 | 50 | } |
45 | 51 | |
— | — | @@ -62,17 +68,14 @@ |
63 | 69 | $ul.append( comments[i].formatted ); |
64 | 70 | } |
65 | 71 | |
66 | | - // Remove the spinner and restore the "More" link |
67 | | - $( '#fbd-list-more' ) |
68 | | - .removeClass( 'mw-ajax-loader' ) |
69 | | - .children( 'a' ) |
70 | | - .css( 'visibility', 'visible' ); |
71 | 72 | if ( !moreResults ) { |
72 | 73 | $( '#fbd-list-more' ).text( mw.msg( 'moodbar-feedback-nomore' ) ); |
73 | 74 | } |
74 | 75 | }, |
75 | 76 | 'error': function( jqXHR, textStatus, errorThrown ) { |
76 | | - // TODO |
| 77 | + $( '#fbd-list-more' ) |
| 78 | + .removeClass( 'mw-ajax-loader' ) |
| 79 | + .text( mw.msg( 'moodbar-feedback-ajaxerror' ) ); |
77 | 80 | }, |
78 | 81 | 'dataType': 'json' |
79 | 82 | } ); |
Index: trunk/extensions/MoodBar/MoodBar.php |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | $wgResourceModules['ext.moodBar.dashboard'] = $mbResourceTemplate + array( |
121 | 121 | 'scripts' => 'ext.moodBar.dashboard/ext.moodBar.dashboard.js', |
122 | 122 | 'dependencies' => array( 'mediawiki.util' ), |
123 | | - 'messages' => array( 'moodbar-feedback-nomore' ), |
| 123 | + 'messages' => array( 'moodbar-feedback-nomore', 'moodbar-feedback-ajaxerror' ), |
124 | 124 | ); |
125 | 125 | |
126 | 126 | $wgResourceModules['ext.moodBar.dashboard.styles'] = $mbResourceTemplate + array( |