UltrasonicNXT has submitted this change and it was merged. Change subject: Fixing private message links so they open in new tabs ......................................................................
Fixing private message links so they open in new tabs For some reason, links, both internal and external, in private messages don't open in new tabs. This can be frustrating especially if when you click a link and it loads in the same tab as Chat, causing you to lose the entire chat conversation. This commit fixes this in the same way I fixed links in chat-topic. Change-Id: Icda3ef7de5ed6063201b7e30e899324ec83ca167 --- M MediaWikiChat.js 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: UltrasonicNXT: Verified; Looks good to me, approved diff --git a/MediaWikiChat.js b/MediaWikiChat.js index 2a111b8..8ae5098 100644 --- a/MediaWikiChat.js +++ b/MediaWikiChat.js @@ -342,7 +342,9 @@ html += MediaWikiChat.htmlTimestamp( timestamp ); html += '</div>'; - $( '#' + convwithE + ' .mwchat-useritem-content' ).append( html ); + // Open any link in private messages in a new tab + var elem = $( html ).appendTo( $( '#' + convwithE + ' .mwchat-useritem-content' ) ); + elem.find( 'a' ).attr( 'target', '_blank' ); if ( user.name != mw.config.get( 'wgUserName' ) ) { $( '#' + convwithE ).attr( 'data-read', 'true' ); -- To view, visit https://gerrit.wikimedia.org/r/129734 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icda3ef7de5ed6063201b7e30e899324ec83ca167 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/MediaWikiChat Gerrit-Branch: master Gerrit-Owner: GeorgeBarnick <george.barn...@brickcraft.me> Gerrit-Reviewer: GeorgeBarnick <george.barn...@brickcraft.me> Gerrit-Reviewer: UltrasonicNXT <adamr_car...@btinternet.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits