Utils
cdf.dashboard. Utils
A collection of utility functions.
AMD Module
require(["cdf/dashboard/Utils"], function(Utils) { /* code goes here */ });
Source: dashboard/Utils.js, line 23
Methods
Name | Description |
---|---|
Utils.addArgs(url) Deprecated | Adds the URL parameters to a local object. |
Utils.clone(obj) : object Deprecated | Deep clones an object. |
Utils.configLanguage(langCode, config) | Configure a language. |
Utils.dateFormat(date, mask, langCode) : string | Formats a date. |
Utils.dateParse(date, mask) : Date | Parses a date with a given mask. |
Utils.doCsvQuoting(value, separator, alwaysEscape) : string | Quote CSV values in a way that is compatible with CSVTokenizer. |
Utils.eachValuesArray(values, opts, f, x) : boolean | Traverses each value, label, and id triple of a values array. |
Utils.equalValues(a, b) : boolean | Determines if two values are considered equal. |
Utils.escapeHtml(input) : string | Escapes a string as an HTML safe string. |
Utils.ev(o) : object | Evaluates the argument. |
Utils.getArgValue(key) : object | undefined Deprecated | Gets an argument value that was previously set by calling |
Utils.getLocationSearchString() : string | Returns the query string part of the URL. |
Utils.getPathParameter(url) : string | undefined | Gets the path from the URL. |
Utils.getQueryParameter(parameterName) : string | Returns the value of a query string parameter. |
Utils.getURLParameters(sURL) : Array.<<code>Array.<<code>String >> | Gets the parameters from a URL. |
Utils.hsvToRgb(h, s, v) : string | Converts an HSV to an RGB color value. |
Utils.isArray(value) : boolean | Determines if a value is considered an array. |
Utils.isFunction(value) : boolean | Determines if a value is considered a function. |
Utils.isNumber(value) : boolean | Determines if a value is considered a number. |
Utils.isString(value) : boolean | Determines if a value is considered a string. |
Utils.normalizeValue(value) : object | Normalizes a value. |
Utils.numberFormat(value, mask, langCode) : string | Formats a number. |
Utils.objectToPropertiesArray(obj) : Array.<<code>Array.<<code>Object >> | undefined | Converts an object to an array. |
Utils.parseMultipleValues(value) : array | object | Given a parameter value obtains an equivalent values array. |
Utils.post(url, obj) | Performs a post to the server. |
Utils.propertiesArrayToObject(pArray) : object | undefined | Converts an array to an object. |
Methods Details
Utils.addArgs(url) Deprecated | ||||||
---|---|---|---|---|---|---|
Adds the URL parameters to a local Source: dashboard/Utils.js, line 452
|
Utils.clone(obj) : object Deprecated | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Deep clones an object. This method is deprecated, use jQuery.extend. Source: dashboard/Utils.js, line 414
|
Utils.configLanguage(langCode, config) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Configure a new or existing language by specifying the language code and a configuration object. Source: dashboard/Utils.js, line 162
|
Utils.dateFormat(date, mask, langCode) : string | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Formats a date with a given mask using the dashboard language, the one that the user specified if it exists, or the default language 'en-US'. Source: dashboard/Utils.js, line 184
|
Utils.dateParse(date, mask) : Date | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parses a date with a given mask. Source: dashboard/Utils.js, line 212
|
Utils.doCsvQuoting(value, separator, alwaysEscape) : string | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Quote CSV values in a way that is compatible with CSVTokenizer. Source: dashboard/Utils.js, line 346
|
Utils.eachValuesArray(values, opts, f, x) : boolean | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Traverses each value, label and id triple of a values array. Source: dashboard/Utils.js, line 518
|
Utils.equalValues(a, b) : boolean | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Determines if two values are considered equal. Source: dashboard/Utils.js, line 660
|
Utils.escapeHtml(input) : string | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Escapes a string as an HTML safe string. It assumes that, if there is an escaped char in the input, then the input is fully escaped. Source: dashboard/Utils.js, line 61
|
Utils.ev(o) : object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Evaluates the argument. If it is a function, calls the function, otherwise returns the argument. Source: dashboard/Utils.js, line 374
|
Utils.getArgValue(key) : object | undefined Deprecated | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets an argument value that was previously set by calling Source: dashboard/Utils.js, line 472
|
Utils.getLocationSearchString() : string | ||||
---|---|---|---|---|
Returns the query string part of the URL. Source: dashboard/Utils.js, line 104
|
Utils.getPathParameter(url) : string | undefined | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Given a URL containing an encoded Pentaho path, e.g. Source: dashboard/Utils.js, line 85
|
Utils.getQueryParameter(parameterName) : string | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Returns the value of a query string parameter. Source: dashboard/Utils.js, line 116
|
Utils.getURLParameters(sURL) : Array.<<code>Array.<<code>String >> | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets the parameters from a URL. CDF URL parameters are defined as those that are present in the query string with names starting with the string Source: dashboard/Utils.js, line 293
|
Utils.hsvToRgb(h, s, v) : string | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts an HSV to an RGB color value. Based on the algorithm described at http://en.wikipedia.org/wiki/HSL_and_HSV. Source: dashboard/Utils.js, line 689
|
Utils.isArray(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered an array. Returns Source: dashboard/Utils.js, line 602
|
Utils.isFunction(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered a function. Source: dashboard/Utils.js, line 618
|
Utils.isNumber(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered a number. Source: dashboard/Utils.js, line 646
|
Utils.isString(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered a string. Source: dashboard/Utils.js, line 632
|
Utils.normalizeValue(value) : object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Normalizes a value so that Source: dashboard/Utils.js, line 584
|
Utils.numberFormat(value, mask, langCode) : string | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Formats a number with a given mask using the dashboard language, the one that the user specified if it exists, or the default language 'en-US'. Source: dashboard/Utils.js, line 136
|
Utils.objectToPropertiesArray(obj) : Array.<<code>Array.<<code>Object >> | undefined | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Converts an object to an array. Source: dashboard/Utils.js, line 276
|
Utils.parseMultipleValues(value) : array | object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Given a parameter value obtains an equivalent values array. The parameter value may encode multiple values in a string format. A nully (i.e. A string value may contain multiple values separated by the character An array or array-like object is returned without modification. Any other value type returns Source: dashboard/Utils.js, line 564
|
Utils.post(url, obj) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Performs a post to the server. Source: dashboard/Utils.js, line 386
|
Utils.propertiesArrayToObject(pArray) : object | undefined | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Converts an array to an object. Source: dashboard/Utils.js, line 261
|