We broke handling of keydown/keyup when we moved the focus to the
canvas, as events from our input element would then no longer be
caught when they bubbled up to the document object (where we
previously caught events).
Restore the previous behaviour in a cleaner manner by creating a
second Keyboard object to handle this extra input variant.
Avoid the deprecated keypress event in favour of the keydown event.
It has the benefit of triggering for all keys, not just those that
produce symbols.
Give the canvas proper focus handling. This avoids messy logic that
needs to disable and enable event handling when we want to interact
with other UI elements.
It also makes sure we can properly inhibit the browser from triggering
local actions on key presses.
The control bar can be dragged to the other side, this isn't obvious
however. This adds a hint on the opposite side in the form of a subtle
glowing half-ellipse.
If a user disconnects but leaves the browser tab open, the password
input field would still contain the password for future connections.
We now clear the input field after reading the password into memory.
It wasn't working properly anymore because it expected to be triggered
by the "load". But we now register that event listener long after the
"load" event has already fired.
Many browsers, for example Chrome on Android will not allow audio to
play unless it's initiated from a user action. It is not reasonable to
display an error for this. Fixes issue #821.
Setting a style to null does restore it in FF, Chrome, Safari and Edge.
But it does not work in Internet Explorer. The proper way to restore to
default values is to set it to the empty string. This works in all
browsers. Fixes issue #808.
This commit moves the global error handler into a separate file,
so that it can catch module loading errors.
This also adds support for properly displaying error messages with
newlines in them (since the module loader may throw those)
This commit restructures many of the ES6 modules, splitting them
up to actual export multiple functions instead of a single object.
It also splits up Util into multiple sub-modules, to make it easier
to maintain.
Finally, localisation is renamed to localization.
This removes the special comment part of the ES6 module syntax,
opting to enable ES6 module syntax by default.
It also appends `.js` to all import paths to better support in-browser
loading.
`app/ui.js` had an incorrect import path which caused issues
when using the ES6 and/or CommonJS builds of noVNC.
`core/util.js` had a non-strict-compatible declaration of a variable
without a `let` or `var` (it now uses `let`).
This fixes both issues.