moderator-toolbox-nxg-for-reddit / util/ui/redditElementsInit
util/ui/redditElementsInit¶
Functions¶
getSubredditColorSalt()¶
getSubredditColorSalt():
string
Defined in: extension/data/util/ui/redditElementsInit.tsx:55
Returns the current subreddit color salt used when computing per-subreddit border colors.
Returns¶
string
makeCommentThread()¶
makeCommentThread(
jsonInput,commentOptions?):HTMLElement
Defined in: extension/data/util/ui/redditElementsInit.tsx:204
Renders a TBCommentChildren React component for a list of comment API objects and returns the host element.
Parameters¶
jsonInput¶
(RedditMoreChildren | RedditThing<CommentData>)[]
Array of Reddit API comment/more child objects.
commentOptions?¶
Optional rendering options forwarded to the comment components.
Returns¶
HTMLElement
makeSingleComment()¶
makeSingleComment(
comment,commentOptions?):HTMLElement
Defined in: extension/data/util/ui/redditElementsInit.tsx:189
Renders a single TBComment React component into a detached host element and returns it.
Parameters¶
comment¶
commentOptions?¶
CommentOptions = {}
Returns¶
HTMLElement
makeSubmissionEntry()¶
makeSubmissionEntry(
submission,submissionOptions?):HTMLElement
Defined in: extension/data/util/ui/redditElementsInit.tsx:176
Renders a TBSubmission React component into a detached host element and returns it.
The host element uses display: contents so it is visually transparent.
Parameters¶
submission¶
submissionOptions?¶
Returns¶
HTMLElement
tbRedditEvent()¶
tbRedditEvent(
elements):void
Defined in: extension/data/util/ui/redditElementsInit.tsx:134
Processes all .toolbox-thing elements inside elements, injecting toolbox slots and
tagging toolbox containers so modules can attach their UI.
Parameters¶
elements¶
Element | ArrayLike<Element>
A single element or array-like collection to scan.
Returns¶
void
Variables¶
colorSaltReady¶
constcolorSaltReady:Promise<void>
Defined in: extension/data/util/ui/redditElementsInit.tsx:46
Resolves once the subreddit color salt has been loaded from extension storage. Await before any make* call where correctness is required.