Prtksxna has uploaded a new change for review.
https://gerrit.wikimedia.org/r/111983
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, 28 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups
refs/changes/83/111983/1
diff --git a/Popups.i18n.php b/Popups.i18n.php
index 407ab67..f7dd947 100644
--- a/Popups.i18n.php
+++ b/Popups.i18n.php
@@ -31,6 +31,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',
);
/** Message documentation (Message documentation)
@@ -42,4 +43,5 @@
'popups-edited-hours' => 'Message to show time span if page was edited
less than a day ago',
'popups-edited-days' => 'Message to show time span if page was edited
less than a year ago',
'popups-edited-years' => 'Message to show time span if page was edited
more than a year ago',
+ 'popups-redirects' => 'Message shown when the popup is showing a
redirected article',
);
diff --git a/Popups.php b/Popups.php
index 9dd805a..2af345b 100644
--- a/Popups.php
+++ b/Popups.php
@@ -57,6 +57,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 e3e7832..2545c2d 100644
--- a/resources/ext.popups.core.js
+++ b/resources/ext.popups.core.js
@@ -44,6 +44,7 @@
curRequest = undefined;
var $thumbnail, $a,
+ redirects = re.query.redirects,
page =
re.query.pages[re.query.pageids[0]],
$contentbox = $( '<div>' ).html(
page.extract ),
thumbnail = page.thumbnail,
@@ -60,7 +61,16 @@
$( '<span>' ).text(
timeAgo( timediff ).text() )
);
- if ( thumbnail ){
+ if ( redirects ) {
+ $contentbox.prepend(
+ $( '<div>' )
+ .addClass(
'mwe-popups-redirect ')
+ .text( mw.message(
'popups-redirects' ).text() ),
+ $( '<h3>' ).text( redirects[ 0
].to )
+ );
+ }
+
+ if ( thumbnail ) {
$thumbnail = $( '<img>' )
.attr( 'src', thumbnail.source )
.removeClass(
'mwe-popups-is-tall mwe-popups-is-not-tall' )
diff --git a/resources/ext.popups.core.less b/resources/ext.popups.core.less
index 022c4f9..425c434 100644
--- a/resources/ext.popups.core.less
+++ b/resources/ext.popups.core.less
@@ -30,6 +30,20 @@
> div {
padding: 1.6em;
+ font-size: 12px;
+ line-height: 18px;
+
+ h3 {
+ margin-top: 0;
+ padding: 0;
+ font-family: Georgia, Times, serif;
+ }
+
+ > div.mwe-popups-redirect {
+ color: #c9c9c9;
+ font-style: italic;
+ margin-bottom: 0;
+ }
+ div {
padding: 0.8em;
--
To view, visit https://gerrit.wikimedia.org/r/111983
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I051e4ed84f216e9c8682138927f6dcb6a407ee57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits