Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js |
— | — | @@ -1,18 +1,15 @@ |
2 | 2 | ( function ( $ ) { |
3 | 3 | $.articleFeedbackv5special = {}; |
4 | 4 | |
5 | | - // TODO: Pass this in from the PHP side. Add it to mwConfig or w/e? |
6 | | - //$.articleFeedbackv5special.page = mw.config.get( 'wgPageId' ); |
| 5 | + // TODO: Pass this in better from the PHP side. |
7 | 6 | $.articleFeedbackv5special.page = hackPageId; |
8 | 7 | $.articleFeedbackv5special.filter = 'all'; |
9 | 8 | $.articleFeedbackv5special.sort = 'newest'; |
10 | 9 | $.articleFeedbackv5special.limit = 25; |
11 | 10 | $.articleFeedbackv5special.offset = 0; |
12 | 11 | $.articleFeedbackv5special.showing = 0; |
| 12 | + $.articleFeedbackv5special.apiUrl = undefined; |
13 | 13 | |
14 | | - $.articleFeedbackv5special.apiUrl = mw.util.wikiScript('api'); //config.get( 'wgScriptPath' ) + '/api.php'; |
15 | | - |
16 | | - |
17 | 14 | $.articleFeedbackv5special.setBinds = function() { |
18 | 15 | $( '#aft5-filter' ).bind( 'change', function(e) { |
19 | 16 | $.articleFeedbackv5special.filter = $(this).val(); |
— | — | @@ -110,8 +107,14 @@ |
111 | 108 | } )( jQuery ); |
112 | 109 | |
113 | 110 | $( document ).ready( function() { |
| 111 | + // This was failing sometimes when it was in the function above. |
| 112 | + // I think it maky have been a race condition. |
| 113 | + $.articleFeedbackv5special.apiUrl = mw.util.wikiScript('api'); |
| 114 | + |
114 | 115 | // Blank out the 'loading' text |
115 | 116 | $( '#aft5-show-feedback' ).text( ' ' ); |
| 117 | + |
| 118 | + // Set up event binds and do initial data fetch. |
116 | 119 | $.articleFeedbackv5special.setBinds(); |
117 | 120 | $.articleFeedbackv5special.loadFeedback(); |
118 | 121 | } ); |