Samuel Mannehed [Fri, 21 Apr 2017 13:23:18 +0000 (15:23 +0200)]
Fix panning test for high DPI devices
There is a drag-threshold in the panning code which the tests didn't
account for. This caused the tests to fail when window.devicePixelRatio
was higher than 1.
Samuel Mannehed [Tue, 11 Apr 2017 08:53:06 +0000 (10:53 +0200)]
Properly restore the default style
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.
Samuel Mannehed [Wed, 5 Apr 2017 12:00:59 +0000 (14:00 +0200)]
Always send mouseUp events properly
If down is false we can't just toggle the current internal state, even
though this is correct most of the time. There are cases where we don't
get the down event and thus won't have a correct internal state. For
example, when clicking in the session after using the clipboard
textarea.
If down is false, we always want to send a mouse event with the button
in 'up'-state.
Solly Ross [Wed, 1 Mar 2017 21:26:15 +0000 (16:26 -0500)]
Fix vnc_auto.html
This commit fixes `vnc_auto.html` to work with the new changes.
Note that it is not translated over when `--with-app` is used
on `util/use_require.js`. We'll probably want to deprecate it,
or do some longer-term cleanup.
Solly Ross [Sat, 11 Feb 2017 21:49:03 +0000 (16:49 -0500)]
Optimize ES6 Module Loader Polyfill
This commit makes the ES6 module loader polyfill use Web Workers,
so that Babel doesn't block the browser from animating. It also
uses localStorage to cache the compiled results, only recompiling
on source changes, so it makes loading faster while developing noVNC.
This includes a vendored copy of the ES6 module loader, modified as
described above.
Solly Ross [Sun, 5 Feb 2017 17:34:47 +0000 (12:34 -0500)]
Update tests to work with new structure
This updates the tests to work with the new structure, and removes the
old `utils/run_from_console.js` files in favor of just using Karma
directly. The Karma debug page now displays the normal mocha HTML, so
we can use that instead of the HTML generation functionality of the old
test runner.
Note that PhantomJS does not work at the moment (PhantomJS 1.5 should
make it possible to test on PhantomJS again).
Solly Ross [Sat, 4 Feb 2017 22:40:18 +0000 (17:40 -0500)]
Remove WebUtil.load_scripts
The only remaining user of WebUtil.load_scripts was for loading
localisation. Instead, we now load the localization information
over XHR as a JSON blob.
Solly Ross [Sat, 4 Feb 2017 22:12:00 +0000 (17:12 -0500)]
Allow transforming to any format
This changes around `utils/use_require.js` to be able to generate any
of AMD (RequireJS), CommonJS, SystemJS, or UMD modules. The three
former also include support for translating `vnc.html`, producing a full
"app" version of noVNC.
Solly Ross [Sat, 4 Feb 2017 04:59:44 +0000 (23:59 -0500)]
Use ES6 modules natively via Polyfill
This commit introduces the "Browser ES Module Loader" polyfill
to support developing with native ES6 modules, without any compilation
step (files are passed through Babel in the browser). This should not
be used in production -- a pre-compiled version passed through babel
ahead of time (as produced by the `npm install` hook or
`utils/use_require.js`) should be used instead.
Pierre Ossman [Thu, 23 Feb 2017 15:29:16 +0000 (16:29 +0100)]
Remove 512x512 icon
It is not a launcher icon, but rather used for display on Google
Play. As such it is not needed and removing it mitigates the issue
of some buggy browsers downloading each and every listed icon.
Samuel Mannehed [Thu, 16 Feb 2017 09:43:32 +0000 (10:43 +0100)]
Remove Util.getEventPosition()
It mostly dealt with scrolling which we don't use. It also made mistakes
in some cases. Remove it and compute the coordinates directly in the
calling code.
Pierre Ossman [Tue, 7 Feb 2017 15:09:10 +0000 (16:09 +0100)]
Tweak spinner appearence
Change the look of the "busy" spinner a bit. It's mostly used for
connection stuff, so give it a more data flow feel. Also bling it
up a bit with some fading. Perty sells. :)
Pierre Ossman [Fri, 3 Feb 2017 16:11:39 +0000 (17:11 +0100)]
Don't delay WebSocket flushing
The native WebSocket is in a much better position to do queue
management than us. We also failed to check the return value and
set up a timer, causing stalls.
This gets us in sync with websockify as of 40238b00.
Pierre Ossman [Fri, 3 Feb 2017 12:17:43 +0000 (13:17 +0100)]
Scroll correct element
The element we want scrolling around is noVNC_screen, not the entire
window. This also allows us to compute the screen size without
fiddling the scrollbars on and off.
Pierre Ossman [Fri, 3 Feb 2017 10:43:17 +0000 (11:43 +0100)]
Center canvas (again)
The previous attempt could leave parts of the canvas outside the
document, making it impossible to reach. Use a safer method as
recommended by Mozilla.
Samuel Mannehed [Mon, 23 Jan 2017 11:20:45 +0000 (12:20 +0100)]
Save settings immediately
Retire the old settingsApply. This also allows UI logic to check the
state of things using the settings instead of having to look at the
values of HTML elements (we couldn't be sure if the changes were
applied yet or not).
Pierre Ossman [Wed, 18 Jan 2017 14:59:31 +0000 (15:59 +0100)]
Fix global error handler
It stopped working when we switched to textContent as it relies
on being able to add new HTML elements. Do things properly by
adding new elements via createElement().
Solly Ross [Thu, 12 Jan 2017 16:43:35 +0000 (11:43 -0500)]
Use textContent instead of innerHTML
Previously, setting `innerHTML` was used to display the statuses. These
could include content communicated from the remote VNC server, allowing
the remove VNC server to inject HTML into the noVNC page.
This commit switches all uses of `innerHTML` to use `textContent`, which
is not vulnerable to the HTML injection.