Commit Graph

1775 Commits

Author SHA1 Message Date
samhed a49d929846 Harmonise CSS names
Follow the same naming convention for all CSS ids and classes.
2016-09-20 15:36:38 +02:00
Pierre Ossman e40978c7fc Let CSS control what it means to be hidden/closed
This avoids hard-coding layout information in the JavaScript code.
It also opens up possibilities for more control in the CSS, e.g. for
animation.
2016-09-20 14:32:57 +02:00
Pierre Ossman 6cba147d4e Simplify modifier button display 2016-09-19 16:27:55 +02:00
samhed 999f1d45db Show/hide logo in updateVisualState()
We control the visibility of almost everything else in this function,
so move the logo handling there as well.
2016-09-19 16:26:23 +02:00
samhed eeb395dc91 Remove unnecessary span:s
They were probably also incorrect to have around block elements
anyway.
2016-09-19 16:24:39 +02:00
samhed 286947cbe2 Fix name for panel CSS class 2016-09-19 16:24:39 +02:00
samhed f9fff03719 Remove unused description 2016-09-19 16:24:39 +02:00
samhed f0d9ab9698 Avoid ambigious optional arguments
Some functions weren't obvious what they would do if an argument was
omitted. Split them up in to separate functions in those cases to
make the API clearer.
2016-09-19 16:19:45 +02:00
Pierre Ossman 3e3eec28f3 Remove beforeunload handler
Support for this is spotty and it is getting more and more restricted
by the day. Give up on this approach.
2016-09-19 16:16:32 +02:00
samhed 0f6af1e3ec Separate UI.start() in to sub-functions 2016-09-19 16:16:05 +02:00
samhed d7f790719a Add events to objects the modern way
The old way only allows a single event handler per event, so switch
over everything to the new model.
2016-09-19 15:58:21 +02:00
samhed bfa414e5e8 Remove unused event handlers
These do not work and the mechanism for releasing keyboard grab on
the settings panel needs more work.
2016-09-19 15:40:10 +02:00
samhed 17eb0fcf50 Trigger autoconnect at proper time
It needs to happen after everything is fully initialised.
2016-09-19 15:30:40 +02:00
samhed 2869308c80 Sort style sheet
Sort and group the entries in the style sheet the same way as in
the HTML document. Makes it easier to find things.
2016-09-19 15:30:40 +02:00
samhed 3911256cff Place related elements together
In order to clarify the HTML we group related panels together with
the corresponding buttons.
2016-09-19 15:27:21 +02:00
samhed 9fc0e4f6e3 Strict positioning of panels
The panels were never meant to be positioned relative their container,
so make sure they pop up exactly where we want in the viewport, no
matter where they are in the structure.
2016-09-19 15:21:24 +02:00
samhed 222f3fba08 Remove unused CSS 2016-09-19 15:21:24 +02:00
Pierre Ossman ecd49c159f Create separate style sheet for vnc_auto.html
The style sheet is intimately connected to the Javascript code and
HTML so trying to share it between both sets is not sensible.
2016-09-19 15:21:24 +02:00
Dmitry Sankevich 33e1462999 Fix TIGHT negotiation with zero sub-auth types
According to the RFB protocol, when in TIGHT auth negotation,
if the client receives a sub-auth count of zero, it should proceed
as if the `None` sub-auth type had already been selected (and not
send a message selecting that type).

Closes #564
2016-09-16 23:22:35 -04:00
Solly Ross f9a0404f51 Merge pull request #661 from kanaka/feature/realvnc5-version-number
Detect RealVNC's VNC 5.0 Protocol Version
2016-09-16 17:50:04 -04:00
Lars Ole Hurlen 49aa5b81c7 Detect RealVNC's RFB 5.0 Protocol Version
The RFB protocol specifies a max version of 3.8, but RealVNC likes to
increment their version when they add new features.  RealVNC 5.3 sends
"005.000" as the version string, since they've extended their
implementation upon RFB v3.8.  We can detect that, and just tell them we
only speak 3.8, instead of barfing on "005.000" as an invalid version.
2016-09-16 17:33:46 -04:00
Solly Ross 9dfbf44028 Merge pull request #603 from WardF/master
Added option for --ssl-only noVNC session to launch.sh
2016-09-16 17:16:43 -04:00
Solly Ross 386db8f54f Merge pull request #496 from kanaka/refactor/modularized
Enable noVNC to become Browserifiable
2016-09-16 16:16:09 -04:00
Solly Ross bd5340c7ee Move input-related files into core/input
This commit moves all the input-related files from `core/`
to `core/input/`, and renames a couple as relevant
(input.js --> input/devices.js, keyboard.js --> input/util.js).
2016-09-16 15:49:52 -04:00
Solly Ross b4ef49ea36 Remove unecessary event-related code from Util
The event-related wrapper functions in Util existed mainly for
backwards-compat.  However, all currently supported browsers
support the standard functions, so these wrappers are no longer needed.
2016-09-16 15:49:52 -04:00
Solly Ross e4fef7be2d Util shouldn't modify window object
This commits prevents Util from modifying the window object.

- `window.requestAnimFrame` was removed (no polyfill is needed anymore)
- the potential redefinition of `console.log` and friends was removed
  (all supported browsers have `console.xyz` defined anyway)
