mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Support for user-defined classes in keyboard XML.
This commit is contained in:
@@ -170,11 +170,16 @@ Guacamole.OnScreenKeyboard = function(url) {
|
|||||||
|
|
||||||
// Get attributes
|
// Get attributes
|
||||||
var key_size = e.attributes["size"];
|
var key_size = e.attributes["size"];
|
||||||
|
var key_class = e.attributes["class"];
|
||||||
|
|
||||||
// Create element
|
// Create element
|
||||||
var key_element = document.createElement("div");
|
var key_element = document.createElement("div");
|
||||||
key_element.className = "guac-keyboard-key";
|
key_element.className = "guac-keyboard-key";
|
||||||
|
|
||||||
|
// Append class if specified
|
||||||
|
if (key_class)
|
||||||
|
key_element.className += " " + key_class.value;
|
||||||
|
|
||||||
// Position keys using container div
|
// Position keys using container div
|
||||||
var key_container_element = document.createElement("div");
|
var key_container_element = document.createElement("div");
|
||||||
key_container_element.className = "guac-keyboard-key-container";
|
key_container_element.className = "guac-keyboard-key-container";
|
||||||
@@ -198,6 +203,7 @@ Guacamole.OnScreenKeyboard = function(url) {
|
|||||||
var modifier = e.attributes["modifier"];
|
var modifier = e.attributes["modifier"];
|
||||||
var keysym = e.attributes["keysym"];
|
var keysym = e.attributes["keysym"];
|
||||||
var sticky = e.attributes["sticky"];
|
var sticky = e.attributes["sticky"];
|
||||||
|
var cap_class = e.attributes["class"];
|
||||||
|
|
||||||
// Get content of key cap
|
// Get content of key cap
|
||||||
var content = e.textContent;
|
var content = e.textContent;
|
||||||
@@ -215,6 +221,10 @@ Guacamole.OnScreenKeyboard = function(url) {
|
|||||||
cap_element.textContent = content;
|
cap_element.textContent = content;
|
||||||
key_element.appendChild(cap_element);
|
key_element.appendChild(cap_element);
|
||||||
|
|
||||||
|
// Append class if specified
|
||||||
|
if (cap_class)
|
||||||
|
cap_element.className += " " + cap_class.value;
|
||||||
|
|
||||||
// Get modifier value
|
// Get modifier value
|
||||||
var modifierValue = 0;
|
var modifierValue = 0;
|
||||||
if (required) {
|
if (required) {
|
||||||
|
Reference in New Issue
Block a user