import select from 'select-dom';
import features from '../libs/features';

function init() {
	// Get repositories link from user profile navigation
	const link = select<HTMLAnchorElement>('.user-profile-nav a[href*="tab=repositories"]');

	if (!link) {
		return false;
	}

	link.search += '&type=source';
}

features.add({
	id: 'set-default-repositories-type-to-sources',
	include: [
		features.isUserProfile
	],
	load: features.onAjaxedPages,
	init
});

import select from 'select-dom';
import features from '../libs/features';

function init() {
	const links = select.all<HTMLAnchorElement>([
		'.user-profile-nav [href$="tab=repositories"]', // "Your repositories" in header dropdown
		'#user-links [href$="tab=repositories"]' // "Repositories" tab on profile
	].join());

	for (const link of links) {
		link.search += '&type=source';
	}
}

features.add({
	id: 'set-default-repositories-type-to-sources',
	load: features.onAjaxedPages,
	init
});

Include "Your repositories" link in `...repositories...-to-sources`
Include "Your repositories" link in `...repositories...-to-sources`
