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 24
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.< | 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.< | 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. |
Utils.sanitizeHtml(html) : string | Sanitizes input HTML. |
Methods Details
Utils.addArgs(url) Deprecated | ||||||
---|---|---|---|---|---|---|
Adds the URL parameters to a local Source: dashboard/Utils.js, line 469
|
Utils.clone(obj) : object Deprecated | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Deep clones an object. This method is deprecated, use jQuery.extend. Source: dashboard/Utils.js, line 431
|
Utils.configLanguage(langCode, config) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Configure a new or existing language by specifying the language code and a configuration object. Source: dashboard/Utils.js, line 179
|
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 201
|
Utils.dateParse(date, mask) : Date | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parses a date with a given mask. Source: dashboard/Utils.js, line 229
|
Utils.doCsvQuoting(value, separator, alwaysEscape) : string | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Quote CSV values in a way that is compatible with CSVTokenizer. Source: dashboard/Utils.js, line 363
|
Utils.eachValuesArray(values, opts, f, x) : boolean | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Traverses each value, label and id triple of a values array. Source: dashboard/Utils.js, line 535
|
Utils.equalValues(a, b) : boolean | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Determines if two values are considered equal. Source: dashboard/Utils.js, line 677
|
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 62
|
Utils.ev(o) : object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Evaluates the argument. If it is a function, calls the function, otherwise returns the argument. Source: dashboard/Utils.js, line 391
|
Utils.getArgValue(key) : object | undefined Deprecated | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets an argument value that was previously set by calling Source: dashboard/Utils.js, line 489
|
Utils.getLocationSearchString() : string | ||||
---|---|---|---|---|
Returns the query string part of the URL. Source: dashboard/Utils.js, line 121
|
Utils.getPathParameter(url) : string | undefined | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Given a URL containing an encoded Pentaho path, e.g. Source: dashboard/Utils.js, line 102
|
Utils.getQueryParameter(parameterName) : string | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Returns the value of a query string parameter. Source: dashboard/Utils.js, line 133
|
Utils.getURLParameters(sURL) : Array.< | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
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 310
|
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 706
|
Utils.isArray(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered an array. Returns Source: dashboard/Utils.js, line 619
|
Utils.isFunction(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered a function. Source: dashboard/Utils.js, line 635
|
Utils.isNumber(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered a number. Source: dashboard/Utils.js, line 663
|
Utils.isString(value) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a value is considered a string. Source: dashboard/Utils.js, line 649
|
Utils.normalizeValue(value) : object | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Normalizes a value so that Source: dashboard/Utils.js, line 601
|
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 153
|
Utils.objectToPropertiesArray(obj) : Array.< | undefined | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Converts an object to an array. Source: dashboard/Utils.js, line 293
|
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 581
|
Utils.post(url, obj) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Performs a post to the server. Source: dashboard/Utils.js, line 403
|
Utils.propertiesArrayToObject(pArray) : object | undefined | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Converts an array to an object. Source: dashboard/Utils.js, line 278
|
Utils.sanitizeHtml(html) : string | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Uses https://code.google.com/archive/p/google-caja/source. Strips unsafe tags and attributes from html. Source: dashboard/Utils.js, line 86
|