You Earned This Badge v0.1

This commit is contained in:
Glorfindel 2018-03-18 16:37:53 +01:00
parent 7ca2dda435
commit 9d521a5328
4 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# You've Earned This Badge, but when and where?
This userscript turns the checkmarks in the badge list (which indicate you've earned a
specific badge) to links to your *personal* badge page, where you can see when and where
you earned the badge
![](badge-list.png)
![](badge.png)
## Installation
- Make sure you have Tampermonkey (for Chrome) or Greasemonkey (for Firefox) installed.
- Install the userscript with
[this direct link](https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/you-earned-this-badge/you-earned-this-badge.user.js).
## Support
- Stack Apps

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,30 @@
// ==UserScript==
// @name You've earned this badge, but when and where?
// @namespace https://github.com/Glorfindel83/
// @description Adds a link in the badges page to show your personal badge page for that badge.
// @author Glorfindel
// @updateURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/you-earned-this-badge/you-earned-this-badge.user.js
// @downloadURL https://raw.githubusercontent.com/Glorfindel83/SE-Userscripts/master/you-earned-this-badge/you-earned-this-badge.user.js
// @version 0.1
// @match *://*.stackexchange.com/help/badges*
// @match *://*.stackoverflow.com/help/badges*
// @match *://*.superuser.com/help/badges*
// @match *://*.serverfault.com/help/badges*
// @match *://*.askubuntu.com/help/badges*
// @match *://*.stackapps.com/help/badges*
// @match *://*.mathoverflow.net/help/badges*
// @grant none
// ==/UserScript==
(function () {
'use strict';
$("span.badge-earned-check").each(function() {
var parent = $(this).parent();
var url = parent.next().find("a").prop("href") + "?userid=" +
/\/users\/(\d+)/g.exec($("a.my-profile").prop("href"))[1];
var anchor = $("<a href=\"" + url + "\"/>");
anchor.append($(this));
parent.append(anchor);
});
}) ();