Commit Graph

280 Commits

Author SHA1 Message Date
Pierre Ossman a80aa41628 Change clippingDisplay() to a property
It fits much better as a property given that it only tells what the
current state of things are.
2017-11-09 13:13:41 +01:00
Pierre Ossman 15a6269510 Remove some unused return values 2017-11-09 13:13:41 +01:00
Pierre Ossman 747b462337 Use standard JavaScript properties
Use normal properties with JavaScript setters and getters instead of
our homegrown stuff.

This also changes the properties to follow normal naming conventions.
2017-11-09 13:03:32 +01:00
Pierre Ossman fdff59eeb4 Move cursor URI check to RFB object
Keeps the Display object simpler, and avoids having to abuse a
property to transfer the information.
2017-11-09 12:52:05 +01:00
Pierre Ossman 134ec26ee0 Remove non-JavaScript render code
It wasn't used anyway so simplify things.
2017-11-09 12:52:05 +01:00
Pierre Ossman 656858a6d6 Remove render_mode property
It can only have a single value these days, so it is no longer
useful.
2017-11-09 12:52:05 +01:00
Pierre Ossman 3d7bb02036 Change some attributes to arguments
Some attributes are better suited as arguments, primarily because they
are associated with a specific method and cannot be changed later.
2017-11-09 12:52:05 +01:00
Pierre Ossman dd0db4d460 Allow omitting configuration for properties 2017-11-09 12:52:05 +01:00
Pierre Ossman ebf1c0f991 Always include ID marker in repeater protocol
This makes sure we're always following the protocol, and the caller
doesn't have to care about the details.
2017-11-09 12:52:05 +01:00
Pierre Ossman f8318361b1 Remove wsProtocols setting
It isn't in use anymore since we deprecated support for Base64 mode.
2017-11-09 12:52:05 +01:00
Pierre Ossman 5b4e5d016e Switch to URL for connect()
This is more in line with how other JavaScript APIs work.
2017-11-09 12:52:05 +01:00
Pierre Ossman c7d08d721f Tidy up variable initialisation
Sort things by category, and organise everything in the same place.
We don't support reuse of RFB objects so we can safely init everything
in the constructor.
2017-11-09 12:52:05 +01:00
Pierre Ossman 30691b668e Remove onFBU* callbacks
They are internal mechanisms that callers should be isolated from.
2017-11-09 12:52:03 +01:00
Pierre Ossman 832be2625b Add resize as a capability
Makes the API more transparent than piggybacking on completion
of the first framebuffer update.
2017-11-09 12:51:15 +01:00
Pierre Ossman cd523e8f28 Make power API generic
Decouple it from XVP and make it a generic API.
2017-11-09 12:47:21 +01:00
Pierre Ossman 85b35fc0cc Add proper protocol encoder for XVP messages 2017-11-09 12:45:08 +01:00
Pierre Ossman 430f00d6fe Allow other credentials than just password
Makes the XVP authentication mechanism more general.
2017-11-09 12:45:05 +01:00
Pierre Ossman 1d6ff4a3e9 Improved focus handling on touch input field
The previous method of retaining focus didn't work reliably when
the RFB object tried to move the focus to the canvas. Add a setting
to control "focus on click" behaviour instead of letting them try
to fight it out.
2017-11-02 15:30:36 +01:00
Pierre Ossman 233c8b6a53 Hide keyboard object from RFB callers 2017-10-27 13:58:12 +02:00
Pierre Ossman f976b5500e Hide mouse object from RFB callers 2017-10-27 13:58:12 +02:00
Pierre Ossman b9854a5ca5 Hide display object from RFB callers 2017-10-27 13:58:11 +02:00
Pierre Ossman 458086177c Let RFB object make sure canvas can have focus
Let's set up things properly ourselves instead of forcing everyone
to create their canvas element just like we want it.
2017-10-18 17:01:34 +02:00
Pierre Ossman 4c11755ce7 Merge branch 'focus' of https://github.com/CendioOssman/noVNC 2017-10-18 15:12:46 +02:00
Pierre Ossman 2afda54456 Only grab key events on canvas
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.
2017-10-18 15:07:17 +02:00
Samuel Mannehed abfe5b7a37 Wait for challenge before asking for password
Fixes #928.
2017-10-16 15:39:10 +02:00
Samuel Mannehed cd23036314 Fix missing semicolons
Was missing in commit 49a8183757
2017-10-12 12:42:16 +02:00
Samuel Mannehed 4a818a7ddd Merge pull request #893 from CendioOssman/amt
Basic support for Intel AMT
2017-10-05 16:59:53 +02:00
Pierre Ossman 8290d3f271 Merge branch 'optional-port' of https://github.com/bkylerussell/noVNC 2017-09-29 16:26:02 +02:00
Pierre Ossman 5a5f5ada58 Basic support for Intel AMT
This restores basic support for Intel AMT servers. They refuse clients
that request more than 16 bits per pixels, so implement a fallback
in just the "Raw" encoding.
2017-09-22 15:17:56 +02:00
Pierre Ossman cd74793b44 Always hide local cursor initally
We don't know if the server will support a client side cursor, so
we have to assume a server side one to start with.
2017-09-22 15:17:56 +02:00
Pierre Ossman c7c6cb196d Remove rect arguments onFBUComplete callback
This callback is for an entire FBU, so it's not really relevant
to include info about just a single of the included rects.
2017-09-22 15:17:56 +02:00
Pierre Ossman 49a8183757 Clean up encoding handling
Allow things to be more explicit and dynamic. Makes it easier to read
and allows us to have more flexible selection of encodings in the future.
2017-09-22 15:17:56 +02:00
Samuel Mannehed 28b004fd70 Combine small mouse wheel events
The VNC protocol can't handle different deltas or speeds for a mouse
wheel event. When using a device that sends a lot of small mouse wheel
events, instead of fewer larger steps, the effect was that mouse wheel
scrolling was way to sensitive.
This patch looks at the delta of wheel events and doesn't send events
until the combined delta has passed a threshold. Single events that
doesn't pass the threshold get sent after a timeout in order to not
loose any events.

