Add MediaWiki:Print.css back in. Now applies to printable=yes -and- actual printing...
authorChad Horohoe <demon@users.mediawiki.org>
Sat, 21 Jun 2008 23:40:26 +0000 (23:40 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sat, 21 Jun 2008 23:40:26 +0000 (23:40 +0000)
RELEASE-NOTES
includes/Skin.php
includes/SkinTemplate.php
languages/messages/MessagesEn.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc

index 839f87e..e96c2cd 100644 (file)
@@ -160,6 +160,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 14558) New system message (emailuserfooter) is now added to the footer of 
   e-mails sent with Special:Emailuser
 * Add support for Hijri (Islamic) calendar
+* (bug 2889) MediaWiki:Print.css applies to the printable version
   
 === Bug fixes in 1.13 ===
 
index 3f8c6b9..86c8c05 100644 (file)
@@ -416,7 +416,7 @@ class Skin extends Linker {
 
        # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way)
        function getUserStylesheet() {
-               global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion;
+               global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion, $wgOut;
                $sheet = $this->getStylesheet();
                $s = "@import \"$wgStylePath/common/shared.css?$wgStyleVersion\";\n";
                $s .= "@import \"$wgStylePath/common/oldshared.css?$wgStyleVersion\";\n";
@@ -428,6 +428,8 @@ class Skin extends Linker {
                        '@import "' . self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n";
 
                $s .= $this->doGetUserStyles();
+               if($wgOut->isPrintable()) $s .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ) . "\";\n"; 
+               else $s .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ) . "\" print;\n"; 
                return $s."\n";
        }
 
index c60cfb4..5339160 100644 (file)
@@ -962,7 +962,8 @@ class SkinTemplate extends Skin {
        function setupUserCss() {
                wfProfileIn( __METHOD__ );
 
-               global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser;
+               global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, 
+                       $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser, $wgOut;
 
                $sitecss = '';
                $usercss = '';
@@ -1005,6 +1006,8 @@ class SkinTemplate extends Skin {
                        $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n";
                        $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n";
                        $sitecss .= '@import "' . self::makeUrl( '-', "action=raw&gen=css$siteargs$skinquery" ) . '";' . "\n";
+                       if( $wgOut->isPrintable()) $sitecss .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI) . '";' . "\n";
+                       else $sitecss .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI) . '" print;' . "\n";
                }
 
                # If we use any dynamic CSS, make a little CDATA block out of it.
index 9bcc004..e879229 100644 (file)
@@ -2669,6 +2669,7 @@ All transwiki import actions are logged at the [[Special:Log/import|import log]]
 'chick.css'       => '/* CSS placed here will affect users of the Chick skin */', # only translate this message to other languages if you have to change it
 'simple.css'      => '/* CSS placed here will affect users of the Simple skin */', # only translate this message to other languages if you have to change it
 'modern.css'      => '/* CSS placed here will affect users of the Modern skin */', # only translate this message to other languages if you have to change it
+'print.css'       => '/* CSS placed here will be applied to the printable version */', # only translate this message to other languages if you have to change it
 
 # Scripts
 'common.js'      => '/* Any JavaScript here will be loaded for all users on every page load. */', # only translate this message to other languages if you have to change it
index da23f94..008a9b9 100644 (file)
@@ -202,6 +202,7 @@ $wgOptionalMessages = array(
        'chick.css',
        'simple.css',
        'modern.css',
+       'print.css',
        'common.js',
        'standard.js',
        'nostalgia.js',
index 882f0c0..debf8c5 100644 (file)
@@ -1890,6 +1890,7 @@ $wgMessageStructure = array(
                'chick.css',
                'simple.css',
                'modern.css',
+               'print.css',
        ),
        'scripts' => array(
                'common.js',