r104739 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104738‎ | r104739 | r104740 >
Date:20:28, 30 November 2011
Author:petrb
Status:ok
Tags:
Comment:
Rewritten styles per suggestion now it's all in one big module
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -27,59 +27,21 @@
2828 $wgExtensionMessagesFiles['OnlineStatusBar'] = "$dir/OnlineStatusBar.i18n.php";
2929
3030 $wgResourceModules['ext.OnlineStatusBar'] = array (
31 - 'styles' => 'OnlineStatusBar.css',
 31+ 'skinStyles' => array (
 32+ 'default' => array ( 'OnlineStatusBar.css' ),
 33+ 'chick' => array ( 'OnlineStatusBarChick.css' ),
 34+ 'vector' => array ( 'OnlineStatusBarVector.css'),
 35+ 'modern' => array ( 'OnlineStatusBarModern.css' ),
 36+ 'standard' => array ( 'OnlineStatusBarClassic.css' ),
 37+ 'monobook' => array ( 'OnlineStatusBarMono.css' ),
 38+ 'simple' => array ( 'OnlineStatusBarSimple.css' ),
 39+ 'cologne' => array ( 'OnlineStatusBarCologne.css' ),
 40+ 'nostalgia' => array ( 'OnlineStatusBarNostalgia.css' ),
 41+ ),
3242 'localBasePath' => dirname ( __FILE__ ),
3343 'remoteExtPath' => 'OnlineStatusBar',
3444 );
3545
36 -$wgResourceModules['ext.OnlineStatusBar.vector'] = array (
37 - 'styles' => 'OnlineStatusBarVector.css',
38 - 'localBasePath' => dirname ( __FILE__ ),
39 - 'remoteExtPath' => 'OnlineStatusBar',
40 -);
41 -
42 -$wgResourceModules['ext.OnlineStatusBar.modern'] = array (
43 - 'styles' => 'OnlineStatusBarModern.css',
44 - 'localBasePath' => dirname ( __FILE__ ),
45 - 'remoteExtPath' => 'OnlineStatusBar',
46 -);
47 -
48 -$wgResourceModules['ext.OnlineStatusBar.chick'] = array (
49 - 'styles' => 'OnlineStatusBarChick.css',
50 - 'localBasePath' => dirname ( __FILE__ ),
51 - 'remoteExtPath' => 'OnlineStatusBar',
52 -);
53 -
54 -$wgResourceModules['ext.OnlineStatusBar.standard'] = array (
55 - 'styles' => 'OnlineStatusBarClassic.css',
56 - 'localBasePath' => dirname ( __FILE__ ),
57 - 'remoteExtPath' => 'OnlineStatusBar',
58 -);
59 -
60 -$wgResourceModules['ext.OnlineStatusBar.monobook'] = array (
61 - 'styles' => 'OnlineStatusBarMono.css',
62 - 'localBasePath' => dirname ( __FILE__ ),
63 - 'remoteExtPath' => 'OnlineStatusBar',
64 -);
65 -
66 -$wgResourceModules['ext.OnlineStatusBar.simple'] = array (
67 - 'styles' => 'OnlineStatusBarSimple.css',
68 - 'localBasePath' => dirname ( __FILE__ ),
69 - 'remoteExtPath' => 'OnlineStatusBar',
70 -);
71 -
72 -$wgResourceModules['ext.OnlineStatusBar.cologne'] = array (
73 - 'styles' => 'OnlineStatusBarCologne.css',
74 - 'localBasePath' => dirname ( __FILE__ ),
75 - 'remoteExtPath' => 'OnlineStatusBar',
76 -);
77 -
78 -$wgResourceModules['ext.OnlineStatusBar.nostalgia'] = array (
79 - 'styles' => 'OnlineStatusBarNostalgia.css',
80 - 'localBasePath' => dirname ( __FILE__ ),
81 - 'remoteExtPath' => 'OnlineStatusBar',
82 -);
83 -
8446 // Load other files of extension
8547 $wgAutoloadClasses['OnlineStatusBar'] = "$dir/OnlineStatusBar.body.php";
8648 $wgAutoloadClasses['OnlineStatusBar_StatusCheck'] = "$dir/OnlineStatusBar.status.php";
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php
@@ -162,20 +162,7 @@
163163 * @return bool
164164 */
165165 public static function stylePage( &$out, &$skin ) {
166 - switch ($skin->getSkinName()) {
167 - case 'monobook':
168 - case 'vector':
169 - case 'simple':
170 - case 'modern':
171 - case 'standard':
172 - case 'nostalgia':
173 - case 'chick':
174 - case 'cologneblue':
175 - $out->addModuleStyles( 'ext.OnlineStatusBar.' . $skin->getSkinName() );
176 - break;
177 - default:
178 - $out->addModuleStyles( 'ext.OnlineStatusBar' );
179 - }
 166+ $out->addModuleStyles( 'ext.OnlineStatusBar' );
180167 return true;
181168 }
182169

Status & tagging log