Solly Ross [Tue, 24 Mar 2015 19:05:38 +0000 (15:05 -0400)]
Create RFB object on connect
In e543525faa9cf0d683f41e183e89cd909f3dd229, we switched to creating
a new RFB object on disconnect. This caused issues, however, since
any errors were only displayed briefly before the new "loaded" text
was displayed instead.
Now, we create the RFB object on connect. This essentially removes
the usefulness of the "loaded" state, but prevents the aforementioned
problem.
To facilitate this, the code which does detection of cursor URI support
was moved from this Display constructor (which now calls the new
function) into its own function, `Util.browserSupportsCursorURIs()`.
samhed [Mon, 9 Mar 2015 13:30:56 +0000 (14:30 +0100)]
* Don't check specific html elements from the display code (Fixes #446)
* Renamed and reworked fbuClip to clippingDisplay
* Added tests for clippingDisplay
* Use the a noVNC_container which covers the entire page to get the full size
(Fixes #463)
* Added maxWidth and maxHeight to the canvas which can limit the viewport size
* Only show either the canvas or the logo, hide one when the other is shown
* Always center the canvas (previously it was only centered when not clipping)
* Removed iOS specific "position-fixed" fixes and start calling setBarPosition
on every resize
* Removed the noVNC_screen_pad
samhed [Thu, 5 Mar 2015 13:56:47 +0000 (14:56 +0100)]
* Change name of ext_desktop_size to the proper ExtendedDesktopSize
* Added better error handling in ExtendedDesktopSize
* Added helper function to share code with DesktopSize
* Update test.rfb.js to only check for error handling if we were the
ones requesting the resize
Solly Ross [Wed, 18 Feb 2015 03:41:34 +0000 (22:41 -0500)]
Support local scaling
This commit adds two new addition scaling options. Both options do
local scaling. The first "Local Scaling", does both upscaling and
downscaling. The second option, "Local Downscaling", only downscales.
This is based on work by @mightypenguin (with an additional bug
reported by @glazik12).
Solly Ross [Tue, 17 Feb 2015 23:53:38 +0000 (18:53 -0500)]
Update UI to allow for different scaling modes
This commit updates the UI to allow for different
scaling modes. The "resize" option was changed to
be a dropdown with the following options: "None" (nothing),
"Remote Resizing" (SetDesktopSize).
Solly Ross [Wed, 25 Feb 2015 22:02:16 +0000 (17:02 -0500)]
Make Util.getPosition be relative to page
Commit 5108c4635c847de9be0edadf572f7426f351b66a caused a regression
in the case where scrolling is used -- getPosition return position
relative to the viewport, while getEventPosition expected a position
relative to the page.
As per
https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect,
the fix for this is simply to add the `pageXOffset` and `pageYOffset` to
the output of `getBoundingClientRect()`.
Solly Ross [Fri, 20 Feb 2015 22:27:27 +0000 (17:27 -0500)]
Fix disconnect/reconnect issues
Commit 155d78b39933a396d2555376f4e70f976c30b86d prevented reconnections
from working properly. This fixes that by creating a new RFB object
after disconnecting or failing.
Furthermore, this ensures that a new connection cannot be opened util
we've actually disconnected (either by timer or by receiving a `close`
event).
Solly Ross [Fri, 20 Feb 2015 22:31:37 +0000 (17:31 -0500)]
Remove 'debian' directory
This commit removes the old debian packaging information, which is
out of date. People who wish to create Debain packages for noVNC
are better off using the package information from the actual Debian
or Ubuntu packages.
Solly Ross [Tue, 17 Feb 2015 22:54:21 +0000 (17:54 -0500)]
Make sure websockify is cloned to the correct dir
When `utils/launch.sh` clones websockify, it can be cloned
into the incorrect directory, depending on how `utils/launch.sh`
is run. This commit ensures that websockify is always cloned into
`utils/websockify`.
Solly Ross [Mon, 16 Feb 2015 22:03:17 +0000 (17:03 -0500)]
Remove local copies of websockify
This commit removes local copies of websockify.
Instead `utils/launch.sh` performs the following logic:
If `utils/websockify` exists, use `utils/websockify/run` (if the latter
does not exist, or is not executable, fail, since this is probably a
mistake).
Otherwise, check to see if websockify is installed somewhere (try
`which websockify`). If it is, use that. Otherwise, clone
websockify from github, and tell git to ignore that directory.
Packaged versions of noVNC should simply list websockify as a
requirement. The debian packaging has been updated to reflect
this.
samhed [Tue, 10 Feb 2015 16:05:58 +0000 (17:05 +0100)]
Support automatic resize [Part 3/4]: ui.js
* Added a resize request (setDesktopSize) triggered when connecting and by
changes to the browser window's size.
* Hid the view-drag-hand when the display area is the same or smaller than the
remote session size.
* Added a setting for the automatic resize feature.
* Updated vnc.html and vnc_auto.html to reflect the changes to the UI.
samhed [Fri, 6 Feb 2015 15:43:45 +0000 (16:43 +0100)]
Support automatic resize [Part 1/4]: display.js
* Split viewportChange into two functions, one for changing size and the other for changing position.
* Modified viewport code to be capable of changing to a bigger size in the context of a
client-initiated resize.
* Made clearer distinctions between when viewport-clipping or not.
* Added public function for telling when viewport-clipping.
* Updated tests that were using viewportChange.
Solly Ross [Mon, 24 Nov 2014 20:16:12 +0000 (15:16 -0500)]
Fixed Erroneous HEXTILE test
The HEXTILE test which tested for a background tile followed
by an empty tile was only wide enough to actually test for one
tile, thus not actually testing the functionality. It now actually
uses two tiles, thus actually testing the functionality.
Ramon de Klein [Thu, 6 Nov 2014 12:11:46 +0000 (13:11 +0100)]
Don't draw "blank" HEXTILE tiles with random data
Previously, if a HEXTILE tiles was received with a subencoding
of 0x00, it would draw a rectangle using data from the render
queue, which would result in random colored blocks when using
the HEXTILE encoding. This is the result of a miscopy during
the refactoring. It now has the correct functionality according
to the RFB protocol specification, which is to draw a rectangle
with the last set background color.
Solly Ross [Mon, 17 Nov 2014 22:52:33 +0000 (17:52 -0500)]
Fix Karma sinon-chai version issues
Previously, we were using the karma-sinon-chai package to
provide sinon-chai to karma. This used an older version of
sinon-chai, and looks to be no longer maintained (it's been
a month since sinon-chai was updated). A new package,
karma-sinon-chai-latest, is now used. This package uses the
latest version of sinon-chai and sinon, just like karma-chai
uses the latest version of chai.
Solly Ross [Mon, 17 Nov 2014 19:19:19 +0000 (14:19 -0500)]
Fix broken tests from changing default screen size
Commit 795fca23dc6cf124b2e6969ee42bd8e7c836d605 changed the default
size from 640 to 240. This broke a couple tests which depended on
the default size being 640. Those tests have now been fixed.
Solly Ross [Sun, 2 Nov 2014 18:27:06 +0000 (13:27 -0500)]
Added in guidelines for contributing to noVNC
In CONTRIBUTING.md, you can now find a set of guidelines for
contributing to the noVNC project. They detail coding style
information, requirements for pull requests, and how to run
the unit tests.
Solly Ross [Tue, 30 Sep 2014 16:17:33 +0000 (12:17 -0400)]
Force Travis to use Node 0.11.13
The latest version of Node.js has a bug that
affects the Karma test runner. A patch has been
merged to Karma, but has not landed in a version
yet. Until a new version of Karma is released,
we should keep node at 0.11.13.
Solly Ross [Tue, 23 Sep 2014 02:30:19 +0000 (22:30 -0400)]
Make Utils.js use Object.define to modify Array
Previously, we were modifying Array's prototype using
simple assignment. This can mess with enumeration/iteration.
Thus, we now use Object.defineProperty with enumerable set to
false.
Solly Ross [Tue, 23 Sep 2014 01:42:32 +0000 (21:42 -0400)]
Add support for Relative Paths in the Test Runner
This patch adds support for using relative paths
with the '-r' or '--relative' methods. This can
be useful if you want to output HTML (with the
'--output-html' option) and use it in a webpage.
Additionally, the '-o' was removed from the documentation
of '--output-html', since it hasn't worked for that in a
while ('-o' means open in browser instead).
Solly Ross [Tue, 23 Sep 2014 01:37:04 +0000 (21:37 -0400)]
Fix Race Condition in Display#clear on IE10
There was a race condition in Display#clear on IE10
because we resize and then clear that causes the canvas
to not actually end up cleared. Clearing the current
viewport first solves the issue. It doesn't appear to
affect other platforms, so it's inside a engine check
(`Util.Engine.trident === 6`). Once we stop supporting
IE10, we should just remove this, because it's not the best
to have Engine-specific code.
Solly Ross [Fri, 19 Sep 2014 19:14:34 +0000 (15:14 -0400)]
Fixed broken mouse test in test.rfb.js
Because we use the XOR (`^`) operator, the button mask must be
set before a MouseUp event happens, otherwise we'll send a pointer
event like it was a MouseDown event. The button mask was not set
in one of the tests, so the test was failing.
Solly Ross [Fri, 19 Sep 2014 18:51:15 +0000 (14:51 -0400)]
Fixed Cursor URI Support Detection
There was a bug in cursor URI support detection due to the way
set_defaults now works -- the code was checking for `null`, whereas
when not set, options default to `undefined` unless otherwise
specified. The code now checks for either `null` or `undefined`.
Tests have been added to ensure that this works properly.
Solly Ross [Fri, 19 Sep 2014 18:48:00 +0000 (14:48 -0400)]
Fixed presence detection bug in utils.set_defaults
Previously, Utils.set_defaults was using `if(conf[keys[i]])`
to check for the presence of a configuration key. This would
fail if `conf[keys[i]]` happened to be false. Instead, we now
use `if(keys[i] in conf)`, which simply checks for the presence
of the key in the conf object.
Solly Ross [Fri, 19 Sep 2014 18:17:15 +0000 (14:17 -0400)]
Fixed Typo Causing MouseUp to not Register
There was a typo in one of the instances of the _buttonMask field
(it was written as _buttonMaks), causing MouseUp to never be sent.
This has been rectified, and the unit tests for the mouse handler
have been changed to check for explicitly sending mouseup and
mousedown.
Solly Ross [Fri, 19 Sep 2014 16:16:06 +0000 (12:16 -0400)]
Fixed assertion collision issues
When run via karma, all the tests are loaded into the same page.
This was causing a collision in the 'displayed' assertion dealing
with using viewportLoc.
The assertions are now in their own file, pulled in by tests that
need them. Additionally, several tests which only set fb_width
and fb_height were correct to set viewportLoc as well.
Solly Ross [Mon, 23 Jun 2014 23:39:50 +0000 (19:39 -0400)]
Add support for Travis CI and SauceLabs Testing
This adds support for Travis CI and SauceLabs
testing. Testing on SauceLabs in done via
the Karma test runner. Note that encrypted
Sauce username and access key values need
to be inserted into .travis.yml as global
environment variables. Additionally, the
local test runner (which is still useful
for debugging tests and code) was updated
to reflect that the 'node_modules' folder
now gets placed in the root directory.
Solly Ross [Sun, 22 Jun 2014 03:26:28 +0000 (23:26 -0400)]
Cleanup: UI code
File: ui.js
Tests Added: False
Changes:
- Fix JSHint errors
- add some curly braces to improve clarity
- move variable declarations to relevant locations instead of at the top
of methods
Solly Ross [Thu, 22 May 2014 20:57:55 +0000 (16:57 -0400)]
Cleanup: WebSocket Helper
File: websock.js
Tests Added: True
Changes:
- Cleaned up JSHint errors
- Converted to normal JS constructor pattern with "private" fields and
methods now simply being prepended by underscores
- Added a "bind" polyfill for use in PhantomJS 1.x in util.js
- Added FakeWebSocket to fill in for actual WebSocket objects when
testing
- Made exception handler actually log exception name and message,
to console, in addition to stack trace
Solly Ross [Wed, 21 May 2014 19:12:20 +0000 (15:12 -0400)]
Cleanup: Webutil code
File: webutil.js
Tests Added: False
Changes:
- Fixed JSHint Errors (global "use strict", spaces)
- added some newline characters when appropriate for readability
- moved variable declarations to the places they were actually used
for readability
Solly Ross [Wed, 21 May 2014 18:54:28 +0000 (14:54 -0400)]
Cleanup: Util code
File: util.js
Tests Added: True (partial -- for logging and array push methods)
Changes:
- Fixed JSHint Errors (indentation, semicolons, global "use strict")
- Made browser detection methods more readable
- added some newline characters when appropriate for readability
- throw Errors not strings!
- Removed conf_defaults, and added make_properties and set_defaults
instead (see below)
The removal of conf_defaults and switch to make_properties and
set_defaults is to facilitate the switch over to normal Javascript
constructors instead of Crockford-style constructors. Now, methods
are added to the objects prototype (and thus make properties is called
outside the constructor).
Solly Ross [Tue, 6 May 2014 19:11:31 +0000 (15:11 -0400)]
Cleanup and Test: base64.js
This is the first commit in a series of commits
which improve the readability of some of the code
and add tests.
File: base64.js
Tests Added: True
Changes:
- Improved indentation
- Fixed JSHint errors
- Moved loop variables to be declared in the loop for better readability
(N.B. Javascript does not have block scoping, so the variables are
still technically available outside the loop -- it just makes the code
clearer to place them inside the loop, since they are only used there)
Solly Ross [Mon, 15 Sep 2014 20:44:36 +0000 (16:44 -0400)]
Support running all tests from the root directory
Previously, if you did not specify a tests file,
you had to be in the 'tests' directory for the
"run all tests" functionality to work. Now it
will work in any directory.
Solly Ross [Tue, 3 Jun 2014 21:42:28 +0000 (17:42 -0400)]
Fix race condition in test runner
Previously, there would be a case where if your tests took
too long to run, the casper test runner would only report
on certain tests. This has been fixed.
Solly Ross [Tue, 3 Jun 2014 20:58:37 +0000 (16:58 -0400)]
Output error events from provider in test runner
Now, 'error' events from the test runner are output to stderr.
Additionally, when debug is enabled, debug output is logged to
stderr instead of stdout (as was the case previously).
Solly Ross [Tue, 3 Jun 2014 15:14:42 +0000 (11:14 -0400)]
Add support for injecting test helper files
Now, the phrase `requires test modules: ` may be place in a comment
in a file to require modules local to the test directory, similarly
to the way the `require local modules: ` line may be used to inject
files in the 'include' directory. This is useful for when common
fakes need to be injected into a test.
Solly Ross [Tue, 3 Jun 2014 15:02:27 +0000 (11:02 -0400)]
Support automatically opening test HTML in browser
When using the '-g' option with run_from_console.js, you can
now pass the '-o' option to automatically open the generated
HTML file in your default browser. This relies on the 'open'
NPM module.
Solly Ross [Mon, 5 May 2014 18:29:29 +0000 (14:29 -0400)]
Fix for scroll offset in Util.getPosition()
Previously, Util.getPosition didn't deal with scrolling
particularly well. This fixes that by calculating the
scroll offset when dealing with getting mouse positions.
Credit to @erikgull and @emmar for the initial version of
the fix. Credit to Brian Huismanfor the initial code.
Credit for this fix goes to Jesper Dam (https://github.com/Medical-Insight/noVNC/tree/fix-ie10-keyboard).
Fix keyboard handling for IE10 (issue #352)
* Keyboard events in IE10 do not provide any useful information on the properties 'which', 'char' or 'charCode'. Instead, it seems to store the char code in the keyCode property.
Changing the type of the keyboardinput element to textarea, fixes issue 356.
* The on-screen keyboard not closing when pressing Enter is more important than not having textsuggestions etc.