*/
$wgLogo = false;
+/**
+ * Array with URL paths to HD versions of the wiki logo. The scaled logo size
+ * should be under 135x155 pixels.
+ * Only 1.5x and 2x versions are supported.
+ *
+ * @par Example:
+ * @code
+ * $wgLogoHD = array(
+ * "1.5x" => "path/to/1.5x_version.png",
+ * "2x" => "path/to/2x_version.png"
+ * );
+ * @endcode
+ *
+ * @since 1.25
+ */
+$wgLogoHD = false;
+
/**
* The URL path of the shortcut icon.
* @since 1.6
*/
public function getStyles( ResourceLoaderContext $context ) {
$logo = $this->getConfig()->get( 'Logo' );
+ $logoHD = $this->getConfig()->get( 'LogoHD' );
$styles = parent::getStyles( $context );
$styles['all'][] = '.mw-wiki-logo { background-image: ' .
CSSMin::buildUrlValue( $logo ) .
'; }';
-
+ if ( $logoHD ) {
+ if ( isset( $logoHD['1.5x'] ) ) {
+ $styles[
+ '(-webkit-min-device-pixel-ratio: 1.5), ' .
+ '(min--moz-device-pixel-ratio: 1.5), ' .
+ '(min-resolution: 1.5dppx), ' .
+ '(min-resolution: 144dpi)'
+ ][] = '.mw-wiki-logo { background-image: ' .
+ CSSMin::buildUrlValue( $logoHD['1.5x'] ) .';' .
+ 'background-size: 135px auto; }';
+ }
+ if ( isset( $logoHD['2x'] ) ) {
+ $styles[
+ '(-webkit-min-device-pixel-ratio: 2), ' .
+ '(min--moz-device-pixel-ratio: 2),'.
+ '(min-resolution: 2dppx), ' .
+ '(min-resolution: 192dpi)'
+ ][] = '.mw-wiki-logo { background-image: ' .
+ CSSMin::buildUrlValue( $logoHD['2x'] ) . ';' .
+ 'background-size: 135px auto; }';
+ }
+ }
return $styles;
}
*/
public function getModifiedHash( ResourceLoaderContext $context ) {
$logo = $this->getConfig()->get( 'Logo' );
- return md5( parent::getModifiedHash( $context ) . $logo );
+ $logoHD = $this->getConfig()->get( 'LogoHD' );
+ return md5( parent::getModifiedHash( $context ) . $logo . json_encode( $logoHD ) );
}
}