Commit Graph

1494 Commits

Author SHA1 Message Date
Pierre Ossman 4f90c1d387 Follow MDN style in API documentation 2017-11-09 13:13:39 +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 facf0b7027 Fix duplicate beforeEach() hook 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 3a0010a3d0 Avoid code duplication in RFB test preparation 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 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 6929a0a183 Split out internal API
We only commit to maintaining the API of the RFB object, not the
other modules.
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 1150497123 Remove package-lock.json
We're an upstream component project so we prefer to keep ourselves
up to date with the latest version of our dependencies. Downstream
packagers will have to do the version locking if they feel it is
necessary.
2017-10-18 16:09:48 +02:00
Pierre Ossman 2292cfa6ff Remove 'focusContainer' attribute from API documentation
It was removed from the code in the previous merge.
2017-10-18 15:51:43 +02:00
Pierre Ossman 94bf610cee Remove 'focused' attributes from API documentation
They were removed from the code in the previous merge.
2017-10-18 15:13:19 +02:00
Pierre Ossman 4c11755ce7 Merge branch 'focus' of https://github.com/CendioOssman/noVNC 2017-10-18 15:12:46 +02:00
Pierre Ossman 3e093af55d Don't let the hidden input field be a tab stop
It's very confusing if you tab between elements and all of a sudden
something hidden gets focus.
2017-10-18 15:08:33 +02:00
Pierre Ossman 867daa98af Restore handling of key events for virtual keyboard
We broke handling of keydown/keyup when we moved the focus to the
canvas, as events from our input element would then no longer be
caught when they bubbled up to the document object (where we
previously caught events).

Restore the previous behaviour in a cleaner manner by creating a
second Keyboard object to handle this extra input variant.
2017-10-18 15:08:33 +02:00
Pierre Ossman 06fe4a3e1b Make sure control bar stays visible on Tab
Avoid the deprecated keypress event in favour of the keydown event.
It has the benefit of triggering for all keys, not just those that
produce symbols.
2017-10-18 15:08:33 +02:00
Pierre Ossman 50c317768e Include .js for anonymous scripts
It is required for syntax highlighting in at least Firefox' debugger.
2017-10-18 15:08:33 +02:00
Pierre Ossman 2545a6c12e Stop giving host field default focus
It's a field that isn't shown by default and rarely changed.
2017-10-18 15:08:33 +02:00
Pierre Ossman e36f95868a Add focus state for control bar buttons
The focus can now move to the canvas so it is no longer a source of
confusion. It is also important to indicate that they have focus now
that we actually respect it.
2017-10-18 15:08:29 +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 aa5b3a3528 Recieve challange before expecting callback
After commit abfe5b7a37 we expect a
challange before sending the callback to the UI. Fixes tests.
2017-10-17 12:29:43 +02:00
Samuel Mannehed a342ed703f Check if <audio>.play() returns a promise
It doesn't always. IE and Edge crashed when trying to play the bell due
to this. Fixes #929.
2017-10-17 12:16:38 +02:00
Samuel Mannehed abfe5b7a37 Wait for challenge before asking for password
Fixes #928.
2017-10-16 15:39:10 +02:00
Samuel Mannehed b573d985e8 Remove dead link to Ganeti Web Manager 2017-10-16 13:12:50 +02:00
Samuel Mannehed 2e735160bf Save pw for reconnections when using query params 2017-10-16 11:06:40 +02:00
Samuel Mannehed 3c5dd884d2 Update API since sendKey() has a new parameter
Commit 94f5cf05f3 added a new parameter to
the public function in the RFB object.
2017-10-12 15:26:21 +02:00
Samuel Mannehed 2f77baabd4 Mouse and Keyboard are seperate files now 2017-10-12 15:17:54 +02:00
Samuel Mannehed ced77799b2 Update link to Websock API page 2017-10-12 15:04:59 +02:00
Samuel Mannehed 90ab0d38e5 Add note clarifying the disconnected state
Makes it clear that the RFB module can not transition away from the
disconnected state.
2017-10-12 15:01:38 +02:00
Samuel Mannehed f5d40c6a4b Use markdown-style tables instead of <table>
Much easier to read in plaintext
2017-10-12 15:00:55 +02:00
Samuel Mannehed df4653826d Remove trailing whitespace 2017-10-12 14:59:49 +02:00
Samuel Mannehed 2b12429e06 Use underscores for bold text intead of asterixes
Makes an asterix-list easier to read in plaintext
2017-10-12 14:58:35 +02:00
Samuel Mannehed f8d08e7b35 Add numbering for each header in the API doc 2017-10-12 14:57:11 +02:00
Samuel Mannehed 5ce9155098 Move API documentation from wiki to the repo
Since the API is tied to the source code it makes more sence to have it
in the repository where it can more easily be tied to different versions
of the software.
2017-10-12 14:48:38 +02:00
Samuel Mannehed cd23036314 Fix missing semicolons
Was missing in commit 49a8183757
2017-10-12 12:42:16 +02:00
Samuel Mannehed 93358b2eed Remove 'fuzzy' marks that were mistakenly left
During the last round of translations a few fuzzy markings was not
removed even though the string was updated. This can happen when the
translators edit the .po-file manually. Fuzzy markings result in that
the strings do not get included into the generated .json files.
2017-10-11 16:20:25 +02:00