Internal utility methods for {Hobo}
- Source:
Methods
-
<static> camelCase(str) → {string}
-
Camel case a string
Parameters:
Name Type Description str
string The string to camel case
- Source:
Returns:
- Type
- string
-
<static> getClass(node) → {string}
-
Get the class string from a node
Parameters:
Name Type Description node
Element The node to get
class
for- Source:
Returns:
- Type
- string
-
<static> makeArray(nodes) → {array}
-
Convert elements to a native Array
Parameters:
Name Type Description nodes
elements The nodes to make into an array
- Source:
Returns:
- Type
- array
-
<static> makeData(node)
-
Establish the hoboDataMap for a node
Parameters:
Name Type Description node
element The node to map data on
- Source:
-
<static> makeId() → {string}
-
Make a unique hobo ID string
- Source:
Returns:
- Type
- string
-
<static> mergeData(data, node)
-
Merge
Parameters:
Name Type Description data
object The data to mutate
node
element The node to pull data from
- Source:
-
<static> removeData(key, node)
-
Delete data from a nodes hoboDataMap
Parameters:
Name Type Description key
string The reference point for a data entry
node
element The node to delete a data value from
- Source:
-
<static> retrieveData(key, node) → {mixed}
-
Get data from a node
Parameters:
Name Type Description key
string The reference point for a data entry
node
element The node to pull a data value from
- Source:
Returns:
- Type
- mixed
-
<static> serializeData(data, prefix) → {string}
-
Convert data into AJAXable querystring
Parameters:
Name Type Description data
object The data to convert
prefix
string The current iterations property name
- Source:
Returns:
- Type
- string
-
<static> setClass(node, klass)
-
Set the class string for a node
Parameters:
Name Type Description node
Element The node to set
class
onklass
string The class string to be applied
- Source:
-
<static> storeData(data, node)
-
Store data in the hoboDataMap
Parameters:
Name Type Description data
object The data to store
node
element The node to store data with
- Source:
-
<static> trimString(str) → {string}
-
Trim leading and trailing whitespace
Parameters:
Name Type Description str
string The string to trim
- Source:
Returns:
- Type
- string