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

Function addPopularBanner

source/features/netiquette.tsx:94–113  ·  view source on GitHub ↗
(commentField: HTMLElement)

Source from the content-addressed store, hash-verified

92}
93
94function addPopularBanner(commentField: HTMLElement): void {
95 if (elementExists('.rgh-popular-banner')) {
96 return;
97 }
98
99 const reactWrapper = closestElementOptional('[class^="InlineAutocomplete"]', commentField);
100 const banner = createBanner({
101 icon: <FlameIcon className="m-0 tmp-m-0" />,
102 classes: 'p-2 text-small color-fg-muted border-0 rounded-0 rgh-popular-banner'.split(' '),
103 text:
104 'This issue is highly active. Reconsider commenting unless you have read all the comments and have something to add.',
105 });
106
107 if (reactWrapper) {
108 reactWrapper.prepend(banner);
109 } else {
110 banner.classList.replace('rounded-0', 'm-2');
111 commentField.prepend(banner);
112 }
113}
114
115function addDraftBanner(commentField: HTMLElement): void {
116 commentField.prepend(

Callers 1

initBannerFunction · 0.85

Calls 3

createBannerFunction · 0.85
prependMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected