moderator-toolbox-nxg-for-reddit / modules/domaintagger/dom

modules/domaintagger/dom

Functions

createDomainTaggerHandlers()

createDomainTaggerHandlers(displayType): DomainTaggerHandlers

Defined in: extension/data/modules/domaintagger/dom.tsx:279

Creates and wires all Domain Tagger DOM handlers based on the current settings.

Parameters

displayType

DomainTaggerSettings

Controls how the color tag is visually applied (dot, border, background, etc.).

Returns

DomainTaggerHandlers

An object of handler functions to be bound to events by the module entry point.

Interfaces

DomainTaggerHandlers

Defined in: extension/data/modules/domaintagger/dom.tsx:39

Handlers returned by createDomainTaggerHandlers and wired up by the module entry point.

Properties

applyDisplayClass

applyDisplayClass: () => void

Defined in: extension/data/modules/domaintagger/dom.tsx:41

Adds the display-type CSS class to document.body.

Returns

void

cleanup

cleanup: () => Promise<void>

Defined in: extension/data/modules/domaintagger/dom.tsx:43

Removes the display-type CSS class from document.body.

Returns

Promise<void>

handleNewThings

handleNewThings: () => void

Defined in: extension/data/modules/domaintagger/dom.tsx:45

Re-runs tag processing on all link things; called on page load and when new things appear (NER).

Returns

void

handleShredditMutations

handleShredditMutations: (mutations) => void

Defined in: extension/data/modules/domaintagger/dom.tsx:58

Processes newly added shreddit-post elements detected by a MutationObserver.

Parameters
mutations

MutationRecord[]

DOM mutation records to scan for new posts.

Returns

void

handleTagButtonClick

handleTagButtonClick: (element, event) => void | Promise<void>

Defined in: extension/data/modules/domaintagger/dom.tsx:51

Opens the DomainTaggerPopup for the clicked “T” tag button.

Parameters
element

Element

The button element that was clicked.

event

MouseEvent

The originating mouse event, used for popup positioning.

Returns

void | Promise<void>

initShreddit

initShreddit: () => void

Defined in: extension/data/modules/domaintagger/dom.tsx:53

Processes all existing shreddit-post elements on the page.

Returns

void