Support for user-defined classes in keyboard XML.

This commit is contained in:
Michael Jumper
2012-01-23 10:41:39 -08:00
parent aa5b07761e
commit 5ca6a2cacf

View File

@@ -170,11 +170,16 @@ Guacamole.OnScreenKeyboard = function(url) {
// Get attributes
var key_size = e.attributes["size"];
var key_class = e.attributes["class"];
// Create element
var key_element = document.createElement("div");
key_element.className = "guac-keyboard-key";
// Append class if specified
if (key_class)
key_element.className += " " + key_class.value;
// Position keys using container div
var key_container_element = document.createElement("div");
key_container_element.className = "guac-keyboard-key-container";
@@ -198,6 +203,7 @@ Guacamole.OnScreenKeyboard = function(url) {
var modifier = e.attributes["modifier"];
var keysym = e.attributes["keysym"];
var sticky = e.attributes["sticky"];
var cap_class = e.attributes["class"];
// Get content of key cap
var content = e.textContent;
@@ -215,6 +221,10 @@ Guacamole.OnScreenKeyboard = function(url) {
cap_element.textContent = content;
key_element.appendChild(cap_element);
// Append class if specified
if (cap_class)
cap_element.className += " " + cap_class.value;
// Get modifier value
var modifierValue = 0;
if (required) {