Home Reference Source

Function

Static Public Summary
public

Old session variable, still used by some ops.

public

ajax(url: string, cb: function, method: string, post: string, contenttype: string, jsonP: boolean, headers: object, options: object)

make an ajax request

public

basename(url: String): String

return the filename part of a url without extension

public

cacheBust(url: String): String

append a unique/random parameter to a url, so the browser is forced to reload the file, even if its cached

public

clamp(value: Number, min: Number, max: Number): *

clamp number / make sure its between min/max

public

cleanJson(obj: *): *

public

cloneObject(o: Object): *

public

copyArray(src: Array, dst: Array): Array

copy the content of an array

public

easeCubicIn(t: *): *

public
public
public

easeExpoIn(t: *): *

public
public

easeExpoOut(t: *): *

public

escapeHTML(string: *): *

public
public

filename(url: String): String

return the filename part of a url

public

float32Concat(first: Float32Array, second: Float32Array): Float32Array

Merge two Float32Arrays.

public

getShortOpName(fullname: string): *

get op shortname: only last part of fullname and without version

public

hashString(str: string, prefix: string): string

public

idleCallback(cb: function)

public

idleCallbackSoon(idleTo: string, cb: function): *

public
public

logErrorConsole(initiator: *)

public

output a stacktrace to the console

public

map(x: Number, _oldMin: Number, _oldMax: Number, _newMin: Number, _newMax: Number, _easing: Number, clampval: Boolean): Number

map a value in a range to a value in another range

public

now(): *

public
public

shortId(): *

public

showUiErrors(op: Op<any>, id: string, txt: string, level: number, options: {})

public

shuffleArray(array: Array | Float32Array): Array | Float32Array

randomize order of an array

public

simpleId(): *

public

smoothStep(perc: Number): Number

smoothStep a value

public

smootherStep(perc: Number): Number

smootherstep a value

public

uniqueArray(arr: Array<any>): *

Static Public

public Variable() source

import {Variable} from './core/sessionvar.js'

Old session variable, still used by some ops. todo: remove from ops.

public ajax(url: string, cb: function, method: string, post: string, contenttype: string, jsonP: boolean, headers: object, options: object) source

import {ajax} from './core/utils.js'

make an ajax request

Params:

NameTypeAttributeDescription
url string
cb function
method string
  • optional
  • default: "GET"
post string
  • optional
contenttype string
  • optional
  • default: "application/x-www-form-urlencoded"
jsonP boolean
  • optional
  • default: false
headers object
  • optional
options object
  • optional

public basename(url: String): String source

import {basename} from './core/utils.js'

return the filename part of a url without extension

Params:

NameTypeAttributeDescription
url String

Return:

String

just the filename

public cacheBust(url: String): String source

import {cacheBust} from './core/utils.js'

append a unique/random parameter to a url, so the browser is forced to reload the file, even if its cached

Params:

NameTypeAttributeDescription
url String

The url to append the cachebuster parameter to.

Return:

String

url with cachebuster parameter

public clamp(value: Number, min: Number, max: Number): * source

import {clamp} from './core/utils.js'

clamp number / make sure its between min/max

Params:

NameTypeAttributeDescription
value Number

value to be mapped

min Number

minimum value

max Number

maximum value

Return:

*

public cleanJson(obj: *): * source

import {cleanJson} from './core/utils.js'

Params:

NameTypeAttributeDescription
obj *

Return:

*

public cloneObject(o: Object): * source

import {cloneObject} from './core/utils.js'

Params:

NameTypeAttributeDescription
o Object

Return:

*

public copyArray(src: Array, dst: Array): Array source

import {copyArray} from './core/utils.js'

copy the content of an array

Params:

NameTypeAttributeDescription
src Array

sourceArray

dst Array

optional

Return:

Array

dst

public easeCubicIn(t: *): * source

import {easeCubicIn} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeCubicInOut(t: *): * source

