API Docs for: 0.9.0
Show:

Assets.common Class

Access point: ac.assets.* Provides methods for adding HTML assets to a page.

Methods

addAsset

(
  • type
  • location
  • content
)

Parameters:

  • type String

    css|js|blob

  • location String

    Either "top" or "bottom".

  • content String

    A string of data.

addAssets

(
  • assets
)

Parameters:

  • assets Object

    by location (top|bottom) & type (css|js|blob)

addBlob

(
  • content
  • location
)

Method for adding a Blob of data to the page. This can be used for adding custom "script" or "style" blocks.

Parameters:

  • content String

    A string of data.

  • location String

    Either "top" or "bottom".

addCss

(
  • link
  • location
)

Method for adding a CSS file to the page.

Parameters:

  • link String

    A URL (./local.css converts to /static/mojit_type/assets/local.css).

  • location String

    Either "top" or "bottom".

addJs

(
  • link
  • location
)

Method for adding a JS file to the page.

Parameters:

  • link String

    A URL (./local.css converts to /static/mojit_type/assets/local.css).

  • location String

    Either "top" or "bottom".

getAssets

() Object

Returns:

Object: assets by location (top|bottom) & type (css|js|blob)

getUrl

(
  • path
)
String

Parameters:

  • path String

    of asset, relative

Returns:

String:

mixAssets

(
  • to
  • from
)
Object

Parameters:

  • to Object
  • from Object

Returns:

Object:

preLoadImage

(
  • url
)
deprecated

Parameters:

  • url String

preLoadImages

(
  • url
)
deprecated

Parameters:

  • url array.

renderLocations

() Object

Returns:

Object: hash table with location and the HTML fragments for each location with all the assets rendered.