diff options
author | Amos Benari <abenari@redhat.com> | 2013-03-18 10:42:06 -0400 |
---|---|---|
committer | Jeremy White <jwhite@codeweavers.com> | 2013-03-19 09:00:38 -0500 |
commit | ec9ae0cbd6d5ebbcea746b4b771ac87835ff8920 (patch) | |
tree | a3dd5f8b91fa4bd04f61fed70f8633b7800e42a1 | |
parent | 828d975b2db7231d5560f4ca3cf0487ce5c80d4b (diff) |
added on succeess event
-rw-r--r-- | main.js | 1 | ||||
-rw-r--r-- | spiceconn.js | 8 |
2 files changed, 9 insertions, 0 deletions
@@ -60,6 +60,7 @@ SpiceMainConn.prototype.process_channel_message = function(msg) if (msg.type == SPICE_MSG_MAIN_INIT) { this.log_info("Connected to " + this.ws.url); + this.report_success("Connected") this.main_init = new SpiceMsgMainInit(msg.data); this.connection_id = this.main_init.session_id; diff --git a/spiceconn.js b/spiceconn.js index b448881..494810e 100644 --- a/spiceconn.js +++ b/spiceconn.js @@ -55,6 +55,8 @@ function SpiceConn(o) this.password = o.password; if (o.onerror !== undefined) this.onerror = o.onerror; + if (o.onsuccess !== undefined) + this.onsuccess = o.onsuccess; this.state = "connecting"; this.ws.parent = this; @@ -420,6 +422,12 @@ SpiceConn.prototype = throw(e); }, + report_success: function(m) + { + if (this.onsuccess != undefined) + this.onsuccess(m); + }, + cleanup: function() { if (this.timeout) |