Code cleanup.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Tue, 11 Oct 2011 22:31:01 +0000 (15:31 -0700)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Tue, 11 Oct 2011 22:31:01 +0000 (15:31 -0700)
src/main/resources/guacamole.js
src/main/resources/oskeyboard.js

index ec925f4..d348d64 100644 (file)
@@ -42,8 +42,6 @@ Guacamole.Client = function(display, tunnel) {
 
     var currentState = STATE_IDLE;
 
-    tunnel.oninstruction = doInstruction;
-
     tunnel.onerror = function(message) {
         if (guac_client.onerror)
             guac_client.onerror(message);
@@ -228,7 +226,7 @@ Guacamole.Client = function(display, tunnel) {
 
         "error": function(parameters) {
             if (guac_client.onerror) guac_client.onerror(parameters[0]);
-            disconnect();
+            guac_client.disconnect();
         },
 
         "name": function(parameters) {
@@ -409,16 +407,16 @@ Guacamole.Client = function(display, tunnel) {
     };
 
 
-    function doInstruction(opcode, parameters) {
+    tunnel.oninstruction = function(opcode, parameters) {
 
         var handler = instructionHandlers[opcode];
         if (handler)
             handler(parameters);
 
-    }
+    };
 
 
-    function disconnect() {
+    guac_client.disconnect = function() {
 
         // Only attempt disconnection not disconnected.
         if (currentState != STATE_DISCONNECTED
@@ -430,9 +428,8 @@ Guacamole.Client = function(display, tunnel) {
             setState(STATE_DISCONNECTED);
         }
 
-    }
-
-    guac_client.disconnect = disconnect;
+    };
+    
     guac_client.connect = function(data) {
 
         setState(STATE_CONNECTING);
@@ -448,4 +445,5 @@ Guacamole.Client = function(display, tunnel) {
         setState(STATE_WAITING);
     };
 
-}
+};
+
index 34c2781..3783216 100644 (file)
@@ -492,5 +492,6 @@ Guacamole.OnScreenKeyboard = function(url) {
     };
 
     return keyboard;
-}
+
+};