r100963 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100962‎ | r100963 | r100964 >
Date:11:55, 27 October 2011
Author:petrb
Status:deferred
Tags:
Comment:
inserted css
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.css (added) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -33,7 +33,7 @@
3434 $modeText = $wgOnlineStatusBarModes[$mode];
3535 return Html::element( 'img', array( 'src' => $icon ) );
3636 }
37 -
 37+
3838 public static function ParserGetVariable ( &$parser, &$varCache, &$index, &$ret ){
3939 if( $index == 'isonline' ){
4040 $name = self::GetOwnerFromTitle ( $parser->getTitle() )->getName();
@@ -47,6 +47,11 @@
4848 return true;
4949 }
5050
 51+ public static function StylePage ( &$out, &$skin ) {
 52+ $out->addModules ( 'ext.OnlineStatusBar' );
 53+ return true;
 54+ }
 55+
5156 public static function GetNow() {
5257 return gmdate( 'Ymdhis', time() );
5358 }
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -26,6 +26,12 @@
2727 $dir = dirname( __FILE__ );
2828 $wgExtensionMessagesFiles['OnlineStatusBar'] = "$dir/OnlineStatusBar.i18n.php";
2929
 30+$wgResourceModules['ext.OnlineStatusBar'] = array (
 31+ 'styles' => 'OnlineStatusBar.css',
 32+ 'localBasePath' => dirname ( __FILE__ ),
 33+ 'remoteExtPath' => 'OnlineStatusBar',
 34+ );
 35+
3036 $wgAutoloadClasses['OnlineStatusBar'] = "$dir/OnlineStatusBar.body.php";
3137
3238 // Configuration
@@ -145,5 +151,6 @@
146152 }
147153
148154 $wgHooks['LanguageGetMagic'][] = 'OnlineStatusBar::MagicWordVar';
 155+$wgHooks['BeforePageDisplay'][] = 'OnlineStatusBar::StylePage';
149156 $wgHooks['MagicWordwgVariableIDs'][] = 'OnlineStatusBar::MagicWordSet';
150157 $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+

Status & tagging log