Make compatible with jQuery. Slight API change.
Rename the $() selector to $D() so that it doesn't collide with the jQuery name. The API change is that the 'target' option for Canvas and RFB objects must now be a DOM Canvas element. A string is no longer accepted because this requires that a DOM lookup is done and the Canvas and RFB should have no UI code in them. Modularity.
This commit is contained in:
+7
-6
@@ -42,7 +42,7 @@
|
||||
var rfb;
|
||||
|
||||
function setPassword() {
|
||||
rfb.sendPassword($('password_input').value);
|
||||
rfb.sendPassword($D('password_input').value);
|
||||
return false;
|
||||
}
|
||||
function sendCtrlAltDel() {
|
||||
@@ -51,9 +51,9 @@
|
||||
}
|
||||
function updateState(rfb, state, oldstate, msg) {
|
||||
var s, sb, cad, klass;
|
||||
s = $('VNC_status');
|
||||
sb = $('VNC_status_bar');
|
||||
cad = $('sendCtrlAltDelButton');
|
||||
s = $D('VNC_status');
|
||||
sb = $D('VNC_status_bar');
|
||||
cad = $D('sendCtrlAltDelButton');
|
||||
switch (state) {
|
||||
case 'failed':
|
||||
case 'fatal':
|
||||
@@ -90,7 +90,7 @@
|
||||
window.onload = function () {
|
||||
var host, port, password;
|
||||
|
||||
$('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
|
||||
$D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
|
||||
|
||||
host = WebUtil.getQueryVar('host', null);
|
||||
port = WebUtil.getQueryVar('port', null);
|
||||
@@ -101,7 +101,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
rfb = new RFB({'encrypt': WebUtil.getQueryVar('encrypt', false),
|
||||
rfb = new RFB({'target': $D('VNC_canvas'),
|
||||
'encrypt': WebUtil.getQueryVar('encrypt', false),
|
||||
'true_color': WebUtil.getQueryVar('true_color', true),
|
||||
'local_cursor': WebUtil.getQueryVar('cursor', true),
|
||||
'shared': WebUtil.getQueryVar('shared', true),
|
||||
|
||||
Reference in New Issue
Block a user