Class: Layout

Layout

new mmir.view.Layout(name, definition, remote, ignoreMissingBody)

The Layout class The constructor parses the layout and divides them into containers (headerContents, bodyContents, dialogsContents).
Name Type Description
name String Name of the Layout (usually the same name as the Layout's controller).
definition String Layout description, i.e. the raw template code that will be processed. May be empty: in this case the processed contents must be added manually (cf. parser.StorageUtils)
remote Boolean optional if the layout refers to a remote resource (DEFAULT: false)
ignoreMissingBody Boolean optional if parsing should ignore missing BODY tag (DEFAULT: false)

Requires

  • module:if
  • module:if

Members

bodyAttributesObject

A JSON-like object containing the attributes of the BODY-tag as String values. For example, for the following BODY-tag:

the bodyAttributes would be
{
	"onload": "handleOnLoad()",
	"class": "some css-classes"
}
Default Value:
  • undefined

bodyContentElementContentElement

The (parsed) content for the body-container.

bodyContentsString

This variable holds the contents of the body part of the layout.
Deprecated
  • unused

    defObject

    The definition string of the layout (ehtml-format, taken from assets/www/views/layout/*.ehtml)

    dialogsContentsString

    This variable holds the contents of the dialogs part of the layout.

    headerContentsString

    This variable holds the contents of the header part of the layout.
    Deprecated
    • unused
      List for extracted & parsed SCRIPT, LINK and STYLE tags

      nameString

      The name of the layout.

      remoteaccessBoolean

      if layout is a remote resouce (will mark script- etc. tags accordingly)

      titleString

      The page / layout title Will be extracted from definition's TITLE-tag, if present.

      yieldsArray

      A list holding the content-references (yield declarations) for the containers (except for body): header, footer, and dialogs

      Methods

      protected_extHeaderElements()

      HELPER: add prototype functions of Layout.TagElement to the #headerElements

      getBodyContents(){String}

      This methods returns the contents of the body part of the layout.
      Returns:
      Type Description
      String The contents of the body part of the layout

      getDialogsContents(){String}

      This methods returns the contents of the dialog part of the layout.
      Returns:
      Type Description
      String The contents of the dialog part of the layout

      getHeaderContents(){String}

      This methods returns the contents of the header part of the layout.
      Returns:
      Type Description
      String The contents of the header part of the layout
      Gets the name of the layout.
      Returns:
      Type Description
      String The name of the layout.

      stringify(disableStrictMode){String}

      Name Type Description
      disableStrictMode Boolean optional OPTIONAL disable JavaScript strict mode in the generated view code
      Returns:
      Type Description
      String stringified representation of the layout