App

App

The controller for the App. The App API is available globally to all components under window.app (or just app).

Constructor

new App()

Source:

Extends

  • View

Members

appInsights :Object

A reference to the Azure App Insights SDK (production only).

Source:
Type:
  • Object

db :Database

A reference to the local database module.

Source:
Type:
  • Database

el

A reference to the app <body> tag.

Source:

helpMenu :HelpMenu

A reference to the helpmenu controller.

Source:
Type:
  • HelpMenu

A reference to the Main Nav controller.

Source:
Type:
  • MainNav

nodes :Object

A table of references to DOM nodes used by the App controller.

Properties:
Name Type Description
info HTMLElement
wrapper HTMLElement
Source:
Type:
  • Object

pages :Map

A Map of page Views, loaded dynamically when the page is requested.

Source:
Type:
  • Map

production :Boolean

A boolean indicating whether the app is currently running on production.

Source:
Type:
  • Boolean

settings :Settings

An object for persisting app/user settings. Saves to Local Storage.

Source:
Type:

shortcuts

An object for registering/unregistering keyboard shortcuts. See https://craig.is/killing/mice for complete documentation. The shortcuts property is a Mousetrap instance.

Source:

Methods

addEventListeners()

Attach event listeners to app shell components.

Source:

(async) addLanguage() → {Promise}

Add a new language and rerender the Languages page.

Source:
Returns:
Type:
Promise

announce(text)

Announce text to screen readers by updating an ARIA live region.

Source:
Parameters:
Name Type Description
text String

the text to announce to screen readers

changeLanguage(languageCID)

Change the current language.

Source:
Parameters:
Name Type Description
languageCID String

The CID of the language to switch to.

(async) displayPage(page)

Display a page, rendering it if necessary.

Source:
Parameters:
Name Type Description
page String

The page to display (in lowercase).

(async) initialize()

Initialize the App.

Source:

(async) renderPage(page)

Render a specific page. This is the only method that should call page-rendering methods.

Source:
Parameters:
Name Type Description
page String

the page to render (home, languages, etc.)