Utils
Summary
Static utility functions
Item Index
Properties
- EMAIL_ADDRESS_PATTERN static
Methods
createMentionedUsersArray
Syntax
Summary
Utility function to return an array of mentioned Users in a message.
Parameters:
Returns:
String[]:
Array of mentioned user IDs.
Example:
const mention = '<span class="mention" abbr="0e372ae0-2dff-4439-8f87-1b8a6562f80e">@Roger</span>';
const userId = '0e372ae0-2dff-4439-8f87-1b8a6562f80e';
const mentionUserIds = Circuit.Utils.createMentionedUsersArray(mention, [userId]);
getBrowserInfo
Syntax
Summary
Provides browser type and version information.
Returns:
Object:
Object with type, version and browser attributes
textToHtmlEscaped
Syntax
Summary
Utility function to escape text as html, but keep line changes.
Parameters:
Returns:
String:
Escaped string
Example:
Circuit.Utils.textToHtmlEscaped('<b>bold</b>\ntest');
// returns <b>bold</b><br>test
Circuit.Utils.textToHtmlEscaped('<b>bold</b>\ntest', true);
// returns <b>bold</b> test
Properties
EMAIL_ADDRESS_PATTERN
Syntax
Summary
Email address patttern. /^[_a-z0-9-\+]+(?:\.[_a-z0-9-\+]+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)*(?:\.[a-z][a-z]+)$/im