Difference between revisions of "MediaWiki:Common.js"

From SEBoK
Jump to: navigation, 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://], [href^=https://]' )
+
         .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' );