blob: 9c13684715c6ac70b7451333991c47578b4c0989 (
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
|
import React from 'dom-chef';
import * as pageDetect from 'github-url-detection';
import features from '../feature-manager.js';
import observe from '../helpers/selector-observer.js';
import {buildRepoURL} from '../github-helpers/index.js';
function addLinkToBanner(banner: HTMLElement): void {
if (banner.lastChild!.textContent.includes('repository has been archived')) {
banner.lastChild!.after(
' You can check out ',
<a href={buildRepoURL('forks')}>its forks</a>,
'.',
);
}
}
function init(signal: AbortSignal): void {
observe('#js-repo-pjax-container > .flash-warn:first-child', addLinkToBanner, {signal});
}
void features.add(import.meta.url, {
include: [
pageDetect.isRepo,
],
init,
});
/*
Test URLs:
https://github.com/probot/template/blob/master/CODE_OF_CONDUCT.md?rgh-link-date=2022-10-12T08%3A11%3A41Z
*/
|