MCPcopy Index your code
hub / github.com/refined-github/refined-github / init

Function init

source/features/warning-for-disallow-edits.tsx:17–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15);
16
17function init(): void | false {
18 const checkbox = $optional('input[name="collab_privs"]');
19 if (!checkbox) {
20 return false;
21 }
22
23 if (pageDetect.isPRConversation()) {
24 attachElement(
25 closestElement('.discussion-sidebar-item', checkbox),
26 {after: getWarning},
27 );
28 } else {
29 const option = closestElement('.js-collab-option', checkbox);
30
31 // Prevent layout shifting when warning appears
32 option.classList.remove('flex-auto');
33 const actionRow = option.parentElement!;
34 actionRow.classList.add('mt-1');
35 actionRow.parentElement!.classList.remove('flex-wrap');
36
37 attachElement(
38 actionRow.lastElementChild!,
39 {after: getWarning},
40 );
41 }
42}
43
44void features.add(import.meta.url, {
45 include: [

Callers

nothing calls this directly

Calls 2

attachElementFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected