File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 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
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
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 ( ) ;
You can’t perform that action at this time.
0 commit comments