- Copyright:
- (c) Copyright 2013 - 2016 AV Digital Media Ltd. All Rights Reserved. No unauthorized copying, distribution or modification to this code in whole or in part is permitted without the express permission of AV Digital Media Ltd (UK).
Properties:
Name | Type | Description |
---|---|---|
array |
Array | Simple Array to store loader objects |
debug |
Boolean | Debug output to console |
skipError |
Boolean | Skip any load errors and continue loading files |
skipCSSError |
Boolean | Skip the onLoad functionality for CSS files in the event it is not supported by the browser |
timer |
Number | Callback delay |
completed |
Number | Create a completed var incremented for each completed item |
head |
HTMLElement | Document head reference |
length |
Number | Create a completed var incremented for each completed item |
onComplete |
function | OnComplete callback referenc |
Access via aim.loader - This is a simple JavaScript and CSS file loading utility, it only have some simple methods for initializing which files should be loaded and calling back the executing path when the load has ben completed.
Methods
(private, static) handleComplete()
Do the complete handler execution and clear the onComplete function
(protected, static) link({function}, callback)
Store a script for the loader, returns the loader instance to support chaining of the method
Parameters:
Name | Type | Description |
---|---|---|
{function} |
String | path - The path to the script which can either be a static string or a function which is expected to return a string |
callback |
function | An optional callback to execute for the specific script returns this to support the method chaining |
Returns:
This will return the aim.loader object to support method chaining
(protected, static) load(callback)
Begin the load sequence for the script
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The complete callback to execute when all scripts are loaded |
(private, static) nextFile()
Load next script checks the script to load and initializes the load if the array length has not been reached
(private, static) options()
Reset the items options to default states to await a next load
(protected, static) options(properties)
Set the optional values for the Loader
Parameters:
Name | Type | Description |
---|---|---|
properties |
Object | The option property list |
(protected, static) script({Function}, callback)
Store a script for the loader, returns the loader instance to support chaining of the method
Parameters:
Name | Type | Description |
---|---|---|
{Function} |
String | path - The path to the script which can either be a static string or a function which is expected to return a string |
callback |
function | An optional callback to execute for the specific script returns this to support the method chaining |
Returns:
This will return the aim.loader object to support method chaining