Commit Graph

51 Commits

Author SHA1 Message Date
Solly Ross 84586c0f17 Change copyright header (#1138)
* Change copyright header

This updates the copyright header to say "The noVNC Authors".  People
who previously had copyright listings are now under the AUTHORS file.
2018-10-09 12:15:35 +02:00
Samuel Mannehed e20f0ee9b6 Limit line length to 80 in vnc_lite 2018-08-28 10:42:39 +02:00
Samuel Mannehed 1c945f812b Add a screen element for vnc_lite.html
Makes it clearer where the remote screen will be created.
2018-08-28 10:42:39 +02:00
Samuel Mannehed 8613f6f4ae Simplify element names in vnc_lite 2018-08-28 10:42:39 +02:00
Samuel Mannehed 011e4bff34 Create our own button for CtrlAltDel in vnc_lite
In order to have better control of the layout and to make the code
easier to follow. Using input type button or buttons will imply a lot of
built in styling that differs from browser to browser.
2018-08-28 10:42:39 +02:00
Samuel Mannehed 5271e30049 Use a simple prompt for passwords in vnc_lite
It's not password-masked, but it allows for a lot simpler code.
2018-08-28 10:42:39 +02:00
Samuel Mannehed 26d51e490e Order vnc_lite functions 2018-08-28 10:42:39 +02:00
Samuel Mannehed c756665e81 Rename functions in vnc_lite
Give them obvious names to make the code easier to understand.
2018-08-28 10:42:39 +02:00
Samuel Mannehed 25551b6b40 Use let and const instead of var in vnc_lite
The rest of noVNC has been converted already. This allows us to remove
the extra scope that was created for the VNC connection.
2018-08-28 10:42:37 +02:00
Samuel Mannehed 6517c498b9 Remove support for the fragment and WebUtil dep
The only remaining use we had of WebUtil was getConfigVar(). Let's get
rid of that dependency and use our own, query-string-only and richly
commented version of that function. It's easier for people to get an
overview of vnc_lite if it's all in one file.

This commit removes support for the fragment, parameters can only be
passed using the query string from now on.
2018-08-28 10:41:56 +02:00
Samuel Mannehed 51f9f0098d Cleanup non-essential options from vnc_lite
This is supposed to be a simple example, it shouldn't have this many
options. This commit removes the following options:
 * logging - the default level 'warn' is good enough
 * title - a weird thing to set from the query string anyway
 * token - not used by most setups
 * encrypt - looking at the URL is good enough
 * repeaterID - not used by most setups
 * shared - uncommon setting
 * resize - not supported by most servers

Note that the removal of 'encrypt' allows us to remove logic for
establishing a default port. The default port for wss is 443 and for ws
it's 80 anyway.
2018-08-28 10:41:52 +02:00
Samuel Mannehed 8c2866df36 Add code comments to vnc_lite 2018-08-28 10:41:19 +02:00
Samuel Mannehed 27dff4a0a2 Simplify connected() function 2018-08-21 12:23:17 +02:00
Samuel Mannehed de79ae92e5 Remove unneccessary code and bling from vnc_lite
Unused code, variables and unnecessary styles. The host/port check
would only have an effect if someone explicitly set them as empty in
the query string. The different colors of the status bar are not
necessary, nor is the styling of the background.
2018-08-21 12:22:57 +02:00
Samuel Mannehed e0d4e5a1c0 Move css rules for vnc_lite to the html
Easier to get an overview if it's all in one file.
2018-08-21 11:34:28 +02:00
Samuel Mannehed e7c1074b65 Get rid of icons for vnc_lite
Icons aren't required and we want to get rid of the 'app/' dependency.
2018-08-20 09:22:05 +02:00
Samuel Mannehed cc2fe2c26e Remove iOS specific code from vnc_lite
vnc_lite.html doesn't have touch support anyway
2018-08-16 15:53:32 +02:00
Samuel Mannehed 0f207c808c Remove machine control buttons from vnc_lite
The vnc_lite example is intended to be minimal and these buttons are
only useful in special cases.
2018-08-16 15:53:32 +02:00
Samuel Mannehed c995c0863e Revert "Handle if desktopName isn't set.."
This reverts commit 22000b93d5. The
'desktopname' and the 'connect' events are dispatched by us in RFB and
are thus serial.
2018-08-16 15:52:21 +02:00
Samuel Mannehed 22000b93d5 Handle if desktopName isn't set when connected
We can't guarantee that the desktopName event has been fired before the
connect event.
2018-08-16 13:33:35 +02:00
Samuel Mannehed b3ac94a978 Remove firebug comments
Firebug is discontinued and it's features are included in browser
development tools now a days.
2018-08-08 14:05:06 +02:00
Samuel Mannehed eebef339be Detail path to icon Makefile 2018-08-08 14:04:45 +02:00
Juanjo Diaz 651c23ece3 Use fat arrow functions `const foo = () => { ... };` for callbacks
and any other function that is passed around and it's not a top level function
2018-07-12 19:06:57 +02:00
Pierre Ossman 42463da166 Temporarily disable SVG favicon
Firefox currently has a bug where it prefers the SVG icon over a
more exact size. This results in a poorly rendered, downscaled icon.
So disable the SVG icon until this has been fixed.

Firefox bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1419039
2018-01-25 15:19:12 +01:00
Pierre Ossman bd2ce0ca89 Add scale ability to vnc_lite.html 2017-12-06 11:29:57 +01:00
Pierre Ossman 9b84f51685 Move resize handling in to RFB object
Makes the API simpler and makes it easier for other frontends to
get this functionality.
2017-12-06 11:29:57 +01:00
Samuel Mannehed db46e36eb9
Merge pull request #950 from samhed/disconnectapi
Abstract information from RFB to the UI
2017-11-17 11:01:11 +01:00
Samuel Mannehed d472f3f19e Abstract RFB errors to avoid sending strings
The API allowed strings to be passed from the RFB module to the
application using the disconnect reason. This caused problems since
the application didn't have control over translations for these
strings.

Most of the information being passed using this string was very
technical and not helpful to the end user. One exception to this was
the security result information regarding for example authentication
failures. The protocol allows the VNC server to pass a string
directly to the user in the security result.

So the disconnect reason is replaced by a boolean saying if the
disconnection was clean or not. And for the security result information
from the server, a new event has been added.
2017-11-14 15:36:12 +01:00
Samuel Mannehed ee5cae9fee Replace updatestate event with connect
Instead of exposing all the internal connection states, the RFB module
will now only send events on connect and on disconnect. This makes it
simpler for the application and gets rid of the double events that were
being sent on disconnect (previously updatestate and disconnect).
2017-11-14 14:10:36 +01:00
Pierre Ossman 56f21bf72c Fix old xvpbuttons references
Things were renamed to the more generic "power" instead of "xvp",
but a few references were overlooked in the merge.
2017-11-14 09:11:28 +01:00
Samuel Mannehed 5b20d338ce Remove RFB.notification()
This interface was a band aid for poor design. The two cases where it
was used was replaced by logging.
2017-11-11 02:10:12 +01:00
Pierre Ossman a201bfc5eb Merge branch 'api' of https://github.com/CendioOssman/noVNC 2017-11-10 14:19:05 +01:00
Pierre Ossman e89eef94aa Use standard EventTarget interface for events 2017-11-09 13:14:16 +01:00
Pierre Ossman 65fdfeae13 Remove unused options argument in onnotification event handler 2017-11-09 13:13:41 +01:00
Pierre Ossman 2f4516f293 Integrate connect() in to constructor
An RFB object represents a single connection so it doesn't make
sense to have one without it trying to connect right away. Matches
the behaviour of other APIs, e.g. WebSocket.
2017-11-09 13:13:41 +01:00
Pierre Ossman 8d1f0a3de8 Remove local cursor setting
We have no reason to disable this except for touch devices, which
we can handle without having a setting for it.
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 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 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 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 430f00d6fe Allow other credentials than just password
Makes the XVP authentication mechanism more general.
2017-11-09 12:45:05 +01:00
Samuel Mannehed 4023a6e1c7 Properly center status message in vnc_lite
This gets rid of the table and uses a flexbox instead.
2017-11-01 09:23:46 +01:00
Samuel Mannehed cf3b528281 Add missing semicolon 2017-10-31 18:58:50 +01:00
Samuel Mannehed dc905e859f Move styling from vnc_lite.html to css
This clears up some conflicting style attributes as well. HTML
inline-styling is prioritized above css styling.
2017-10-31 18:58:14 +01:00
Samuel Mannehed 8167e459bc Remove unnecessary css rules for lite 2017-10-31 18:57:14 +01:00
Samuel Mannehed 178bf8ec97 Get rid of unnecessary noVNC_container in lite
If we want to keep vnc_lite simple, we shouldn't have unnecessary
elements. All aspects of the container could be moved up a step in the
hierarchy.
2017-10-31 16:06:57 +01:00
Pierre Ossman bf82644461 Get proper same-origin behaviour when loading modules
The browsers currently do not default to same-origin behaviour for
modules, so we need to be explicit in order for necessary
credentials to be passed along. This seems to be changing though,
but we need to wait for the browsers to actually roll out more
lenient defaults:

https://github.com/whatwg/fetch/pull/585
2017-10-09 16:00:38 +02:00
Frederik Carlier 14ecdc62b4 Only load ES6 module loader polyfill if needed
Safari and Chrome now have native support for modules, so we need to make sure we only load our polyfill when actually needed.
2017-09-29 14:09:25 +02:00
Samuel Mannehed c464f47e96 Remove trailing whitespace 2017-05-13 01:56:24 +02:00