mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-06 04:34:24 +08:00
Added definitions for noVNC (https://github.com/kanaka/noVNC)
This commit is contained in:
32
noVNC/noVNC-tests.ts
Normal file
32
noVNC/noVNC-tests.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
///<reference path="noVNC.d.ts" />
|
||||
|
||||
Util.load_scripts(["webutil.js", "base64.js", "websock.js", "des.js",
|
||||
"input.js", "display.js", "jsunzip.js", "rfb.js"]);
|
||||
|
||||
var rfb:RFB;
|
||||
|
||||
function setPassword() {
|
||||
rfb.sendPassword('password');
|
||||
}
|
||||
|
||||
function sendCtrlAltDel() {
|
||||
rfb.sendCtrlAltDel();
|
||||
}
|
||||
|
||||
function init() {
|
||||
var host:string, port:number, password:string, path:string, token;
|
||||
var canvas = <HTMLCanvasElement>document.getElementById('noVNC_canvas');
|
||||
|
||||
rfb = new RFB({
|
||||
target: canvas,
|
||||
encrypt: true,
|
||||
repeaterID: "myrepeaterid",
|
||||
true_color: true,
|
||||
local_cursor: true,
|
||||
shared: true,
|
||||
view_only: true,
|
||||
updateState: true,
|
||||
onPasswordRequired: (rfb: RFB) => { }
|
||||
});
|
||||
rfb.connect(host, port, password, path);
|
||||
};
|
||||
Reference in New Issue
Block a user