MediaWiki:Gadget-emailLinks.js

// /* email links *//*
 * BY: U:Technical 13
 * This Gadget shows all email links placed by T:User or T:UserForums if the user has email set up and enabled.

( function ( $, mw ) { $( '.emailLink' ).each( function( i ) { var checkEmailableUser = $( this ).attr( 'class' ).replace( 'emailLink ',  ).replace( 'email', ); ( new mw.Api ).get( {     action: 'query',      list: 'users',      usprop: 'emailable',      ususers: checkEmailableUser    } ).done( function( usResponse ) {      var isEmailable = ( usResponse.query.users[ 0 ].emailable !== undefined ? true : false );     if ( isEmailable ) {        $( '.email' + checkEmailableUser ).show;      }    } ); } ); }( jQuery, mediaWiki ) ); //