Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
(Created page with "→Any JavaScript here will be loaded for all users on every page load.: →* * Open external links in the sidebar in a new window *: $( '#mw-panel, #panel' ) // #panel...") |
|||
Line 7: | Line 7: | ||
$( '#mw-panel, #panel' ) // #panel is for pre-1.17 compatibility | $( '#mw-panel, #panel' ) // #panel is for pre-1.17 compatibility | ||
.find('a[class*="external"]' ) | .find('a[class*="external"]' ) | ||
− | .filter( '[href^=http | + | .filter( '[href^=http://]' ) |
.attr( 'target' , '_blank' ); | .attr( 'target' , '_blank' ); |
Revision as of 20:01, 12 March 2015
/* Any JavaScript here will be loaded for all users on every page load. */ /** * Open external links in the sidebar in a new window * */ $( '#mw-panel, #panel' ) // #panel is for pre-1.17 compatibility .find('a[class*="external"]' ) .filter( '[href^=http://]' ) .attr( 'target' , '_blank' );