A web tool function kits.
Funk contains several usual functions you may use under web enviromment.
- jQuery 3.x
jf_client(ua) get client device type/os/browser
ua(string) : navigator.userAgent | request.headers['user-agent']
{
device(string) : 'desktop|mobile(phone)|mobile(tablet)', os(string) : 'Windows|MacOS|iOS|Android|Linux|others', browser(string) : 'Chrome|Firefox|IE|Edge|Safari|Opera|others'
jf_intFill(num, len, stuff = ' ', dir = true) output formatted string of integer}
num(string|number) : number to be formatted len(integer) : output string length >stuff : char to be filled if the length is less than len dir(bool) : true for leading filled|false for trail filled
jf_floatFill(num, len, deciaml = 0, stuff = ' ', dir = true) output formatted string of floatformatted string(string), won't change if the original length greater than len
num(string|number) : number to be formatted len(integer) : total length of output string decimal(integer) : counts of decimal, fill 0 if length is less than decimal stuff(string) : char to be filled if the length is less than len dir(bool) ; true for leading fill|false for trail fill
jf_dbgCheck(tag, mute = false) print current timestamp with tag and the interval from last checked pointformatted string(string), won't change if the original length greater than len
tag(string) : tag name >mute(bool) : put data into array without printing to console.
jf_dbgDump() dump data to console from the beginningN/A
N/A
jf_dbgReset() clear checked historyN/A
N/A
N/A
Code released under the MIT license