From 913083993baa211510d3e4cd9b16ca9c97703950 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Wed, 2 Jun 2010 17:08:25 -0500 Subject: [PATCH] Direct example. Move all DOM code default_controls.js. Move DOM manipulation into include/default_controls.js and update vnc.html to use it. Add an example vnc_auto.html which automatically connects using parameters from the query string and doesn't use default_controls.js. Reorder functions in vnc.js to put external interface functions at the top of the RFB namespace. --- include/default_controls.js | 140 ++++++++++++++ vnc.html | 11 +- vnc.js | 353 +++++++++++++++--------------------- vnc_auto.html | 73 ++++++++ 4 files changed, 364 insertions(+), 213 deletions(-) create mode 100644 include/default_controls.js create mode 100644 vnc_auto.html diff --git a/include/default_controls.js b/include/default_controls.js new file mode 100644 index 0000000..2ad9d17 --- /dev/null +++ b/include/default_controls.js @@ -0,0 +1,140 @@ +DefaultControls = { + +load: function(target) { + var url; + + /* Handle state updates */ + RFB.setUpdateState(DefaultControls.updateState); + RFB.setClipboardReceive(DefaultControls.clipReceive); + + /* Populate the 'target' DOM element with default controls */ + if (!target) { target = 'vnc'; } + + html = ""; + html += '
'; + html += '