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

Function initBanner

source/features/netiquette.tsx:131–141  ·  view source on GitHub ↗
(signal: AbortSignal)

Source from the content-addressed store, hash-verified

129}
130
131function initBanner(signal: AbortSignal): void {
132 observe(newCommentField, async (field: HTMLElement) => {
133 // Check inside the observer because React views load after dom-ready
134 const closingDate = await getCloseDate();
135 if (closingDate && wasLongAgo(closingDate) && (areIssuesEnabled() || areDiscussionsEnabled())) {
136 addResolvedBanner(field, closingDate);
137 } else if (isPopular() && !(await userIsModerator())) {
138 addPopularBanner(field);
139 }
140 }, {signal});
141}
142
143function makeFieldKinder(field: HTMLParagraphElement): void {
144 if (field.textContent.trim() === 'Add your comment here...') {

Callers

nothing calls this directly

Calls 9

observeFunction · 0.85
getCloseDateFunction · 0.85
wasLongAgoFunction · 0.85
areIssuesEnabledFunction · 0.85
areDiscussionsEnabledFunction · 0.85
addResolvedBannerFunction · 0.85
isPopularFunction · 0.85
userIsModeratorFunction · 0.85
addPopularBannerFunction · 0.85

Tested by

no test coverage detected