Commit Graph

1775 Commits

Author SHA1 Message Date
Pierre Ossman f7363fd26d Move keyboard handling in to Keyboard class
Replace the multi stage pipeline system with something simpler.
That level of abstraction is not needed.
2017-05-04 12:13:47 +02:00
Pierre Ossman 9e6f71cb75 Remove modifier synchronisation
The fields provided cannot tell us if it is the left or right
version of the key that's pressed, so they are inherently unreliable.
It is also not a huge problem in practice as we'll get in sync on
the next press or release of the modifier.
2017-05-04 12:13:47 +02:00
Pierre Ossman a784a9cabc Remove QEMU key event handler
The normal event handler provides all the necessary information
now, so it is no longer needed.
2017-05-04 12:13:47 +02:00
Pierre Ossman d0703d1bde Simplify keyboard event API
No need for an object for three static fields.
2017-05-04 12:13:47 +02:00
Pierre Ossman 94f5cf05f3 Send keyboard events from single place
This makes it easier to handle any needed variations, like different
types of messages.
2017-05-04 12:13:47 +02:00
Pierre Ossman f714f7deae Improve lookup of special keys
Look up keys that are independent of layout and state first,
followed by keys that are only mild variations in layouts.
This is more robust as there might be multiple physical keys
generating the same symbols, and Keysyms don't map directly to
Unicode in all cases.

At the same time switch over to using the modern, standardised
'code' field for lookup.
2017-05-04 12:13:47 +02:00
Pierre Ossman bfa1b237b9 Improve character keysym lookup
Use the more modern 'key' field, and remove some legacy fallbacks
that are no longer required. This also removes the "stall" mechanism
as it is not needed with current browsers.
2017-05-04 12:13:47 +02:00
Pierre Ossman 80cb8ffddd Use standard DOM identifiers for physical keys 2017-05-04 12:13:45 +02:00
Samuel Mannehed 1c5702b0b5 Merge pull request #817 from univention/master
Remove double unescaping of title
2017-05-03 13:57:23 +02:00
Philipp Hahn 08cd672e40 Remove double unescaping of title
Commit fa5b334dcb by Joel Martin changed
getQueryVal() to always decode the value using decodeURIComponent(), but
unescape() is still used for extracting the title, leading to
double-unescaping.

As unescape() is deprecated anyway, remove the last user.

Cc: Joel Martin <github@martintribe.org>
Cc: Anthony Young <sleepsonthefloor@gmail.com>
2017-05-03 12:24:41 +02:00
Pierre Ossman 36bdf13654 Only load ES6 module loader polyfill if needed
Safari now has native support for modules, so we need to make sure
we only load our polyfill when actually needed.
2017-04-28 14:44:00 +02:00
Samuel Mannehed 0613d18894 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.
2017-04-21 15:23:18 +02:00
Samuel Mannehed e4290d8c00 Add Pierre as contributor in package.json 2017-04-19 15:34:16 +02:00
Samuel Mannehed 101ff12736 Update url's 2017-04-19 15:33:42 +02:00
Samuel Mannehed 41c958d450 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.
2017-04-11 10:57:21 +02:00
Soichi Hayashi dd44a8ead8 Fixed the issue where novnc can't be relocated 2017-04-05 16:09:50 +02:00
Samuel Mannehed 270bdbd7fb 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.
2017-04-05 14:00:59 +02:00
Samuel Mannehed f4ae0a1402 Merge pull request #801 from CendioOssman/errors
Improve fallback error handler
2017-04-03 08:18:48 +02:00
Pierre Ossman f7c620d34e Generate source map for ES module loader rollup
Makes it easier to debug things as you get the original source and
proper line numbers.
2017-03-27 16:30:08 +02:00
Pierre Ossman 36efb9783c Handle uncaught WebWorker exceptions 2017-03-27 16:29:38 +02:00
Pierre Ossman 5d00fd9bf0 Try to populate error location on Promise errors 2017-03-27 16:29:38 +02:00
Pierre Ossman 999b5da753 Only use unhandledrejection fallback when needed 2017-03-27 16:29:38 +02:00
Pierre Ossman 36653517a5 Use common code to handle Promise errors 2017-03-27 16:29:38 +02:00
Pierre Ossman 732233eda0 Handle partial error location information
We might not get line or column number, but the file is still
useful information.
2017-03-27 16:29:38 +02:00
Pierre Ossman 5da03103a3 ErrorEvent.error isn't always set
It's not just a matter of the browser lacking support.
2017-03-27 16:29:38 +02:00
Pierre Ossman 13c558e3a0 Limit fallback error width to window width
Change the layout a bit to make sure the entire message can be read.
2017-03-27 16:29:38 +02:00
Pierre Ossman c361080be8 Use monospace font for unhandled errors
The browsers uses crude layout formatting that expects this.
2017-03-27 16:29:38 +02:00
Solly Ross 5abbdf5a51 Merge pull request #738 from patrakov/master
Changed the default compression level to 2
2017-03-24 17:40:15 -07:00
Pierre Ossman a5c8a755e8 Hide internal keyboard functions
These may change and are not part of a stable API.

