r64080 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64079‎ | r64080 | r64081 >
Date:17:12, 23 March 2010
Author:lhridley
Status:ok (Comments)
Tags:
Comment:
Fixes bug 22916 -- stylesheets for Vector skin now load in the correct order
Modified paths:
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -30,9 +30,6 @@
3131
3232 parent::initPage( $out );
3333
34 - // Append skin-specific styles
35 - $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
36 - $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
3734 // Append CSS which includes IE only behavior fixes for hover support -
3835 // this is better than including this in a CSS fille since it doesn't
3936 // wait for the CSS file to load before fetching the HTC file.
@@ -41,14 +38,32 @@
4239 $wgStylePath .
4340 '/vector/csshover.htc")}</style><![endif]-->'
4441 );
 42+ }
 43+
 44+ /**
 45+ * Load skin and user css files in the correct order
 46+ * fixes bug 22916
 47+ * @param object $out OutputPage object
 48+ */
 49+
 50+ function setupSkinUserCss( OutputPage $out ){
 51+ global $wgStylePath, $wgVectorExtraStyles;
 52+
 53+ parent::setupSkinUserCss( $out );
 54+
 55+ // Append skin-specific styles
 56+ $out->addStyle( 'origins/main-rtl.css', 'screen', '', 'rtl' );
 57+ $out->addStyle( 'origins/main-ltr.css', 'screen', '', 'ltr' );
 58+
4559 // Add extra stylesheets
4660 // THIS IS ONLY USEFUL FOR EXPERIMENTING WITH DIFFERNT STYLE OPTIONS! THIS WILL BE REMOVED IN THE NEAR FUTURE.
4761 if ( is_array( $wgVectorExtraStyles ) ) {
4862 foreach ( $wgVectorExtraStyles as $style ) {
49 - $out->addStyle( 'vector/' . $style, 'screen' );
 63+ $out->addStyle( 'origins/' . $style, 'screen' );
5064 }
5165 }
5266 }
 67+
5368 /**
5469 * Builds a structured array of links used for tabs and menus
5570 * @return array

Follow-up revisions

RevisionCommit summaryAuthorDate
r64087Followup to r64080: unused globalscatrope19:20, 23 March 2010

Comments

#Comment by Catrope (talk | contribs)   18:20, 23 March 2010
+		$out->addStyle( 'origins/main-rtl.css', 'screen', '', 'rtl' );
+		$out->addStyle( 'origins/main-ltr.css', 'screen', '', 'ltr' );
...
-				$out->addStyle( 'vector/' . $style, 'screen' );
+				$out->addStyle( 'origins/' . $style, 'screen' );

What's this "origins" stuff? This'll break on any MW install that doesn't have the origins/ dir, i.e. every install but yours.

#Comment by Lhridley (talk | contribs)   18:49, 23 March 2010

Sorry...my bad. Fixed in r64083

#Comment by Catrope (talk | contribs)   19:09, 23 March 2010
-				$out->addStyle( 'vector/' . $style, 'screen' );
+				$out->addStyle( 'origins/' . $style, 'screen' );

wasn't fixed in r64083.

#Comment by Lhridley (talk | contribs)   19:16, 23 March 2010
( That's what I get for multitasking. Sorry -- missed that line. -- fixed in r64084

Status & tagging log