Skip to content

Commit 28c93c2

Browse files
committed
Mentioned-links: Include count
1 parent ecb3976 commit 28c93c2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

github-mentioned-links.user.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name GitHub Mentioned Links
3-
// @version 0.1.2
3+
// @version 0.1.3
44
// @description A userscript adds all mentioned links in the side bar
55
// @license MIT
66
// @author Rob Garrison
@@ -9,8 +9,8 @@
99
// @run-at document-idle
1010
// @grant GM_getValue
1111
// @grant GM_setValue
12-
// @require https://greasyfork.org/scripts/28721-mutations/code/mutations.js?version=952601
13-
// @require https://greasyfork.org/scripts/398877-utils-js/code/utilsjs.js?version=952600
12+
// @require https://greasyfork.org/scripts/28721-mutations/code/mutations.js?version=1108163
13+
// @require https://greasyfork.org/scripts/398877-utils-js/code/utilsjs.js?version=1079637
1414
// @icon https://github.githubassets.com/pinned-octocat.svg
1515
// @updateURL https://raw.githubusercontent.com/Mottie/GitHub-userscripts/master/github-mentioned-links.user.js
1616
// @downloadURL https://raw.githubusercontent.com/Mottie/GitHub-userscripts/master/github-mentioned-links.user.js
@@ -92,12 +92,13 @@
9292

9393
function buildLinks(links) {
9494
const entry = $("#ghml-wrapper") || item.cloneNode(true);
95+
const hasLinks = links.length;
9596
entry.innerHTML = `
9697
<summary class="discussion-sidebar-heading text-bold d-flex flex-items-center">
97-
Mentioned Links
98+
Mentioned Links ${hasLinks ? `(${links.length})` : ""}
9899
</summary>
99100
<ul class="list-style-none">
100-
${links.length ? links.join("") : "No links found"}
101+
${hasLinks ? links.join("") : "No links found"}
101102
</ul>`;
102103
$(selectors.sidebar).after(entry);
103104
addLoadMoreButton();

0 commit comments

Comments
 (0)