]> git.proxmox.com Git - mirror_novnc.git/blobdiff - vnc_auto.html
Change server example
[mirror_novnc.git] / vnc_auto.html
index 48577f55c7e6324542af162192c61b326c8456e0..e4fc46769d818cf6be2a9fba3dd80cd36cabaf82 100644 (file)
@@ -81,8 +81,7 @@
         WebUtil.load_scripts({
             'core': ["base64.js", "websock.js", "des.js", "input/keysymdef.js",
                      "input/xtscancodes.js", "input/util.js", "input/devices.js",
-                     "display.js", "inflator.js", "rfb.js", "input/keysym.js"],
-            'app': ["webutil.js"]});
+                     "display.js", "inflator.js", "rfb.js", "input/keysym.js"]});
 
         var rfb;
         var resizeTimeout;
             var html;
             html = '<form onsubmit="return setPassword();"';
             html += '  style="margin-bottom: 0px">';
-            html += msg;
+            html += '<label></label>'
             html += '<input type=password size=10 id="password_input" class="noVNC_status">';
             html += '<\/form>';
-            status(html, "warn");
+
+            // bypass status() because it sets text content
+            document.getElementById('noVNC_status_bar').setAttribute("class", "noVNC_status_warn");
+            document.getElementById('noVNC_status').innerHTML = html;
+            document.getElementById('noVNC_status').querySelector('label').textContent = msg;
         }
         function setPassword() {
             rfb.sendPassword(document.getElementById('password_input').value);
                     level = "warn";
             }
             document.getElementById('noVNC_status_bar').setAttribute("class", "noVNC_status_" + level);
-            document.getElementById('noVNC_status').innerHTML = text;
+            document.getElementById('noVNC_status').textContent = text;
         }
         function updateState(rfb, state, oldstate) {
             var cad = document.getElementById('sendCtrlAltDelButton');
-            var encrypt = (rfb && rfb.get_encrypt()) ? 'encrypted' : 'unencrypted';
             switch (state) {
                 case 'connecting':
                     status("Connecting", "normal");
                     break;
                 case 'connected':
-                    status("Connected (" + encrypt + ") to: " + desktopName, "normal");
+                    if (rfb && rfb.get_encrypt()) {
+                        status("Connected (encrypted) to " +
+                               desktopName, "normal");
+                    } else {
+                        status("Connected (unencrypted) to " +
+                               desktopName, "normal");
+                    }
                     break;
                 case 'disconnecting':
                     status("Disconnecting", "normal");