MediaWiki:Gadget-ShowAvatar.js: Difference between revisions
(Created page with ""use strict"; // <pre> $(() => { const commonsUrl = new mw.Uri(`${mw.config.get("wgServer")}${mw.config.get("wgScriptPath")}/`); commonsUrl.query.user = mw.config.get("wgPageName").replace(/^user:/i, ""); commonsUrl.path = "/extensions/Avatar/avatar.php"; const imgUrl = new mw.Uri(commonsUrl); imgUrl.query.user = mw.config.get("wgUserName"); const img = $("<img>").attr("src", imgUrl); const link = $("<a>").attr("href", `${mw.config.get("wgServ...") |
No edit summary |
||
Line 1: | Line 1: | ||
var img = $('<img>').attr('src', mw.config.get('wgScriptPath') + '/extensions/Avatar/avatar.php?user=' + mw.user.id()); | |||
var link = $('<a>').attr('href', mw.util.getUrl('Special:UploadAvatar')).append(img); | |||
$('#pt-userpage').before($('<li id="pt-avatar"></li>').append(link)); | |||