Generate a URL to a discussion.
Generate a URL to a post.
Generate a URL to a user.
The avatar
helper displays a user's avatar.
Attributes to apply to the avatar element
The fullTime
helper displays a formatted time string wrapped in a
The highlight
helper searches for a word phrase in a string, and wraps
matches with the tag.
The string to highlight.
The word or words to highlight.
The humanTime
helper displays a time in a human-friendly time-ago format
(e.g. '12 days ago'), wrapped in a
The icon
helper displays an icon.
The full icon class, prefix and the icon’s name.
Any other attributes to apply.
The listItems
helper wraps an array of components in the provided tag,
stripping out any unnecessary Separator
components.
By default, this tag is an <li>
tag, but this is customisable through the
second function parameter, customTag
.
The punctuateSeries
helper formats a list of strings (e.g. names) to read
fluently in the application's locale.
punctuateSeries(['Toby', 'Franz', 'Dominion']) // Toby, Franz, and Dominion
')}
The useronline
helper displays a green circle if the user is online
The username
helper displays a user's username in a
tag. If the user doesn't exist, the username will be displayed as [deleted].
The abbreviateNumber
utility converts a number to a shorter localized form.
The anchorScroll
utility saves the scroll position relative to an element,
and then restores it after a callback has been run.
This is useful if a redraw will change the page's content above the viewport. Normally doing this will result in the content in the viewport being pushed down or pulled up. By wrapping the redraw with this utility, the scroll position can be anchor to an element that is in or below the viewport, so the content in the viewport will stay the same.
The element to anchor the scroll position to.
The callback to run that will change page content.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
Escapes the RegExp
special characters in input
.
Get all of the registered handlers for an event.
The name of the event.
Unregister an event handler.
The name of the event.
The function that handles the event.
Register an event handler.
The name of the event.
The function to handle the event.
Register an event handler so that it will run only once, and then unregister itself.
The name of the event.
The function to handle the event.
Trigger an event.
The name of the event.
Arguments to pass to event handlers.
The extract
utility deletes a property from an object and returns its
value.
The object that owns the property
The name of the property to extract
The value of the property
Extract the text nodes from a virtual element.
The formatNumber
utility localizes a number into a string with the
appropriate punctuation based on the provided locale otherwise will default to the users locale.
The humanTime
utility converts a date to a localized, human-readable time-
ago string.
Returns if the passed value is an object.
In this context, "object" refers to any non-primitive value, including arrays, function, maps, dates, and more.
The liveHumanTimes
initializer sets up a loop every 1 second to update
timestamps rendered with the humanTime
helper.
The mapRoutes
utility converts a map of named application routes into a
format that can be understood by Mithril, and wraps them in route resolvers
to provide each route with the current route name.
The mixin
utility assigns the properties of a set of 'mixin' objects to
the prototype of a parent object.
The class to extend the new class from.
The objects to mix in.
A new class that extends Parent and contains the mixins.
Mithril 2 does not completely rerender the page if a route change leads to the same route (or the same component handling a different route). This util calls m.route.set, forcing a reonit.
Convert the given string to a unique color.
Check if class A is the same as or a subclass of class B.
An event handler factory that makes it simpler to implement data binding for component event listeners.
The handler created by this factory passes the DOM element's attribute identified by the first argument to the callback (usually a bidirectional Mithril stream: https://mithril.js.org/stream.html#bidirectional-bindings).
Replaces m.withAttr for Mithril 2.0.
The routes
initializer defines the forum app's routes.
Get a list of controls for a discussion.
The parent component under which the controls menu will be displayed.
Delete the discussion after confirming with the user.
Get controls for a discussion which are destructive (e.g. delete).
Hide a discussion.
Get controls for a discussion pertaining to moderation (e.g. rename, lock).
Rename the discussion.
Open the reply composer for the discussion. A promise will be returned, which resolves when the composer opens successfully. If the user is not logged in, they will be prompted. If they don't have permission to reply, the promise will be rejected.
Whether or not to scroll down to the last post if the discussion is being viewed.
Whether or not to force a reload of the composer component, even if it is already open for this discussion.
Restore a discussion.
Get controls for a discussion pertaining to the current user (e.g. reply, follow).
The parent component under which the controls menu will be displayed.
Delete a post.
Open the composer to edit a post.
Hide a post.
Restore a post.
Delete the user.
Edit the user.
Show deletion alert of user.
Get controls for a user pertaining to the current user (e.g. poke, follow).
Shows an alert if the user has not yet confirmed their email address.
The slidable
utility adds touch gestures to an element so that it can be
slid away to reveal controls underneath, and then released to activate those
controls.
It relies on the element having children with particular CSS classes.
The function returns a record with a reset
proeprty. This is a function
which reverts the slider to its original position. This should be called,
for example, when a controls dropdown is closed.
Generated using TypeDoc version 0.22.10
The
routes
initializer defines the forum app's routes.