From: Brion Vibber Date: Mon, 13 Oct 2014 14:15:12 +0000 (-0700) Subject: Add HiDPI PNG variants for 'Powered by MediaWiki' footer icon X-Git-Tag: 1.31.0-rc.0~12615^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=f0f2435db22d3ca76a0812975588dd73d2e1bf00;p=lhc%2Fweb%2Fwiklou.git Add HiDPI PNG variants for 'Powered by MediaWiki' footer icon Added 1.5x and 2x-density variants of the 'Powered by MediaWiki' footer icon, built from this SVG version on Commons: https://commons.wikimedia.org/wiki/File:Powered_by_MediaWiki.svg Note the SVG version is too large to use directly right now as it contains a huge amount of detail; the PNGs are only a few KiB. Renderings from Commons taken and run through pngcrush. Note that adding 'srcset' attributes to footer icons appears to work just fine here, so can be done for others. Bug: T65872 Change-Id: I785d21add456eeddb6ed1ee36a1906d178323e63 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 80609836dc..f9dc1ed222 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3154,6 +3154,7 @@ $wgExperimentalHtmlIds = false; * for the icon, the following keys are used: * - src: An absolute url to the image to use for the icon, this is recommended * but not required, however some skins will ignore icons without an image + * - srcset: optional additional-resolution images; see HTML5 specs * - url: The url to use in the a element around the text or icon, if not set an a element will * not be outputted * - alt: This is the text form of the icon, it will be displayed without an image in @@ -3170,7 +3171,7 @@ $wgFooterIcons = array( ), "poweredby" => array( "mediawiki" => array( - "src" => null, // Defaults to "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" + "src" => null, // Defaults to "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" plus srcset for 1.5x, 2x "url" => "//www.mediawiki.org/", "alt" => "Powered by MediaWiki", ) diff --git a/includes/Setup.php b/includes/Setup.php index c75429efc9..4e63d9186e 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -140,6 +140,9 @@ if ( isset( $wgFooterIcons['poweredby'] ) ) { $wgFooterIcons['poweredby']['mediawiki']['src'] = "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"; + $wgFooterIcons['poweredby']['mediawiki']['srcset'] = + "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png 1.5x, " . + "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png 2x"; } /** diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 999dda87ee..752387b592 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -837,9 +837,12 @@ abstract class Skin extends ContextSource { function getPoweredBy() { global $wgResourceBasePath; - $url = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" ); - $text = 'Powered by MediaWiki'; + $url1 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" ); + $url1_5 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_132x47.png" ); + $url2 = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_176x62.png" ); + $text = 'Powered by MediaWiki'; Hooks::run( 'SkinGetPoweredBy', array( &$text, $this ) ); return $text; } diff --git a/resources/assets/poweredby_mediawiki_132x47.png b/resources/assets/poweredby_mediawiki_132x47.png new file mode 100644 index 0000000000..a784ecff9f Binary files /dev/null and b/resources/assets/poweredby_mediawiki_132x47.png differ diff --git a/resources/assets/poweredby_mediawiki_176x62.png b/resources/assets/poweredby_mediawiki_176x62.png new file mode 100644 index 0000000000..7970801208 Binary files /dev/null and b/resources/assets/poweredby_mediawiki_176x62.png differ