Year of the Dragon: Through May 28th, claim free Expansion Pack (excluding Vecna Unleashed) or a Greater Elixir of Discovery! Speak to Xatheral in the Hall of Heroes. edit

Game mechanicsNewbie guideIn developmentDDO StoreSocial Media


ChallengesClassesCollectablesCraftingEnhancementsEpic DestiniesFavorFeats

GlossaryItemsMapsMonstersPlacesQuestsRacesReincarnationSkillsSpells


Please create an account or log in to build a reputation and unlock more editing privileges, and then visit DDO wiki's IRC Chat/Discord if you need any help!

MediaWiki:Gadget-emailLinks.js

From DDO wiki
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes, you can click here or try one of the methods below..

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl+F5 or Ctrl+r ( Command+r on a Mac)
  • Google Chrome: Press Ctrl+ Shift+R ( Command+ Shift+R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl+F5
  • Konqueror: Click Reload or press F5
  • Opera: Clear the cache in Tools ‣ Preferences
//<nowiki>
/* 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 ) );
//</nowiki>[[Category:Gadgets]]