Reference Source
import ForumApplication from 'flarum/forum/ForumApplication'
public class | source

ForumApplication

Extends:

Application → ForumApplication

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

An object which controls the state of the cached discussion list, which is used in the index page and the slideout pane.

public

An object which controls the state of the page's drawer.

public

The app's history stack, which keeps track of which routes the user visits so that they can easily navigate back to the previous route.

public

A map of notification types to their components.

public

An object which controls the state of the user's notifications.

public

An object which controls the state of the page's side pane.

public

A map of post types to their components.

public

search: *

Method Summary

Public Methods
public

Callback for when an external authenticator (social login) action has completed.

public

mount()

public

Check whether or not the user is currently viewing a discussion.

Inherited Summary

From class Application
public

An object that manages the state of active alerts.

public

Whether or not the app has been booted.

public

A local cache that can be used to store data at the application level, so that is persists between different routes.

public

The page the app is currently on.

public

data: *

public

drawer: *

public

The forum model for this application.

public
public

An ordered list of initializers to bootstrap the application.

public

modal: *

public

The page the app was on before the current page.

public

A map of routes, keyed by a unique route name.

public

The app's session.

public

The app's data store.

public

title: *

public
public

The app's translator.

private

The key for an Alert that was shown as a result of an AJAX request error.

public

boot()

public

bootExtensions(extensions: *)

public

load(payload: *)

public

mount(basePath: string)

public

Get the API response document that has been preloaded into the application.

public

request(options: Object): Promise

Make an AJAX request, handling any low-level errors that may occur.

public

route(name: String, params: Object): String

Construct a URL to the route with the given name.

public

Determine the current screen mode, based on our media queries.

public

setTitle(title: String)

Set the <title> of the page.

public

setTitleCount(count: Integer)

Set a number to display in the <title> of the page.

public
private

showDebug(error: RequestError, formattedError: string[])

Public Constructors

public constructor() source

Public Members

public composer: * source

public discussions: DiscussionListState source

An object which controls the state of the cached discussion list, which is used in the index page and the slideout pane.

public drawer: Drawer source

An object which controls the state of the page's drawer.

Override:

Application#drawer

public history: History source

The app's history stack, which keeps track of which routes the user visits so that they can easily navigate back to the previous route.

public notificationComponents: Object source

A map of notification types to their components.

public notifications: NotificationListState source

An object which controls the state of the user's notifications.

public pane: Pane source

An object which controls the state of the page's side pane.

public postComponents: Object source

A map of post types to their components.

Public Methods

public authenticationComplete(payload: Object) source

Callback for when an external authenticator (social login) action has completed.

If the payload indicates that the user has been logged in, then the page will be reloaded. Otherwise, a SignUpModal will be opened, prefilled with the provided details.

Params:

NameTypeAttributeDescription
payload Object

A dictionary of attrs to pass into the sign up modal. A truthy loggedIn attr indicates that the user has logged in, and thus the page is reloaded.

public mount() source

Override:

Application#mount

public viewingDiscussion(discussion: Discussion): Boolean source

Check whether or not the user is currently viewing a discussion.

Params:

NameTypeAttributeDescription
discussion Discussion

Return:

Boolean