mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Refactor supporting recent changes to guacamole-common-js (removal of getLayers() from Guacamole.Client, changes to Guacamole.Client constructor prototype, and addition of Guacamole.Client.getDisplay()).
This commit is contained in:
@@ -103,10 +103,12 @@
|
|||||||
|
|
||||||
// Instantiate client
|
// Instantiate client
|
||||||
var guac = new Guacamole.Client(
|
var guac = new Guacamole.Client(
|
||||||
GuacamoleUI.display,
|
|
||||||
new Guacamole.HTTPTunnel("tunnel")
|
new Guacamole.HTTPTunnel("tunnel")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Add client to UI
|
||||||
|
GuacamoleUI.display.appendChild(guac.getDisplay());
|
||||||
|
|
||||||
// Tie UI to client
|
// Tie UI to client
|
||||||
GuacamoleUI.attach(guac);
|
GuacamoleUI.attach(guac);
|
||||||
|
|
||||||
|
@@ -423,32 +423,6 @@ GuacamoleUI.attach = function(guac) {
|
|||||||
|
|
||||||
// Display error message
|
// Display error message
|
||||||
GuacamoleUI.showError(error);
|
GuacamoleUI.showError(error);
|
||||||
|
|
||||||
// Show error by desaturating display
|
|
||||||
var layers = guac.getLayers();
|
|
||||||
for (var i=0; i<layers.length; i++) {
|
|
||||||
layers[i].filter(desaturateFilter);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter for desaturation
|
|
||||||
function desaturateFilter(data, width, height) {
|
|
||||||
|
|
||||||
for (var i=0; i<data.length; i+=4) {
|
|
||||||
|
|
||||||
// Get RGB values
|
|
||||||
var r = data[i];
|
|
||||||
var g = data[i+1];
|
|
||||||
var b = data[i+2];
|
|
||||||
|
|
||||||
// Desaturate
|
|
||||||
var v = Math.max(r, g, b) / 2;
|
|
||||||
data[i] = v;
|
|
||||||
data[i+1] = v;
|
|
||||||
data[i+2] = v;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user