Site [mwf.site]

Description

The mwf.site namespace contains a number of properties and functions related to the global state of the framework. Most of these values are passed into Javascript server-side from the framework configuration settings.

Functions & Properties

Current (MWF 1.2)

The following are available through the mwf.site namespace:

  • mwf.site.root The web root of the directory containing the front splash page.

  • mwf.site.asset.root The web root of the framework assets directory.

  • mwf.site.analytics.key A Google analytics key, if one is configured in the framework config, or NULL otherwise.

  • mwf.site.mobile.maxWidth The maximum width that is considered a "mobile" device, where any device above this value will cause mwf.classification.isMobile() to return false. If this is not configured in the framework config, then this is NULL.

  • mwf.site.mobile.maxHeight The maximum height that is considered a "mobile" device, where any device above this value will cause mwf.classification.isMobile() to return false. If this is not configured in the framework config, then this is NULL.

  • mwf.site.domain() The domain of the current page, used for determining preview mode bar.

Previous (MWF 1.0-1.1)

The following functions have been deprecated but are available for backwards compatibility:

  • mwf.site.webroot() An alias to mwf.site.root.

  • mwf.site.webassetroot() An alias to mwf.site.asset.root.

  • mwf.site.frontpage() Appends index.php to mwf.site.root.