Namespace Railgun
A wrapper object for all Railgun client methods and modules. In this context, a "module" refers to a single section tag of the Wikia Rail, as well as all associated states and behaviors of that entity. All modules are themselves objects in the Railgun namespace. The Railgun.Storage namespace is not technically considered a module.
- Defined in: RailgunClient.js
Method Summary
Method Attributes | Method Name and Description |
---|---|
<static> | Railgun.init() Railgun's main initialization method which is called upon pageload. |
<static> | Railgun.initLoadModules() Loads all modules after all localStorage data has been copied to the Storage namespace. |
<static> | Railgun.initProcessServerResponse(event) Processes the initialization response from the Railgun server after the retrieve request has been made by Railgun.initRequestServer(). |
<static> | Railgun.initRequestServer() The client's iframe onload event listener that sends a retrieve request to the server to get all data from localStorage. |
Field Detail
<static> {Boolean}Railgun.isDebug
Specifies the debug mode of the Railgun client. In debug mode, the Railgun stylesheet and Railgun server pages are non-cached, and some extra data is printed to the console for testing purposes.
- Default Value:
- false
<static> {String}Railgun.version
The version of the Railgun client source code.
Method Detail
- <static> Railgun.init()Railgun's main initialization method which is called upon pageload. This method is responsible for preventing Railgun from loading if the usage preconditions are not met. It also attaches the Railgun stylesheet to the head of the document, loads the iframe into the document by initializing the Storage object, and passes execution to
Railgun.initRequestServer()
when the iframe has loaded. - <static> Railgun.initLoadModules()Loads all modules after all localStorage data has been copied to the Storage namespace. This method un-registers
Railgun.initProcessServerResponse()
as a message event listener for the window. - <static> Railgun.initProcessServerResponse(event)Processes the initialization response from the Railgun server after the retrieve request has been made by Railgun.initRequestServer(). This method initializes the
Railgun.Storage.serverState
andRailgun.Storage.storageState
properties in the Storage namespace and then callsRailgun.initLoadModules()
- Parameters:
- {MessageEvent} event
- a message event representing the server's response
- <static> Railgun.initRequestServer()The client's iframe onload event listener that sends a retrieve request to the server to get all data from localStorage. Execution passes to
Railgun.initProcessServerResponse()
after the server has handled the request.