MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
| Line 1: | Line 1: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$('a[href*="/Player:"], a[href*="index.php?title=Player:"]').each(function() { | |||
if ($(this).find('img').length > 0) return; | |||
var username = $(this).attr('href').match(/Player:([^&|#/]+)/); | |||
if ($( | if (!username) return; | ||
var name = decodeURIComponent(username[1]); | |||
var img = $('<img>') | var img = $('<img>') | ||
.attr('src', 'https://minotar.net/helm/' + | .attr('src', 'https://minotar.net/helm/' + name + '/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); | ||
}); | }); | ||
}); | }); | ||
Revision as of 05:20, 15 October 2026
$(document).ready(function() {
$('a[href*="/Player:"], a[href*="index.php?title=Player:"]').each(function() {
if ($(this).find('img').length > 0) return;
var username = $(this).attr('href').match(/Player:([^&|#/]+)/);
if (!username) return;
var name = decodeURIComponent(username[1]);
var img = $('<img>')
.attr('src', 'https://minotar.net/helm/' + name + '/16')
.css({ width: '16px', height: '16px', verticalAlign: 'middle', marginRight: '4px', imageRendering: 'pixelated' });
$(this).prepend(img);
});
});