Merge pull request #280 from samhed/documenttitle
Display the desktop name in the document title
This commit is contained in:
commit
df9d3d9cf2
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* noVNC: HTML5 VNC client
|
* noVNC: HTML5 VNC client
|
||||||
* Copyright (C) 2012 Joel Martin
|
* Copyright (C) 2012 Joel Martin
|
||||||
|
* Copyright (C) 2013 Samuel Mannehed for Cendio AB
|
||||||
* Licensed under MPL 2.0 (see LICENSE.txt)
|
* Licensed under MPL 2.0 (see LICENSE.txt)
|
||||||
*
|
*
|
||||||
* See README.md for usage and integration instructions.
|
* See README.md for usage and integration instructions.
|
||||||
|
@ -165,6 +166,8 @@ Util.conf_defaults(conf, that, defaults, [
|
||||||
'onFBUComplete(rfb, fbu): RFB FBU received and processed '],
|
'onFBUComplete(rfb, fbu): RFB FBU received and processed '],
|
||||||
['onFBResize', 'rw', 'func', function() { },
|
['onFBResize', 'rw', 'func', function() { },
|
||||||
'onFBResize(rfb, width, height): frame buffer resized'],
|
'onFBResize(rfb, width, height): frame buffer resized'],
|
||||||
|
['onDesktopName', 'rw', 'func', function() { },
|
||||||
|
'onDesktopName(rfb, name): desktop name received'],
|
||||||
|
|
||||||
// These callback names are deprecated
|
// These callback names are deprecated
|
||||||
['updateState', 'rw', 'func', function() { },
|
['updateState', 'rw', 'func', function() { },
|
||||||
|
@ -873,6 +876,7 @@ init_msg = function() {
|
||||||
/* Connection name/title */
|
/* Connection name/title */
|
||||||
name_length = ws.rQshift32();
|
name_length = ws.rQshift32();
|
||||||
fb_name = ws.rQshiftStr(name_length);
|
fb_name = ws.rQshiftStr(name_length);
|
||||||
|
conf.onDesktopName(that, fb_name);
|
||||||
|
|
||||||
if (conf.true_color && fb_name === "Intel(r) AMT KVM")
|
if (conf.true_color && fb_name === "Intel(r) AMT KVM")
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* noVNC: HTML5 VNC client
|
* noVNC: HTML5 VNC client
|
||||||
* Copyright (C) 2012 Joel Martin
|
* Copyright (C) 2012 Joel Martin
|
||||||
|
* Copyright (C) 2013 Samuel Mannehed for Cendio AB
|
||||||
* Licensed under MPL 2.0 (see LICENSE.txt)
|
* Licensed under MPL 2.0 (see LICENSE.txt)
|
||||||
*
|
*
|
||||||
* See README.md for usage and integration instructions.
|
* See README.md for usage and integration instructions.
|
||||||
|
@ -82,7 +83,8 @@ start: function(callback) {
|
||||||
|
|
||||||
UI.rfb = RFB({'target': $D('noVNC_canvas'),
|
UI.rfb = RFB({'target': $D('noVNC_canvas'),
|
||||||
'onUpdateState': UI.updateState,
|
'onUpdateState': UI.updateState,
|
||||||
'onClipboard': UI.clipReceive});
|
'onClipboard': UI.clipReceive,
|
||||||
|
'onDesktopName': UI.updateDocumentTitle});
|
||||||
UI.updateVisualState();
|
UI.updateVisualState();
|
||||||
|
|
||||||
// Unfocus clipboard when over the VNC area
|
// Unfocus clipboard when over the VNC area
|
||||||
|
@ -530,6 +532,12 @@ updateVisualState: function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// Display the desktop name in the document title
|
||||||
|
updateDocumentTitle: function(rfb, name) {
|
||||||
|
document.title = name + " - noVNC";
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
clipReceive: function(rfb, text) {
|
clipReceive: function(rfb, text) {
|
||||||
Util.Debug(">> UI.clipReceive: " + text.substr(0,40) + "...");
|
Util.Debug(">> UI.clipReceive: " + text.substr(0,40) + "...");
|
||||||
$D('noVNC_clipboard_text').value = text;
|
$D('noVNC_clipboard_text').value = text;
|
||||||
|
|
Loading…
Reference in New Issue