moderator-toolbox-nxg-for-reddit / modules/commenttriage/platformInterface
modules/commenttriage/platformInterface¶
Functions¶
createOldRedditAdapter()¶
createOldRedditAdapter():
CommentTriageAdapter
Defined in: extension/data/modules/commenttriage/platformInterface.ts:86
Returns the old-Reddit binding for CommentTriageAdapter.
Returns¶
Interfaces¶
CommentTriageAdapter¶
Defined in: extension/data/modules/commenttriage/platformInterface.ts:19
Methods¶
collapse()¶
collapse(
el):void
Defined in: extension/data/modules/commenttriage/platformInterface.ts:66
Collapses a comment element.
Parameters¶
el¶
Element
Returns¶
void
findNewComments()¶
findNewComments():
Element[]
Defined in: extension/data/modules/commenttriage/platformInterface.ts:24
Returns all comment elements not yet processed by the triage run.
Returns¶
Element[]
getChildContainer()¶
getChildContainer(
el):Element|null
Defined in: extension/data/modules/commenttriage/platformInterface.ts:57
Returns the child sitetable/container element of a comment, used when recursively sorting children.
Parameters¶
el¶
Element
Returns¶
Element | null
The child container, or null if the comment has no children.
getDirectChildren()¶
getDirectChildren(
container):HTMLElement[]
Defined in: extension/data/modules/commenttriage/platformInterface.ts:52
Returns the direct child comment elements within a container, excluding “load more” stubs.
Parameters¶
container¶
Element
Returns¶
HTMLElement[]
getMoreChildrenContainer()¶
getMoreChildrenContainer(
clickTarget):Element|null
Defined in: extension/data/modules/commenttriage/platformInterface.ts:82
Returns the sitetable container to re-sort after a “load more comments” click.
Parameters¶
clickTarget¶
Element
The element that was clicked.
Returns¶
Element | null
The container to re-sort, or null if not applicable.
getParentComment()¶
getParentComment(
el):Element|null
Defined in: extension/data/modules/commenttriage/platformInterface.ts:50
Returns the nearest ancestor comment element, for walking the comment tree upward.
Parameters¶
el¶
Element
Returns¶
Element | null
The parent comment element, or null if at the root.
getRootContainer()¶
getRootContainer():
Element|null
Defined in: extension/data/modules/commenttriage/platformInterface.ts:63
Returns the root comment container for the page.
Returns¶
Element | null
The root sitetable or equivalent element, or null if not found.
isControversial()¶
isControversial(
el):boolean
Defined in: extension/data/modules/commenttriage/platformInterface.ts:39
Returns true if the comment is marked controversial by Reddit.
Parameters¶
el¶
Element
Returns¶
boolean
markProcessed()¶
markProcessed(
el):void
Defined in: extension/data/modules/commenttriage/platformInterface.ts:26
Marks a comment element as processed so it is not re-scored on subsequent runs.
Parameters¶
el¶
Element
Returns¶
void
preSortFixup()¶
preSortFixup(
container):void
Defined in: extension/data/modules/commenttriage/platformInterface.ts:75
Performs any pre-sort fixup needed before the sort algorithm runs. On old Reddit this flattens Never-Ending Reddit (NER) pagination markers; on other platforms this is a no-op.
Parameters¶
container¶
Element
Returns¶
void
readChildCount()¶
readChildCount(
el):number|null
Defined in: extension/data/modules/commenttriage/platformInterface.ts:37
Reads the number of child comments.
Parameters¶
el¶
Element
Returns¶
number | null
The child count, or null if unavailable on this platform.
readScore()¶
readScore(
el):number|null
Defined in: extension/data/modules/commenttriage/platformInterface.ts:32
Reads the vote score for a comment.
Parameters¶
el¶
Element
Returns¶
number | null
The numeric score, or null if unavailable on this platform.
uncollapse()¶
uncollapse(
el):void
Defined in: extension/data/modules/commenttriage/platformInterface.ts:68
Expands (uncollapses) a comment element.
Parameters¶
el¶
Element
Returns¶
void
commentSelector¶
Defined in: extension/data/modules/commenttriage/platformInterface.ts:21
CSS selector that matches a comment container element (e.g.
.thingorshreddit-comment).