This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ShowAvatar[ResourceLoader|default|type=general|dependencies=mediawiki.Uri]|ShowAvatar.js|ShowAvatar.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* SPDX-License-Identifier: GPL-3.0 | ||
* _addText: '{{Gadget Header|license=GPL-3.0}}' | ||
* | ||
* @source <https://github.com/TopRealm/InterfaceCodes/tree/master/src/Gadgets/Appearance/ShowAvatar.css> | ||
*/ | ||
/** | ||
* +--------------------------------------------------------+ | ||
* | === WARNING: GLOBAL GADGET FILE === | | ||
* +--------------------------------------------------------+ | ||
* | All changes should be made in the repository, | | ||
* | otherwise they will be lost. | | ||
* +--------------------------------------------------------+ | ||
* | Changes to this page may affect many users. | | ||
* | Please discuss changes at talk page before editing. | | ||
* +--------------------------------------------------------+ | ||
*/ | ||
/* <nowiki> */ | ||
#p-personal li { | ||
margin-top: 1em; | ||
margin-bottom: 0.2em; | ||
} | ||
|
||
#pt-userpage { | ||
background: none !important; | ||
padding-left: 0 !important; | ||
} | ||
|
||
#pt-avatar { | ||
margin-top: 0.25em !important; | ||
margin-bottom: 0 !important; | ||
} | ||
|
||
#pt-avatar img { | ||
width: 2.5em; | ||
border-radius: 50%; | ||
} | ||
|
||
.skin-citizen #user-rootpage-avatar { | ||
border-radius: 5px; | ||
top: 8px; | ||
position: relative; | ||
} | ||
|
||
.skin-gongbi #user-rootpage-avatar { | ||
border-radius: 10px; | ||
padding: 4px; | ||
} | ||
|
||
/* 1.28+ Echo fix */ | ||
#p-personal #pt-notifications-alert, | ||
#p-personal #pt-notifications-notice { | ||
margin-top: 0.8em; | ||
} | ||
/* </nowiki> */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* SPDX-License-Identifier: GPL-3.0 | ||
* _addText: '{{Gadget Header|license=GPL-3.0}}' | ||
* | ||
* @source <https://github.com/TopRealm/InterfaceCodes/tree/master/src/Gadgets/Appearance/ShowAvatar.js> | ||
*/ | ||
/** | ||
* +--------------------------------------------------------+ | ||
* | === WARNING: GLOBAL GADGET FILE === | | ||
* +--------------------------------------------------------+ | ||
* | All changes should be made in the repository, | | ||
* | otherwise they will be lost. | | ||
* +--------------------------------------------------------+ | ||
* | Changes to this page may affect many users. | | ||
* | Please discuss changes at talk page before editing. | | ||
* +--------------------------------------------------------+ | ||
*/ | ||
/* <nowiki> */ | ||
"use strict"; | ||
$(function () { | ||
var avatarUrl = new mw.Uri("https://wiki.zorua.top/"); | ||
avatarUrl.query.user = mw.config.get("wgPageName").replace(/^user:/i, ""); | ||
avatarUrl.path = "/extensions/Avatar/avatar.php"; | ||
var imgUrl = new mw.Uri(avatarUrl); | ||
imgUrl.query.user = mw.config.get("wgUserName"); | ||
var img = $("<img>").attr({ | ||
src: imgUrl, | ||
title: "上传头像", | ||
}); | ||
var link = $("<a>").attr("href", "https://wiki.zorua.top/wiki/Special:UploadAvatar").append(img); | ||
$("#pt-userpage").before($('<li id="pt-avatar"></li>').append(link)); | ||
if (mw.config.get("wgNamespaceNumber") === 2 && !mw.config.get("wgPageName").includes("/")) { | ||
var hrefUrl = new mw.Uri(avatarUrl); | ||
hrefUrl.path = "/Special:Viewavatar"; | ||
var srcUrl = new mw.Uri(avatarUrl); | ||
$(".ns-2 #firstHeading").prepend($("<a/>").attr({ | ||
href: hrefUrl, | ||
title: "查看头像", | ||
}).prepend($("<img/>").attr({ | ||
src: srcUrl, | ||
id: "user-rootpage-avatar", | ||
}).css({ | ||
width: "1.2em", | ||
height: "1.2em", | ||
}))); | ||
} | ||
}); | ||
/* </nowiki> */ |