Apply target=_blank in code

This simplifies the message, eliminating complexity
for translators to get the html right, and eliminating
required manual review for such messages.

Bug: T360390
Change-Id: I010ae21283aeb821ce8b0b0bbe29bcabafdb4d55
这个提交包含在:
Matthias Mullie 2024-04-22 09:13:04 +02:00
父节点 808010fc4d
当前提交 6046fbf452
共有 5 个文件被更改,包括 10 次插入15 次删除

查看文件

@ -119,7 +119,7 @@
"ellipsis",
"tutorial-popup-title",
"tutorial-popup-text1",
"tutorial-popup-text3",
"tutorial-popup-text2",
"tutorial-popup-text-mobile",
"tutorial-popup-close"
]

查看文件

@ -30,7 +30,7 @@
"searchvue-links-showmore": "view other pages",
"tutorial-popup-title": "Search result previews",
"tutorial-popup-text1": "Click on the the article snippet to preview the search result and view related content.",
"tutorial-popup-text3": "You can turn previews on and off in the <a href=\"$1\" target=\"_blank\">search preferences</a>.",
"tutorial-popup-text2": "You can turn previews on and off in the [[Special:Preferences#mw-prefsection-searchoptions|search preferences]].",
"tutorial-popup-text-mobile": "Tap on the the article snippet or the arrow to preview the search result and see related content.",
"tutorial-popup-close": "Close"
}

查看文件

@ -32,7 +32,7 @@
"searchvue-links-showmore": "Button text used to toggle between interwiki links on mobile view.",
"tutorial-popup-title": "Heading of the tutorial popup",
"tutorial-popup-text1": "First paragraph in the tutorial popup",
"tutorial-popup-text3": "Second paragraph in the tutorial popup. Parameters:\n* $1 - The URL of the search preferences",
"tutorial-popup-text2": "Second paragraph in the tutorial popup, instructing users to enable/disable previous in the Search preferences.",
"tutorial-popup-text-mobile": "Tutorial popup text for mobile devices",
"tutorial-popup-close": "Title for the svg used to close tutorial popup\n{{identical|Close}}"
}

查看文件

@ -42,7 +42,7 @@
{{ $i18n( 'tutorial-popup-text1' ).text() }}
</p>
<!-- eslint-disable vue/no-v-html -->
<p v-html="$i18n( 'tutorial-popup-text3', url ).text()"></p>
<p v-html="preferencesMessage"></p>
</template>
</div>
</section>
@ -61,10 +61,6 @@ module.exports = exports = {
compatConfig: { MODE: 3 },
compilerOptions: { whitespace: 'condense' },
props: {
url: {
type: String,
required: true
},
isMobile: {
type: Boolean,
required: true
@ -73,6 +69,11 @@ module.exports = exports = {
computed: {
QuickViewTutorialPopupClass() {
return this.isMobile ? 'QuickViewTutorialPopup__mobile' : 'QuickViewTutorialPopup';
},
preferencesMessage() {
const $msg = $( '<p>' ).append( this.$i18n( 'tutorial-popup-text2' ).parseDom() );
$msg.find( 'a' ).attr( 'target', '_blank' );
return $msg.html();
}
}
};

查看文件

@ -2,7 +2,6 @@
<div>
<quick-view-tutorial-popup
v-if="tutorialPopupVisible"
:url="preferencesUrl"
:is-mobile="isMobile"
:style="{ top: firstSectionContentHeight / 2 + firstSectionHeadingHeight + topPositionAdjuster + 'px' }"
@close="onCloseTutorialPopup"
@ -44,12 +43,7 @@ module.exports = exports = {
mapState( useRootStore, [
'selectedIndex',
'isMobile'
] ),
{
preferencesUrl() {
return new mw.Title( 'Preferences#mw-prefsection-searchoptions', -1 ).getUrl();
}
}
] )
),
methods: {
setTutorialPopupVisibility() {