r105390 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105389‎ | r105390 | r105391 >
Date:00:29, 7 December 2011
Author:petrb
Status:deferred
Tags:
Comment:
work in progress is probably totaly broken, I just need a quick review :)
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.hooks.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/ext.onlinestatusbar.js (added) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.hooks.php
@@ -162,7 +162,7 @@
163163 * @return bool
164164 */
165165 public static function stylePage( &$out, &$skin ) {
166 - $out->addModuleStyles( 'ext.OnlineStatusBar' );
 166+ $out->addModules( 'ext.OnlineStatusBar' );
167167 return true;
168168 }
169169
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
132 + native
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -25,7 +25,7 @@
2626 return <<<HTML
2727 <div class="onlinestatusbarbody metadata onlinestatusbartop" id="status-top">
2828 <div class="onlinestatusbaricon">
29 -$text</div></div>
 29+</div></div>
3030 HTML;
3131 }
3232
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -38,6 +38,7 @@
3939 'cologne' => array ( 'OnlineStatusBarCologne.css' ),
4040 'nostalgia' => array ( 'OnlineStatusBarNostalgia.css' ),
4141 ),
 42+ 'scripts' => 'ext.onlinestatusbar.js',
4243 'localBasePath' => dirname ( __FILE__ ),
4344 'remoteExtPath' => 'OnlineStatusBar',
4445 );

Status & tagging log