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:
+2
-2
@@ -29,7 +29,7 @@
|
||||
|
||||
function message(str) {
|
||||
console.log(str);
|
||||
cell = $('messages');
|
||||
cell = $D('messages');
|
||||
cell.innerHTML += msg_cnt + ": " + str + "\n";
|
||||
cell.scrollTop = cell.scrollHeight;
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
var canvas = Canvas({'target' : 'canvas'});
|
||||
var canvas = new Canvas({'target' : $D('canvas')});
|
||||
canvas.resize(width, height, true);
|
||||
canvas.start(keyPress, mouseButton, mouseMove);
|
||||
message("Canvas initialized");
|
||||
|
||||
Reference in New Issue
Block a user