moderator-toolbox-nxg-for-reddit / modules/massmoderation/oldReddit/queueSorting

modules/massmoderation/oldReddit/queueSorting

Functions

appendNewItems()

appendNewItems(sitetable, things): void

Defined in: extension/data/modules/massmoderation/oldReddit/queueSorting.ts:34

Appends auto-refresh things to a “New Items” section pinned at the very bottom of the queue, creating the section (with its header) on first use. The section is kept as the site table’s last child so it stays at the bottom even when subreddit grouping is active; items remain here until the user triggers a resort (see dissolveNewItemsSection).

Parameters

sitetable

Element

The queue site table.

things

Element[]

Newly fetched .thing elements to pin at the bottom.

Returns

void


groupBySubreddit()

groupBySubreddit(sitetable): void

Defined in: extension/data/modules/massmoderation/oldReddit/queueSorting.ts:219

Groups queue items in the site table by subreddit, wrapping each subreddit’s items in a labelled .toolbox-sub-group container. Call again to re-group after sorting. Intentional vanilla DOM: wraps and reorders existing Reddit .thing nodes; React cannot own nodes it didn’t render.

Parameters

sitetable

Element

The site table element to group within.

Returns

void


groupThings()

groupThings(): void

Defined in: extension/data/modules/massmoderation/oldReddit/queueSorting.ts:74

Groups mod-queue comments under their parent submission using wrapper divs. Intentional vanilla DOM: reorders Reddit’s .thing nodes; React cannot own nodes it didn’t render.

Returns

void


sortThings()

sortThings(order, asc, groupCommentsOnModPage): void

Defined in: extension/data/modules/massmoderation/oldReddit/queueSorting.ts:146

Sorts the queue items in the site table by the given field and direction. Intentional vanilla DOM: reorders existing Reddit .thing nodes; React cannot own nodes it didn’t render.

Parameters

order

string

The sort field: 'age', 'edited', 'removed', 'score', or 'reports'.

asc

boolean

Whether to sort ascending (true) or descending (false).

groupCommentsOnModPage

boolean

Whether to group comments by submission after sorting (mod pages only).

Returns

void


ungroupBySubreddit()

ungroupBySubreddit(sitetable): void

Defined in: extension/data/modules/massmoderation/oldReddit/queueSorting.ts:269

Ungroups items previously grouped by groupBySubreddit, restoring them as direct children of the site table.

Parameters

sitetable

Element

The site table element to ungroup within.

Returns

void