webvirtmgr/static/js/spice-html5/main.js
/*----------------------------------------------------------------------------
**  SpiceMainConn
**      This is the master Javascript class for establishing and
**  managing a connection to a Spice Server.
**  
**      Invocation:  You must pass an object with properties as follows:
**          uri         (required)  Uri of a WebSocket listener that is
**                                  connected to a spice server.
**          password    (required)  Password to send to the spice server
**          message_id  (optional)  Identifier of an element in the DOM
**                                  where SpiceConn will write messages.
**                                  It will use classes spice-messages-x,
**                                  where x is one of info, warning, or error.
**          screen_id   (optional)  Identifier of an element in the DOM
**                                  where SpiceConn will create any new
**                                  client screens.  This is the main UI.
**          dump_id     (optional)  If given, an element to use for
**                                  dumping every single image + canvas drawn.
**                                  Sometimes useful for debugging.
**          onerror     (optional)  If given, a function to receive async
**                                  errors.  Note that you should also catch
**                                  errors for ones that occur inline
**          onagent     (optional)  If given, a function to be called when
**                                  a VD agent is connected; a good opportunity
**                                  to request a resize
**
**  Throws error if there are troubles.  Requires a modern (by 2012 standards)
**      browser, including WebSocket and WebSocket.binaryType == arraybuffer
**
**--------------------------------------------------------------------------*/
SpiceMainConn
This is the master Javascript class for establishing and
managing a connection to a Spice Server.

You must pass an object with properties as follows:
uri         (required)  Uri of a WebSocket listener that is
connected to a spice server.
password    (required)  Password to send to the spice server
message_id  (optional)  Identifier of an element in the DOM
where SpiceConn will write messages.
It will use classes spice-messages-x,
where x is one of info, warning, or error.
screen_id   (optional)  Identifier of an element in the DOM
where SpiceConn will create any new
client screens.  This is the main UI.
dump_id     (optional)  If given, an element to use for
dumping every single image + canvas drawn.
Sometimes useful for debugging.
onerror     (optional)  If given, a function to receive async
errors.  Note that you should also catch
errors for ones that occur inline
onagent     (optional)  If given, a function to be called when
a VD agent is connected; a good opportunity
to request a resize

Throws error if there are troubles.  Requires a modern (by 2012 standards)
browser, including WebSocket and WebSocket.binaryType == arraybuffer
SpiceMainConn This is the master Javascript class for establishing and managing a connection to a Spice Server . You must pass an object with properties as follows : uri ( required ) Uri of a WebSocket listener that is connected to a spice server . password ( required ) Password to send to the spice server message_id ( optional ) Identifier of an element in the DOM where SpiceConn will write messages . It will use classes spice - messages - x where x is one of info warning or error . screen_id ( optional ) Identifier of an element in the DOM where SpiceConn will create any new client screens . This is the main UI . dump_id ( optional ) If given an element to use for dumping every single image + canvas drawn . Sometimes useful for debugging . onerror ( optional ) If given a function to receive async errors . Note that you should also catch errors for ones that occur inline onagent ( optional ) If given a function to be called when a VD agent is connected ; a good opportunity to request a resize Throws error if there are troubles . Requires a modern ( by 2012 standards ) browser including WebSocket and WebSocket . binaryType == arraybuffer
function SpiceMainConn()
{
    if (typeof WebSocket === "undefined")
        throw new Error("WebSocket unavailable.  You need to use a different browser.");
    SpiceConn.apply(this, arguments);
    this.agent_msg_queue = [];
    this.file_xfer_tasks = {};
    this.file_xfer_task_id = 0;
    this.file_xfer_read_queue = [];
}
function SpiceMainConn ( ) { if ( typeof WebSocket === "undefined" ) throw new Error ( "WebSocket unavailable.  You need to use a different browser." ) ; SpiceConn . apply ( this , arguments ) ; this . agent_msg_queue = [ ] ; this . file_xfer_tasks = { } ; this . file_xfer_task_id = 0 ; this . file_xfer_read_queue = [ ] ; }
SpiceMainConn
This is the master Javascript class for establishing and
managing a connection to a Spice Server.
SpiceMainConn This is the master Javascript class for establishing and managing a connection to a Spice Server .