This also reindents the object functions to make sure they can
access private functions.
2017-03-24 11:53:16 +01:00
Pierre Ossman 0a865e15ff Remove character substitution
We can handle any Unicode codepoint now, so stop replacing symbols.
2017-03-24 11:35:36 +01:00
Pierre Ossman 278a5e7fbd Simplify keysymdef.js
Some Unicode to Keysym mappings can be computed and can therefore
be left out of the huge lookup table.
2017-03-24 11:31:38 +01:00
Pierre Ossman 041568bd31 Clean up keysymdef 2017-03-24 11:26:02 +01:00
Pierre Ossman 524d67f283 Remove keysym names from keysymdef.js
They were incomplete and turned off in most cases so they served
little use besides adding complexity.
2017-03-24 11:16:53 +01:00
Pierre Ossman 9076defaca Get parse.js in sync with generated code
The generated keysymdef.js was recently converted to ES modules,
but the generating script was overlooked.
2017-03-24 10:49:00 +01:00
Pierre Ossman 7e19216368 Define an initial shadow for spinner
IE and Edge refuse to animate attributes that weren't present in
the static definition.
2017-03-23 17:53:09 +01:00
Solly Ross dd7068984d Merge pull request #774 from novnc/refactor/es6-module-loader
[Refactor] ES6 Modules
2017-03-22 15:28:13 -07:00
Solly Ross d6c17390f0 Make vnc_playback.html functional once more
This commit makes vnc_playback.html functional once more, and completely
refactors tests/playback.js to make it usable in other scenarios.

In order for vnc_playback.js to properly load playback files now, they
must `export` their variables.
2017-03-21 17:39:07 -04:00
Solly Ross 7569cdc21e 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.
2017-03-21 17:39:07 -04:00
Solly Ross 152c399513 Vendor in an IE11 polyfill for Promises
This commit introduces a polyfill to add support for Promises in IE11.
This means IE11 can be tested without first running
`utils/as_require.js`.
2017-03-21 17:39:07 -04:00
Solly Ross adfc9d3f54 Move error handler into separate file
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)
2017-03-21 17:39:07 -04:00
Solly Ross e6a8eb15ca Only apply settings with an RFB object
We should only apply settings if we have an RFB object available.
Some of the settings handlers didn't respect this, but do now.
2017-03-21 17:39:07 -04:00
Solly Ross b4ff032e20 Fix view_only clipboard handling
We need to actually consume the clipboard event message,
even if we don't act on it.
2017-03-21 17:39:07 -04:00
Solly Ross c53af3f5f6 Move scripts in vnc.html head
This commit moves the vnc.html scripts into head.
2017-03-21 17:39:07 -04:00
Solly Ross 399fa2ee2d 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.
2017-03-21 17:39:07 -04:00
Solly Ross e25f9c4010 Use transition animation while loading
This shows the transition animation while loading, so users can see
something is going on.
2017-03-21 17:39:07 -04:00
Solly Ross dfae3209eb 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).
2017-03-21 17:39:07 -04:00
Solly Ross 6d6f0db0da Refactor ES6 module structure/split up Util
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.
2017-03-21 17:39:05 -04:00
Solly Ross 6e744119f8 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.
2017-03-07 11:11:29 -05:00
Solly Ross 2a7c6d20ab Load translations over XHR
This commit causes translations to be loaded over XHR instead of
the import system.
2017-03-07 11:11:29 -05:00
Solly Ross bc35b1d27e Remove WebUtil.dirObj
`WebUtil.dirObj` wasn't being used anywhere, so this removes it.
2017-03-07 11:11:29 -05:00