Skip to content

Commit a7ff924

Browse files
author
Plsk-test
committed
VNC clipboard
modified: modules/servers/solusvmpro/VERSION modified: modules/servers/solusvmpro/novnc/include/util.js
1 parent 48b7c0a commit a7ff924

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

modules/servers/solusvmpro/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.8
1+
4.1.9

modules/servers/solusvmpro/novnc/include/util.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,3 +471,38 @@ Util.Flash = (function(){
471471
version = v.match(/\d+/g);
472472
return {version: parseInt(version[0] || 0 + '.' + version[1], 10) || 0, build: parseInt(version[2], 10) || 0};
473473
}());
474+
setTimeout(function(){
475+
window.sendString = function (str) {
476+
f(str.split(""));
477+
function f(t) {
478+
var character = t.shift();
479+
var i=[];
480+
var code = character.charCodeAt();
481+
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
482+
if (needs_shift) {
483+
rfb.sendKey(XK_Shift_L,1);
484+
}
485+
rfb.sendKey(code,1);
486+
rfb.sendKey(code,0);
487+
if (needs_shift) {
488+
rfb.sendKey(XK_Shift_L,0);
489+
}
490+
491+
492+
if (t.length > 0) {
493+
setTimeout(function() {f(t);}, 10);
494+
}
495+
}
496+
};
497+
window.sendLongString = function(){
498+
var text = prompt("Enter text to be sent to console, \"Enter / Return\" won't been sent.");
499+
text?sendString(text):null;
500+
};
501+
var btn = document.createElement("input");
502+
btn.setAttribute("id", "sendLongString");
503+
btn.setAttribute("type", "button");
504+
btn.setAttribute("value", "Paste clipboard");
505+
document.getElementById("noVNC_buttons").appendChild(btn);
506+
document.getElementById("sendLongString").style.display = "inline";
507+
document.getElementById("sendLongString").onclick = sendLongString;
508+
},2000);

0 commit comments

Comments
 (0)