Pecoes Wiki
Advertisement

Namespace Railgun.Storage

A wrapper object defining Railgun's storage namespace, which is responsible for
handling communications with the Railgun server.

Field Summary
Field AttributesField Name and Description
<static> <constant>  
Railgun.Storage.domain
The domain where the Railgun server is located.
<static>  
Railgun.Storage.iframe
A reference to the iframe HTML element which is appended to the body of the main page&#13;when initialized in Railgun.Storage.init().
<static>  
Railgun.Storage.serverState
A copy of all the properties of the RailgunServer object.
<static>  
Railgun.Storage.storageState
A copy of all the contents of localStorage provided by the server upon pageload.

Method Summary

Method AttributesMethod Name and Description
<static>  
Railgun.Storage.init()
The initialization method for the Storage object.
<static>  
Railgun.Storage.sendRequest(request)
The main line of communication from client to server.

Field Detail

<static> <constant> {String}Railgun.Storage.domain
The domain where the Railgun server is located.
Default Value:
"http://railgunscript.wikia.com"
<static> {Object}Railgun.Storage.iframe
A reference to the iframe HTML element which is appended to the body of the main page&#13;when initialized in Railgun.Storage.init(). The client communicates with&#13;the server by issuing postMessage requests to the iframe's contentWindow property.
See:
Railgun.Storage.init()
<static> {Object}Railgun.Storage.serverState
A copy of all the properties of the RailgunServer object. This property is&#13;initialized in Railgun.initProcessServerResponse().
See:
Railgun.initProcessServerResponse()
<static> {Object}Railgun.Storage.storageState
A copy of all the contents of localStorage provided by the server upon pageload. This&#13;property is initialized in Railgun.initProcessServerResponse().
See:
Railgun.initProcessServerResponse()

Method Detail

  • <static> Railgun.Storage.init()
    The initialization method for the Storage object. This method loads the server into an&#13;iframe and appends it to the body of the document.
  • <static> Railgun.Storage.sendRequest(request)
    The main line of communication from client to server. This method accepts a&#13;request object as a parameter, converts it to JSON and sends it to the&#13;server via iframe.contentWindow.postMessage(). Sample usage:
    Railgun.Storage.sendRequest({
    &#13; id : "showSiderail()",
    &#13; instruction : "setItem",
    &#13; key : "siderailHidden",
    &#13; value : false&#13;});
    Parameters:
    {Object} request
    a request object to be sent to the server
Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-5-30 23:16
Advertisement