]>
Commit | Line | Data |
---|---|---|
0e8bc41f DM |
1 | <!DOCTYPE html> |
2 | <html> | |
3 | <head> | |
4 | <title>noVNC</title> | |
5 | ||
6 | <meta charset="utf-8"> | |
7 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
8 | ||
9 | <!-- Apple iOS Safari settings --> | |
10 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
11 | <meta name="apple-mobile-web-app-capable" content="yes" /> | |
12 | <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> | |
13 | <!-- App Start Icon --> | |
14 | <link rel="apple-touch-startup-image" href="images/screen_320x460.png" /> | |
15 | <!-- For iOS devices set the icon to use if user bookmarks app on their homescreen --> | |
16 | <link rel="apple-touch-icon" href="images/screen_57x57.png"> | |
17 | ||
18 | <!-- Stylesheets --> | |
19 | <link rel="stylesheet" href="include/base.css" title="plain"> | |
20 | ||
21 | <script src="include/util.js"></script> | |
22 | </head> | |
23 | ||
24 | <body style="margin: 0px;"> | |
25 | <div id="noVNC_screen"> | |
82eef941 DM |
26 | <div id="noVNC_status_state" style="margin-top: 0px; visibility: hidden; position: absolute;"></div> |
27 | <div id="noVNC_status_msg" style="margin-top: 0px; visibility: hidden; position: absolute;"></div> | |
0e8bc41f DM |
28 | <canvas id="noVNC_canvas" width="640px" height="20px"> |
29 | Canvas not supported. | |
30 | </canvas> | |
31 | </div> | |
32 | ||
33 | <script> | |
34 | /*jslint white: false */ | |
35 | /*global window, $, Util, RFB, */ | |
36 | "use strict"; | |
37 | ||
38 | // Load supporting scripts | |
39 | Util.load_scripts(["webutil.js", "base64.js", "websock.js", "des.js", | |
40 | "keysymdef.js", "keyboard.js", "input.js", "display.js", | |
41 | "jsunzip.js", "rfb.js"]); | |
42 | ||
43 | var rfb; | |
44 | ||
45 | function passwordRequired(rfb) { | |
82eef941 DM |
46 | $D('noVNC_status_state').innerHTML = "pwrequest"; |
47 | $D('noVNC_status_msg').innerHTML = "needs password"; | |
0e8bc41f DM |
48 | } |
49 | function setPassword() { | |
82eef941 | 50 | //rfb.sendPassword($D('password_input').value); |
0e8bc41f DM |
51 | return false; |
52 | } | |
0e8bc41f | 53 | |
82eef941 DM |
54 | function updateState(rfb, state, oldstate, msg) { |
55 | var sm, ss; | |
56 | ||
57 | sm = $D('noVNC_status_msg'); | |
58 | ss = $D('noVNC_status_state'); | |
59 | ||
60 | if (state !== "normal") { | |
0e8bc41f DM |
61 | xvpInit(0); |
62 | } | |
63 | ||
82eef941 DM |
64 | ss.innerHTML = state; |
65 | ||
66 | if (typeof(msg) !== 'undefined') { | |
67 | sm.innerHTML = msg; | |
68 | } | |
0e8bc41f DM |
69 | } |
70 | ||
71 | function xvpInit(ver) { | |
82eef941 | 72 | // do nothing |
0e8bc41f DM |
73 | } |
74 | ||
75 | window.onscriptsload = function () { | |
76 | var host, port, password, path, token; | |
77 | ||
0e8bc41f DM |
78 | WebUtil.init_logging(WebUtil.getQueryVar('logging', 'warn')); |
79 | document.title = unescape(WebUtil.getQueryVar('title', 'noVNC')); | |
80 | // By default, use the host and port of server that served this file | |
81 | host = WebUtil.getQueryVar('host', window.location.hostname); | |
82 | port = WebUtil.getQueryVar('port', window.location.port); | |
0e8bc41f DM |
83 | password = WebUtil.getQueryVar('password', ''); |
84 | path = WebUtil.getQueryVar('path', 'websockify'); | |
85 | ||
86 | if ((!host) || (!port)) { | |
82eef941 | 87 | updateState('failed', "Must specify host and port in URL"); |
0e8bc41f DM |
88 | return; |
89 | } | |
90 | ||
91 | rfb = new RFB({'target': $D('noVNC_canvas'), | |
92 | 'encrypt': WebUtil.getQueryVar('encrypt', | |
93 | (window.location.protocol === "https:")), | |
94 | 'repeaterID': WebUtil.getQueryVar('repeaterID', ''), | |
95 | 'true_color': WebUtil.getQueryVar('true_color', true), | |
96 | 'local_cursor': WebUtil.getQueryVar('cursor', true), | |
97 | 'shared': WebUtil.getQueryVar('shared', true), | |
98 | 'view_only': WebUtil.getQueryVar('view_only', false), | |
99 | 'updateState': updateState, | |
100 | 'onXvpInit': xvpInit, | |
101 | 'onPasswordRequired': passwordRequired}); | |
102 | rfb.connect(host, port, password, path); | |
103 | ||
104 | $D("noVNC_screen").onmouseover = function(e) { | |
105 | window.focus(); | |
106 | }; | |
0e8bc41f DM |
107 | }; |
108 | </script> | |
109 | </body> | |
110 | </html> |