Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.hooks.php |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | * @return bool |
164 | 164 | */ |
165 | 165 | public static function stylePage( &$out, &$skin ) { |
166 | | - $out->addModuleStyles( 'ext.OnlineStatusBar' ); |
| 166 | + $out->addModules( 'ext.OnlineStatusBar' ); |
167 | 167 | return true; |
168 | 168 | } |
169 | 169 | |
Index: trunk/extensions/OnlineStatusBar/ext.onlinestatusbar.js |
— | — | @@ -0,0 +1,30 @@ |
| 2 | +// brion's |
| 3 | + |
| 4 | +$(function() { |
| 5 | + |
| 6 | + $statusbar = $('#status-top'); |
| 7 | + |
| 8 | + // Only do the rest if we have the statusbar! |
| 9 | + if ($statusbar.length > 0) { |
| 10 | + function updateOnlineStatusBar() { |
| 11 | + // ... code to fetch and update |
| 12 | + $.ajax({ |
| 13 | + url: mw.config.get('wgScriptUrl') + '/api' + mw.config.get('wgScriptExtension'), |
| 14 | + params: { |
| 15 | + action: "query", |
| 16 | + prop: "onlinestatus", |
| 17 | + onlinestatususer: mw.config.get('wgTitle'), |
| 18 | + format: 'json' |
| 19 | + }, |
| 20 | + success: function(data) { |
| 21 | + // code to update the statusbar based on the returned message |
| 22 | + } |
| 23 | +}); |
| 24 | + } |
| 25 | + |
| 26 | + // Update the status every couple minutes if we leave the page open |
| 27 | + window.setInterval(updateOnlineStatusBar(), 120 * 1000); |
| 28 | + updateOnlineStatusBar(); |
| 29 | +} |
| 30 | + |
| 31 | +}); |
Property changes on: trunk/extensions/OnlineStatusBar/ext.onlinestatusbar.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 32 | + native |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | return <<<HTML |
27 | 27 | <div class="onlinestatusbarbody metadata onlinestatusbartop" id="status-top"> |
28 | 28 | <div class="onlinestatusbaricon"> |
29 | | -$text</div></div> |
| 29 | +</div></div> |
30 | 30 | HTML; |
31 | 31 | } |
32 | 32 | |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php |
— | — | @@ -38,6 +38,7 @@ |
39 | 39 | 'cologne' => array ( 'OnlineStatusBarCologne.css' ), |
40 | 40 | 'nostalgia' => array ( 'OnlineStatusBarNostalgia.css' ), |
41 | 41 | ), |
| 42 | + 'scripts' => 'ext.onlinestatusbar.js', |
42 | 43 | 'localBasePath' => dirname ( __FILE__ ), |
43 | 44 | 'remoteExtPath' => 'OnlineStatusBar', |
44 | 45 | ); |