Hide 'redirectedfrom' notice when printing articles
authorglaisher <glaisher.wiki@gmail.com>
Sat, 22 Nov 2014 09:35:58 +0000 (14:35 +0500)
committerglaisher <glaisher.wiki@gmail.com>
Mon, 1 Dec 2014 08:06:54 +0000 (13:06 +0500)
Wrap the 'redirectedfrom' message in "mw-redirectedfrom" id
and then add it to commonPrint.css to hide it when printing.

Bug: 16296
Change-Id: I077bda9596c37b122a1f6964470d9d85108d834e

includes/page/Article.php
resources/src/mediawiki.legacy/commonPrint.css

index cf53f1d..e3541bd 100644 (file)
@@ -1003,7 +1003,9 @@ class Article implements Page {
                                        array( 'redirect' => 'no' )
                                );
 
-                               $outputPage->addSubtitle( wfMessage( 'redirectedfrom' )->rawParams( $redir ) );
+                               $outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
+                                       wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
+                               . "</span>" );
 
                                // Add the script to update the displayed URL and
                                // set the fragment if one was specified in the redirect
@@ -1025,7 +1027,9 @@ class Article implements Page {
                        // If it was reported from a trusted site, supply a backlink.
                        if ( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {
                                $redir = Linker::makeExternalLink( $rdfrom, $rdfrom );
-                               $outputPage->addSubtitle( wfMessage( 'redirectedfrom' )->rawParams( $redir ) );
+                               $outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
+                                       wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
+                               . "</span>" );
 
                                // Add the script to update the displayed URL
                                $outputPage->addJsConfigVars( array(
index 9405719..ef2d71e 100644 (file)
@@ -34,6 +34,7 @@ span.mw-filepage-other-resolutions,
 #filetoc,
 .usermessage,
 .patrollink,
+.ns-0 .mw-redirectedfrom,
 #mw-navigation,
 #siteNotice {
        display: none;