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
* 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
* 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
* - 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
),
"poweredby" => array(
"mediawiki" => 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",
)
"url" => "//www.mediawiki.org/",
"alt" => "Powered by MediaWiki",
)
) {
$wgFooterIcons['poweredby']['mediawiki']['src'] =
"$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png";
) {
$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";
function getPoweredBy() {
global $wgResourceBasePath;
function getPoweredBy() {
global $wgResourceBasePath;
- $url = htmlspecialchars( "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png" );
- $text = '<a href="//www.mediawiki.org/"><img src="' . $url
- . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
+ $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 = '<a href="//www.mediawiki.org/"><img src="' . $url1
+ . '" srcset="' . $url1_5 . ' 1.5x, ' . $url2 . ' 2x" '
+ . 'height="31" width="88" alt="Powered by MediaWiki" /></a>';
Hooks::run( 'SkinGetPoweredBy', array( &$text, $this ) );
return $text;
}
Hooks::run( 'SkinGetPoweredBy', array( &$text, $this ) );
return $text;
}