MediaWiki:Common.js: Difference between revisions

From BetaHaven Wiki
Jump to navigationJump to search
Created page with "mw.hook('wikipage.content').add(function() { $('.mw-userlink').each(function() { var username = $(this).text(); var img = $('<img>') .attr('src', 'https://crafatar.com/avatars/' + encodeURIComponent(username) + '?size=16&overlay') .css({ width: '16px', height: '16px', verticalAlign: 'middle', marginRight: '4px', imageRendering: 'pixelated' }); $(this).prepend(img); }); });"
 
No edit summary
Line 3: Line 3:
         var username = $(this).text();
         var username = $(this).text();
         var img = $('<img>')
         var img = $('<img>')
             .attr('src', 'https://crafatar.com/avatars/' + encodeURIComponent(username) + '?size=16&overlay')
             .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:28, 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);
    });
});