Amire80 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/141953
Change subject: Make source article and translation instructions open in a new
page
......................................................................
Make source article and translation instructions open in a new page
This was suggested based on user testing.
Change-Id: I4565f87afe614bdc7799096fb064caea0903f816
---
M modules/source/ext.cx.source.js
M modules/tools/ext.cx.tools.instructions.js
2 files changed, 12 insertions(+), 2 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/53/141953/1
diff --git a/modules/source/ext.cx.source.js b/modules/source/ext.cx.source.js
index 5b14dbc..3e7894f 100644
--- a/modules/source/ext.cx.source.js
+++ b/modules/source/ext.cx.source.js
@@ -80,6 +80,10 @@
).parse()
);
+ // The <a> element is added by the message, which has [].
+ // This makes the article open in a new tab (or window).
+ $articleLink.find( 'a' ).prop( 'target', '_blank' );
+
$subHeading = $( '<div>' )
.addClass( 'cx-column__sub-heading' )
.append( $languageLabel, $articleLink );
diff --git a/modules/tools/ext.cx.tools.instructions.js
b/modules/tools/ext.cx.tools.instructions.js
index 4b4ea21..ba1b637 100644
--- a/modules/tools/ext.cx.tools.instructions.js
+++ b/modules/tools/ext.cx.tools.instructions.js
@@ -40,6 +40,8 @@
InstructionsCard.prototype.constructor = InstructionsCard;
InstructionsCard.prototype.render = function () {
+ var $guidelines;
+
this.$card.find( '.tools.count.one' )
.text( mw.language.convertNumber( 1 ) );
this.$card.find( '.text.heading.one' )
@@ -61,13 +63,17 @@
this.$card.find( '.text.description.three' )
.text( mw.msg( 'cx-tools-instructions-text6' ) );
- this.$card.find( '.card__section.guidelines' )
+ $guidelines = this.$card.find( '.card__section.guidelines' )
.html(
mw.message(
'cx-tools-view-guidelines',
mw.util.getUrl(
'Wikipedia:Translation#How_to_translate' )
).parse()
- );
+ );
+
+ // The <a> element is added by the message, which has [].
+ // This makes the article open in a new tab (or window).
+ $guidelines.find( 'a' ).prop( 'target', '_blank' );
};
InstructionsCard.prototype.getCard = function () {
--
To view, visit https://gerrit.wikimedia.org/r/141953
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4565f87afe614bdc7799096fb064caea0903f816
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits