BundleLoader Class
Load a javascript and run it, and shows a progress bar while doing so.
For making the transition into the actualy application, there are some other features, such as the ability to not make the progress bar go to 100%.
Item Index
Methods
hide
()
Hide the loader.
load
-
urls
-
[message]
-
[completeProgress]
Load javascript.
This function loads the javascript from the specified url, and then runs it.
By default, the loading screen will be hidden when the script is run. If there are extra resources to be loaded as part of the application startup, specify a number for the completeProgress parameter, and the loading screen will not hide itself, but instead stop at the specified percentage.
It is then up to the loaded bundle to actually hide the loader when all resources are loaded.
Parameters:
-
urls
StringUrl or array of urls to the javascript main bundle file.
-
[message]
String optionalThe message to show while loading.
-
[completeProgress]
Number optionalThe progress to stop at.
loadNext
()
Load next url.
onAnimateInterval
()
private
Animate the loader if the size of the load job is not known.
onLoadRequestError
()
private
On error.
onLoadRequestLoad
()
private
Load request complete.
onLoadRequestProgress
()
private
Load request progress.
show
-
title
-
[percent]
Show the loader, with message and optional percent.
The percent parameter is optional. If this is omitted the progress bar will show as in an indefinite state.
Parameters:
-
title
StringThe message to show.
-
[percent]
Number optionalThe percentage of the completion to show.
showMessage
-
title
Show only a message without the progress bar.
Parameters:
-
title
String
waitForBody
()
private
Wait for the body to exist so we can attach ourselves.