]> git.proxmox.com Git - mirror_novnc.git/commit - include/ui.js
New API. Refactor Canvas and RFB objects.
authorJoel Martin <github@martintribe.org>
Mon, 2 Aug 2010 22:07:27 +0000 (17:07 -0500)
committerJoel Martin <github@martintribe.org>
Mon, 2 Aug 2010 22:07:27 +0000 (17:07 -0500)
commit8db09746b7b96da6bf48d0d7ef22f40df7205f7d
treed14e37eac87f38a6f717f7d9d4cad2fd8b813445
parent8171f4d8187109093a32322377a35676813546ea
New API. Refactor Canvas and RFB objects.

New API:

To use the RFB object, you now must instantiate it (this allows more
than one instance of it on the same page).

    rfb = new RFB(settings);

The 'settings' variable is a namespace that contains initial default
settings. These can also be set and read using 'rfb.set_FOO()' and
'rfb.get_FOO()' where FOO is the setting name. The current settings
are (and defaults) are:
    - target: the DOM Canvas element to use ('VNC_canvas').
    - encrypt: whether to encrypt the connection (false)
    - true_color: true_color or palette (true)
    - b64encode: base64 encode the WebSockets data (true)
    - local_cursor: use local cursor rendering (true if supported)
    - connectTimeout: milliseconds to wait for connect (2000)
    - updateState: callback when RFB state changes (none)
    - clipboardReceive: callback when clipboard data received (none)

The parameters to the updateState callback have also changed. The
function spec is now updateState(rfb, state, oldstate, msg):
    - rfb: the RFB object that this state change is for.
    - state: the new state
    - oldstate: the previous state
    - msg: a message associate with the state (not always set).

The clipboardReceive spec is clipboardReceive(rfb, text):
    - rfb: the RFB object that this text is from.
    - text: the clipboard text received.

Changes:

- The RFB and Canvas namespaces are now more proper objects. Private
  implementation is no longer exposed and the public API has been made
  explicit. Also, instantiation allows more than one VNC connection
  on the same page (to complete this, DefaultControls will also need
  this same refactoring).

- Added 'none' logging level.

- Removed automatic stylesheet selection workaround in util.js and
  move it to defaultcontrols so that it doesn't interfere with
  intergration.

- Also, some major JSLinting.

- Fix input, canvas, and cursor tests to work with new model.
README.md
include/canvas.js
include/default_controls.js
include/rfb.js
include/util.js
tests/canvas.html
tests/cursor.html
tests/input.html
vnc.html
vnc_auto.html