Created by staff of the U.S. Securities and Exchange Commission.
Data and content created by government employees within the scope of their employment are not subject to domestic copyright protection. 17 U.S.C. 105.

# functions.js README

## Purpose

High level Developer information regarding the Constant Functions functionality.

## Variables

- N/A

## Functions

- `ConstantsFunctions.setParentContainerStyles()`
  - Purpose:
    - Adds dynamic `style` attribute to `#dynamic-xbrl-form` based on possible `style` attributes on `<body>` tag of dynamic XHTML Form.
  - Arguments:
    - input : String
- `ConstantsFunctions.setHTMLAttributes()`
  - Purpose:
    - Sets `Constants.getHTMLAttributes` based on attributes on `<html>` tag of dynamic XHTML Form.
  - Arguments:
    - input: String
- `ConstantsFunctions.setMetaSourceDocumentsThenFixLinks()`
  - Purpose:
    - Sets `Constants.getMetaSourceDocuments` based on MetaLinks.json `instance` value(s)
  - Arguments:
    - input: String
- `ConstantsFunctions.setHTMLPrefix()`
  - Purpose:
    - Sets `Constants.getHTMLPrefix` based on `Constants.getHTMLAttributes`. Looping over the array, which ever value equals `http://www.xbrl.org/2013/inlineXBRL` will be used as the HTML Prefix ex: IX
    - Arguments:
      - N/A
- `ConstantsFunctions.setMetaTags()`
  - Purpose:
    - Sets `Constants.getMetaTags` based on MetaLinks.json `instance` => `{{XHTML Path}}` => `tag` Object.
    - Runs `ConstantsFunctions.setMetaCalculationsParentTags()`
  - Arguments:
    - input: Object
- `ConstantsFunctions.setMetaCalculationsParentTags()`
  - Purpose:
    - Sets `Constants.getMetaCalculationsParentTags` based on `Constants.getMetaTags`
    - If individual Meta Tag has value of `calculation`, and is unique, it is then added
  - Arguments:
    - N/A
- `ConstantsFunctions.setMetaEntityCounts()`
  - Purpose:
    - Sets `Constants.getMetaEntityCounts` based on input Object from MetaLinks.json
  - Arguments:
    - input : Object
- `ConstantsFunctions.setMetaReports()`
  - Purpose:
    - Sets `Constants.getMetaReports` based on MetaLinks.json `instance` => `{{XHTML Path}}` => `report` Object.
  - Arguments:
    - input: Object
- `ConstantsFunctions.setMetaStandardReference()`
  - Purpose:
    - Sets `Constants.getMetaStandardReference` based on MetaLinks.json `std_ref` Object.
  - Arguments:
    - input: Object
- `ConstantsFunctions.setSingleMetaStandardReference()`
  - Purpose:
    - Returns a single `Constants.getMetaStandardReference` that corresponds to the `ref` input.
  - Arguments:
    - ref: String
- `ConstantsFunctions.setMetaVersion`
  - Purpose:
    - Sets `Constants.getMetaVersion`,
    - If version is 2.0 or greater:
      - We remove all `.meta-links-version` to give User full functionality.
    - If version is less than 2.0
      - We give the User a warning, and they will have minimal functionality.
  - Arguments:
    - input: String
- `ConstantsFunctions.setMetaCustomPrefix`
  - Purpose:
    - Sets `Constants.getMetaCustomPrefix` based on`input[nxprefix]`
  - Arguments:
    - input: Object
- `ConstantsFunctions.setMetaDts`
  - Purpose:
    - Sets `Constants.getMetaDts` based on input
  - Arguments:
    - input: Object
- `ConstantsFunctions.setMetaHidden`
  - Purpose:
    - Sets `Constants.getMetaHidden` based on input
  - Arguments:
    - input: Object
- `ConstantsFunctions.setFormattingObject`
  - Purpose:
    - Sets `Constants.getFormattingObject` based on the attributes from the `<html>` tag of the dynamic XHTML Form. This is a crucial step to add new transforms.
  - Arguments:
    - input: Object
- `ConstantsFunctions.setFormattingObject`
  - Purpose:
    - Returns the URL variables that are nested within the `?doc=` || `?file=` params
  - Arguments:
    - url: String

## Related

- ConstantsFunctions
- Errors