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

modules/usernotes/dom

Functions

createNotesDisplay()

createNotesDisplay(__namedParameters): NotesDisplayHandlers

Defined in: extension/data/modules/usernotes/dom.tsx:99

Creates the note-tag rendering and popup-opening handlers for the Usernotes module. Registers note tags at the authorActions UI location.

Parameters

__namedParameters

UserNotesSettings

Returns

NotesDisplayHandlers


createNotesManager()

createNotesManager(unManagerLink): NotesManagerHandlers

Defined in: extension/data/modules/usernotes/dom.tsx:454

Creates the manager-link and overlay-open handlers for the Usernotes module.

Parameters

Returns

NotesManagerHandlers

Interfaces

NotesDisplayHandlers

Defined in: extension/data/modules/usernotes/dom.tsx:72

Handlers returned by createNotesDisplay for wiring up the notes-display lifecycle.

Properties

cleanup

cleanup: () => Promise<void>

Defined in: extension/data/modules/usernotes/dom.tsx:74

Disposes the note-tag renderer registered by this factory. Pass to lifecycle.mount in index.ts.

Returns

Promise<void>

handleNewThings

handleNewThings: () => void

Defined in: extension/data/modules/usernotes/dom.tsx:76

Debounced handler to re-process all known subreddits when new things appear on the page.

Returns

void

openNotesPopup

openNotesPopup: (subreddit, user, link, disableLink, initialPosition, contextID?, initialTabIndex?) => Promise<void>

Defined in: extension/data/modules/usernotes/dom.tsx:84

Opens the add-note popup for a user in a subreddit.

Parameters
subreddit

string

user

string

initialPosition
left

number

top

number

contextID?

string

Reddit fullname of the thing being linked to the note.

initialTabIndex?

number

Tab to open by default (0 = Toolbox, 1 = Native).

Returns

Promise<void>


NotesManagerHandlers

Defined in: extension/data/modules/usernotes/dom.tsx:433

Handlers returned by createNotesManager for the modbox manage-usernotes links.

Properties

handleBansLinkClick

handleBansLinkClick: (element) => void

Defined in: extension/data/modules/usernotes/dom.tsx:443

Navigates to the subreddit’s ban management page.

Parameters
element

Element

Returns

void

handleFlairLinkClick

handleFlairLinkClick: (element) => void

Defined in: extension/data/modules/usernotes/dom.tsx:447

Navigates to the subreddit’s flair management page.

Parameters
element

Element

Returns

void

handleManagerClick

handleManagerClick: (element) => Promise<void>

Defined in: extension/data/modules/usernotes/dom.tsx:439

Opens the manager for the subreddit stored in the clicked element’s data-subreddit attribute.

Parameters
element

Element

Returns

Promise<void>

handleMutesLinkClick

handleMutesLinkClick: (element) => void

Defined in: extension/data/modules/usernotes/dom.tsx:445

Navigates to the subreddit’s mute management page.

Parameters
element

Element

Returns

void

handleNewPage

handleNewPage: (event) => Promise<void>

Defined in: extension/data/modules/usernotes/dom.tsx:435

Adds or removes modbox context items when the page subreddit changes.

Parameters
event

CustomEvent<TBPageContext>

Returns

Promise<void>

handleOpenManagerEvent

handleOpenManagerEvent: (event) => void

Defined in: extension/data/modules/usernotes/dom.tsx:437

Opens the manager for the subreddit passed via the event’s detail.subreddit field.

Parameters
event

Event

Returns

void

openManagerForSubreddit

openManagerForSubreddit: (subreddit) => Promise<void>

Defined in: extension/data/modules/usernotes/dom.tsx:441

Loads usernotes and opens the manager overlay for the given subreddit.

Parameters
subreddit

string

Returns

Promise<void>