From: Trevor Parscal Date: Wed, 30 Sep 2009 23:01:46 +0000 (+0000) Subject: Decided to go with yet another approach for adding extra stylesheets for Vector ... X-Git-Tag: 1.31.0-rc.0~39441 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=4a40b9dd2756a2f8068f9b948408d1ed2557f093;p=lhc%2Fweb%2Fwiklou.git Decided to go with yet another approach for adding extra stylesheets for Vector (so that we can test new ideas out and keep our CSS in the SVN). 1. Removed ExperiementalSkins extension 2. Added $wgVectorExtraStyles to DefaultSettings.php 3. Added code in Vector.php that adds in any extra styles defined just after adding in the main style --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6f99492e57..6646997de0 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4108,6 +4108,14 @@ $wgVectorUseSimpleSearch = false; */ $wgVectorUseIconWatch = false; +/** + * Add extra stylesheets for Vector - This is only being used so that we can play around with different options while + * keeping our CSS code in the SVN and not having to change the main Vector styles. This will probably go away later on. + * null = add no extra styles + * array = list of style paths relative to skins/vector/ + */ +$wgVectorExtraStyles = null; + /** * Preprocessor caching threshold */ diff --git a/skins/Vector.php b/skins/Vector.php index e18230e4b0..f97392e73b 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -26,8 +26,8 @@ class SkinVector extends SkinTemplate { * @param object $out Output page object to initialize */ public function initPage( OutputPage $out ) { - global $wgStylePath, $wgJsMimeType, $wgStyleVersion; - + global $wgStylePath, $wgJsMimeType, $wgStyleVersion, $wgScriptPath, $wgVectorExtraStyles; + parent::initPage( $out ); // Append skin-specific styles @@ -41,6 +41,13 @@ class SkinVector extends SkinTemplate { $wgStylePath . '/vector/csshover.htc")}' ); + // Add extra stylesheets + // THIS IS ONLY USEFUL FOR EXPERIMENTING WITH DIFFERNT STYLE OPTIONS! THIS WILL BE REMOVED IN THE NEAR FUTURE. + if ( is_array( $wgVectorExtraStyles ) ) { + foreach ( $wgVectorExtraStyles as $style ) { + $out->addStyle( 'vector/' . $style, 'screen' ); + } + } // Append common IE fixes, which perhaps should be included in all // skins, but for now it seems each skin needs to include them // explicitly