API Docs for: 0.8.0
Show:

MediaLoader Class

Handles retrieval and injection of media in articles and pages

Constructor

Methods

getMediaTemplate

(
  • options
  • cb
)

Retrieves the media template for rendering media

Parameters:

  • options Object
    • [mediaTemplatePath='elements/media'] String optional
  • cb Function

onMediaAvailable

(
  • articleLayout
  • options
  • cb
)

Parameters:

  • articleLayout String
  • options Object
  • cb Function

replaceMediaTag

(
  • layout
  • mediaTemplate
  • mediaCache
  • cb
)

Replaces an article or page layout's ^media_display^ tag with a media embed

Parameters:

  • layout String

    The HTML layout of the article or page

  • mediaTemplate String

    The template of the media embed

  • mediaCache Object
  • cb Function

    Callback function

scanForFlags

(
  • layout
)
Array

Scans a string for media flags then parses them to return an array of each one that was found

Parameters:

  • layout String

Returns:

Array:

start

(
  • articleLayout
  • [options]
  • cb
)

Processes an article or page to insert media

Parameters:

  • articleLayout String

    The HTML layout of the article or page

  • [options] Object optional
  • cb Function