summaryrefslogtreecommitdiff
path: root/source/features/highlight-own-issues-and-prs.tsx
blob: efedafec8a7f9b009cb51ab84a6b10ba36b099fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import select from 'select-dom';
import features from '../libs/features';
import {getUsername} from '../libs/utils';

function init(): void {
	// "Opened by {user}" and "Created by {user}"
	for (const username of select.all(`.opened-by a[title$="ed by ${CSS.escape(getUsername())}"]`)) {
		username.style.fontWeight = 'bold';
	}
}

features.add({
	id: __featureName__,
	description: 'Highlights discussions opened by you.',
	screenshot: 'https://user-images.githubusercontent.com/1402241/53065281-01560000-3506-11e9-9a51-0bdf69e20b4a.png',
	include: [
		features.isDiscussionList
	],
	load: features.onAjaxedPages,
	init
});