KASM-3891 add URL param to show control bar in iframe (#56)
* KASM-3891 add URL param to show control bar in iframe and post message to parent on control bar open and close * KASM-3891 send fullscreen requests to parent and bypass local logic --------- Co-authored-by: ryan.kuba <ryan.kuba@kasmweb.com>
This commit is contained in:
parent
46e361a4e1
commit
8ec5d5d7d4
14
app/ui.js
14
app/ui.js
|
@ -775,6 +775,9 @@ const UI = {
|
||||||
openControlbar() {
|
openControlbar() {
|
||||||
document.getElementById('noVNC_control_bar')
|
document.getElementById('noVNC_control_bar')
|
||||||
.classList.add("noVNC_open");
|
.classList.add("noVNC_open");
|
||||||
|
if (WebUtil.isInsideKasmVDI()) {
|
||||||
|
parent.postMessage({ action: 'control_open', value: 'Control bar opened'}, '*' );
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
closeControlbar() {
|
closeControlbar() {
|
||||||
|
@ -784,6 +787,9 @@ const UI = {
|
||||||
if (UI.rfb) {
|
if (UI.rfb) {
|
||||||
UI.rfb.focus();
|
UI.rfb.focus();
|
||||||
}
|
}
|
||||||
|
if (WebUtil.isInsideKasmVDI()) {
|
||||||
|
parent.postMessage({ action: 'control_close', value: 'Control bar closed'}, '*' );
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleControlbar() {
|
toggleControlbar() {
|
||||||
|
@ -1434,7 +1440,9 @@ const UI = {
|
||||||
UI.rfb.addEventListener("clipboard", UI.clipboardRx);
|
UI.rfb.addEventListener("clipboard", UI.clipboardRx);
|
||||||
}
|
}
|
||||||
UI.rfb.addEventListener("disconnect", UI.disconnectedRx);
|
UI.rfb.addEventListener("disconnect", UI.disconnectedRx);
|
||||||
document.getElementById('noVNC_control_bar_anchor').setAttribute('style', 'display: none');
|
if (! WebUtil.getConfigVar('show_control_bar')) {
|
||||||
|
document.getElementById('noVNC_control_bar_anchor').setAttribute('style', 'display: none');
|
||||||
|
}
|
||||||
|
|
||||||
//keep alive for websocket connection to stay open, since we may not control reverse proxies
|
//keep alive for websocket connection to stay open, since we may not control reverse proxies
|
||||||
//send a keep alive within a window that we control
|
//send a keep alive within a window that we control
|
||||||
|
@ -1774,6 +1782,10 @@ const UI = {
|
||||||
* ------v------*/
|
* ------v------*/
|
||||||
|
|
||||||
toggleFullscreen() {
|
toggleFullscreen() {
|
||||||
|
if (WebUtil.isInsideKasmVDI()) {
|
||||||
|
parent.postMessage({ action: 'fullscreen', value: 'Fullscreen clicked'}, '*' );
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (document.fullscreenElement || // alternative standard method
|
if (document.fullscreenElement || // alternative standard method
|
||||||
document.mozFullScreenElement || // currently working methods
|
document.mozFullScreenElement || // currently working methods
|
||||||
document.webkitFullscreenElement ||
|
document.webkitFullscreenElement ||
|
||||||
|
|
Loading…
Reference in New Issue