![]() |
Infohub JS API
|
Static helper functions.
Static Public Member Functions | |
| static | atou (b64) |
| static | calcEdges (geo) |
| static | clone (obj) |
| static | compare (obj1, obj2, recursively=false) |
| static | compileFilterString (projectlist, cataloguelist, constraints, property_typeids, ptr_property) |
| static | componentToHex (c) |
| static | count (obj) |
| static | createId () |
| static | createTimestamp () |
| static | dbToTxt (str) |
| static | elideText (str, max_length) |
| static | getSizeAsString (size) |
| static | getTokenList (str, start, end) |
| static | htmlToText (html, all) |
| static | increaseIndex (str_number) |
| static | isEqual (val1, val2, propertytype, options=null) |
| static | isValue (v) |
| static | matchValue (value, propertytype, matchvalue, propertymap=null) |
| static | md5 (inputString) |
| static | replaceSpecialCharsWithASCII (id) |
| static | replaceStr (str, olds, news) |
| static | rgbToHex (r, g, b) |
| static | sanitize (id) |
| static | sanitizeText (str) |
| static | sanitizeTooltip (a) |
| static | txtToDb (str) |
| static | utoa (data) |
| static | validateArray (pattern) |
| static | validateEmail (str) |
| static | validateRegex (pattern) |
| static | wildcardToRegex (wildcard) |
| static | xor (a, b) |
|
static |
| {*} | b64 |
|
static |
| {*} | geo |
|
static |
Clone/Deep copy this object.
| {Object} | obj |
|
static |
Compares content of two objects (yet not recursively for objects!).
| {Object} | obj1 |
| {Object} | obj2 |
| {boolean} | [recursively] not implemented yet |
|
static |
Compile filter string from id, type, name pattern and properties.
| {*} | projectlist can be empty |
| {*} | cataloguelist can be empty |
| {*} | constraints = { 'pattern_object_id' : ' ... ' // AND 'pattern_object_name' : ' ... ' // AND 'pattern_object_type' : ' ... ' // AND } |
| {*} | property_typeids Search in these property types |
| {*} | ptr_property Search in each property type for this pattern |
|
static |
Convert component (R,G or B) to hex value.
0 => 0 255 => FF
| {number} | c |
|
static |
Count objects/keys in a dictionary.
| {Object} | obj |
|
static |
Create a new ID.
|
static |
|
static |
Encode text from text to HTML acceptable text.
->
``` -> '
| {string} | str |
/**
| {string} | str - Text to be decoded from DB format to JSON. |
|
static |
Elide text.
| {string} | str - Text |
| {number} | max_length - Maximum length of text |
|
static |
Get number of bytes as formatted text in suitable units ['Bytes', 'kB', 'MB', 'GB'].
| {number} | size |
|
static |
Get tokens specified by start-end string in str Examples start = '[[' , end = ']]'.
| {string} | str |
| {string} | start |
| {string} | end |
|
static |
Convert hmtl to plain text.
| {string} | html |
| {boolean} | all if true, get full text content (faster), else if slow get inner text (considering styles like display: none, slightly slower) |
|
static |
Increase Index given as A0, A1, ... , B0, B1, ...
| {*} | str_number |
|
static |
| {*} | val1 |
| {*} | val2 |
| {Object} | propertytype |
| {Object} | options { precision: 0.0001, case_sensitive: true } |
|
static |
| {*} | v |
|
static |
Check if a property value matches the given values.
| {any} | value Value of property. If null or undefined, false will be returned. |
| {string} | xsdatatype Explicit data type of value ('xs:...') |
| {*} | matchvalue Values : '*', ["A","B", "C"], [1,2,3], /^abc/g, == 'Text', > 1.234 |
| {Object} | propertymap Evaluated values for property references [[name##type]] { 'Text##xs:string' : "ABC", 'Number##xs:double' : 1.234 } |
|
static |
Create a md5 key from a given string.
| {string} | inputString |
|
static |
replaces each character of !
"#$%&'()*+,./:;<=>?[]^<tt>{|}~ with _\<ASCIcode\>_. So jQuery can work with it. see jquery docs: https://api.jquery.com/category/selectors/ Escaping with \\\\ as recommended there didn't work. \@param {String} id any String used as id with jquery \@returns {String} id but each character of !\"#$%&'()*+,./:;<=>?@[\]^{|}~ replaced by _<ASCIcode>_
|
static |
| {*} | str |
| {*} | olds |
| {*} | news |
|
static |
Convert (RGB) color to hex value.
(0,0,0) => #000000 (255,255,255) => #FFFFFF
| {*} | r |
| {*} | g |
| {*} | b |
|
static |
Sanitize ID.
Remove :, =, ' '
| {string} | id |
|
static |
Remove 'invalid'/invisible characters from string which can occur when copy-pasting from html pages Todo: better Black- or Whitelist?
Ranges?
| {string} | str |
|
static |
Convert a string which is stored in a db to a string that can be rendered in html.
``` -> '
| {*} | str |
/**
Sanitize string 'a' so it can be used in a html tooltip (title).
| {string} | a |
|
static |
Encode text from text to JSON acceptable text.
So this text can be transferred and stored in a DB.
->
' -> ```
| {string} | str - Text to be encoded from JSON |
|
static |
| {*} | data |
|
static |
Check if pattern is a string representation (JSON) of an array.
| {string} | pattern |
|
static |
Validates whether a text is a syntactically correct email address.
Note: The only way to reliably verify that a supplied email is a working valid email is to send a mail with a verification link
| {string} | str - String holding the Email address |
|
static |
Check if pattern is a valid regex expression.
| {string} | pattern |
|
static |
| {string} | wildcard |
|
static |
| {*} | a |
| {*} | b |