39 $default = !is_array( $logo ) ? $logo : $logo[
'1x'];
40 $styles[
'all'][] =
'.mw-wiki-logo { background-image: ' .
41 CSSMin::buildUrlValue( $default ) .
44 if ( is_array( $logo ) ) {
45 if ( isset( $logo[
'svg'] ) ) {
46 $styles[
'all'][] =
'.mw-wiki-logo { ' .
47 'background-image: -webkit-linear-gradient(transparent, transparent), ' .
48 CSSMin::buildUrlValue( $logo[
'svg'] ) .
'; ' .
49 'background-image: linear-gradient(transparent, transparent), ' .
50 CSSMin::buildUrlValue( $logo[
'svg'] ) .
';' .
51 'background-size: 135px auto; }';
53 if ( isset( $logo[
'1.5x'] ) ) {
55 '(-webkit-min-device-pixel-ratio: 1.5), ' .
56 '(min--moz-device-pixel-ratio: 1.5), ' .
57 '(min-resolution: 1.5dppx), ' .
58 '(min-resolution: 144dpi)'
59 ][] =
'.mw-wiki-logo { background-image: ' .
60 CSSMin::buildUrlValue( $logo[
'1.5x'] ) .
';' .
61 'background-size: 135px auto; }';
63 if ( isset( $logo[
'2x'] ) ) {
65 '(-webkit-min-device-pixel-ratio: 2), ' .
66 '(min--moz-device-pixel-ratio: 2), ' .
67 '(min-resolution: 2dppx), ' .
68 '(min-resolution: 192dpi)'
69 ][] =
'.mw-wiki-logo { background-image: ' .
70 CSSMin::buildUrlValue( $logo[
'2x'] ) .
';' .
71 'background-size: 135px auto; }';
100 if ( !is_array( $logo ) ) {
102 $preloadLinks[ $logo ] = [
'as' =>
'image' ];
103 return $preloadLinks;
106 if ( isset( $logo[
'svg'] ) ) {
109 $preloadLinks [ $logo[
'svg'] ] = [
'as' =>
'image' ];
110 return $preloadLinks;
113 foreach ( $logo
as $dppx => $src ) {
115 $dppx = substr( $dppx, 0, -1 );
116 $logosPerDppx[$dppx] = $src;
120 uksort( $logosPerDppx,
function ( $a, $b ) {
127 foreach ( $logosPerDppx
as $dppx => $src ) {
128 $logos[] = [
'dppx' => $dppx,
'src' => $src ];
131 $logosCount =
count( $logos );
137 for ( $i = 0; $i < $logosCount; $i++ ) {
142 $media_query =
'not all and (min-resolution: ' . $logos[ 1 ][
'dppx'] .
'dppx)';
143 } elseif ( $i !== $logosCount - 1 ) {
148 $upper_bound = floatval( $logos[ $i + 1 ][
'dppx'] ) - 0.000001;
149 $media_query =
'(min-resolution: ' . $logos[ $i ][
'dppx'] .
150 'dppx) and (max-resolution: ' . $upper_bound .
'dppx)';
153 $media_query =
'(min-resolution: ' . $logos[ $i ][
'dppx'] .
'dppx)';
156 $preloadLinks[ $logos[$i][
'src'] ] = [
'as' =>
'image',
'media' => $media_query ];
159 return $preloadLinks;
172 if ( !is_array( $val ) ) {
187 $logo = $conf->
get(
'Logo' );
188 $logoHD = $conf->
get(
'LogoHD' );
190 $logo1Url = OutputPage::transformResourcePath( $conf, $logo );
200 if ( isset( $logoHD[
'svg'] ) ) {
201 $logoUrls[
'svg'] = OutputPage::transformResourcePath(
207 if ( isset( $logoHD[
'1.5x'] ) ) {
208 $logoUrls[
'1.5x'] = OutputPage::transformResourcePath(
213 if ( isset( $logoHD[
'2x'] ) ) {
214 $logoUrls[
'2x'] = OutputPage::transformResourcePath(
235 $summary = parent::getDefinitionSummary(
$context );
237 'logo' => $this->
getConfig()->get(
'Logo' ),
238 'logoHD' => $this->
getConfig()->get(
'LogoHD' ),