Pop up menu in center, but do not rely on position: fixed.
[guacamole.git] / src / main / webapp / client.xhtml
index 1a319ea..312d3c3 100644 (file)
@@ -54,6 +54,8 @@
 
         </div>
 
+        <!-- Keyboard event target for platforms with native OSKs -->
+        <textarea id="eventTarget"></textarea>
 
         <!-- Display -->
         <div id="display">
             </div>
         </div>
 
+        <!-- Touch-specific menu -->
+        <div id="touchMenu">
+            <img id="touchShowClipboard" src="images/menu-icons/tango/edit-paste.png"/>
+            <img id="touchShowKeyboard" src="images/menu-icons/tango/input-keyboard.png"/>
+            <img id="touchLogout" src="images/menu-icons/tango/system-log-out.png"/>
+        </div>
+
         <!-- guacamole-common-js scripts -->
         <script type="text/javascript" src="guacamole-common-js/keyboard.js"></script>
         <script type="text/javascript" src="guacamole-common-js/mouse.js"></script>
 
                     var tunnel;
 
-                    // TODO: Detect WebSocket and websocket-tunnel
-                    tunnel = new Guacamole.WebSocketTunnel("websocket-tunnel")
-                    //tunnel = new Guacamole.HTTPTunnel("tunnel")
+                    // If WebSocket available, try to use it.
+                    if (window.WebSocket)
+                        tunnel = new Guacamole.ChainedTunnel(
+                            new Guacamole.WebSocketTunnel("websocket-tunnel"),
+                            new Guacamole.HTTPTunnel("tunnel")
+                        );
+
+                    // If no WebSocket, then use HTTP.
+                    else
+                        tunnel = new Guacamole.HTTPTunnel("tunnel")
 
                     // Instantiate client
                     var guac = new Guacamole.Client(tunnel);
 
                     try {
 
-                        // Get ID
-                        var id = window.location.search.substring(1);
+                        // Get entire query string, and pass to connect().
+                        // Normally, only the "id" parameter is required, but
+                        // all parameters should be preserved and passed on for
+                        // the sake of authentication.
 
-                        // Connect client
-                        guac.connect("id=" + id);
+                        var connect_string = window.location.search.substring(1);
+                        guac.connect(connect_string);
 
                     }
                     catch (e) {