Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

API: JS: Utilities

nateemerson edited this page May 21, 2011 · 5 revisions

mwf.site

  • mwf.site.webroot() Returns the web root for the instance in use.
  • mwf.site.webassetroot() Returns the web root for the asset path of the instance in use.
  • mwf.site.frontpage() Returns the web path to the front page of the instance.

mwf.user_agent

  • mwf.user_agent.is_mobile() Returns true if the user is using a mobile device.
  • mwf.user_agent.is_standard() Returns true if the user is using a standard device or above.
  • mwf.user_agent.is_full() Returns true if the user is using a device a full device.
  • mwf.user_agent.is_iphone_os() Returns true if the user is using a device on iOS.
  • mwf.user_agent.is_overridden() Returns true is the user has overridden their default user agent classification.
  • mwf.user_agent.is_preview() Returns true if the user is on a desktop machine and viewing the page with a classification overrride.
  • mwf.user_agent.get_browser() Returns a string of the device browser name.
  • mwf.user_agent.get_browser_version() Returns a string of the device browser version.
  • mwf.user_agent.get_os() Returns a string of the device operating system name.
  • mwf.user_agent.get_os_version() Returns a string of the device operating system version.

mwf.user_browser

  • mwf.browser.pageWidth()
  • mwf.browser.pageHeight()
  • mwf.browser.posLeft()
  • mwf.browser.posTop()
  • mwf.browser.posRight()
  • mwf.browser.posBottom()

mwf.util

  • mwf.util.importJS(webpath) Writes a script tag to the DOM with the web path in question to include the script specified. This allows the dynamic loading of a script asynchronous from page load if desired, as well as allows the browser to best cache the item.
Clone this wiki locally