Sumit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/231886

Change subject: WikidataPageBanner add max-wdith
......................................................................

WikidataPageBanner add max-wdith

Add a parameter max-width to the banner so as to prevent pixelation of the
banner.

Bug: T108986
Change-Id: I54353ca33a243954392de4467f2f2b23b76601a2
---
M includes/WikidataPageBanner.functions.php
M templates/banner.mustache
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikidataPageBanner 
refs/changes/86/231886/1

diff --git a/includes/WikidataPageBanner.functions.php 
b/includes/WikidataPageBanner.functions.php
index 374e20c..0c6658d 100644
--- a/includes/WikidataPageBanner.functions.php
+++ b/includes/WikidataPageBanner.functions.php
@@ -149,6 +149,8 @@
                        $options['bannerfile'] = $bannerfile->getLocalUrl();
                        $options['banner'] = $bannerurl;
                        $options['srcset'] = $srcset;
+                       $file = wfFindFile( $bannerfile );
+                       $options['maxWidth'] = $file->getWidth();
                        $banner = $templateParser->processTemplate(
                                        'banner',
                                        $options
diff --git a/templates/banner.mustache b/templates/banner.mustache
index 40560be..aca46f3 100644
--- a/templates/banner.mustache
+++ b/templates/banner.mustache
@@ -1,7 +1,7 @@
 <div class="ext-wpb-pagebanner noprint">
        <div class="wpb-topbanner">
                <div class="wpb-name">{{title}}</div>
-               <a class="image" title="{{tooltip}}" href="{{bannerfile}}"><img 
src="{{banner}}" srcset="{{srcset}}" class="wpb-banner-image {{originx}}" 
data-pos-x="{{data-pos-x}}" data-pos-y="{{data-pos-y}}"></a>
+               <a class="image" title="{{tooltip}}" href="{{bannerfile}}"><img 
src="{{banner}}" srcset="{{srcset}}" class="wpb-banner-image {{originx}}" 
data-pos-x="{{data-pos-x}}" data-pos-y="{{data-pos-y}}" 
style="max-width:{{maxWidth}}px"></a>
                {{#hasIcons}}
                <div class="wpb-iconbox">
                        {{#icons}}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54353ca33a243954392de4467f2f2b23b76601a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataPageBanner
Gerrit-Branch: master
Gerrit-Owner: Sumit <asthana.sumi...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to