import {easeCubicInOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeCubicOut(t: *): * source

import {easeCubicOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeExpoIn(t: *): * source

import {easeExpoIn} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeExpoInOut(t: *): * source

import {easeExpoInOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeExpoOut(t: *): * source

import {easeExpoOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public escapeHTML(string: *): * source

import {escapeHTML} from './core/utils.js'

Params:

NameTypeAttributeDescription
string *

Return:

*

public extendJs() source

import {extendJs} from './core/extendjs.js'

public filename(url: String): String source

import {filename} from './core/utils.js'

return the filename part of a url

Params:

NameTypeAttributeDescription
url String

Return:

String

just the filename

public float32Concat(first: Float32Array, second: Float32Array): Float32Array source

import {float32Concat} from './core/utils.js'

Merge two Float32Arrays.

Params:

NameTypeAttributeDescription
first Float32Array

Left-hand side array

second Float32Array

Right-hand side array

Return:

Float32Array

public getShortOpName(fullname: string): * source

import {getShortOpName} from './core/utils.js'

get op shortname: only last part of fullname and without version

Params:

NameTypeAttributeDescription
fullname string

full op name

Return:

*

public hashString(str: string, prefix: string): string source

import {hashString} from './core/utils.js'

Params:

NameTypeAttributeDescription
str string
prefix string

Return:

string

See:

public idleCallback(cb: function) source

import {idleCallback} from './core/utils.js'

Params:

NameTypeAttributeDescription
cb function

public idleCallbackSoon(idleTo: string, cb: function): * source

import {idleCallbackSoon} from './core/utils.js'

Params:

NameTypeAttributeDescription
idleTo string
cb function

Return:

*

public internalNow(): * source

import {internalNow} from './core/timer.js'

Return:

*

public logErrorConsole(initiator: *) source

import {logErrorConsole} from './core/utils.js'

Params:

NameTypeAttributeDescription
initiator *

public logStack() source

import {logStack} from './core/utils.js'

output a stacktrace to the console

public map(x: Number, _oldMin: Number, _oldMax: Number, _newMin: Number, _newMax: Number, _easing: Number, clampval: Boolean): Number source

import {map} from './core/utils.js'

map a value in a range to a value in another range

Params:

NameTypeAttributeDescription
x Number

value to be mapped

_oldMin Number

old range minimum value

_oldMax Number

old range maximum value

_newMin Number

new range minimum value

_newMax Number

new range maximum value

_easing Number
clampval Boolean

Return:

Number

mapped value

public now(): * source

import {now} from './core/timer.js'

Return:

*

public request(options: CblRequestOptions) source

import {request} from './core/utils.js'

Params:

NameTypeAttributeDescription
options CblRequestOptions

public shortId(): * source

import {shortId} from './core/utils.js'

Return:

*

public showUiErrors(op: Op<any>, id: string, txt: string, level: number, options: {}) source

import {showUiErrors} from './core/uierrors.js'

Params:

NameTypeAttributeDescription
op Op<any>
id string
txt string
level number
options {}
  • optional

public shuffleArray(array: Array | Float32Array): Array | Float32Array source

import {shuffleArray} from './core/utils.js'

randomize order of an array

Params:

NameTypeAttributeDescription
array Array | Float32Array

{Array} original

Return:

Array | Float32Array

shuffled array

public simpleId(): * source

import {simpleId} from './core/utils.js'

Return:

*

public smoothStep(perc: Number): Number source

import {smoothStep} from './core/utils.js'

smoothStep a value

Params:

NameTypeAttributeDescription
perc Number

value value to be smoothed [0-1]

Return:

Number

smoothed value

public smootherStep(perc: Number): Number source

import {smootherStep} from './core/utils.js'

smootherstep a value

Params:

NameTypeAttributeDescription
perc Number

value to be smoothed [0-1]

Return:

Number

smoothed value

public uniqueArray(arr: Array<any>): * source

import {uniqueArray} from './core/utils.js'

Params:

NameTypeAttributeDescription
arr Array<any>

Return:

*