Fixes #577.
2017-09-17 18:23:57 +02:00
Samuel Mannehed c1e2785fb6 Split devices.js into keyboard.js and mouse.js 2017-09-17 18:23:57 +02:00
Pierre Ossman c338622719 Build encoding stats array dynamically
Avoids having to hard code which encodings we might see.
2017-09-07 17:18:25 +02:00
Pierre Ossman f8ec2df2bb Add helper for encoding enumeration and names 2017-09-07 17:18:25 +02:00
Pierre Ossman 3e8b26ab58 Remove unused encoding handlers
These should never be sent by a server, so we don't need handlers
for them.
2017-09-07 17:18:25 +02:00
Pierre Ossman bc86b63c24 Remove unused helper for Tight encoding
It's already been inlined where used.
2017-09-07 17:18:25 +02:00
Pierre Ossman 910fd3afc9 Fix handling of ExtendedDesktopSize errors 2017-09-07 17:18:25 +02:00
Pierre Ossman 91d5c62589 Merge resize handling to single method
It also fits better in the core RFB object rather than as a helper
for the encoding handlers.
2017-09-07 17:18:25 +02:00
Pierre Ossman 1678bf860f Stop hiding exceptions in WebSock class
Let them application decide how to deal with such things and do not
enforce this particular model, which easily hides bugs.
2017-09-07 17:18:25 +02:00
shaneharris b5c982ea42 fix typscript error - the only one. (#837)
* fix typscript error TypeScript error: novnc/core/rfb.js(1012,17): Error TS7027: Unreachable code detected.

* Update rfb.js
2017-08-05 02:29:50 +02:00
Pierre Ossman be70fe0a3d Only send QEMU Extended Key Event if we have a scan code
Servers will assume that a scan code is present if this message type
is used, so fall back to the standard key event message if we don't
know the scan code.
2017-07-07 15:06:13 +02:00
Pierre Ossman 4093c37f28 Ignore compositing key
keyCode 229 is commonly used with virtual keyboards when the
system cannot map things to a specific key. As such we should
treat it as 'Unidentified'.
2017-07-07 15:04:44 +02:00
Pierre Ossman 8f8c1803ff Merge branch 'qemufix' of https://github.com/CendioOssman/noVNC 2017-07-06 13:07:19 +02:00
Pierre Ossman 2bf4cf5a20 try/catch guard for QEMU keyboard test
Safari on older iOS doesn't support creating KeyboardEvent objects,
so put a guard in to avoid crashes.
2017-07-06 13:00:00 +02:00
Pierre Ossman 7cac5c8e9f Fallback for missing keypress events
IE and Edge have some corner cases (e.g. Ctrl+key) where we get
insufficient information in the keydown event, and we never get
a keypress event. Try to make a guess of the key in those cases.
2017-07-06 13:00:00 +02:00
Pierre Ossman 7e79dfe425 Track keys using keyIdentifier
This is necessary on older iOS where code isn't provided.
2017-07-06 13:00:00 +02:00
Pierre Ossman e7c4d669f0 Handle iOS special keys 2017-06-21 14:02:24 +02:00
Pierre Ossman 9e99ce126c Fake key release for iOS hardware keyboards
iOS sends decent key down events, but junk key up events when a
hardware keyboard is used. This confuses the key tracking as a
corresponding release is then never detected. To work around this
we'll treat the hardware keyboard like the virtual ones and send
the key release right away.
2017-06-21 13:58:53 +02:00
Pierre Ossman 858ea4a774 Avoid use of 'let' and 'const'
They are not supported on older browsers, e.g. iOS 9.
2017-06-02 15:41:37 +02:00
Pierre Ossman 844e983916 Limit use of keypress fallback
It was preventing key events for dead keys, so try to reduce it to
only cases where we must use it.
2017-06-02 14:38:16 +02:00
Pierre Ossman 459ed0083f Allow key events without symbols
They can still be useful if the server makes use of the keycode instead.
2017-06-02 14:37:36 +02:00
Pierre Ossman dfa7826d72 Get XT scan code mappings from the keycodemapdb project
This way we can work together with other projects that need this kind
of mapping.
2017-05-31 16:20:24 +02:00
Samuel Mannehed afb621d577 Add missing semicolon 2017-05-13 01:56:35 +02:00
Samuel Mannehed 333ad45c70 Don't capture touch events
They are implicitly captured anyway, and we get problems if we try
to explicitly capture them.
2017-05-11 13:34:43 +02:00
Samuel Mannehed 4f1c81dca9 Stop tracking mouse capture state
Was a workaround for other bugs which are now fixed.
2017-05-11 13:30:40 +02:00
Samuel Mannehed cb568ece8b Stop grabbing mouse events globally
Not necessary anymore since we have proper capture.
2017-05-11 13:27:10 +02:00
Pierre Ossman 26586b9ddf Remove colour map support
It was broken and unused. Remove it so we can simplify the code.
2017-05-04 15:13:33 +02:00
Pierre Ossman fb7e99e84b Remove browser engine detection
It is out of date and not used anyway.
2017-05-04 14:52:05 +02:00
Pierre Ossman 38170d2442 Merge branch 'png_cursor' of https://github.com/CendioOssman/noVNC 2017-05-04 13:13:02 +02:00
Pierre Ossman 545442afc3 Merge branch 'keyboard' of https://github.com/CendioOssman/noVNC 2017-05-04 12:18:55 +02:00
Pierre Ossman 9782d4a324 Use KeyboardEvent.key too look up keysyms
And emulate it on browsers where it is missing or incorrect. This
makes the code more future oriented as it primarily uses the standardised
fields.
2017-05-04 12:13:48 +02:00
Pierre Ossman 634cc1ba46 Handle CapsLock on macOS
Modifiers behave a bit oddly on macOS, causing weird CapsLock events
to be sent by the browsers.
2017-05-04 12:13:48 +02:00
Pierre Ossman bf43c26319 Clean up AltGraph handling
It doesn't need to be this general as the issue is mostly about
Windows. Also use the same modifier shuffle that RealVNC and
TigerVNC uses to get macOS working well.
2017-05-04 12:13:48 +02:00
Pierre Ossman ae82053366 Simplify pressed key handling
Prefer avoid having the server simulate multiple key presses by
refusing to use multiple keysyms for the same physical key.
2017-05-04 12:13:47 +02:00
Pierre Ossman 9fce233d51 Simplify handling of keypress
Use a dedicated variable to track a two stage key rather than
piggy-backing on the key state array.
2017-05-04 12:13:47 +02:00
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 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
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
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
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 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
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 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 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
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
Samuel Mannehed ef1e8bab22 Allow view_only to be changed while connected 2017-02-19 01:53:41 +01:00
Samuel Mannehed f78a652e86 Don't send or recieve clipboard in view_only 2017-02-18 20:39:57 +01:00
Samuel Mannehed c3325dc6f7 Fix translateDOM for placeholders
Replaced 'in' with a comma, like in the surrounding code.
2017-02-17 12:45:54 +01:00
Samuel Mannehed 280676c7e9 Properly encapsulate the scale in Display
Other parts of the code shouldn't have to care about this. Let Display
convert between canvas coordinates and framebuffer coordinates.
2017-02-16 14:00:39 +01:00
Samuel Mannehed 8cbf1dd9d2 Set correct cursor style for setCapture() 2017-02-16 14:00:36 +01:00
Samuel Mannehed 10d1ecc118 Remove return value from event handlers
It's not used in modern event handlers.
2017-02-16 13:59:34 +01:00
Samuel Mannehed a0e3ec0ae6 Stop using window.event
It's an old propriatary IE thing that isn't necessary.
2017-02-16 13:59:34 +01:00
Samuel Mannehed af1b2ae1e5 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.
2017-02-16 13:59:34 +01:00
Samuel Mannehed b69dda9b19 Clean up some mouse workarounds
Adds comments that clarifies why they are needed. Also narrows the
handler for contextmenu a bit.
2017-02-16 13:59:34 +01:00
Samuel Mannehed 1658466579 Improve setCapture polyfill
Fix some corner cases.

Fixes issue #773
2017-02-16 13:59:22 +01:00
Pierre Ossman 0ee5ca6ebe Fix tests after changing auth negotiation
PhantomJS has a very basic implementation of Uint8Array, so we
need to help it out a bit.
2017-02-13 15:00:32 +01:00
Pierre Ossman 95533c579e Better selection of auth type
If no authentication is required then we should pick the None
option to avoid bothering the user.
2017-02-13 13:58:10 +01:00
Pierre Ossman 6ffdfd3aa7 Improve check for when to ignore mouse events
The browser tells us which element was under the cursor, so we don't
have to calculate it ourselves.
2017-02-09 16:02:58 +01:00
Pierre Ossman 86d15a4929 Use setCapture() polyfill everywhere
This makes sure we get consistent behaviour across all browsers.
2017-02-09 15:51:22 +01:00
Pierre Ossman d314d2c226 Merge branch 'util-console' of https://github.com/tghw/noVNC 2017-02-07 16:37:58 +01:00
Pierre Ossman d2467189f5 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.
2017-02-03 17:12:41 +01:00
Pierre Ossman 2e6a58fb15 Avoid changing scale unless necessary
It causes the browser to redo the layout needlessly otherwise,
having annoying effects like moving the scroll position.
2017-02-03 12:00:13 +01:00
Pierre Ossman a6e52f9a73 Merge display scale changes 2017-02-03 11:56:02 +01:00
Samuel Mannehed 3e08594c89 Fix rfb._cleanup() (#743)
We don't have to check for _display or context here since this is a
private function which is never called under such circumstances. This
solves problems caused by display.get_context() which was previously
removed in e549ae074f.
2017-01-09 12:49:10 +01:00
Alexander E. Patrakov a124c8eab2 Changed the default compression level to 2
The old default was to ask for the maximum compression level. This
is against the recommendations in libvncserver/tight.c due to excessive
CPU load. It also causes Vino 3.8.1 (still shipped with Ubuntu 16.04
LTS) to prefer the blurry JPEG compression too much - e.g. red text on
the default background in MATE terminal becomes almost unreadable.

The new default is the recommended compression level for low-color
workloads, according to libvncserver source. Also, it is the maximum
compression level that doesn't trigger the Vino bug with red text in
most cases.

Fixes issue #737.
2016-12-29 18:22:31 +05:00
Lee-Feng 558544364c Fix no auth "this._updateState" bug
Fixes #735
2016-12-20 08:37:31 +01:00
Samuel Mannehed c01b2f0259 Merge pull request #699 from CendioOssman/double
Display double buffering
2016-12-13 12:42:22 +01:00
Pierre Ossman adf345fdc4 Clean up viewport handling
Make sure the viewport is properly updated when necessary, on respects
given restrictions.
2016-12-09 09:20:50 +01:00
Pierre Ossman 3f781f2aa3 Remove max dimension handling
The viewport handling is now a lot clearer, so simply limit the size
of the viewport in the caller rather than having this extra layer
of checks.
2016-12-09 09:20:50 +01:00
Pierre Ossman e549ae074f Prevent access to sensitive display variables
These should not be directly accessed. Instead use drawing operation
and Display.resize().
2016-12-09 09:20:50 +01:00
Pierre Ossman 84cd0e719e Double buffering damage tracking
Optimise the copy from the hidden canvas to the visible one a bit
by only copying the modified area.
2016-12-09 09:20:50 +01:00
Pierre Ossman 2ba767a7fe Use double buffering for the display
Do all rendering to a hidden canvas and then copy over the finished
frame to the visible canvas once everything is done. This simplifies
things and solves some bugs as we can retain a copy of the entire
frame buffer.
2016-12-09 09:20:50 +01:00
Pierre Ossman 74e390512d Remove blitStringImage() in favour of imageRect()
The latter is more generic and can easily be modified for other
mechanisms in the future.
2016-12-09 09:20:50 +01:00
Kyle Russell 1a50f6809f rfb: Allow port to be optionally appended to URI
Supports server configurations that might prefer wss:// connections
on the default port, then proxies them through the web server to the
VNC server.

This proxy configuration is helpful on servers using self-signed
certificates.  Accessing the https://host/vnc_auto.html page and
adding an exception for that host is sufficient to also satisfy the
wss://host/ request, unlike requests to wss://host:port/ which
may require an extra certificate exception.
2016-11-24 06:14:31 -06:00
Samuel Mannehed f5bf2d84ef Merge pull request #718 from ossman/po
Use gettext .po files, and translate everything
2016-11-22 21:02:13 +01:00
Pierre Ossman edffd9e2f8 Also translate HTML elements 2016-11-19 13:23:00 +01:00
Samuel Mannehed 9964ab0e8e Add a space in logging of RFB._fail() 2016-11-18 10:30:40 +01:00
Pierre Ossman 3cdc603aa4 Use gettext .po files for translations
This allows the same workflow as most other projects for translations.
2016-11-17 20:42:08 +01:00
Pierre Ossman 45729def6d Restore translations for some strings
We lost the translation calls for a couple of strings in one of
the clenaups.
2016-11-17 19:58:10 +01:00
Pierre Ossman f28e248d3f Use _() as shorthand for translations
Used commonly when gettext is used for translations. Avoids cluttering
the code.
2016-11-17 19:58:10 +01:00
Samuel Mannehed 67cd2072ab Allow specifying details when calling RFB._fail()
RFB's _fail function logs the error, disconnects the session and sets
disconnect_reason. The disconnect_reason is upon disconnection sent to
the user interface. It is thus not suitable for including error details
that aren't user friendly. The idea is that you will look in the
browser console for a full log with details of the error.
2016-11-10 15:17:37 +01:00
Samuel Mannehed 9f909d9b46 Don't wait for websocket closes on failure
RFB._fail() can be called at any time in any state, it is not certain
that we will get a close event on the socket since the socket might not
be open. This caused us to hit the disconnect timeout in such cases.

Fixes issue #678
2016-11-10 15:17:37 +01:00
Samuel Mannehed b2e961d48d Ensure proper connection state transitions
Makes the state machine more rubust and clear.
2016-11-10 15:17:31 +01:00
Samuel Mannehed b45905ab86 Handle server-side disconnections
Don't handle socket-close events when connected as errors. You could
for example, in the VNC session run 'vncconfig -disconnect'.
2016-11-10 14:33:29 +01:00
Samuel Mannehed e48d1b254e Separate state actions from connection actions 2016-11-10 14:33:29 +01:00
Samuel Mannehed c4b274ebb8 Move disconnect actions to a separate funciton
Done in order to be consistent with connect() and to separate state
actions from connection actions.
2016-11-10 14:33:29 +01:00
Samuel Mannehed 376864d6d1 Handle errors while opening a Websocket
For example, previously if the user typed in illegal characters in the
port field, no error would be displayed in the interface and the page
would stop at "connecting".
2016-11-10 14:33:29 +01:00
Samuel Mannehed b2cf3b68b3 requestDesktopSize() should always return a value 2016-11-10 14:33:23 +01:00
Samuel Mannehed b85a13de69 Merge pull request #689 from ossman/keysym
Don't send Unicode as keysym
2016-11-10 09:36:43 +01:00
Giannis Kosmas b98b2f813d Added Greek translation 2016-10-28 21:22:25 +03:00
Samuel Mannehed 9e26112d1a Ensure translations variable is set before use 2016-10-28 18:40:56 +02:00
Samuel Mannehed a4fc1fa586 Add Swedish translation 2016-10-28 15:41:08 +02:00
Samuel Mannehed fdb02f8570 Always translate literals instead of variables
Makes it much easier to find what needs to be translated.
2016-10-28 15:41:08 +02:00
Samuel Mannehed da88c28714 Remove unnecessary whitespace 2016-10-28 15:41:08 +02:00
Samuel Mannehed a93cda3a36 Move app-specific location of language files
The core directory should only contain core API code that isn't
specific to an application.
2016-10-28 14:30:14 +02:00
Loek Janssen 5af39a878a Added localization to statusbar 2016-10-28 12:40:28 +02:00
Pierre Ossman d9ca5e5b6b Don't allow more than one pending update 2016-10-24 14:42:45 +02:00
Pierre Ossman bb6965f2e6 Wait for proper image load event
There is a specific event for when an image has finished loading,
so trigger on that rather than polling. The polling interval of
requestAnimationFrame() can also be very large.
2016-10-24 14:42:13 +02:00
Pierre Ossman 1578fa68ac Hide image handling in display object
The callers don't need to concern themselves with how images are
rendered, so hide the details behind the API. This also avoids
exposing the render queue.
2016-10-24 14:42:13 +02:00
Pierre Ossman 9535539bb2 Process entire WebSocket message at once
setTimeout() causes too much delay to be useful. Also, we
already handle all rects in a message at once, so this shouldn't
be too much of a change.
2016-10-24 14:42:08 +02:00