Lib Class
_libs\Lib.js:1
Lib is a general library of additional utilities and helper commands used in StudioLite
Constructor
Lib
()
Object
Returns:
instantiated Lib
Item Index
Methods
- addBackboneCollectionSave
- addBackboneViewOptions
- base64Decode
- base64Encode
- capitaliseFirst
- cleanChar
- cleanProbCharacters
- colorToDecimal
- colorToHex
- decimalToHex
- foreceBrowserCompatability
- function
- getComment
- getEpochTime
- getThemeColor
- hexToDecimal
- inDevMode
- initUserAgent
- isEmpty
- isMobile
- loadCss
- log
- logErrors
- padZeros
- parseToFloatDouble
- parseXml
- promptOnExit
- remoteFileExits
- rgbToHex
- selectionSwitcher
- setIntervalTimes
- uniqueArray
- validateEmail
- xml2json
- xml2json
Methods
addBackboneCollectionSave
()
Add to backbone collection save option
addBackboneViewOptions
()
Add the now deprecated Backbone > View > Options so we can pass as args to new views
base64Decode
-
UNKNOWN
base64Decode
Parameters:
-
UNKNOWNString
Returns:
base64Encode
-
UNKNOWN
base64Encode
Parameters:
-
UNKNOWNString
Returns:
capitaliseFirst
-
string
Capitilize first letter
Parameters:
-
stringString
Returns:
string
cleanChar
-
value
Simplify a string to basic character set
Parameters:
-
valueString
Returns:
cleaned string
cleanProbCharacters
-
i_string -
i_restriction
Remove characters that a problemtaic to app / js
Parameters:
-
i_stringString -
i_restrictionNumber
Returns:
string
colorToDecimal
-
color
Smart convert color (many) to decinal
Parameters:
-
colorString
Returns:
decimal
colorToHex
-
color
Smart convert color (many) to hex
Parameters:
-
colorString
Returns:
hex
decimalToHex
-
d
Decimal to hex converter
Parameters:
-
dNumber
Returns:
hex
foreceBrowserCompatability
()
Force browser compatability
function
-
i_name
Get specific param name from URL
Parameters:
-
i_nameString
Returns:
getComment
-
str
Get DOM comment string
Parameters:
-
strString
Returns:
string of comment if retrieved
getEpochTime
()
Number
Returns Epoch base time
Returns:
getThemeColor
-
color
Get current selection theme color
Parameters:
-
colorString
hexToDecimal
-
h
Hex to decimal converter
Parameters:
-
hString
Returns:
decimal
inDevMode
()
Boolean
In dev mode
Returns:
initUserAgent
()
Set user agent / browser version
isEmpty
-
i_string
Returns this model's attributes as...
Parameters:
-
i_stringString
Returns:
isMobile
()
Boolean
Is running platform a mobile device
Returns:
loadCss
-
i_url
Load non primary CSS
Parameters:
-
i_urlString
log
-
msg
Output formatted string to console and omit error on old browsers...
Parameters:
-
msgString
logErrors
()
log errors in distribution mode
padZeros
-
n -
width -
z
Pad zeros
Parameters:
-
nNumbervalue
-
widthNumberpre-pad width
-
zNumbernegative as in '-'
Returns:
zero padded string
parseToFloatDouble
-
i_value
Convert number or string to float with double precision
Parameters:
-
i_valueObject
Returns:
parseXml
-
xml
Convert an XML data format to a DOM enabled data structure
Parameters:
-
xmlXMLdata to parse
Returns:
xml data structure
promptOnExit
()
Prompt on application exit
remoteFileExits
-
url
Check if a remote file exists
Parameters:
-
urlString
Returns:
rgbToHex
-
rgb
RGB color to hex converter
Parameters:
-
rgbNumber
Returns:
hex
selectionSwitcher
()
Enable selection switcher via jquery plugin usage: $('#element').disableSelection() or$('#element').enableSelection()
setIntervalTimes
-
i_func -
i_sleep -
i_timesRun
Run a function n number of times with sleep in between
Parameters:
-
i_funcFunction -
i_sleepNumber -
i_timesRunNumber
uniqueArray
-
i_array
Returns the total unique members of an array
Parameters:
-
i_arrayArray
Returns:
total unique members
validateEmail
-
emailAddress
Validate email address format using regexp
Parameters:
-
emailAddressString
Returns:
xml2json
-
o -
internal
Convert a json data format to xml
Parameters:
-
oJSON -
internalObject
Returns:
xml data structure
xml2json
-
xml -
internal
Convert an XML data format to json
Parameters:
-
xmlXML -
internalObject
Returns:
json data structure
digitalsignage.com - open source docs