Members
# active :boolean
if phone calls are configurated on the current kiosk
Type:
- boolean
# pollingInterval :number
the intervall time in which the status of a call gets updated (default: 3000 [3 seconds])
Type:
- number
Methods
# isMobile() → {boolean}
Function to check, if this page is running on a mobile device
Returns:
True, if this is a mobile device
- Type
- boolean
Example
if(isMobile())
{
// apply some mobile-related custom styles
}
else
{
// do something that is only relevant on desktop devices
}
# range(min, max, stepsize) → {Array.<int>}
optimized range-function
Parameters:
Name | Type | Description |
---|---|---|
min |
number | start value |
max |
number | upper bound |
stepsize |
number | size of the steps |
Returns:
an array containing the numbers from min to max with a stepsize of stepsize
- Type
- Array.<int>
Examples
Example 1 - Range with stepsize
range(2,12,3); // returns [2,5,8,11]
Example 2 - ForEach-Usage
for(let i of range(0,9))
{
console.log(i);
}
// produces a more readable similar loop to:
// for(let i=0; i<=9; i++) { ... }
# sha1(text) → {string}
sha1 function
Parameters:
Name | Type | Description |
---|---|---|
text |
string | the text which should be hashed |
Returns:
The hashed sha1-string
- Type
- string
Examples
sha1("Hallo test!").then(hash => doSomething(hash)) // then-style
let hashed = await sha1("Hallo test!"); // async context
# sha256(text) → {string}
sha256 function
Parameters:
Name | Type | Description |
---|---|---|
text |
string | the text which should be hashed |
Returns:
The hashed sha256-string
- Type
- string
Examples
sha256("Hallo test!").then(hash => doSomething(hash)) // then-style
let hashed = await sha256("Hallo test!"); // async context
# sha385(text) → {string}
sha384 function
Parameters:
Name | Type | Description |
---|---|---|
text |
string | the text which should be hashed |
Returns:
The hashed sha384-string
- Type
- string
Examples
sha385("Hallo test!").then(hash => doSomething(hash)) // then-style
let hashed = await sha385("Hallo test!"); // async context
# sha512(text) → {string}
sha512 function
Parameters:
Name | Type | Description |
---|---|---|
text |
string | the text which should be hashed |
Returns:
The hashed sha512-string
- Type
- string
Examples
sha512("Hallo test!").then(hash => doSomething(hash)) // then-style
let hashed = await sha512("Hallo test!"); // async context
# sleep(ms) → {Promise}
Async timeout function. Await it to suspend the current function for X milliseconds
Parameters:
Name | Type | Description |
---|---|---|
ms |
number | The number of milliseconds to await |
Returns:
a promise, that resolves after the timeout
- Type
- Promise
Examples
Example 1 - .then()-style
sleep(5000)
.then(() => doSomething());
doAnotherThing();
// Waits 5 seconds and executes the callback
// Please note, that doAnotherThing() will get executed instantly because sleep returns only a Promise that resolves after the given amount of time.
Example 2 - Async context
await sleep(5000);
doSomething();
// pauses the current function for 5 seconds and then continues