ce528311e6d1d8b9b67b88bb1e6c4874ed070ba5
[guacamole.git] / src / main / webapp / client.xhtml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html>
3
4 <!--
5     Guacamole - Clientless Remote Desktop
6     Copyright (C) 2010  Michael Jumper
7
8     This program is free software: you can redistribute it and/or modify
9     it under the terms of the GNU Affero General Public License as published by
10     the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU Affero General Public License for more details.
17
18     You should have received a copy of the GNU Affero General Public License
19     along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 -->
21
22 <html xmlns="http://www.w3.org/1999/xhtml">
23
24     <head>
25         <link rel="icon" type="image/png" href="images/guacamole-logo-64.png"/>
26         <link rel="stylesheet" type="text/css" href="styles/client.css"/>
27         <link rel="stylesheet" type="text/css" href="styles/keyboard.css"/>
28         <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"/>
29         <meta name="apple-mobile-web-app-capable" content="yes"/>
30         <title>Guacamole ${project.version}</title>
31     </head>
32
33     <body>
34
35         <!-- Menu -->
36         <div id="menu">
37
38             <!-- Clipboard -->
39             <button id="showClipboard">Show Clipboard</button>
40             <div id="clipboardDiv">
41                 <h2>Clipboard</h2>
42                 <p>
43                 Text copied/cut within Guacamole will appear here. Changes to the text will affect the remote clipboard, and will be pastable within the remote desktop. Use the textbox below as an interface between the client and server clipboards.
44                 </p>
45                 <textarea rows="10" cols="40" id="clipboard"></textarea>
46             </div>
47
48             <button id="showKeyboard">Show Keyboard</button>
49             <button id="ctrlAltDelete">Ctrl-Alt-Delete</button>
50             <button id="logout">Logout</button>
51
52             <!-- Logo and status -->
53             <img id="status-logo" class="logo" src="images/guacamole-logo-24.png" alt="Guacamole" title="Guacamole ${project.version}"/>
54
55         </div>
56
57         <!-- Keyboard event target for platforms with native OSKs -->
58         <textarea id="eventTarget"></textarea>
59
60         <!-- Display -->
61         <div id="display">
62             
63             <!-- Menu trigger -->
64             <div id="menuControl"></div>
65
66         </div>
67
68         <!-- On-screen keyboard -->
69         <div id="keyboardContainer"></div>
70
71         <!-- Dimensional clone of viewport -->
72         <div id="viewportClone"/>
73
74         <!-- Dialogs -->
75         <div class="dialogOuter">
76             <div class="dialogMiddle">
77
78                 <!-- Status Dialog -->
79                 <div id="statusDialog" class="dialog">
80                     <p id="statusText"></p>
81                     <div class="buttons"><button id="reconnect">Reconnect</button></div>
82                 </div>
83
84             </div>
85         </div>
86
87         <!-- Touch-specific menu -->
88         <div class="dialogOuter">
89             <div class="dialogMiddle">
90
91                 <div id="touchMenu">
92                     <img id="touchShowClipboard" src="images/menu-icons/tango/edit-paste.png"/>
93                     <img id="touchShowKeyboard" src="images/menu-icons/tango/input-keyboard.png"/>
94                     <img id="touchLogout" src="images/menu-icons/tango/system-log-out.png"/>
95                 </div>
96
97             </div>
98         </div>
99
100         <!-- guacamole-common-js scripts -->
101         <script type="text/javascript" src="guacamole-common-js/keyboard.js"></script>
102         <script type="text/javascript" src="guacamole-common-js/mouse.js"></script>
103         <script type="text/javascript" src="guacamole-common-js/layer.js"></script>
104         <script type="text/javascript" src="guacamole-common-js/tunnel.js"></script>
105         <script type="text/javascript" src="guacamole-common-js/guacamole.js"></script>
106         <script type="text/javascript" src="guacamole-common-js/oskeyboard.js"></script>
107
108         <!-- guacamole-default-webapp scripts -->
109         <script type="text/javascript" src="scripts/interface.js"></script>
110
111         <!-- Init -->
112         <script type="text/javascript"> /* <![CDATA[ */
113
114             // Start connect after control returns from onload (allow browser
115             // to consider the page loaded).
116             window.onload = function() {
117                 window.setTimeout(function() {
118
119                     var tunnel;
120
121                     // If WebSocket available, try to use it.
122                     if (window.WebSocket)
123                         tunnel = new Guacamole.ChainedTunnel(
124                             new Guacamole.WebSocketTunnel("websocket-tunnel"),
125                             new Guacamole.HTTPTunnel("tunnel")
126                         );
127
128                     // If no WebSocket, then use HTTP.
129                     else
130                         tunnel = new Guacamole.HTTPTunnel("tunnel")
131
132                     // Instantiate client
133                     var guac = new Guacamole.Client(tunnel);
134
135                     // Add client to UI
136                     guac.getDisplay().className = "software-cursor";
137                     GuacamoleUI.display.appendChild(guac.getDisplay());
138
139                     // Tie UI to client
140                     GuacamoleUI.attach(guac);
141
142                     try {
143
144                         // Get entire query string, and pass to connect().
145                         // Normally, only the "id" parameter is required, but
146                         // all parameters should be preserved and passed on for
147                         // the sake of authentication.
148
149                         var connect_string = window.location.search.substring(1);
150                         guac.connect(connect_string);
151
152                     }
153                     catch (e) {
154                         GuacamoleUI.showError(e.message);
155                     }
156
157                 }, 0);
158             };
159
160         /* ]]> */ </script>
161
162     </body>
163
164 </html>