FANDOM


Namespace RailgunServer

A wrapper object for all Railgun server methods. The main method is processRequest(), which is the server's message event handler. The event handler delegates various client requests to the other methods in the namespace.

Field Summary
Field AttributesField Name and Description
<static>  
RailgunServer.isDebug
true if the server is in debug mode, false otherwise
<static>  
RailgunServer.keys
A list of keys associated with localStorage data.
<static>  
RailgunServer.version
The version of the Railgun server source code.

Method Summary

Method AttributesMethod Name and Description
<static>  
RailgunServer.getItem(key)
Retrieves a single item from localStorage.
<static>  
RailgunServer.processRequest(event)
The Railgun server's message event listener which processes requests made by the Railgun client.
<static>  
RailgunServer.reset()
Removes all items from localStorage associated with native list of keys.
<static>  
RailgunServer.retrieve()
Retrieves all items from localStorage associated with the native list of keys.
<static>  
RailgunServer.setItem(key, value)
Associates a value with a given key in localStorage.

Field Detail

<static> {Boolean}RailgunServer.isDebug
true if the server is in debug mode, false otherwise
Default Value:
false
<static> {Array}RailgunServer.keys
A list of keys associated with localStorage data.
Default Value:
["friends", "siderailHidden"]
<static> {String}RailgunServer.version
The version of the Railgun server source code.

Method Detail

  • <static> RailgunServer.getItem(key)
    Retrieves a single item from localStorage.
    Parameters:
    {String} key
    the key to query localStorage for
    Returns:
    the JSON.parsed value associated with the given key
  • <static> RailgunServer.processRequest(event)
    The Railgun server's message event listener which processes requests made by the Railgun client. This method reads instructions from the client, delegates the task to an appropriate method, and then sends the server's response back to the client. To make a request, the client must send the server a JSON.stringified request object with instruction, key and value properties: { instruction : "setItem", key : "siderailHidden", value : true }
    Parameters:
    {MessageEvent} event
    an event corresponding to a postMessage request made by the client
  • <static> RailgunServer.reset()
    Removes all items from localStorage associated with native list of keys.
    See:
    RailgunServer.keys
  • <static> {Object}RailgunServer.retrieve()
    Retrieves all items from localStorage associated with the native list of keys.
    Returns:
    {Object} a mapping of (key, value) pairs in localStorage
    See:
    RailgunServer.keys
  • <static> {Boolean}RailgunServer.setItem(key, value)
    Associates a value with a given key in localStorage.
    Parameters:
    {String} key
    a key to associate with the given value
    value
    some value of arbitrary type to be stored
    Returns:
    {Boolean} true if the operation was successful false otherwise
Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-5-30 23:16

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.