r80771 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80770‎ | r80771 | r80772 >
Date:21:16, 22 January 2011
Author:hartman
Status:ok
Tags:
Comment:
Finish porting the Simple skin to resourceloader.

* quickbar CSS removed, since simple doesn't even have #quickbar.
* default of line-trough removed, since this is already present in the skin CSS.
Fixes part of bug 26649
Modified paths:
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/skins/Simple.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Simple.php
@@ -21,36 +21,31 @@
2222 var $skinname = 'simple', $stylename = 'simple',
2323 $template = 'MonoBookTemplate', $useHeadElement = true;
2424
25 - function setupSkinUserCss( OutputPage $out ){
 25+ function setupSkinUserCss( OutputPage $out ) {
2626 parent::setupSkinUserCss( $out );
2727
28 - $out->addStyle( 'simple/main.css', 'screen' );
29 - }
 28+ $out->addModuleStyles( 'skins.simple' );
3029
31 - function reallyGenerateUserStylesheet() {
32 - global $wgUser;
33 - $s = '';
34 - if( $wgUser->getOption( 'highlightbroken' ) ) {
35 - $s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n";
36 - } else {
37 - $s .= <<<CSS
38 -a.new, #quickbar a.new,
39 -a.stub, #quickbar a.stub {
40 - color: inherit;
41 - text-decoration: inherit;
42 -}
43 -a.new:after, #quickbar a.new:after {
44 - content: "?";
45 - color: #CC2200;
46 - text-decoration: $underline;
47 -}
48 -a.stub:after, #quickbar a.stub:after {
49 - content: "!";
50 - color: #772233;
51 - text-decoration: $underline;
52 -}
53 -CSS;
 30+ /* Add some userprefs specific CSS styling */
 31+ global $wgUser, $wgContLang;
 32+ $rules = array();
 33+ $underline = "";
 34+
 35+ if ( $wgUser->getOption( 'underline' ) < 2 ) {
 36+ $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline' : 'none' . ";";
5437 }
55 - return $s;
 38+
 39+ /* Also inherits from resourceloader */
 40+ if( !$wgUser->getOption( 'highlightbroken' ) ) {
 41+ $rules[] = "a.new, a.stub { color: inherit; text-decoration: inherit;}";
 42+ $rules[] = "a.new:after { color: #CC2200; $underline;}";
 43+ $rules[] = "a.stub:after { $underline; }";
 44+ }
 45+ $style = implode( "\n", $rules );
 46+ if ( $wgContLang->getDir() === 'rtl' ) {
 47+ $style = CSSJanus::transform( $style, true, false );
 48+ }
 49+ $out->addInlineStyle( $style );
 50+
5651 }
5752 }
Index: trunk/phase3/resources/Resources.php
@@ -21,6 +21,9 @@
2222 //$GLOBALS['wgHandheldStyle'] => array( 'media' => 'handheld' ),
2323 ),
2424 ),
 25+ 'skins.simple' => array(
 26+ 'styles' => array( 'skins/simple/main.css' => array( 'media' => 'screen' ) ),
 27+ ),
2528
2629 /* jQuery */
2730

Follow-up revisions

RevisionCommit summaryAuthorDate
r80776Port Modern to resourceloader...hartman22:46, 22 January 2011
r80785Port the remaining Skin.php skins standard(classic), Cologneblue and Nostalgia...hartman01:41, 23 January 2011
r808971.17: MFT r80697, r80755, r80767, r80771, r80773, r80774, r80779, r80816, r80...catrope18:57, 24 January 2011

Status & tagging log