MediaWiki:Gadget-ShowAvatar.js: Difference between revisions
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
const img = $('<img>').attr('src', mw.config.get('wgScriptPath') + '/extensions/Avatar/avatar.php?nocache=true&user=' + mw.user.id()); | |||
const link = $('<a>').attr('href', mw.util.getUrl('Special:UploadAvatar')).append(img); | |||
$('#pt-userpage-2').before($('<li id="pt-avatar"></li>').append(link)); | if(window.innerWidth>500){ | ||
$('#pt-userpage-2').before($('<li id="pt-avatar"></li>').append(link)); | |||
} |
Latest revision as of 11:29, 22 December 2022
const img = $('<img>').attr('src', mw.config.get('wgScriptPath') + '/extensions/Avatar/avatar.php?nocache=true&user=' + mw.user.id());
const link = $('<a>').attr('href', mw.util.getUrl('Special:UploadAvatar')).append(img);
if(window.innerWidth>500){
$('#pt-userpage-2').before($('<li id="pt-avatar"></li>').append(link));
}