Yuvipanda has submitted this change and it was merged.

Change subject: Add `redirects to` message at the top of the popup
......................................................................


Add `redirects to` message at the top of the popup

Change-Id: I051e4ed84f216e9c8682138927f6dcb6a407ee57
---
M Popups.i18n.php
M Popups.php
M resources/ext.popups.core.js
M resources/ext.popups.core.less
4 files changed, 25 insertions(+), 0 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/Popups.i18n.php b/Popups.i18n.php
index 4d28a6d..a681a5a 100644
--- a/Popups.i18n.php
+++ b/Popups.i18n.php
@@ -32,6 +32,7 @@
        'popups-edited-hours' => 'Last edited {{PLURAL:$1|1 hour|$1 hours}} 
ago.',
        'popups-edited-days' => 'Last edited {{PLURAL:$1|yesterday|$1 days 
ago}}.',
        'popups-edited-years' => 'Last edited {{PLURAL:$1|1 year|$1 years}} 
ago.',
+       'popups-redirects' => 'redirects to <h3>$1</h3>',
 );
 
 /** Message documentation (Message documentation)
@@ -55,6 +56,7 @@
        'popups-edited-years' => 'Message to show time span if page was edited 
more than a year ago. Parameters:
 * $1 - number of years
 {{Related|Popups-edited}}',
+       'popups-redirects' => 'Message shown when the popup is showing a 
redirected page',
 );
 
 /** Arabic (العربية)
diff --git a/Popups.php b/Popups.php
index cc25a4e..a9f3a6c 100644
--- a/Popups.php
+++ b/Popups.php
@@ -51,6 +51,7 @@
                        'popups-edited-hours',
                        'popups-edited-days',
                        'popups-edited-years',
+                       'popups-redirects',
                ),
                'remoteExtPath' => $remoteExtPath,
                'localBasePath' => $localBasePath,
diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js
index e5156f4..f3870f4 100644
--- a/resources/ext.popups.core.js
+++ b/resources/ext.popups.core.js
@@ -44,6 +44,7 @@
                                curRequest = undefined;
 
                                var $a,
+                                       redirects = re.query.redirects,
                                        page = 
re.query.pages[re.query.pageids[0]],
                                        $contentbox = $( '<div>' ).addClass( 
'mwe-popups-extract' ).text( page.extract ),
                                        thumbnail = page.thumbnail,
@@ -61,6 +62,14 @@
                                                        $( '<span>' ).text( 
timeAgo( timediff ).text() )
                                                );
 
+                               if ( redirects ) {
+                                       $contentbox.prepend(
+                                               $( '<div>' )
+                                                       .addClass( 
'mwe-popups-redirect ')
+                                                       .html( mw.message( 
'popups-redirects', redirects[ 0 ].to ).text() )
+                                       );
+                               }
+
                                $a = $( '<a>' ).append( $thumbnail, 
$contentbox, $timestamp).attr( 'href', href );
                                cache[ href ] = { box: $a, thumbnail: 
thumbnail, tall: tall     };
                                createBox( href, $el );
diff --git a/resources/ext.popups.core.less b/resources/ext.popups.core.less
index 45b0d49..097cb07 100644
--- a/resources/ext.popups.core.less
+++ b/resources/ext.popups.core.less
@@ -27,6 +27,19 @@
                > div {
                        padding: 1.28em;
                        padding-bottom: 3.84em;
+
+                       h3 {
+                               margin-top: 0;
+                               padding: 0;
+                               font-family: Georgia, Times, serif;
+                               font-style: normal;
+                       }
+
+                       > div.mwe-popups-redirect {
+                               color: #c9c9c9;
+                               font-style: italic;
+                               margin-bottom: 3px;
+                       }
                }
 
                > div.mwe-popups-is-tall{

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I051e4ed84f216e9c8682138927f6dcb6a407ee57
Gerrit-PatchSet: 16
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Prtksxna <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>

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

Reply via email to