mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-10 07:01:21 +00:00
Connection icons, initial autohiding menu implementation.
This commit is contained in:
@@ -97,13 +97,6 @@
|
|||||||
var errorDialog = document.getElementById("errorDialog");
|
var errorDialog = document.getElementById("errorDialog");
|
||||||
var errorDialogText = document.getElementById("errorText");
|
var errorDialogText = document.getElementById("errorText");
|
||||||
|
|
||||||
// Position display correctly
|
|
||||||
window.onresize = function() {
|
|
||||||
display.style.top = menu.offsetHeight + "px";
|
|
||||||
};
|
|
||||||
|
|
||||||
window.onresize();
|
|
||||||
|
|
||||||
var state = document.getElementById("state");
|
var state = document.getElementById("state");
|
||||||
guac.onstatechange = function(clientState) {
|
guac.onstatechange = function(clientState) {
|
||||||
|
|
||||||
@@ -184,6 +177,10 @@
|
|||||||
var mouse = new Guacamole.Mouse(display);
|
var mouse = new Guacamole.Mouse(display);
|
||||||
mouse.onmousedown = mouse.onmouseup = mouse.onmousemove =
|
mouse.onmousedown = mouse.onmouseup = mouse.onmousemove =
|
||||||
function(mouseState) {
|
function(mouseState) {
|
||||||
|
|
||||||
|
if (mouseState.y <= 5)
|
||||||
|
showMenu();
|
||||||
|
|
||||||
guac.sendMouseState(mouseState);
|
guac.sendMouseState(mouseState);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -335,6 +332,69 @@
|
|||||||
// TODO: Handle exception ...
|
// TODO: Handle exception ...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var menu_shaded = false;
|
||||||
|
|
||||||
|
var hide_interval = null;
|
||||||
|
var show_interval = null;
|
||||||
|
|
||||||
|
function hideMenu() {
|
||||||
|
|
||||||
|
if (!menu_shaded) {
|
||||||
|
|
||||||
|
var step = Math.floor(menu.offsetHeight / 5) + 1;
|
||||||
|
var offset = 0;
|
||||||
|
menu_shaded = true;
|
||||||
|
|
||||||
|
window.clearInterval(show_interval);
|
||||||
|
hide_interval = window.setInterval(function() {
|
||||||
|
|
||||||
|
offset -= step;
|
||||||
|
menu.style.top = offset + "px";
|
||||||
|
|
||||||
|
if (offset <= -menu.offsetHeight) {
|
||||||
|
window.clearInterval(hide_interval);
|
||||||
|
menu.style.visiblity = "hidden";
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function showMenu() {
|
||||||
|
|
||||||
|
if (menu_shaded) {
|
||||||
|
|
||||||
|
var step = Math.floor(menu.offsetHeight / 5) + 1;
|
||||||
|
var offset = -menu.offsetHeight;
|
||||||
|
menu_shaded = false;
|
||||||
|
menu.style.visiblity = "";
|
||||||
|
|
||||||
|
window.clearInterval(hide_interval);
|
||||||
|
show_interval = window.setInterval(function() {
|
||||||
|
|
||||||
|
offset += step;
|
||||||
|
|
||||||
|
if (offset >= 0) {
|
||||||
|
offset = 0;
|
||||||
|
window.clearInterval(show_interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
menu.style.top = offset + "px";
|
||||||
|
|
||||||
|
}, 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
display.onmouseout = function() {
|
||||||
|
showMenu();
|
||||||
|
};
|
||||||
|
|
||||||
|
display.onmouseover = function() {
|
||||||
|
hideMenu();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* ]]> */ </script>
|
/* ]]> */ </script>
|
||||||
|
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@@ -131,6 +131,9 @@
|
|||||||
var protocol = document.createElement("td");
|
var protocol = document.createElement("td");
|
||||||
var id = document.createElement("td");
|
var id = document.createElement("td");
|
||||||
|
|
||||||
|
var protocolIcon = document.createElement("div");
|
||||||
|
protocolIcon.className = "protocol icon " + configs[i].protocol;
|
||||||
|
|
||||||
// Set CSS
|
// Set CSS
|
||||||
protocol.className = "protocol";
|
protocol.className = "protocol";
|
||||||
id.className = "name";
|
id.className = "name";
|
||||||
@@ -141,7 +144,8 @@
|
|||||||
"client.xhtml?" + encodeURIComponent(configs[i].id));
|
"client.xhtml?" + encodeURIComponent(configs[i].id));
|
||||||
|
|
||||||
// Set cell contents
|
// Set cell contents
|
||||||
protocol.textContent = configs[i].protocol;
|
protocol.appendChild(protocolIcon);
|
||||||
|
//protocol.textContent = configs[i].protocol;
|
||||||
clientLink.textContent = configs[i].id;
|
clientLink.textContent = configs[i].id;
|
||||||
id.appendChild(clientLink);
|
id.appendChild(clientLink);
|
||||||
|
|
||||||
|
@@ -86,14 +86,6 @@ div.errorDialog p {
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu.connected {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu.connected:hover {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu.error {
|
#menu.error {
|
||||||
background: #D44;
|
background: #D44;
|
||||||
}
|
}
|
||||||
@@ -139,6 +131,11 @@ div#clipboardDiv {
|
|||||||
border-radius: 0.5em;
|
border-radius: 0.5em;
|
||||||
|
|
||||||
width: 50em;
|
width: 50em;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu:hover div#clipboardDiv {
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#clipboardDiv h2 {
|
div#clipboardDiv h2 {
|
||||||
|
@@ -219,3 +219,14 @@ div#connection-list-ui a[href] {
|
|||||||
div#connection-list-ui a[href]:hover {
|
div#connection-list-ui a[href]:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.protocol.icon {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
background-image: url('../images/protocol-icons/tango/video-display.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
.protocol.icon.ssh {
|
||||||
|
background-image: url('../images/protocol-icons/tango/terminal.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user