A project using Refugee Lib needs to include only a single script:<script type="text/javascript" src="./script/rlBoot.js></script>
Then utilize rlBoot.bootRefugeeLib to load and initialize the rest of the library.
example: 01-quickstart
Methods
-
(static) bootRefugeeLib(divIdForMessages, additionalScriptURLs, bootContext, mainFunc, clearDivOnSuccess)
-
Initializes Refugee Lib scripts, optionally loads additional scripts, calls a main function afterwards and displays boot progress.
Parameters:
Name Type Description divIdForMessagesstring the DOM id of a div tag which will be used to display progress messages
additionalScriptURLsArray.<string> URLs to additional scripts to load after the Refugee Lib scripts have been loaded
bootContextobject set to "this" and call from the global namespace inside the main HTML file (or to any other object implementing the "eval" function)
mainFuncrlBoot~mainFunc will be called after booting
clearDivOnSuccessboolean set to true, if the div for boot messages should be cleared and hidden after a successful boot process
Returns:
whatever the given
rlBoot~mainFuncreturns -
(static) bootRefugeeLibMinimal()
-
(experimental/todo) boot a minimal interface-less subset of Refugee Lib functionality
Type Definitions
-
mainFunc(bootCode)
-
Function signature for use with
bootRefugeeLib.Parameters:
Name Type Description bootCodenumber receives the result of the library boot progress (0 on success)