# Global

##

### Methods

#### capitalize_filter()

Transforms the first Character of a string to uppercase.

Source:
  - core/Filters.js, line 51
See:
  - String.prototype.capitalize

#### dateFormat_filter(format)

Returns a formatted string representation of a Date. Simply wraps javascripts Date.format-method.

##### Parameters:

Name | Type | Description
--- | --- | ---
`format` |  |

Source:
  - core/Filters.js, line 201
See:
  - Date.prototype.format

#### encode(text, encodeNewLineopt) → {string}

Encodes a string for HTML output and inserts linebreak tags. Performs the following string manipulations: All line breaks (i.e. line feeds) are replaced with
tags. All special characters are being replaced with their equivalent HTML entity. Existing markup tags are being encoded.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`text` | string |  |  | The string to encode for HTML output.
`encodeNewLine` | boolean | <optional> | true | If or if not to encode line breaks (i.e. line feeds).

Source:
  - core/Global.js, line 95

##### Returns:

The encoded string.

Type
  string

#### encodeForm(text) → {string}

Encodes a string for HTML output, leaving linebreaks untouched. Performs the following string manipulations: Unlike encode, leaves linebreaks untouched. This is what you usually want to do for encoding form content (esp. with text input values). All special characters (i.e. non ASCII) are being replaced with their equivalent HTML entity. Existing markup tags are being encoded.

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | The string to format for HTML output.

Source:
  - core/Global.js, line 211

##### Returns:

The string formatted for HTML output.

Type
  string

#### encodeXml(text) → {string}

Encodes a string for XML output. Performs the following string manipulations: All special characters are being replaced with their equivalent HTML entity. Existing tags, single and double quotes, as well as ampersands are being encoded. Some invalid XML characters below '0x20' are removed

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | The string to encode for XML output.

Source:
  - core/Global.js, line 150

##### Returns:

The string encoded for XML output.

Type
  string

#### escapeHtml_filter()

Escapes the characters in a String using HTML entities.

Source:
  - core/Filters.js, line 120
See:
  - http://www.google.com/codesearch?q=escapeHtml

#### escapeJavaScript_filter()

Escapes a string so it may be used in JavaScript String definitions.

Source:
  - core/Filters.js, line 147

#### escapeUrl_filter(charset)

Escapes the characters in a String to be suitable to use as an HTTP parameter value.

##### Parameters:

Name | Type | Description
--- | --- | ---
`charset` |  | Optional String. The name of a supported character encoding.

Source:
  - core/Filters.js, line 137
See:
  - http://www.google.com/codesearch?q=escapeUrl

#### escapeXml_filter()

Escapes the characters in a String using XML entities. Currently simply wraps Helma's encodeXml-method.

Source:
  - core/Filters.js, line 110
See:
  - global.encodeXml

#### gettext()

For convenience reasons the public methods and macros are put into global scope too

Source:
  - jala/code/I18n.js, line 392

#### isArray(val)

Returns true if the value passed as argument is an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 94

##### Returns:

True if the value is an array, false otherwise

#### isBoolean(val)

Returns true if the value passed as argument is either a boolean literal or an instance of Boolean.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 50

##### Returns:

True if the value is a boolean, false otherwise

#### isDate(val)

Returns true if the value passed as argument is either a Javascript date or an instance of java.util.Date.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 105

##### Returns:

True if the value is a date, false otherwise

#### isFunction(val)

Returns true if the value passed as argument is a function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 128

##### Returns:

True if the argument is a function, false otherwise

#### isNull(val)

Returns true if the value passed as argument is null.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 74

##### Returns:

True if the value is null, false otherwise

#### isNumber(val)

Returns true if the value passed as argument is either a number, an instance of Number or of java.lang.Number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 62

##### Returns:

True if the value is a number, false otherwise

#### isObject(val)

Returns true if the value passed as argument is either a Javascript object or an instance of java.lang.Object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 117

##### Returns:

True if the value is an object, false otherwise

#### isString(val)

Returns true if the value passed as argument is either a string literal, an instance of String or of java.lang.String.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 37

##### Returns:

True if the value is a string, false otherwise

#### isUndefined(val)

Returns true if the value passed as argument is undefined.

##### Parameters:

Name | Type | Description
--- | --- | ---
`val` | Object | The value to test

Source:
  - jala/code/Global.js, line 84

##### Returns:

True if the value is undefined, false otherwise

#### linebreakToHtml_filter()

Replaces linebreaks with HTML linebreaks.

Source:
  - core/Filters.js, line 157

#### lowercase_filter()

Transforms a string to lowercase.

Source:
  - core/Filters.js, line 31
See:
  - String.prototype.toLowerCase

#### now_macro(Object)

renders the current datetime

##### Parameters:

Name | Type | Description
--- | --- | ---
`Object` |  | containing a formatting string as format property

Source:
  - core/Global.js, line 52

#### property_macro(Object)

write out a property contained in app.properties

##### Parameters:

Name | Type | Description
--- | --- | ---
`Object` |  | containing the name of the property

Source:
  - core/Global.js, line 31

#### replace_filter(old, new)

Performs a string replacement.

##### Parameters:

Name | Type | Description
--- | --- | ---
`old` |  |
`new` |  |

Source:
  - core/Filters.js, line 170

#### skin_macro()

renders a global skin

Source:
  - core/Global.js, line 72

#### stripTags(markup) → {string}

Removes any markup tags contained in the passed string, and returns the modified string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`markup` | string | The text that is to be stripped of tags.

Source:
  - core/Global.js, line 227

##### Returns:

The text with the tags stripped out.

Type
  string

#### stripTags_filter()

Removes all tags from a String. Currently simply wraps Helma's stripTags-method.

Source:
  - core/Filters.js, line 99
See:
  - global.stripTags

#### substring_filter(from, to)

Returns a substring. Simply wraps the javascript method 'substring'.

##### Parameters:

Name | Type | Description
--- | --- | ---
`from` |  |
`to` |  |

Source:
  - core/Filters.js, line 186
See:
  - String.prototype.substring

#### titleize_filter()

Transforms the first Character of each word in a string to uppercase.

Source:
  - core/Filters.js, line 62
See:
  - String.prototype.titleize

#### trim_filter()

Removes leading and trailing whitespaces.

Source:
  - core/Filters.js, line 88
See:
  - String.prototype.trim

#### truncate_filter(limit, clipping)

Cuts a String at a certain position, and optionally appends a suffix, if truncation has occurred.

##### Parameters:

Name | Type | Description
--- | --- | ---
`limit` |  | Maximum length
`clipping` |  | Appended String, default is the empty String

Source:
  - core/Filters.js, line 76
See:
  - String.prototype.head

#### uppercase_filter()

Transforms a string to uppercase.

Source:
  - core/Filters.js, line 41
See:
  - String.prototype.toUpperCase

#### write_macro(Object)

wrapper to output a string from within a skin just to be able to use different encodings

##### Parameters:

Name | Type | Description
--- | --- | ---
`Object` |  | containing the string as text property

Source:
  - core/Global.js, line 42