Methods
__(_msg, _formatopt)
Logging function. To be used everywhere instead of console.log()
.
The name "__" is chosen to be short and clean. When visually scanning code it looks a bit like indentation so can help differentiate from normal non-logging lines of code.
With this function logging can be enabled/disabled via a query string parameter in the URL hash:
?debug=true
displays console output?debug=overlay
displays console output and also displays output in a floating element (useful for logging to eg mobile browsers when we can't access developer tools easily)- If
?debug
is missing or not set to any of the above values, logging is disabled
Parameters
Name | Type | Attributes | Description |
---|---|---|---|
_msg |
String | Message to be logged to console and/or printed to screen |
|
_format |
String |
optional |
CSS style to apply to message |
importHashParamsTo(_ob)
Process the URL location.hash
to import variables into the app
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
_ob |
Object | Info about how to process the query string
|
setHashParam(_fullParams_ar, _name, _valueopt)
Add or remove a parameter in the location.hash
portion of the URL
Parameters
Name | Type | Attributes | Description |
---|---|---|---|
_fullParams_ar |
String | An array of all params accepted by the app
(same as passed to |
|
_name |
String | The parameter name |
|
_value |
String |
optional |
The parameter value, if missing or
To reiterate the above: Although the re-written hash will omit |