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:
-
UNKNOWN
String
Returns:
base64Encode
-
UNKNOWN
base64Encode
Parameters:
-
UNKNOWN
String
Returns:
capitaliseFirst
-
string
Capitilize first letter
Parameters:
-
string
String
Returns:
string
cleanChar
-
value
Simplify a string to basic character set
Parameters:
-
value
String
Returns:
cleaned string
cleanProbCharacters
-
i_string
-
i_restriction
Remove characters that a problemtaic to app / js
Parameters:
-
i_string
String -
i_restriction
Number
Returns:
string
colorToDecimal
-
color
Smart convert color (many) to decinal
Parameters:
-
color
String
Returns:
decimal
colorToHex
-
color
Smart convert color (many) to hex
Parameters:
-
color
String
Returns:
hex
decimalToHex
-
d
Decimal to hex converter
Parameters:
-
d
Number
Returns:
hex
foreceBrowserCompatability
()
Force browser compatability
function
-
i_name
Get specific param name from URL
Parameters:
-
i_name
String
Returns:
getComment
-
str
Get DOM comment string
Parameters:
-
str
String
Returns:
string of comment if retrieved
getEpochTime
()
Number
Returns Epoch base time
Returns:
getThemeColor
-
color
Get current selection theme color
Parameters:
-
color
String
hexToDecimal
-
h
Hex to decimal converter
Parameters:
-
h
String
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_string
String
Returns:
isMobile
()
Boolean
Is running platform a mobile device
Returns:
loadCss
-
i_url
Load non primary CSS
Parameters:
-
i_url
String
log
-
msg
Output formatted string to console and omit error on old browsers...
Parameters:
-
msg
String
logErrors
()
log errors in distribution mode
padZeros
-
n
-
width
-
z
Pad zeros
Parameters:
-
n
Numbervalue
-
width
Numberpre-pad width
-
z
Numbernegative as in '-'
Returns:
zero padded string
parseToFloatDouble
-
i_value
Convert number or string to float with double precision
Parameters:
-
i_value
Object
Returns:
parseXml
-
xml
Convert an XML data format to a DOM enabled data structure
Parameters:
-
xml
XMLdata to parse
Returns:
xml data structure
promptOnExit
()
Prompt on application exit
remoteFileExits
-
url
Check if a remote file exists
Parameters:
-
url
String
Returns:
rgbToHex
-
rgb
RGB color to hex converter
Parameters:
-
rgb
Number
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_func
Function -
i_sleep
Number -
i_timesRun
Number
uniqueArray
-
i_array
Returns the total unique members of an array
Parameters:
-
i_array
Array
Returns:
total unique members
validateEmail
-
emailAddress
Validate email address format using regexp
Parameters:
-
emailAddress
String
Returns:
xml2json
-
o
-
internal
Convert a json data format to xml
Parameters:
-
o
JSON -
internal
Object
Returns:
xml data structure
xml2json
-
xml
-
internal
Convert an XML data format to json
Parameters:
-
xml
XML -
internal
Object
Returns:
json data structure