MediaWiki:Common.js: Difference between revisions

From BetaHaven Wiki
Jump to navigationJump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 3: Line 3:
         var username = $(this).text();
         var username = $(this).text();
         var img = $('<img>')
         var img = $('<img>')
             .attr('src', 'https://minotar.net/avatar/' + encodeURIComponent(username) + '/16')
             .attr('src', 'https://minotar.net/helm/' + encodeURIComponent(username) + '/16')
             .css({ width: '16px', height: '16px', verticalAlign: 'middle', marginRight: '4px', imageRendering: 'pixelated' });
             .css({ width: '16px', height: '16px', verticalAlign: 'middle', marginRight: '4px', imageRendering: 'pixelated' });
         $(this).prepend(img);
         $(this).prepend(img);
     });
     });
});
});

Revision as of 03:30, 3 June 2026

mw.hook('wikipage.content').add(function() {
    $('.mw-userlink').each(function() {
        var username = $(this).text();
        var img = $('<img>')
            .attr('src', 'https://minotar.net/helm/' + encodeURIComponent(username) + '/16')
            .css({ width: '16px', height: '16px', verticalAlign: 'middle', marginRight: '4px', imageRendering: 'pixelated' });
        $(this).prepend(img);
    });
});