blob: 399c835db90bf4fe2b18e9e8a9802560822adb59 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import React from 'dom-chef';
import select from 'select-dom';
import * as pageDetect from 'github-url-detection';
import features from '.';
import {getCleanPathname} from '../github-helpers';
function buildUrl(queryField: string): URL {
const url = new URL('/search', location.href);
url.searchParams.set('o', 'desc');
url.searchParams.set('q', `user:${getCleanPathname()}`);
url.searchParams.set('s', queryField);
url.searchParams.set('type', 'Repositories');
return url;
}
function init(): void {
// Showcase title
select('.js-pinned-items-reorder-container .text-normal')!.firstChild!.after(
' / ',
<a href={String(buildUrl('stars'))}>Top repositories</a>
);
}
void features.add({
id: __filebasename,
description: 'Adds a link to the user’s most starred repositories.',
screenshot: 'https://user-images.githubusercontent.com/1402241/48474026-43e3ae80-e82c-11e8-93de-159ad4c6f283.png'
}, {
include: [
pageDetect.isUserProfileMainTab
],
init
});
|