moderator-toolbox-nxg-for-reddit / dom/shreddit/feed

dom/shreddit/feed

Functions

findCreditBarTargets()

findCreditBarTargets(root): CreditBarTarget[]

Defined in: extension/data/dom/shreddit/feed.ts:42

Find feed post credit bars that need a toolbox anchor. Returns both mod-notes-backed targets and feed-only targets (no mod-notes-opener present). Callers should skip feed-only targets when the feedPageUsernames setting is disabled.

Parameters

root

Element

Returns

CreditBarTarget[]


findHighlightCardTargets()

findHighlightCardTargets(root): HighlightCardTarget[]

Defined in: extension/data/dom/shreddit/feed.ts:120

Find community-highlight-card elements that need a credit bar injected. Skips cards that have already been processed (contain .toolbox-author-slot). These appear on subreddit pages as pinned-post cards.

Parameters

root

Element

Returns

HighlightCardTarget[]

Interfaces

HighlightCardTarget

Defined in: extension/data/dom/shreddit/feed.ts:105

Data extracted from a community-highlight-card element.

Properties

author

author: string

Defined in: extension/data/dom/shreddit/feed.ts:109

avatarSrc

avatarSrc: string

Defined in: extension/data/dom/shreddit/feed.ts:112

card

card: Element

Defined in: extension/data/dom/shreddit/feed.ts:106

labelSlot

labelSlot: HTMLElement

Defined in: extension/data/dom/shreddit/feed.ts:108

postId

postId: string

Defined in: extension/data/dom/shreddit/feed.ts:111

subreddit

subreddit: string

Defined in: extension/data/dom/shreddit/feed.ts:110

titleEl

titleEl: Element | null

Defined in: extension/data/dom/shreddit/feed.ts:107

Type Aliases

CreditBarTarget

CreditBarTarget = { author: string; creditBar: Element; isCompact: boolean; kind: "mod-notes"; needsThingContainer: boolean; postEl: Element; postId: string; separator: Element; subreddit: string; thingId: string; } | { author: string; creditBar: Element; hasNativeAuthor: boolean; kind: "feed-only"; needsThingContainer: boolean; postEl: Element; postId: string; separator: Element; subreddit: string; }

Defined in: extension/data/dom/shreddit/feed.ts:5

Union Members

Type Literal

{ author: string; creditBar: Element; isCompact: boolean; kind: "mod-notes"; needsThingContainer: boolean; postEl: Element; postId: string; separator: Element; subreddit: string; thingId: string; }

author

author: string

creditBar

creditBar: Element

isCompact

isCompact: boolean

kind

kind: "mod-notes"

needsThingContainer

needsThingContainer: boolean

Whether postEl still needs a thing-level container appended.

postEl

postEl: Element

postId

postId: string

separator

separator: Element

subreddit

subreddit: string

thingId

thingId: string


Type Literal

{ author: string; creditBar: Element; hasNativeAuthor: boolean; kind: "feed-only"; needsThingContainer: boolean; postEl: Element; postId: string; separator: Element; subreddit: string; }

author

author: string

creditBar

creditBar: Element

hasNativeAuthor

hasNativeAuthor: boolean

True when the credit bar already has a native [slot=”authorName”] element (e.g. mod queues). In that case the username link must not be inserted, but needsThingContainer should still be processed.

kind

kind: "feed-only"

needsThingContainer

needsThingContainer: boolean

Whether postEl still needs a thing-level container appended.

postEl

postEl: Element

postId

postId: string

separator

separator: Element

subreddit

subreddit: string