Difference between revisions of "MediaWiki:Common.js"
From maurer
(allow selected links to open in a new window) |
(No difference)
|
Revision as of 16:18, 9 January 2018
/* Any JavaScript here will be loaded for all users on every page load. */
/**
* @source mediawiki.org/wiki/Snippets/Open_specific_external_links_in_new_window
* @version 3
*/
$(function( $ ) {
$( '#mw-content-text' ).on( 'click', '.newwin > a', function( e ) {
var otherWindow = window.open();
otherWindow.opener = null;
otherWindow.location = this;
return false;
} );
} );