-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of nakohdo Sent: 21 January 2011 19:57 To: mediawiki-l@lists.wikimedia.org Subject: Re: [Mediawiki-l] External Link Opening in New Tab or Window
Just put the following JavaScript code in your wiki's MediaWiki:Common.js page:
// Anything in this function wrapper will be executed when the page is ready for action ( function( $ ) { $( document ).ready( function() {
// Open external links in the sidebar in a new window $( '#mw-panel, #panel' ) // #panel is for pre-1.17 compatibility .find( 'li a' ) .filter( '[href^=http://], [href^=https://]' ) .attr( 'target' , '_blank' ); } ); } )( jQuery );
-------------------------------
I've added it to MediaWiki:Common.js but it changes nothing. I have tried clearing the cache and also accessing the URL using another browser that hasn't accessed the wiki before. No difference.