Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | $modeText = $wgOnlineStatusBarModes[$mode]; |
35 | 35 | return Html::element( 'img', array( 'src' => $icon ) ); |
36 | 36 | } |
37 | | - |
| 37 | + |
38 | 38 | public static function ParserGetVariable ( &$parser, &$varCache, &$index, &$ret ){ |
39 | 39 | if( $index == 'isonline' ){ |
40 | 40 | $name = self::GetOwnerFromTitle ( $parser->getTitle() )->getName(); |
— | — | @@ -47,6 +47,11 @@ |
48 | 48 | return true; |
49 | 49 | } |
50 | 50 | |
| 51 | + public static function StylePage ( &$out, &$skin ) { |
| 52 | + $out->addModules ( 'ext.OnlineStatusBar' ); |
| 53 | + return true; |
| 54 | + } |
| 55 | + |
51 | 56 | public static function GetNow() { |
52 | 57 | return gmdate( 'Ymdhis', time() ); |
53 | 58 | } |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php |
— | — | @@ -26,6 +26,12 @@ |
27 | 27 | $dir = dirname( __FILE__ ); |
28 | 28 | $wgExtensionMessagesFiles['OnlineStatusBar'] = "$dir/OnlineStatusBar.i18n.php"; |
29 | 29 | |
| 30 | +$wgResourceModules['ext.OnlineStatusBar'] = array ( |
| 31 | + 'styles' => 'OnlineStatusBar.css', |
| 32 | + 'localBasePath' => dirname ( __FILE__ ), |
| 33 | + 'remoteExtPath' => 'OnlineStatusBar', |
| 34 | + ); |
| 35 | + |
30 | 36 | $wgAutoloadClasses['OnlineStatusBar'] = "$dir/OnlineStatusBar.body.php"; |
31 | 37 | |
32 | 38 | // Configuration |
— | — | @@ -145,5 +151,6 @@ |
146 | 152 | } |
147 | 153 | |
148 | 154 | $wgHooks['LanguageGetMagic'][] = 'OnlineStatusBar::MagicWordVar'; |
| 155 | +$wgHooks['BeforePageDisplay'][] = 'OnlineStatusBar::StylePage'; |
149 | 156 | $wgHooks['MagicWordwgVariableIDs'][] = 'OnlineStatusBar::MagicWordSet'; |
150 | 157 | $wgHooks['ParserGetVariableValueSwitch'][] = 'OnlineStatusBar::ParserGetVariable'; |
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.css |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +/* |
| 3 | +This is a part of css used on english wp, it's needed for wikis |
| 4 | +where topicon isn't defined |
| 5 | +*/ |
| 6 | +div.topicon { |
| 7 | + position: absolute; |
| 8 | + top: -2em; |
| 9 | + margin-right: -10px; |
| 10 | + display: block !important; |
| 11 | +} |
| 12 | + |