MediaWiki talk:Gadget-exlinks.js
Update
![]() | It is requested that an edit be made to the interface page at MediaWiki:Gadget-exlinks.js. (edit · history · last · links)
This template must be followed by a complete and specific description of the request, that is, specify what text should be removed and a verbatim copy of the text that should replace it. "Please change X" is not acceptable and will be rejected; the request must be of the form "please change X to Y".
The edit may be made by any interface administrator. Remember to change the |
Hi!
Could someone update this gadget to use jQuery and the recommended functions from MW 1.17? It would be something like this:
$(function() {
var $alinks = mw.util.$content.find( 'a' );
$alinks.each( function() {
var $tablink = $( this );
if ( $tablink.hasClass( 'external' ) && $tablink.attr( 'href' ).indexOf( mw.config.get( 'wgServer' ) ) !== 0 ) {
$tablink.attr( 'target', '_blank' );
}
} );
});
After the change, I think it will be possible to change the definition of this gadget to
* exlinks[ResourceLoader|dependencies=mediawiki.util]|exlinks.js
Helder 18:09, 27 July 2011 (UTC)
- Is that not required to be inside a document.ready ? —TheDJ (talk • contribs) 22:04, 31 July 2011 (UTC)