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

ForumApplication

You can directly use an instance of this class. app

Extends:

Application → ForumApplication

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
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 page's side pane.

public

A map of post types to their components.

public

The page's search component instance.

Method Summary

Public Methods
public

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

public

Check whether or not the user is currently composing a reply to a discussion.

public

mount()

public

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

Inherited Summary

From class Application
public

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

data: *

public

drawer: *

public

The forum model for this application.

public

An ordered list of initializers to bootstrap the application.

public

modal: *

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

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

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

Public Constructors

public constructor() source

Public Members

public composer: * source

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 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.

The page's search component instance.

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 props to pass into the sign up modal. A truthy loggedIn prop indicates that the user has logged in, and thus the page is reloaded.

public composingReplyTo(discussion: Discussion): Boolean source

Check whether or not the user is currently composing a reply to a discussion.

Params:

NameTypeAttributeDescription
discussion Discussion

Return:

Boolean

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