API Docs for version 1.2.7300

Utils

Module: Circuit

static

Summary

Static utility functions

Item Index

Properties

Methods

getBrowserInfo

Syntax

getBrowserInfo

() Object

Summary

Provides browser type and version information.

Returns:

Object:

Object with type, version and browser attributes

textToHtmlEscaped

Syntax

textToHtmlEscaped

(
  • str
  • [spaceForNewlines]
)
String

Summary

Utility function to escape text as html, but keep line changes.

Parameters:

  • str String

    Text content to escape

  • [spaceForNewlines] Boolean optional

    If true, newlines (\n) are converted to   instead of

Returns:

String:

Escaped string

Example:

Circuit.Utils.textToHtmlEscaped('<b>bold</b>\ntest');
// returns &lt;b&gt;bold&lt;/b&gt;<br>test

Circuit.Utils.textToHtmlEscaped('<b>bold</b>\ntest', true);
// returns &lt;b&gt;bold&lt;/b&gt;&nbsp;test

Properties

EMAIL_ADDRESS_PATTERN

Syntax

EMAIL_ADDRESS_PATTERN

String final static

Summary

Email address patttern. /^[_a-z0-9-\+]+(?:\.[_a-z0-9-\+]+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)*(?:\.[a-z][a-z]+)$/im