summaryrefslogtreecommitdiff
path: root/source/features/star-repo-hotkey.tsx
blob: 86a96e6e2ebd74d37b69aad661cd2c70fd9d07e2 (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 * as pageDetect from 'github-url-detection';

import features from '.';

function init(): void {
	// There are two buttons: unstar and star
	for (const button of select.all('.js-social-form > button')) {
		button.dataset.hotkey = 'g s';
	}
}

void features.add(__filebasename, {
	shortcuts: {
		'g s': 'Star and unstar repository'
	},
	include: [
		pageDetect.isRepo
	],
	init
});