2016-09-16 15:49:52 -04:00
Solly Ross 9eca6889be Switch to PhantomJS 2.x for testing
This commit switches over to use PhantomJS 2.x, bringing in a whole host
of improvements (including `Function#bind`, so we can remove the
`Function#bind` shim in core/util.js).
2016-09-16 15:49:52 -04:00
Solly Ross 3949a09534 Don't modify Array prototype
This commit removes our modification of the Array prototype.
It wasn't actually used much in the main code, anyway, and it's a
bad practice to modify built-in prototypes.
2016-09-16 15:49:52 -04:00
Solly Ross 72bdd06ea2 Clean up Util
This commit removes unused code from Util, and moves the script-loading
functionality to WebUtil.
2016-09-16 15:49:52 -04:00
Solly Ross a62b1b352a Clean up unused files in tests
There were quite a few old/irrelevant files in `tests/`.
This commit removes them.
2016-09-16 15:49:52 -04:00
Solly Ross ae510306b5 Enable noVNC to become Browserifiable
This commit restructures noVNC, splitting it into the core directory
and the app directory, with the former containing core noVNC parts,
and the latter containing parts specific to the application.
2016-09-16 15:49:51 -04:00
Samuel Mannehed 7a16304e52 Update copyright 2016-09-03 19:26:29 +02:00
Samuel Mannehed 17f67ca83c Fix indentation in list of encodings 2016-09-01 16:00:22 +02:00
Samuel Mannehed 25e4928fbb Move QEMUExtendedKeyEvent encoding
The encoding list is ordered by number.
2016-09-01 15:59:01 +02:00
Samuel Mannehed 058be7851d Add missing commas and semicolons 2016-09-01 15:56:28 +02:00
Solly Ross f4f4e8993d Merge pull request #596 from danielhb/master
QEMU RFB extension

Fixes #21 🎉 (again)
2016-08-29 13:28:15 -04:00
Daniel Henrique Barboza 49637e432e QEMU RFB extension - keyboard.js changes
Added a 'QEMUKeyEventDecoder' method to deal with the
key events generated when the QEMU extension is active. Another
method, 'TrackQEMUKeyState', was also created with this same
goal.

Although both methods have similaries with the existing methods
'KeyEventDecoder' and 'TrackKeyState', specially when dealing
with 'supress' and 'releaseall', the logic behind the QEMU extension
does not required keysym generation for most cases (some NumPad keys
are an exception) and, as such, there is no need to treat 'keyPressed'
events and to handle char modifiers.

'TrackQEMUKeyState' also handles a Windows scenario where the
'AltGR' key generates CtrlLeft and AltRight keystrokes. The solution
was to avoid this specific combination to be sent to the VNC server,
discarding the extra 'CtrlLeft' key. Considering that the user can
send CtrlLeft+AltLeft, CtrlRight+AltRight and even CtrlRight+AltLeft,
this workaround to allow Windows users to use AltGR in their noVNC
sessions is worthwhile.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
2016-08-26 17:34:39 -03:00
Daniel Henrique Barboza 8f06673a25 QEMU RFB extension - rfb.js and input.js changes
In input.js, a new keyboard handler was added to deal exclusively
with the QEMU key event extension. '_onKeyPress()' signature
was changed to allow the same method to treat both cases.

The extension will only be enabled if the browser has support
for the KeyboardEvent.code property.

Changes in rfb.js:

- added a new extension code, QEMUExtendedKeyEvent, value -258.

- handleKeyPress now receives 'keyevent' instead of 'keysym' and
'down'. Both values are retrieved from keyevent as they were
in the previous signature. This method now can send QEMU RFB
extended key messages if the flag was set to 'true'.

- tests/test.rfb.js were changed folowing the onKeyPress() signature
change.

- added a new function to send the QEMU extended key message.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
2016-08-26 17:34:39 -03:00
Daniel Henrique Barboza 99feba6ba8 QEMU RFB extension - new file xtscancodes.js
This new file contains the XT scancode mapping that
the extension will use in rfb.js file.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
2016-08-26 17:06:42 -03:00
samhed 4e0c36dda7 Add missing return values 2016-08-26 12:20:51 +02:00
samhed 9104d3b567 Remove unnecessary debug logging 2016-08-26 12:19:30 +02:00
samhed c4df8ca92c Remove bad trailing commas 2016-08-26 12:18:28 +02:00
samhed bf568e56f0 Merge branch 'continuousupdates' into noVNCmaster 2016-08-26 12:06:05 +02:00
Trần Tuấn Anh 12f4747ced Removing unused import (#642) 2016-08-26 11:09:22 +02:00
samhed 76a86ff514 Add support for ContinuousUpdates
Instead of requesting frame buffer updates we can, if the server
supports it, continuously recieve frame buffer updates at a rate
determined by the server.

The server can use fencing messages and measure response times to
determine how often it will continue to send updates.
2016-08-26 11:04:19 +02:00
Samuel Mannehed da17d0369d Add missing event argument and curly bracket 2016-08-25 16:49:02 +02:00
Samuel Mannehed b9efece4a8 Fix window close warning
The code didn't follow current API for the beforeunload event.
2016-08-25 15:40:11 +02:00
Samuel Mannehed 9d16e512ba Proper spacing 2016-08-25 15:16:04 +02:00
Samuel Mannehed e961641fa9 Fix the extra keys
Commit 529c64e103 broke this. #shame#
2016-08-25 14:40:21 +02:00
Solly Ross 342d408d64 Merge pull request #583 from kanaka/bug/misc-fixes
Misc Fixes (ImageData Constructor Detection and Firefox Nightly Bug Workaround)
2016-08-23 16:00:48 -04:00