Commit Graph

1811 Commits

Author SHA1 Message Date
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
Solly Ross 6cae7b58b8 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.
2017-03-07 11:11:28 -05:00
Pierre Ossman 83250a6aa6 Use PNG for mouse cursors
The browsers' support for Microsoft's cursor format is a bit spotty,
so use the more common PNG format instead. This also allows us to
use a Canvas to generate the image, rather than coding it by hand.
2017-03-06 16:29:27 +01:00
Solly Ross 4faaf43176 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.
2017-03-01 11:21:34 -05:00
Solly Ross fba220c6fc Vendor an ES6-modules-compatible Pako
This commit vendors a converted, stripped-down version of Pako which
uses ES6 modules instead of CommonJS modules.
2017-03-01 11:21:32 -05:00
Solly Ross 3ae0bb0968 Uncomment ES6 module syntax
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.
2017-02-26 16:30:37 -05:00
Solly Ross d55e454582 Fix typos in imports and i18n
`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.
2017-02-26 16:30:37 -05:00
Samuel Mannehed b56d975248 Merge branch 'settingswhileconnected' of https://github.com/samhed/noVNC
Closes pull request #778
2017-02-24 15:42:27 +01:00
Samuel Mannehed 7a005a1b18 Merge branch 'disableLabels' of https://github.com/samhed/noVNC
Closes pull request #776
2017-02-24 15:13:09 +01:00
Pierre Ossman 6e8a8c8df1 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.
2017-02-23 16:29:16 +01:00
Pierre Ossman 90ecc739df Protect against race in setCapture() polyfill
It might take a long time for a timer to fire, long enough for a
new grab to be initiated. Clearing out the capture element would
then cause a crash.
2017-02-23 14:26:50 +01:00
Samuel Mannehed 24584cca89 Disable labels for settings as well
Makes the settings UI easier to read.
2017-02-21 11:58:03 +01:00
Samuel Mannehed 6c857dc50c Set input type number for port & reconnect_delay 2017-02-21 11:57:24 +01:00
Pierre Ossman a7ca8e5c1a Fix wrong colours on local cursor
The RGB order was backwards compared to the pixel format we've
requested, resulting in the red and blue channels getting swapped.
2017-02-20 16:44:54 +01:00
Samuel Mannehed fb49f91b00 Allow local cursor to be changed while connected 2017-02-19 01:53:41 +01:00