jenkins-bot has submitted this change and it was merged.

Change subject: Add config options for correctly displaying the copyright logo
......................................................................


Add config options for correctly displaying the copyright logo

Change-Id: I6f126daab9b132d8d7b1d297ce1078d80a5ce5f1
---
M MobileFrontend.php
M includes/skins/SkinMinerva.php
2 files changed, 20 insertions(+), 6 deletions(-)

Approvals:
  Kaldari: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MobileFrontend.php b/MobileFrontend.php
index 5e2c74f..f82c59c 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -329,11 +329,18 @@
 /**
  * Make the logos configurable.
  *
- * Currently, only 'copyright' element is supported, which is the logo for 
your content license
+ * Currently, 'copyright', 'copyright-width', and 'copyright-height' elements 
are supported.
+ * 'copyright' is the URL of the logo for your content license.
+ * 'copyright-width' (optional) is the width in pixels of the copyright image 
you want to display
+ * 'copyright-height' (optional) is the height in pixels of the copyright 
image you want to display
+ * If the actual 'copyright' dimensions are 200x30, then you may want to set 
the width and height
+ * to 100 and 15 respectively (in order to support retina screens).
  *
  * Example: array(
- *     'copyright' => 'mysite_copyright_logo.png',
- *     );
+ *     'copyright' => '/images/mysite_copyright_logo.png',
+ *     'copyright-width' => 100,
+ *     'copyright-height' => 15,
+ *     );
  */
 $wgMFCustomLogos = array();
 
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 6276e17..a176bd4 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -1028,10 +1028,17 @@
 
                if ( isset( $wgMFCustomLogos['copyright'] ) ) {
                        $suffix = $wgMFTrademarkSitename ? ' ®' : '';
-                       $sitename = Html::element( 'img', array(
+                       $attributes =  array(
                                'src' => $wgMFCustomLogos['copyright'],
-                               'alt' => $footerSitename . $suffix
-                       ) );
+                               'alt' => $footerSitename . $suffix,
+                       );
+                       if ( isset( $wgMFCustomLogos['copyright-height'] ) ) {
+                               $attributes['height'] = 
$wgMFCustomLogos['copyright-height'];
+                       }
+                       if ( isset( $wgMFCustomLogos['copyright-width'] ) ) {
+                               $attributes['width'] = 
$wgMFCustomLogos['copyright-width'];
+                       }
+                       $sitename = Html::element( 'img', $attributes );
                } else {
                        $suffix = $wgMFTrademarkSitename ? ' ™' : '';
                        $sitename = $footerSitename . $suffix;

-- 
To view, visit https://gerrit.wikimedia.org/r/174588
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6f126daab9b132d8d7b1d297ce1078d80a5ce5f1
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to